{ "openapi": "3.1.0", "info": { "title": "Bifrost API", "description": "Bifrost HTTP Transport API for AI model inference and gateway management.\n\nThis API provides a unified interface for interacting with multiple AI providers\nincluding OpenAI, Anthropic, Bedrock, Gemini, and more through a single API,\nalong with comprehensive management APIs for configuring and monitoring the gateway.\n\n## API Structure\n\n### Unified Inference API (`/v1/*`)\nThe primary API using Bifrost's unified format. Model parameters use the format\n`provider/model` (e.g., `openai/gpt-4`, `anthropic/claude-3-opus`).\n\n### Async Inference API (`/v1/async/*`)\nSubmit inference requests for asynchronous execution. Returns a job ID immediately\nand allows polling for results. Supports all inference types except batches, files,\nand containers.\n\n### Provider Integration APIs\nNative provider-format APIs for drop-in compatibility:\n- `/openai/*` - OpenAI-compatible API\n- `/anthropic/*` - Anthropic-compatible API\n- `/genai/*` - Google GenAI (Gemini) compatible API\n- `/bedrock/*` - AWS Bedrock compatible API\n- `/cohere/*` - Cohere compatible API\n\n### Framework Integration APIs\nMulti-provider proxy endpoints for AI frameworks:\n- `/litellm/*` - LiteLLM proxy with all provider formats\n- `/langchain/*` - LangChain compatible endpoints\n- `/pydanticai/*` - PydanticAI compatible endpoints\n\n### Management APIs (`/api/*`)\nAPIs for managing and monitoring the Bifrost gateway:\n- `/api/config` - Configuration management\n- `/api/providers` - Provider and API key management\n- `/api/plugins` - Plugin management\n- `/api/governance/*` - Virtual keys, teams, customers, budgets, rate limits, routing rules, and pricing overrides\n- `/api/logs` - Log search and analytics\n- `/api/mcp/*` - MCP (Model Context Protocol) client management\n- `/api/session/*` - Authentication and session management\n- `/api/cache/*` - Cache management\n- `/health` - Health check endpoint\n\n## Fallbacks\nRequests can include fallback models that will be tried if the primary model fails.\n", "version": "1.0.0", "contact": { "name": "Contact Us", "url": "https://getmaxim.ai/bifrost" }, "license": { "name": "Apache 2.0", "url": "https://opensource.org/licenses/Apache-2.0" } }, "servers": [ { "url": "{baseUrl}", "description": "Your Bifrost instance", "variables": { "baseUrl": { "default": "http://localhost:8080", "description": "Base URL of your Bifrost instance (e.g. https://bifrost.mycompany.com)" } } } ], "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "ApiKeyAuth": [] } ], "tags": [ { "name": "Models", "description": "Model listing and information" }, { "name": "Chat Completions", "description": "Chat-based text generation" }, { "name": "Text Completions", "description": "Text completion generation" }, { "name": "Responses", "description": "OpenAI Responses API compatible endpoints" }, { "name": "Rerank", "description": "Document reranking by relevance to a query" }, { "name": "Embeddings", "description": "Text embedding generation" }, { "name": "Images", "description": "Image generations, editing, and variations" }, { "name": "Videos", "description": "Video generation and management" }, { "name": "Audio", "description": "Speech synthesis and transcription" }, { "name": "Count Tokens", "description": "Token counting utilities" }, { "name": "Batch", "description": "Batch processing operations" }, { "name": "Files", "description": "File management operations" }, { "name": "Containers", "description": "Container management operations" }, { "name": "Async Jobs", "description": "Asynchronous job submission and retrieval endpoints" }, { "name": "OpenAI Integration", "description": "OpenAI-compatible API endpoints (/openai/*)" }, { "name": "Azure Integration", "description": "Azure OpenAI integration endpoints" }, { "name": "Anthropic Integration", "description": "Anthropic-compatible API endpoints (/anthropic/*)" }, { "name": "GenAI Integration", "description": "Google GenAI (Gemini) compatible API endpoints (/genai/*)" }, { "name": "Bedrock Integration", "description": "AWS Bedrock compatible API endpoints (/bedrock/*)" }, { "name": "Cohere Integration", "description": "Cohere compatible API endpoints (/cohere/*)" }, { "name": "LiteLLM Integration", "description": "LiteLLM proxy endpoints with multi-provider support (/litellm/*)" }, { "name": "LangChain Integration", "description": "LangChain compatible endpoints with multi-provider support (/langchain/*)" }, { "name": "PydanticAI Integration", "description": "PydanticAI compatible endpoints with multi-provider support (/pydanticai/*)" }, { "name": "Health", "description": "Health check endpoints" }, { "name": "Configuration", "description": "Configuration management endpoints" }, { "name": "Session", "description": "Session and authentication endpoints" }, { "name": "Providers", "description": "Provider management endpoints" }, { "name": "Plugins", "description": "Plugin management endpoints" }, { "name": "MCP", "description": "Model Context Protocol endpoints" }, { "name": "Governance", "description": "Virtual keys, teams, and customers management" }, { "name": "Logging", "description": "Log search and management endpoints" }, { "name": "Cache", "description": "Cache management endpoints" } ], "paths": { "/v1/models": { "get": { "operationId": "listModels", "summary": "List available models", "description": "Lists available models. If provider is not specified, lists all models from all configured providers.\n", "tags": [ "Models" ], "parameters": [ { "name": "provider", "in": "query", "description": "Filter by provider (e.g., openai, anthropic, bedrock)", "schema": { "$ref": "#/components/schemas/ModelProvider" } }, { "name": "page_size", "in": "query", "description": "Maximum number of models to return", "schema": { "type": "integer", "minimum": 0 } }, { "name": "page_token", "in": "query", "description": "Token for pagination", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/chat/completions": { "post": { "operationId": "createChatCompletion", "summary": "Create a chat completion", "description": "Creates a completion for the provided messages. Supports streaming via SSE.\n", "tags": [ "Chat Completions" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/completions": { "post": { "operationId": "createTextCompletion", "summary": "Create a text completion", "description": "Creates a completion for the provided prompt. Supports streaming via SSE.\n", "tags": [ "Text Completions" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/responses": { "post": { "operationId": "createResponse", "summary": "Create a response", "description": "Creates a response using the OpenAI Responses API format. Supports streaming via SSE.\n", "tags": [ "Responses" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/rerank": { "post": { "operationId": "rerankDocuments", "summary": "Rerank documents", "description": "Reorders input documents by relevance to a query.\n", "tags": [ "Rerank" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RerankRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RerankResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/embeddings": { "post": { "operationId": "createEmbedding", "summary": "Create embeddings", "description": "Creates an embedding vector representing the input text.\n", "tags": [ "Embeddings" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/audio/speech": { "post": { "operationId": "createSpeech", "summary": "Create speech", "description": "Generates audio from the input text. Returns audio data or streams via SSE.\n", "tags": [ "Audio" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "application/json": { "schema": { "$ref": "#/components/schemas/SpeechResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/audio/transcriptions": { "post": { "operationId": "createTranscription", "summary": "Create transcription", "description": "Transcribes audio into text in the input language.\n", "tags": [ "Audio" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/images/generations": { "post": { "operationId": "imageGeneration", "summary": "Generate an image", "description": "Generates images from text prompts using the specified model.\n", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "prompt": { "type": "string", "description": "Text prompt to generate image" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "quality": { "type": "string", "enum": [ "auto", "high", "medium", "low", "hd", "standard" ], "description": "Quality of the generated image" }, "style": { "type": "string", "enum": [ "natural", "vivid" ], "description": "Style of the generated image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response.\n" }, "background": { "type": "string", "enum": [ "transparent", "opaque", "auto" ], "description": "Background type for the image" }, "moderation": { "type": "string", "enum": [ "low", "auto" ], "description": "Content moderation level" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3, "description": "Number of partial images to generate" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Compression level (0-100%)" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "user": { "type": "string", "description": "User identifier for tracking" }, "seed": { "type": "integer", "description": "Seed for reproducible image generation" }, "negative_prompt": { "type": "string", "description": "Negative prompt to guide what to avoid in generation" }, "num_inference_steps": { "type": "integer", "description": "Number of inference steps for generation" }, "stream": { "type": "boolean", "default": false, "description": "Whether to stream the response. When true, images are sent as SSE.\nWhen streaming, providers may return base64 chunks (`b64_json`) and/or URLs (`url`) depending on provider and configuration.\n" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } ] } } } }, "responses": { "200": { "description": "Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when `stream=true`.\nWhen streaming, events are sent with the following event types:\n- `image_generation.partial_image`: Intermediate image chunks with base64-encoded image data\n- `image_generation.completed`: Final event for each image with usage information\n- `error`: Error events with error details\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the generation request" }, "created": { "type": "integer", "format": "int64", "description": "Unix timestamp when the image was created" }, "model": { "type": "string", "description": "Model used for generation" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the generated image" }, "b64_json": { "type": "string", "description": "Base64-encoded image data" }, "revised_prompt": { "type": "string", "description": "Revised prompt used for generation" }, "index": { "type": "integer", "description": "Index of this image" } } }, "description": "Array of generated images" }, "background": { "type": "string", "description": "Background type for the image" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "quality": { "type": "string", "description": "Quality of the generated image" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming response chunk for image generation.\nSent via Server-Sent Events (SSE).\nProviders may return either b64_json (base64-encoded image data) or url (public URL to the image).\n", "properties": { "id": { "type": "string", "description": "Request identifier" }, "type": { "type": "string", "enum": [ "image_generation.partial_image", "image_generation.completed", "error" ], "description": "Type of stream event" }, "partial_image_index": { "type": "integer", "description": "Index of the partial image chunk" }, "sequence_number": { "type": "integer", "description": "Sequence number for event ordering within the stream" }, "b64_json": { "type": "string", "description": "Base64-encoded chunk of image data.\nOptional; either b64_json or url may be present.\n" }, "url": { "type": "string", "format": "uri", "description": "Optional public URL to the generated image chunk.\nUsed by HuggingFace and other providers that return image URLs instead of base64 data.\n" }, "created_at": { "type": "integer", "format": "int64", "description": "Timestamp when chunk was created" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "quality": { "type": "string", "description": "Quality setting used" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output format used" }, "revised_prompt": { "type": "string", "description": "Revised prompt" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } }, "description": "Token usage" }, "error": { "$ref": "#/components/schemas/BifrostError", "description": "Error information if generation failed" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/images/edits": { "post": { "operationId": "imageEdit", "summary": "Edit an image", "description": "Edits an image using a text prompt and optional mask. Request must be sent as multipart/form-data\nwith at least `model`, `prompt` (unless `type` is `background_removal`), and `image` (or `image[]`).\n", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "model", "image" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "prompt": { "type": "string", "description": "Text prompt describing the edit. Required unless `type` is `background_removal`.\n" }, "image": { "type": "string", "format": "binary", "description": "Image file to edit. Use field name `image` for a single file or `image[]` for multiple files.\n" }, "mask": { "type": "string", "format": "binary", "description": "Optional mask image for inpainting (transparent areas indicate regions to edit)" }, "type": { "type": "string", "enum": [ "inpainting", "outpainting", "background_removal" ], "description": "Type of edit operation" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto" ], "description": "Size of the output image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response" }, "stream": { "type": "boolean", "default": false, "description": "When true, stream the response via Server-Sent Events" }, "background": { "type": "string", "enum": [ "transparent", "opaque", "auto" ], "description": "Background type for the image" }, "input_fidelity": { "type": "string", "enum": [ "low", "high" ], "description": "How closely to follow the original image" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3, "description": "Number of partial images to generate when streaming" }, "quality": { "type": "string", "enum": [ "auto", "high", "medium", "low", "standard" ], "description": "Quality of the output image" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "num_inference_steps": { "type": "integer", "description": "Number of inference steps" }, "seed": { "type": "integer", "description": "Seed for reproducible editing" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Compression level (0-100%)" }, "negative_prompt": { "type": "string", "description": "What to avoid in the edit" }, "user": { "type": "string", "description": "User identifier for tracking" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "200": { "description": "Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when `stream=true`.\nWhen streaming, events are sent with the following event types:\n- `image_edit.partial_image`: Intermediate image chunks with base64-encoded image data\n- `image_edit.completed`: Final event for each image with usage information\n- `error`: Error events with error details\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the generation request" }, "created": { "type": "integer", "format": "int64", "description": "Unix timestamp when the image was created" }, "model": { "type": "string", "description": "Model used for generation" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the generated image" }, "b64_json": { "type": "string", "description": "Base64-encoded image data" }, "revised_prompt": { "type": "string", "description": "Revised prompt used for generation" }, "index": { "type": "integer", "description": "Index of this image" } } }, "description": "Array of generated images" }, "background": { "type": "string", "description": "Background type for the image" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "quality": { "type": "string", "description": "Quality of the generated image" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming response chunk for image edit.\nSent via Server-Sent Events (SSE) when `stream=true`.\n", "properties": { "id": { "type": "string", "description": "Request identifier" }, "type": { "type": "string", "enum": [ "image_edit.partial_image", "image_edit.completed", "error" ], "description": "Type of stream event" }, "partial_image_index": { "type": "integer", "description": "Index of the partial image chunk" }, "sequence_number": { "type": "integer", "description": "Sequence number for event ordering within the stream" }, "b64_json": { "type": "string", "description": "Base64-encoded chunk of image data; optional" }, "url": { "type": "string", "format": "uri", "description": "Optional public URL to the image chunk" }, "created_at": { "type": "integer", "format": "int64", "description": "Timestamp when chunk was created" }, "size": { "type": "string", "description": "Size of the image" }, "quality": { "type": "string", "description": "Quality setting used" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output format used" }, "revised_prompt": { "type": "string", "description": "Revised prompt" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } }, "description": "Token usage" }, "error": { "$ref": "#/components/schemas/BifrostError", "description": "Error information if edit failed" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/images/variations": { "post": { "operationId": "imageVariation", "summary": "Create Variation", "description": "Creates variations of an image. Request must be sent as multipart/form-data with `model` and `image` (or `image[]`).\nDoes not support streaming.\n", "tags": [ "Images" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "model", "image" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "image": { "type": "string", "format": "binary", "description": "Image file to create variations of. Use field name `image` for a single file or `image[]` for multiple (first image is used).\n" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of variations to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the output images" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response" }, "user": { "type": "string", "description": "User identifier for tracking" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "200": { "description": "Successful response. Returns JSON with generated image variation(s).", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the generation request" }, "created": { "type": "integer", "format": "int64", "description": "Unix timestamp when the image was created" }, "model": { "type": "string", "description": "Model used for generation" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the generated image" }, "b64_json": { "type": "string", "description": "Base64-encoded image data" }, "revised_prompt": { "type": "string", "description": "Revised prompt used for generation" }, "index": { "type": "integer", "description": "Index of this image" } } }, "description": "Array of generated images" }, "background": { "type": "string", "description": "Background type for the image" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "quality": { "type": "string", "description": "Quality of the generated image" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/videos": { "post": { "operationId": "videoGeneration", "summary": "Generate a video", "description": "Creates a video generation job from a text prompt. This is an asynchronous operation\nthat returns immediately with a job ID. Use the retrieve endpoint to check the status\nand get the video URL when generation is complete.\n", "tags": [ "Videos" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "prompt": { "type": "string", "description": "Text prompt describing the video to generate" }, "input_reference": { "type": "string", "description": "Optional reference image for image-to-video. OpenAI and Gemini require a base64 data URL (e.g., `data:image/png;base64,...`). Runway and Replicate accept both data URLs and plain URLs." }, "seconds": { "type": "string", "description": "Duration of the video in seconds as a string (e.g., \"4\")" }, "size": { "type": "string", "description": "Resolution of the generated video (e.g., `1280x720`, `720x1280`, `1920x1080`)" }, "negative_prompt": { "type": "string", "description": "Text describing what to avoid in the generated video" }, "seed": { "type": "integer", "description": "Seed for reproducible generation" }, "video_uri": { "type": "string", "description": "Source video URI for video-to-video generation (provider-specific, e.g. GCS URI)" }, "audio": { "type": "boolean", "description": "Enable audio generation in the video (supported by select providers/models)" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "200": { "description": "Successful response. Returns a video generation job object with status information.\nPoll the retrieve endpoint to check completion status.\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Provider-native job ID. To use in path parameters (retrieve/delete/download), combine as `{id}:{provider}` (e.g., `task_abc123:runway`)" }, "object": { "type": "string", "enum": [ "video" ], "description": "Object type, always \"video\"" }, "model": { "type": "string", "description": "Model used for video generation" }, "status": { "type": "string", "enum": [ "queued", "in_progress", "completed", "failed" ], "description": "Current lifecycle status of the video generation job:\n- `queued`: Job is waiting to be processed\n- `in_progress`: Video is currently being generated\n- `completed`: Video generation completed successfully\n- `failed`: Video generation failed\n" }, "progress": { "type": "number", "format": "float", "minimum": 0, "maximum": 100, "description": "Approximate completion percentage (0-100)" }, "prompt": { "type": "string", "description": "Prompt used to generate the video" }, "remixed_from_video_id": { "type": "string", "description": "Source video ID if this is a remix" }, "seconds": { "type": "string", "description": "Duration of the generated video in seconds as a string (e.g., \"4\")" }, "size": { "type": "string", "description": "Resolution of the generated video (e.g., \"1920x1080\")" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job was created" }, "completed_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job completed" }, "expires_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when downloadable assets expire" }, "videos": { "type": "array", "description": "Generated video outputs (only present when status is \"completed\")", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url", "base64" ], "description": "Output format of this video" }, "url": { "type": "string", "format": "uri", "description": "URL to the generated video (present when type is \"url\")" }, "base64": { "type": "string", "description": "Base64-encoded video content (present when type is \"base64\")" }, "content_type": { "type": "string", "description": "MIME type of the video (e.g., \"video/mp4\")" } } } }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Human-readable error message" } } }, "content_filter": { "type": "object", "description": "Information about content that was filtered due to safety policies", "properties": { "filtered_count": { "type": "integer", "description": "Number of items filtered" }, "reasons": { "type": "array", "items": { "type": "string" }, "description": "Human-readable reasons for filtering" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "videoList", "summary": "List video generation jobs", "description": "Lists video generation jobs for a specific provider. Results are paginated\nand can be filtered using query parameters.\n", "tags": [ "Videos" ], "parameters": [ { "name": "provider", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Provider name (e.g., \"openai\", \"gemini\")" }, { "name": "after", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Cursor for pagination - ID of the last item from the previous page" }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, "description": "Maximum number of results to return" }, { "name": "order", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "asc", "desc" ], "default": "desc" }, "description": "Sort order by creation time" } ], "responses": { "200": { "description": "Successful response. Returns a paginated list of video generation jobs.", "content": { "application/json": { "schema": { "type": "object", "properties": { "object": { "type": "string", "enum": [ "list" ], "description": "Object type, always \"list\"" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Provider-native video ID. To use in path parameters (retrieve/delete/download), combine as `{id}:{provider}` (e.g., `task_abc123:runway`)" }, "object": { "type": "string", "enum": [ "video" ], "description": "Object type, always \"video\"" }, "model": { "type": "string", "description": "Model used for generation" }, "status": { "type": "string", "enum": [ "queued", "in_progress", "completed", "failed" ], "description": "Current lifecycle status of the video generation job:\n- `queued`: Job is waiting to be processed\n- `in_progress`: Video is currently being generated\n- `completed`: Video generation completed successfully\n- `failed`: Video generation failed\n" }, "progress": { "type": "number", "format": "float", "minimum": 0, "maximum": 100, "description": "Approximate completion percentage (0-100)" }, "prompt": { "type": "string", "description": "Prompt used to generate the video" }, "remixed_from_video_id": { "type": "string", "description": "Source video ID if this is a remix" }, "seconds": { "type": "string", "description": "Duration of the video in seconds as a string (e.g., \"4\")" }, "size": { "type": "string", "description": "Resolution of the generated video (e.g., \"1920x1080\")" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job was created" }, "completed_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job completed" }, "expires_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when downloadable assets expire" }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Human-readable error message" } } } } }, "description": "Array of video generation jobs" }, "first_id": { "type": "string", "description": "ID of the first item in the list" }, "last_id": { "type": "string", "description": "ID of the last item in the list" }, "has_more": { "type": "boolean", "description": "Whether there are more results available" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/videos/{video_id}": { "get": { "operationId": "videoRetrieve", "summary": "Retrieve a video generation job", "description": "Retrieves the status and metadata for a video generation job.\nUse this endpoint to poll for completion status after creating a video generation job.\nWhen the status is \"completed\", the response will include a URL to download the video.\n", "tags": [ "Videos" ], "parameters": [ { "name": "video_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Video ID in format `id:provider` (e.g., `video_abc123:openai`)" } ], "responses": { "200": { "description": "Successful response. Returns the video generation job details.", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Provider-native job ID. To use in path parameters (retrieve/delete/download), combine as `{id}:{provider}` (e.g., `task_abc123:runway`)" }, "object": { "type": "string", "enum": [ "video" ], "description": "Object type, always \"video\"" }, "model": { "type": "string", "description": "Model used for video generation" }, "status": { "type": "string", "enum": [ "queued", "in_progress", "completed", "failed" ], "description": "Current lifecycle status of the video generation job:\n- `queued`: Job is waiting to be processed\n- `in_progress`: Video is currently being generated\n- `completed`: Video generation completed successfully\n- `failed`: Video generation failed\n" }, "progress": { "type": "number", "format": "float", "minimum": 0, "maximum": 100, "description": "Approximate completion percentage (0-100)" }, "prompt": { "type": "string", "description": "Prompt used to generate the video" }, "remixed_from_video_id": { "type": "string", "description": "Source video ID if this is a remix" }, "seconds": { "type": "string", "description": "Duration of the generated video in seconds as a string (e.g., \"4\")" }, "size": { "type": "string", "description": "Resolution of the generated video (e.g., \"1920x1080\")" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job was created" }, "completed_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job completed" }, "expires_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when downloadable assets expire" }, "videos": { "type": "array", "description": "Generated video outputs (only present when status is \"completed\")", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url", "base64" ], "description": "Output format of this video" }, "url": { "type": "string", "format": "uri", "description": "URL to the generated video (present when type is \"url\")" }, "base64": { "type": "string", "description": "Base64-encoded video content (present when type is \"base64\")" }, "content_type": { "type": "string", "description": "MIME type of the video (e.g., \"video/mp4\")" } } } }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Human-readable error message" } } }, "content_filter": { "type": "object", "description": "Information about content that was filtered due to safety policies", "properties": { "filtered_count": { "type": "integer", "description": "Number of items filtered" }, "reasons": { "type": "array", "items": { "type": "string" }, "description": "Human-readable reasons for filtering" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Video not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "videoDelete", "summary": "Delete a video generation job", "description": "Deletes a video generation job and its associated assets.\nThis operation cannot be undone.\n", "tags": [ "Videos" ], "parameters": [ { "name": "video_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Video ID in format `id:provider` (e.g., `video_abc123:openai`)" } ], "responses": { "200": { "description": "Successful response. Returns deletion confirmation.", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the deleted video" }, "object": { "type": "string", "enum": [ "video.deleted" ], "description": "Object type, always \"video.deleted\"" }, "deleted": { "type": "boolean", "description": "Whether the video was successfully deleted" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Video not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/videos/{video_id}/content": { "get": { "operationId": "videoDownload", "summary": "Download video content", "description": "Downloads the binary content of a generated video.\nThe video must have a status of \"completed\" to be downloadable.\nReturns the raw video file (typically MP4 format).\n", "tags": [ "Videos" ], "parameters": [ { "name": "video_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Video ID in format `id:provider` (e.g., `video_abc123:openai`)" }, { "name": "variant", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "video", "thumbnail", "spritesheet" ] }, "description": "Variant of the video content to download (provider-specific)" } ], "responses": { "200": { "description": "Successful response. Returns the video file as binary content.", "content": { "video/mp4": { "schema": { "type": "string", "format": "binary" } }, "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Video not found or not yet available", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/videos/{video_id}/remix": { "post": { "operationId": "videoRemix", "summary": "Remix a video", "description": "Creates a new video generation job by remixing an existing video with a new prompt.\nThe source video must have a status of \"completed\" to be remixed.\nReturns a new video generation job that can be polled for completion.\n", "tags": [ "Videos" ], "parameters": [ { "name": "video_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Video ID in format `id:provider` (e.g., `video_abc123:openai`)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "prompt" ], "properties": { "prompt": { "type": "string", "description": "Text prompt describing how to remix the video" } } } } } }, "responses": { "200": { "description": "Successful response. Returns a new video generation job object.\nPoll the retrieve endpoint to check completion status.\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Provider-native job ID. To use in path parameters (retrieve/delete/download), combine as `{id}:{provider}` (e.g., `task_abc123:runway`)" }, "object": { "type": "string", "enum": [ "video" ], "description": "Object type, always \"video\"" }, "model": { "type": "string", "description": "Model used for video generation" }, "status": { "type": "string", "enum": [ "queued", "in_progress", "completed", "failed" ], "description": "Current lifecycle status of the video generation job:\n- `queued`: Job is waiting to be processed\n- `in_progress`: Video is currently being generated\n- `completed`: Video generation completed successfully\n- `failed`: Video generation failed\n" }, "progress": { "type": "number", "format": "float", "minimum": 0, "maximum": 100, "description": "Approximate completion percentage (0-100)" }, "prompt": { "type": "string", "description": "Prompt used to generate the video" }, "remixed_from_video_id": { "type": "string", "description": "Source video ID if this is a remix" }, "seconds": { "type": "string", "description": "Duration of the generated video in seconds as a string (e.g., \"4\")" }, "size": { "type": "string", "description": "Resolution of the generated video (e.g., \"1920x1080\")" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job was created" }, "completed_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when the job completed" }, "expires_at": { "type": "integer", "format": "int64", "description": "Unix timestamp (seconds) when downloadable assets expire" }, "videos": { "type": "array", "description": "Generated video outputs (only present when status is \"completed\")", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url", "base64" ], "description": "Output format of this video" }, "url": { "type": "string", "format": "uri", "description": "URL to the generated video (present when type is \"url\")" }, "base64": { "type": "string", "description": "Base64-encoded video content (present when type is \"base64\")" }, "content_type": { "type": "string", "description": "MIME type of the video (e.g., \"video/mp4\")" } } } }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code" }, "message": { "type": "string", "description": "Human-readable error message" } } }, "content_filter": { "type": "object", "description": "Information about content that was filtered due to safety policies", "properties": { "filtered_count": { "type": "integer", "description": "Number of items filtered" }, "reasons": { "type": "array", "items": { "type": "string" }, "description": "Human-readable reasons for filtering" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Source video not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/responses/input_tokens": { "post": { "operationId": "countTokens", "summary": "Count tokens", "description": "Counts the number of tokens in the provided messages.\n", "tags": [ "Count Tokens" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/batches": { "post": { "operationId": "createBatch", "summary": "Create a batch job", "description": "Creates a batch job for asynchronous processing.\n", "tags": [ "Batch" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "listBatches", "summary": "List batch jobs", "description": "Lists batch jobs for a provider.\n", "tags": [ "Batch" ], "parameters": [ { "name": "provider", "in": "query", "required": true, "description": "Provider to list batches for", "schema": { "$ref": "#/components/schemas/ModelProvider" } }, { "name": "limit", "in": "query", "description": "Maximum number of batches to return", "schema": { "type": "integer", "minimum": 1 } }, { "name": "after", "in": "query", "description": "Cursor for pagination", "schema": { "type": "string" } }, { "name": "before", "in": "query", "description": "Cursor for pagination", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/batches/{batch_id}": { "get": { "operationId": "retrieveBatch", "summary": "Retrieve a batch job", "description": "Retrieves a specific batch job by ID.\n", "tags": [ "Batch" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "description": "The ID of the batch to retrieve", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the batch", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRetrieveResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/batches/{batch_id}/cancel": { "post": { "operationId": "cancelBatch", "summary": "Cancel a batch job", "description": "Cancels a batch job.\n", "tags": [ "Batch" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "description": "The ID of the batch to cancel", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the batch", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "status": { "type": "string", "enum": [ "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "canceled", "ended" ] }, "request_counts": { "type": "object", "properties": { "total": { "type": "integer" }, "completed": { "type": "integer" }, "failed": { "type": "integer" }, "succeeded": { "type": "integer" }, "expired": { "type": "integer" }, "canceled": { "type": "integer" }, "pending": { "type": "integer" } } }, "cancelling_at": { "type": "integer", "format": "int64" }, "cancelled_at": { "type": "integer", "format": "int64" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/batches/{batch_id}/results": { "get": { "operationId": "getBatchResults", "summary": "Get batch results", "description": "Retrieves results from a completed batch job.\n", "tags": [ "Batch" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "description": "The ID of the batch", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the batch", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "batch_id": { "type": "string" }, "results": { "type": "array", "items": { "type": "object", "properties": { "custom_id": { "type": "string" }, "response": { "type": "object", "properties": { "status_code": { "type": "integer" }, "request_id": { "type": "string" }, "body": { "type": "object" } } }, "result": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "object" } } }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/files": { "post": { "operationId": "uploadFile", "summary": "Upload a file", "description": "Uploads a file to be used with batch operations or other features.\n", "tags": [ "Files" ], "parameters": [ { "name": "provider", "in": "query", "description": "Provider to upload file to (can also use x-model-provider header)", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/FileUploadRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileUploadResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "listFiles", "summary": "List files", "description": "Lists files for a provider.\n", "tags": [ "Files" ], "parameters": [ { "name": "x-model-provider", "in": "query", "required": true, "description": "Provider to list files for", "schema": { "$ref": "#/components/schemas/ModelProvider" } }, { "name": "purpose", "in": "query", "description": "Filter by purpose", "schema": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] } }, { "name": "limit", "in": "query", "description": "Maximum number of files to return", "schema": { "type": "integer", "minimum": 1 } }, { "name": "after", "in": "query", "description": "Cursor for pagination", "schema": { "type": "string" } }, { "name": "order", "in": "query", "description": "Sort order (asc/desc)", "schema": { "type": "string", "enum": [ "asc", "desc" ] } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/files/{file_id}": { "get": { "operationId": "retrieveFile", "summary": "Retrieve file metadata", "description": "Retrieves metadata for a specific file.\n", "tags": [ "Files" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the file", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "bytes": { "type": "integer", "format": "int64" }, "created_at": { "type": "integer", "format": "int64" }, "filename": { "type": "string" }, "purpose": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] }, "status": { "type": "string", "enum": [ "uploaded", "processed", "processing", "error", "deleted" ] }, "status_details": { "type": "string" }, "expires_at": { "type": "integer", "format": "int64" }, "storage_backend": { "type": "string" }, "storage_uri": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "deleteFile", "summary": "Delete a file", "description": "Deletes a file.\n", "tags": [ "Files" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file to delete", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the file", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "deleted": { "type": "boolean" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/files/{file_id}/content": { "get": { "operationId": "getFileContent", "summary": "Download file content", "description": "Downloads the content of a file.\n", "tags": [ "Files" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the file", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/containers": { "post": { "operationId": "createContainer", "summary": "Create a container", "description": "Creates a new container for storing files and data.\n", "tags": [ "Containers" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provider", "name" ], "properties": { "provider": { "$ref": "#/components/schemas/ModelProvider" }, "name": { "type": "string", "description": "Name of the container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "file_ids": { "type": "array", "items": { "type": "string" }, "description": "IDs of existing files to copy into this container" }, "memory_limit": { "type": "string", "description": "Memory limit for the container (e.g., \"1g\", \"4g\")" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier for the created container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "listContainers", "summary": "List containers", "description": "Lists containers for a provider.\n", "tags": [ "Containers" ], "parameters": [ { "name": "provider", "in": "query", "required": true, "description": "Provider to list containers for", "schema": { "$ref": "#/components/schemas/ModelProvider" } }, { "name": "limit", "in": "query", "description": "Maximum number of containers to return (1-100, default 20)", "schema": { "type": "integer", "minimum": 1, "limit": 200, "maximum": 100 } }, { "name": "after", "in": "query", "description": "Cursor for pagination", "schema": { "type": "string" } }, { "name": "order", "in": "query", "description": "Sort order (asc/desc)", "schema": { "type": "string", "enum": [ "asc", "desc" ] } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "object": { "type": "string", "description": "The object type (always \"list\")" }, "data": { "type": "array", "items": { "type": "object", "description": "A container object", "properties": { "id": { "type": "string", "description": "The unique identifier for the container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container (e.g., \"1g\", \"4g\")" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" } } }, "description": "List of container objects" }, "first_id": { "type": "string", "description": "ID of the first container in the list" }, "last_id": { "type": "string", "description": "ID of the last container in the list" }, "has_more": { "type": "boolean", "description": "Whether there are more containers to fetch" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/containers/{container_id}": { "get": { "operationId": "retrieveContainer", "summary": "Retrieve a container", "description": "Retrieves a specific container by ID.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container to retrieve", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier for the container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "deleteContainer", "summary": "Delete a container", "description": "Deletes a container.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container to delete", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the deleted container" }, "object": { "type": "string", "description": "The object type (always \"container.deleted\")" }, "deleted": { "type": "boolean", "description": "Whether the container was successfully deleted" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/containers/{container_id}/files": { "post": { "operationId": "createContainerFile", "summary": "Create a file in a container", "description": "Creates a new file in a container. You can either upload file content directly\nvia multipart/form-data or reference an existing file by its ID.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "description": "Request to create a file in a container via multipart upload", "properties": { "file": { "type": "string", "format": "binary", "description": "The file content to upload" }, "file_path": { "type": "string", "description": "Optional path for the file within the container" } } } }, "application/json": { "schema": { "type": "object", "description": "Request to create a file in a container by referencing an existing file", "required": [ "file_id" ], "properties": { "file_id": { "type": "string", "description": "The ID of an existing file to copy into the container" }, "file_path": { "type": "string", "description": "Optional path for the file within the container" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from creating a file in a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the created file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "listContainerFiles", "summary": "List files in a container", "description": "Lists all files in a container.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } }, { "name": "limit", "in": "query", "description": "Maximum number of files to return", "schema": { "type": "integer", "minimum": 1, "maximum": 100 } }, { "name": "after", "in": "query", "description": "Cursor for pagination", "schema": { "type": "string" } }, { "name": "order", "in": "query", "description": "Sort order (asc/desc)", "schema": { "type": "string", "enum": [ "asc", "desc" ] } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response containing a list of files in a container", "properties": { "object": { "type": "string", "description": "The object type (always \"list\")" }, "data": { "type": "array", "items": { "type": "object", "description": "A file object within a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file (e.g., \"user_upload\", \"copied\")" } } }, "description": "List of file objects" }, "first_id": { "type": "string", "description": "ID of the first file in the list" }, "last_id": { "type": "string", "description": "ID of the last file in the list" }, "has_more": { "type": "boolean", "description": "Whether there are more files to fetch" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/containers/{container_id}/files/{file_id}": { "get": { "operationId": "retrieveContainerFile", "summary": "Retrieve a file from a container", "description": "Retrieves metadata for a specific file in a container.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container", "schema": { "type": "string" } }, { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from retrieving a file from a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "deleteContainerFile", "summary": "Delete a file from a container", "description": "Deletes a file from a container.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container", "schema": { "type": "string" } }, { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file to delete", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from deleting a file from a container", "properties": { "id": { "type": "string", "description": "The ID of the deleted file" }, "object": { "type": "string", "description": "The object type (always \"container.file.deleted\")" }, "deleted": { "type": "boolean", "description": "Whether the file was successfully deleted" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/containers/{container_id}/files/{file_id}/content": { "get": { "operationId": "getContainerFileContent", "summary": "Download file content from a container", "description": "Downloads the content of a file from a container.\n", "tags": [ "Containers" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "description": "The ID of the container", "schema": { "type": "string" } }, { "name": "file_id", "in": "path", "required": true, "description": "The ID of the file", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "required": true, "description": "The provider of the container", "schema": { "$ref": "#/components/schemas/ModelProvider" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/chat/completions": { "post": { "operationId": "createAsyncChatCompletion", "summary": "Create async chat completion", "description": "Submits a chat completion request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/completions": { "post": { "operationId": "createAsyncTextCompletion", "summary": "Create async text completion", "description": "Submits a text completion request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/responses": { "post": { "operationId": "createAsyncResponse", "summary": "Create async response", "description": "Submits a response request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/embeddings": { "post": { "operationId": "createAsyncEmbedding", "summary": "Create async embedding", "description": "Submits an embedding request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/audio/speech": { "post": { "operationId": "createAsyncSpeech", "summary": "Create async speech", "description": "Submits a speech synthesis request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nSSE streaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/audio/transcriptions": { "post": { "operationId": "createAsyncTranscription", "summary": "Create async transcription", "description": "Submits a transcription request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TranscriptionRequest" } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/generations": { "post": { "operationId": "createAsyncImageGeneration", "summary": "Create async image generation", "description": "Submits an image generation request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "prompt": { "type": "string", "description": "Text prompt to generate image" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "quality": { "type": "string", "enum": [ "auto", "high", "medium", "low", "hd", "standard" ], "description": "Quality of the generated image" }, "style": { "type": "string", "enum": [ "natural", "vivid" ], "description": "Style of the generated image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response.\n" }, "background": { "type": "string", "enum": [ "transparent", "opaque", "auto" ], "description": "Background type for the image" }, "moderation": { "type": "string", "enum": [ "low", "auto" ], "description": "Content moderation level" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3, "description": "Number of partial images to generate" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Compression level (0-100%)" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "user": { "type": "string", "description": "User identifier for tracking" }, "seed": { "type": "integer", "description": "Seed for reproducible image generation" }, "negative_prompt": { "type": "string", "description": "Negative prompt to guide what to avoid in generation" }, "num_inference_steps": { "type": "integer", "description": "Number of inference steps for generation" }, "stream": { "type": "boolean", "default": false, "description": "Whether to stream the response. When true, images are sent as SSE.\nWhen streaming, providers may return base64 chunks (`b64_json`) and/or URLs (`url`) depending on provider and configuration.\n" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } ] } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/edits": { "post": { "operationId": "createAsyncImageEdit", "summary": "Create async image edit", "description": "Submits an image edit request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\nStreaming is not supported for async requests.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "model", "image" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "prompt": { "type": "string", "description": "Text prompt describing the edit. Required unless `type` is `background_removal`.\n" }, "image": { "type": "string", "format": "binary", "description": "Image file to edit. Use field name `image` for a single file or `image[]` for multiple files.\n" }, "mask": { "type": "string", "format": "binary", "description": "Optional mask image for inpainting (transparent areas indicate regions to edit)" }, "type": { "type": "string", "enum": [ "inpainting", "outpainting", "background_removal" ], "description": "Type of edit operation" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1536x1024", "1024x1536", "auto" ], "description": "Size of the output image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response" }, "stream": { "type": "boolean", "default": false, "description": "When true, stream the response via Server-Sent Events" }, "background": { "type": "string", "enum": [ "transparent", "opaque", "auto" ], "description": "Background type for the image" }, "input_fidelity": { "type": "string", "enum": [ "low", "high" ], "description": "How closely to follow the original image" }, "partial_images": { "type": "integer", "minimum": 0, "maximum": 3, "description": "Number of partial images to generate when streaming" }, "quality": { "type": "string", "enum": [ "auto", "high", "medium", "low", "standard" ], "description": "Quality of the output image" }, "output_format": { "type": "string", "enum": [ "png", "webp", "jpeg" ], "description": "Output image format" }, "num_inference_steps": { "type": "integer", "description": "Number of inference steps" }, "seed": { "type": "integer", "description": "Seed for reproducible editing" }, "output_compression": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Compression level (0-100%)" }, "negative_prompt": { "type": "string", "description": "What to avoid in the edit" }, "user": { "type": "string", "description": "User identifier for tracking" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/variations": { "post": { "operationId": "createAsyncImageVariation", "summary": "Create async image variation", "description": "Submits an image variation request for asynchronous execution. Returns a job ID immediately\nwith HTTP 202. Poll the corresponding GET endpoint with the job ID to retrieve the result.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncResultTTL" } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "model", "image" ], "properties": { "model": { "type": "string", "description": "Model identifier in format `provider/model`" }, "image": { "type": "string", "format": "binary", "description": "Image file to create variations of. Use field name `image` for a single file or `image[]` for multiple (first image is used).\n" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "description": "Number of variations to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the output images" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response" }, "user": { "type": "string", "description": "User identifier for tracking" }, "fallbacks": { "type": "array", "items": { "$ref": "#/components/schemas/Fallback" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "202": { "description": "Job accepted for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/chat/completions/{job_id}": { "get": { "operationId": "getAsyncChatCompletionJob", "summary": "Get async chat completion job", "description": "Retrieves the status and result of an async chat completion job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/completions/{job_id}": { "get": { "operationId": "getAsyncTextCompletionJob", "summary": "Get async text completion job", "description": "Retrieves the status and result of an async text completion job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/responses/{job_id}": { "get": { "operationId": "getAsyncResponseJob", "summary": "Get async response job", "description": "Retrieves the status and result of an async response job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/embeddings/{job_id}": { "get": { "operationId": "getAsyncEmbeddingJob", "summary": "Get async embedding job", "description": "Retrieves the status and result of an async embedding job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/audio/speech/{job_id}": { "get": { "operationId": "getAsyncSpeechJob", "summary": "Get async speech job", "description": "Retrieves the status and result of an async speech job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/audio/transcriptions/{job_id}": { "get": { "operationId": "getAsyncTranscriptionJob", "summary": "Get async transcription job", "description": "Retrieves the status and result of an async transcription job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/generations/{job_id}": { "get": { "operationId": "getAsyncImageGenerationJob", "summary": "Get async image generation job", "description": "Retrieves the status and result of an async image generation job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/edits/{job_id}": { "get": { "operationId": "getAsyncImageEditJob", "summary": "Get async image edit job", "description": "Retrieves the status and result of an async image edit job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/v1/async/images/variations/{job_id}": { "get": { "operationId": "getAsyncImageVariationJob", "summary": "Get async image variation job", "description": "Retrieves the status and result of an async image variation job.\nReturns HTTP 202 if the job is still pending or processing, HTTP 200 if completed or failed.\n", "tags": [ "Async Jobs" ], "parameters": [ { "$ref": "#/components/parameters/AsyncJobId" } ], "responses": { "200": { "description": "Job completed (successfully or with failure)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "202": { "description": "Job is still pending or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncJobResponse" } } } }, "404": { "description": "Job not found or expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/chat/completions": { "post": { "operationId": "openaiCreateChatCompletion", "summary": "Create chat completion (OpenAI format)", "description": "Creates a chat completion using OpenAI-compatible format.\nSupports streaming via SSE.\n\n**Async inference:** Send `x-bf-async: true` to submit the request as a background job and receive a job ID immediately. Poll with `x-bf-async-id: ` to retrieve the result. When the job is still processing, the response will have an empty `choices` array. When completed, `choices` will contain the full result. See [Async Inference](/features/async-inference) for details.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/chat/completions`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "x-bf-async", "in": "header", "required": false, "schema": { "type": "string", "enum": [ "true" ] }, "description": "Set to `true` to submit this request as an async job. Returns immediately with a job ID. Not compatible with streaming." }, { "name": "x-bf-async-id", "in": "header", "required": false, "schema": { "type": "string" }, "description": "Poll for results of a previously submitted async job by providing the job ID returned from the initial async request." }, { "name": "x-bf-async-job-result-ttl", "in": "header", "required": false, "schema": { "type": "integer", "default": 3600 }, "description": "Override the default result TTL in seconds. Results expire after this duration from completion time." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/chat/completions": { "post": { "operationId": "azureCreateChatCompletion", "summary": "Create chat completion (Azure OpenAI)", "description": "Creates a chat completion using Azure OpenAI deployment.\n", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" }, "description": "Azure API version" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/completions": { "post": { "operationId": "openaiCreateTextCompletion", "summary": "Create text completion (OpenAI format)", "description": "Creates a text completion using OpenAI-compatible format.\nThis is the legacy completions API.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/completions`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAITextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/completions": { "post": { "operationId": "azureCreateTextCompletion", "summary": "Create text completion (Azure OpenAI)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAITextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/responses": { "post": { "operationId": "openaiCreateResponse", "summary": "Create response (OpenAI Responses API)", "description": "Creates a response using OpenAI Responses API format.\nSupports streaming via SSE.\n\n**Async inference:** Send `x-bf-async: true` to submit the request as a background job and receive a job ID immediately. Poll with `x-bf-async-id: ` to retrieve the result. When the job is still processing, the response `status` will not be `completed`. When completed, the full response with `output_text` will be returned. See [Async Inference](/features/async-inference) for details.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/responses`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "x-bf-async", "in": "header", "required": false, "schema": { "type": "string", "enum": [ "true" ] }, "description": "Set to `true` to submit this request as an async job. Returns immediately with a job ID. Not compatible with streaming." }, { "name": "x-bf-async-id", "in": "header", "required": false, "schema": { "type": "string" }, "description": "Poll for results of a previously submitted async job by providing the job ID returned from the initial async request." }, { "name": "x-bf-async-job-result-ttl", "in": "header", "required": false, "schema": { "type": "integer", "default": 3600 }, "description": "Override the default result TTL in seconds. Results expire after this duration from completion time." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/responses": { "post": { "operationId": "azureCreateResponse", "summary": "Create response (Azure OpenAI)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/responses/input_tokens": { "post": { "operationId": "openaiCountInputTokens", "summary": "Count input tokens", "description": "Counts the number of tokens in a Responses API request.\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/embeddings": { "post": { "operationId": "openaiCreateEmbedding", "summary": "Create embeddings (OpenAI format)", "description": "Creates embedding vectors for the input text.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/embeddings`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/embeddings": { "post": { "operationId": "azureCreateEmbedding", "summary": "Create embeddings (Azure OpenAI)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/audio/speech": { "post": { "operationId": "openaiCreateSpeech", "summary": "Create speech (OpenAI TTS)", "description": "Generates audio from text using OpenAI TTS.\nSupports streaming via SSE when stream_format is set to 'sse'.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/audio/speech`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAISpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "audio/opus": { "schema": { "type": "string", "format": "binary" } }, "audio/aac": { "schema": { "type": "string", "format": "binary" } }, "audio/flac": { "schema": { "type": "string", "format": "binary" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/audio/speech": { "post": { "operationId": "azureCreateSpeech", "summary": "Create speech (Azure OpenAI TTS)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAISpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "audio/opus": { "schema": { "type": "string", "format": "binary" } }, "audio/aac": { "schema": { "type": "string", "format": "binary" } }, "audio/flac": { "schema": { "type": "string", "format": "binary" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/audio/transcriptions": { "post": { "operationId": "openaiCreateTranscription", "summary": "Create transcription (OpenAI Whisper)", "description": "Transcribes audio into text using OpenAI Whisper.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/audio/transcriptions`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/OpenAITranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/audio/transcriptions": { "post": { "operationId": "azureCreateTranscription", "summary": "Create transcription (Azure OpenAI)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/OpenAITranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/models": { "get": { "operationId": "openaiListModels", "summary": "List models (OpenAI format)", "description": "Lists available models in OpenAI format.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/models`).\n", "tags": [ "OpenAI Integration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/models": { "get": { "operationId": "azureListModels", "summary": "List models (Azure OpenAI)", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/batches": { "post": { "operationId": "openaiCreateBatch", "summary": "Create batch job (OpenAI format)", "description": "Creates a batch processing job.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/batches`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchCreateResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "openaiListBatches", "summary": "List batch jobs (OpenAI format)", "description": "Lists batch processing jobs.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/batches`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 30 }, "description": "Maximum number of batches to return" }, { "name": "after", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Filter by provider" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/batches/{batch_id}": { "get": { "operationId": "openaiRetrieveBatch", "summary": "Retrieve batch job (OpenAI format)", "description": "Retrieves details of a batch processing job.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/batches/{batch_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Batch job ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the batch" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchRetrieveResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/batches/{batch_id}/cancel": { "post": { "operationId": "openaiCancelBatch", "summary": "Cancel batch job (OpenAI format)", "description": "Cancels a batch processing job.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/batches/{batch_id}/cancel`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Batch job ID to cancel" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the batch" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "status": { "type": "string", "enum": [ "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "canceled", "ended" ] }, "request_counts": { "type": "object", "properties": { "total": { "type": "integer" }, "completed": { "type": "integer" }, "failed": { "type": "integer" }, "succeeded": { "type": "integer" }, "expired": { "type": "integer" }, "canceled": { "type": "integer" }, "pending": { "type": "integer" } } }, "cancelling_at": { "type": "integer", "format": "int64" }, "cancelled_at": { "type": "integer", "format": "int64" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/images/generations": { "post": { "operationId": "openaiCreateImage", "summary": "Create image", "description": "Generates images from text prompts using OpenAI-compatible format.\n\n**Note:** Azure OpenAI deployments are also supported via the Azure integration endpoint.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/images/generations`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier" }, "prompt": { "type": "string", "description": "Text prompt to generate image" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "default": 1, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "quality": { "type": "string", "enum": [ "standard", "hd" ], "description": "Quality of the generated image" }, "style": { "type": "string", "enum": [ "natural", "vivid" ], "description": "Style of the generated image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response. This parameter is not supported for streaming requests." }, "user": { "type": "string", "description": "User identifier for tracking" }, "stream": { "type": "boolean", "default": false, "description": "Whether to stream the response. When true, images are sent as base64 chunks via SSE.\n" }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "200": { "description": "Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when `stream=true`.\nWhen streaming, each event contains a chunk of the image as base64 data, with the final event having type `image_generation.completed`.\n", "content": { "application/json": { "schema": { "type": "object", "properties": { "created": { "type": "integer", "format": "int64", "description": "Unix timestamp when the image was created" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the generated image" }, "b64_json": { "type": "string", "description": "Base64-encoded image data" }, "revised_prompt": { "type": "string", "description": "Revised prompt used for generation" }, "index": { "type": "integer", "description": "Index of this image" } } }, "description": "Array of generated images" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "description": "Output format used" }, "quality": { "type": "string", "description": "Quality setting used" }, "size": { "type": "string", "description": "Size setting used" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } } } } } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming response chunk for image generation (OpenAI format).\nSent via Server-Sent Events (SSE) when stream=true.\n", "properties": { "type": { "type": "string", "enum": [ "image_generation.partial_image", "image_generation.completed", "error" ], "description": "Type of stream event" }, "b64_json": { "type": "string", "description": "Base64-encoded chunk of image data" }, "partial_image_index": { "type": "integer", "description": "Index of the partial image chunk" }, "sequence_number": { "type": "integer", "description": "Ordering index for stream chunks" }, "created_at": { "type": "integer", "format": "int64", "description": "Timestamp when chunk was created" }, "size": { "type": "string", "description": "Size of the generated image" }, "quality": { "type": "string", "description": "Quality setting used" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "description": "Output format used" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } }, "description": "Token usage (usually in final chunk)" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/openai/deployments/{deployment-id}/images/generations": { "post": { "operationId": "azureCreateImage", "summary": "Create image (Azure OpenAI)", "description": "Generates images from text prompts using Azure OpenAI deployment.\n", "tags": [ "OpenAI Integration", "Azure Integration" ], "parameters": [ { "name": "deployment-id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Azure deployment ID" }, { "name": "api-version", "in": "query", "schema": { "type": "string" }, "description": "Azure API version" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier" }, "prompt": { "type": "string", "description": "Text prompt to generate image" }, "n": { "type": "integer", "minimum": 1, "maximum": 10, "default": 1, "description": "Number of images to generate" }, "size": { "type": "string", "enum": [ "256x256", "512x512", "1024x1024", "1792x1024", "1024x1792", "1536x1024", "1024x1536", "auto" ], "description": "Size of the generated image" }, "quality": { "type": "string", "enum": [ "standard", "hd" ], "description": "Quality of the generated image" }, "style": { "type": "string", "enum": [ "natural", "vivid" ], "description": "Style of the generated image" }, "response_format": { "type": "string", "enum": [ "url", "b64_json" ], "default": "url", "description": "Format of the response. This parameter is not supported for streaming requests." }, "user": { "type": "string", "description": "User identifier for tracking" }, "stream": { "type": "boolean", "default": false, "description": "Whether to stream the response. When true, images are sent as base64 chunks via SSE.\n" }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback models to try if primary model fails" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "created": { "type": "integer", "format": "int64", "description": "Unix timestamp when the image was created" }, "data": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "URL of the generated image" }, "b64_json": { "type": "string", "description": "Base64-encoded image data" }, "revised_prompt": { "type": "string", "description": "Revised prompt used for generation" }, "index": { "type": "integer", "description": "Index of this image" } } }, "description": "Array of generated images" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "description": "Output format used" }, "quality": { "type": "string", "description": "Quality setting used" }, "size": { "type": "string", "description": "Size setting used" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } } } } } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming response chunk for image generation (OpenAI format).\nSent via Server-Sent Events (SSE) when stream=true.\n", "properties": { "type": { "type": "string", "enum": [ "image_generation.partial_image", "image_generation.completed", "error" ], "description": "Type of stream event" }, "b64_json": { "type": "string", "description": "Base64-encoded chunk of image data" }, "partial_image_index": { "type": "integer", "description": "Index of the partial image chunk" }, "sequence_number": { "type": "integer", "description": "Ordering index for stream chunks" }, "created_at": { "type": "integer", "format": "int64", "description": "Timestamp when chunk was created" }, "size": { "type": "string", "description": "Size of the generated image" }, "quality": { "type": "string", "description": "Quality setting used" }, "background": { "type": "string", "description": "Background type used" }, "output_format": { "type": "string", "description": "Output format used" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" }, "input_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } }, "total_tokens": { "type": "integer", "description": "Total tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens" }, "output_tokens_details": { "type": "object", "properties": { "image_tokens": { "type": "integer", "description": "Tokens used for images" }, "text_tokens": { "type": "integer", "description": "Tokens used for text" } } } }, "description": "Token usage (usually in final chunk)" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/files": { "post": { "operationId": "openaiUploadFile", "summary": "Upload file (OpenAI format)", "description": "Uploads a file for use with batch processing or other features.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/files`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file", "purpose" ], "properties": { "file": { "type": "string", "format": "binary", "description": "File to upload" }, "purpose": { "type": "string", "enum": [ "assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision", "user_data", "evals" ], "description": "Purpose of the file" }, "provider": { "type": "string", "description": "Provider for file storage" }, "storage_config": { "type": "object", "description": "Storage configuration for cloud storage backends", "properties": { "s3": { "type": "object", "description": "AWS S3 storage configuration", "properties": { "bucket": { "type": "string", "description": "S3 bucket name" }, "region": { "type": "string", "description": "AWS region" }, "prefix": { "type": "string", "description": "Path prefix for stored files" } } }, "gcs": { "type": "object", "description": "Google Cloud Storage configuration", "properties": { "bucket": { "type": "string", "description": "GCS bucket name" }, "project": { "type": "string", "description": "GCP project ID" }, "prefix": { "type": "string", "description": "Path prefix for stored files" } } } } } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileUploadResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "openaiListFiles", "summary": "List files (OpenAI format)", "description": "Lists uploaded files.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/files`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "purpose", "in": "query", "schema": { "type": "string" }, "description": "Filter by purpose" }, { "name": "limit", "in": "query", "schema": { "type": "integer" }, "description": "Maximum files to return" }, { "name": "after", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Filter by provider" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/files/{file_id}": { "get": { "operationId": "openaiRetrieveFile", "summary": "Retrieve file metadata (OpenAI format)", "description": "Retrieves metadata for an uploaded file.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/files/{file_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the file" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "bytes": { "type": "integer", "format": "int64" }, "created_at": { "type": "integer", "format": "int64" }, "filename": { "type": "string" }, "purpose": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] }, "status": { "type": "string", "enum": [ "uploaded", "processed", "processing", "error", "deleted" ] }, "status_details": { "type": "string" }, "expires_at": { "type": "integer", "format": "int64" }, "storage_backend": { "type": "string" }, "storage_uri": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "openaiDeleteFile", "summary": "Delete file (OpenAI format)", "description": "Deletes an uploaded file.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/files/{file_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID to delete" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the file" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "deleted": { "type": "boolean" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/files/{file_id}/content": { "get": { "operationId": "openaiGetFileContent", "summary": "Get file content (OpenAI format)", "description": "Retrieves the content of an uploaded file.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/files/{file_id}/content`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the file" } ], "responses": { "200": { "description": "Successful response", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/containers": { "post": { "operationId": "openaiCreateContainer", "summary": "Create container (OpenAI format)", "description": "Creates a new container for storing files and data.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers`).\n", "tags": [ "OpenAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provider", "name" ], "properties": { "provider": { "$ref": "#/components/schemas/ModelProvider" }, "name": { "type": "string", "description": "Name of the container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "file_ids": { "type": "array", "items": { "type": "string" }, "description": "IDs of existing files to copy into this container" }, "memory_limit": { "type": "string", "description": "Memory limit for the container (e.g., \"1g\", \"4g\")" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier for the created container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "openaiListContainers", "summary": "List containers (OpenAI format)", "description": "Lists containers for a provider.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider to list containers for (defaults to openai)" }, { "name": "limit", "in": "query", "schema": { "type": "integer" }, "description": "Maximum containers to return" }, { "name": "after", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] }, "description": "Sort order" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "object": { "type": "string", "description": "The object type (always \"list\")" }, "data": { "type": "array", "items": { "type": "object", "description": "A container object", "properties": { "id": { "type": "string", "description": "The unique identifier for the container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container (e.g., \"1g\", \"4g\")" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" } } }, "description": "List of container objects" }, "first_id": { "type": "string", "description": "ID of the first container in the list" }, "last_id": { "type": "string", "description": "ID of the last container in the list" }, "has_more": { "type": "boolean", "description": "Whether there are more containers to fetch" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/containers/{container_id}": { "get": { "operationId": "openaiRetrieveContainer", "summary": "Retrieve container (OpenAI format)", "description": "Retrieves a specific container by ID.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique identifier for the container" }, "object": { "type": "string", "description": "The object type (always \"container\")" }, "name": { "type": "string", "description": "The name of the container" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the container was created" }, "status": { "type": "string", "enum": [ "running" ], "description": "The status of a container" }, "expires_after": { "type": "object", "description": "Expiration configuration for a container", "properties": { "anchor": { "type": "string", "description": "The anchor point for expiration (e.g., \"last_active_at\")" }, "minutes": { "type": "integer", "description": "Number of minutes after anchor point" } } }, "last_active_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of last activity" }, "memory_limit": { "type": "string", "description": "Memory limit for the container" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "description": "User-provided metadata" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "openaiDeleteContainer", "summary": "Delete container (OpenAI format)", "description": "Deletes a container.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID to delete" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the deleted container" }, "object": { "type": "string", "description": "The object type (always \"container.deleted\")" }, "deleted": { "type": "boolean", "description": "Whether the container was successfully deleted" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/containers/{container_id}/files": { "post": { "operationId": "openaiCreateContainerFile", "summary": "Create file in container (OpenAI format)", "description": "Creates a new file in a container. You can either upload file content directly\nvia multipart/form-data or reference an existing file by its ID.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}/files`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "description": "Request to create a file in a container via multipart upload", "properties": { "file": { "type": "string", "format": "binary", "description": "The file content to upload" }, "file_path": { "type": "string", "description": "Optional path for the file within the container" } } } }, "application/json": { "schema": { "type": "object", "description": "Request to create a file in a container by referencing an existing file", "required": [ "file_id" ], "properties": { "file_id": { "type": "string", "description": "The ID of an existing file to copy into the container" }, "file_path": { "type": "string", "description": "Optional path for the file within the container" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from creating a file in a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the created file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "openaiListContainerFiles", "summary": "List files in container (OpenAI format)", "description": "Lists all files in a container.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}/files`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" }, { "name": "limit", "in": "query", "schema": { "type": "integer" }, "description": "Maximum files to return" }, { "name": "after", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" }, { "name": "order", "in": "query", "schema": { "type": "string", "enum": [ "asc", "desc" ] }, "description": "Sort order" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response containing a list of files in a container", "properties": { "object": { "type": "string", "description": "The object type (always \"list\")" }, "data": { "type": "array", "items": { "type": "object", "description": "A file object within a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file (e.g., \"user_upload\", \"copied\")" } } }, "description": "List of file objects" }, "first_id": { "type": "string", "description": "ID of the first file in the list" }, "last_id": { "type": "string", "description": "ID of the last file in the list" }, "has_more": { "type": "boolean", "description": "Whether there are more files to fetch" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/containers/{container_id}/files/{file_id}": { "get": { "operationId": "openaiRetrieveContainerFile", "summary": "Retrieve file from container (OpenAI format)", "description": "Retrieves metadata for a specific file in a container.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}/files/{file_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from retrieving a file from a container", "properties": { "id": { "type": "string", "description": "The unique identifier for the file" }, "object": { "type": "string", "description": "The object type (always \"container.file\")" }, "container_id": { "type": "string", "description": "The ID of the container this file belongs to" }, "path": { "type": "string", "description": "The path of the file within the container" }, "bytes": { "type": "integer", "format": "int64", "description": "The size of the file in bytes" }, "created_at": { "type": "integer", "format": "int64", "description": "Unix timestamp of when the file was created" }, "source": { "type": "string", "description": "The source of the file" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "openaiDeleteContainerFile", "summary": "Delete file from container (OpenAI format)", "description": "Deletes a file from a container.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}/files/{file_id}`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID to delete" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Response from deleting a file from a container", "properties": { "id": { "type": "string", "description": "The ID of the deleted file" }, "object": { "type": "string", "description": "The object type (always \"container.file.deleted\")" }, "deleted": { "type": "boolean", "description": "Whether the file was successfully deleted" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/openai/v1/containers/{container_id}/files/{file_id}/content": { "get": { "operationId": "openaiGetContainerFileContent", "summary": "Get file content from container (OpenAI format)", "description": "Downloads the content of a file from a container.\n\n**Note:** This endpoint also works without the `/v1` prefix (e.g., `/openai/containers/{container_id}/files/{file_id}/content`).\n", "tags": [ "OpenAI Integration" ], "parameters": [ { "name": "container_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Container ID" }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" }, { "name": "provider", "in": "query", "schema": { "type": "string" }, "description": "Provider for the container (defaults to openai)" } ], "responses": { "200": { "description": "Successful response", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages": { "post": { "operationId": "anthropicCreateMessage", "summary": "Create message (Anthropic format)", "description": "Creates a message using Anthropic Messages API format.\nSupports streaming via SSE.\n\n**Async inference:** Send `x-bf-async: true` to submit the request as a background job and receive a job ID immediately. Poll with `x-bf-async-id: ` to retrieve the result. When the job is still processing, the response will have an empty `content` array. When completed, `content` will contain the full result. See [Async Inference](/features/async-inference) for details.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "x-bf-async", "in": "header", "required": false, "schema": { "type": "string", "enum": [ "true" ] }, "description": "Set to `true` to submit this request as an async job. Returns immediately with a job ID. Not compatible with streaming." }, { "name": "x-bf-async-id", "in": "header", "required": false, "schema": { "type": "string" }, "description": "Poll for results of a previously submitted async job by providing the job ID returned from the initial async request." }, { "name": "x-bf-async-job-result-ttl", "in": "header", "required": false, "schema": { "type": "integer", "default": 3600 }, "description": "Override the default result TTL in seconds. Results expire after this duration from completion time." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message_start", "content_block_start", "content_block_delta", "content_block_stop", "message_delta", "message_stop", "ping", "error" ] }, "message": { "$ref": "#/components/schemas/AnthropicMessageResponse" }, "index": { "type": "integer" }, "content_block": { "$ref": "#/components/schemas/AnthropicContentBlock" }, "delta": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text_delta", "input_json_delta", "thinking_delta", "signature_delta" ] }, "text": { "type": "string" }, "partial_json": { "type": "string" }, "thinking": { "type": "string" }, "signature": { "type": "string" }, "stop_reason": { "type": "string" }, "stop_sequence": { "type": "string" } } }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cache_creation_input_tokens": { "type": "integer" }, "cache_read_input_tokens": { "type": "integer" }, "cache_creation": { "type": "object", "properties": { "ephemeral_5m_input_tokens": { "type": "integer" }, "ephemeral_1h_input_tokens": { "type": "integer" } } } } }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/complete": { "post": { "operationId": "anthropicCreateComplete", "summary": "Create completion (Anthropic legacy format)", "description": "Creates a text completion using Anthropic's legacy Complete API.\nSupports streaming via SSE.\n", "tags": [ "Anthropic Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicTextRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "completion" }, "id": { "type": "string" }, "completion": { "type": "string" }, "stop_reason": { "type": "string", "enum": [ "stop_sequence", "max_tokens", null ] }, "model": { "type": "string" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens generated" } } } } } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "completion" }, "id": { "type": "string" }, "completion": { "type": "string" }, "stop_reason": { "type": "string", "enum": [ "stop_sequence", "max_tokens", null ] }, "model": { "type": "string" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens generated" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/models": { "get": { "operationId": "anthropicListModels", "summary": "List models (Anthropic format)", "description": "Lists available models in Anthropic format.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of models to return" }, { "name": "before_id", "in": "query", "schema": { "type": "string" }, "description": "Return models before this ID" }, { "name": "after_id", "in": "query", "schema": { "type": "string" }, "description": "Return models after this ID" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages/count_tokens": { "post": { "operationId": "anthropicCountTokens", "summary": "Count tokens (Anthropic format)", "description": "Counts the number of tokens in a message request.\n", "tags": [ "Anthropic Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/AnthropicMessageRequest" } ] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages/batches": { "post": { "operationId": "anthropicCreateBatch", "summary": "Create batch job (Anthropic format)", "description": "Creates a batch processing job using Anthropic format.\nUse x-model-provider header to specify the provider.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider to use (defaults to anthropic)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "requests" ], "properties": { "requests": { "type": "array", "items": { "type": "object", "required": [ "custom_id", "params" ], "properties": { "custom_id": { "type": "string", "description": "Unique identifier for this request" }, "params": { "type": "object", "description": "Request parameters (same as AnthropicMessageRequest)" } } }, "description": "Array of batch request items" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "message_batch" }, "processing_status": { "type": "string", "enum": [ "in_progress", "ended", "canceling" ] }, "request_counts": { "type": "object", "properties": { "processing": { "type": "integer" }, "succeeded": { "type": "integer" }, "errored": { "type": "integer" }, "canceled": { "type": "integer" }, "expired": { "type": "integer" } } }, "ended_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "expires_at": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time", "nullable": true }, "cancel_initiated_at": { "type": "string", "format": "date-time", "nullable": true }, "results_url": { "type": "string", "nullable": true } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "anthropicListBatches", "summary": "List batch jobs (Anthropic format)", "description": "Lists batch processing jobs.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider to use (defaults to anthropic)" }, { "name": "page_size", "in": "query", "schema": { "type": "integer", "default": 20 }, "description": "Maximum number of batches to return" }, { "name": "page_token", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "message_batch" }, "processing_status": { "type": "string", "enum": [ "in_progress", "ended", "canceling" ] }, "request_counts": { "type": "object", "properties": { "processing": { "type": "integer" }, "succeeded": { "type": "integer" }, "errored": { "type": "integer" }, "canceled": { "type": "integer" }, "expired": { "type": "integer" } } }, "ended_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "expires_at": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time", "nullable": true }, "cancel_initiated_at": { "type": "string", "format": "date-time", "nullable": true }, "results_url": { "type": "string", "nullable": true } } } }, "has_more": { "type": "boolean" }, "first_id": { "type": "string" }, "last_id": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages/batches/{batch_id}": { "get": { "operationId": "anthropicRetrieveBatch", "summary": "Retrieve batch job (Anthropic format)", "description": "Retrieves details of a batch processing job.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Batch job ID" }, { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider for the batch" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "message_batch" }, "processing_status": { "type": "string", "enum": [ "in_progress", "ended", "canceling" ] }, "request_counts": { "type": "object", "properties": { "processing": { "type": "integer" }, "succeeded": { "type": "integer" }, "errored": { "type": "integer" }, "canceled": { "type": "integer" }, "expired": { "type": "integer" } } }, "ended_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "expires_at": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time", "nullable": true }, "cancel_initiated_at": { "type": "string", "format": "date-time", "nullable": true }, "results_url": { "type": "string", "nullable": true } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages/batches/{batch_id}/cancel": { "post": { "operationId": "anthropicCancelBatch", "summary": "Cancel batch job (Anthropic format)", "description": "Cancels a batch processing job.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Batch job ID to cancel" }, { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider for the batch" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "message_batch" }, "processing_status": { "type": "string", "enum": [ "in_progress", "ended", "canceling" ] }, "request_counts": { "type": "object", "properties": { "processing": { "type": "integer" }, "succeeded": { "type": "integer" }, "errored": { "type": "integer" }, "canceled": { "type": "integer" }, "expired": { "type": "integer" } } }, "ended_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "expires_at": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time", "nullable": true }, "cancel_initiated_at": { "type": "string", "format": "date-time", "nullable": true }, "results_url": { "type": "string", "nullable": true } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/messages/batches/{batch_id}/results": { "get": { "operationId": "anthropicGetBatchResults", "summary": "Get batch results (Anthropic format)", "description": "Retrieves results of a completed batch job.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "batch_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Batch job ID" }, { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider for the batch" } ], "responses": { "200": { "description": "Successful response (JSONL stream)", "content": { "application/x-ndjson": { "schema": { "type": "string" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/files": { "post": { "operationId": "anthropicUploadFile", "summary": "Upload file (Anthropic format)", "description": "Uploads a file. Use x-model-provider header to specify the provider.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider to use (defaults to anthropic)" } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "file" ], "properties": { "file": { "type": "string", "format": "binary", "description": "File to upload (raw file content)" }, "filename": { "type": "string", "description": "Original filename" }, "purpose": { "type": "string", "description": "Purpose of the file (e.g., \"batch\")" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "file" }, "filename": { "type": "string" }, "mime_type": { "type": "string", "description": "MIME type of the file" }, "size_bytes": { "type": "integer", "description": "Size of the file in bytes" }, "created_at": { "type": "string", "format": "date-time" }, "downloadable": { "type": "boolean" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "anthropicListFiles", "summary": "List files (Anthropic format)", "description": "Lists uploaded files.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider to use (defaults to anthropic)" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 30 }, "description": "Maximum files to return" }, { "name": "after_id", "in": "query", "schema": { "type": "string" }, "description": "Cursor for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "file" }, "filename": { "type": "string" }, "mime_type": { "type": "string", "description": "MIME type of the file" }, "size_bytes": { "type": "integer", "description": "Size of the file in bytes" }, "created_at": { "type": "string", "format": "date-time" }, "downloadable": { "type": "boolean" } } } }, "has_more": { "type": "boolean" }, "first_id": { "type": "string" }, "last_id": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/files/{file_id}/content": { "get": { "operationId": "anthropicGetFileContent", "summary": "Get file content (Anthropic format)", "description": "Retrieves file content. Returns raw binary file data when Accept header is set to application/octet-stream,\nor file metadata as JSON when Accept header is set to application/json.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" }, { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider for the file" }, { "name": "Accept", "in": "header", "schema": { "type": "string", "enum": [ "application/json", "application/octet-stream" ], "default": "application/json" }, "description": "Response content type - use application/octet-stream for binary download" } ], "responses": { "200": { "description": "Successful response. Returns file metadata as JSON or raw binary file content.\nWhen returning binary content, the Content-Type header indicates the file's MIME type\nand Content-Disposition header may include the filename.\n", "headers": { "Content-Type": { "schema": { "type": "string" }, "description": "MIME type of the file (e.g., application/pdf, image/png, text/plain)" }, "Content-Disposition": { "schema": { "type": "string" }, "description": "Attachment filename directive (e.g., attachment; filename=\"document.pdf\")" } }, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "file" }, "filename": { "type": "string" }, "mime_type": { "type": "string", "description": "MIME type of the file" }, "size_bytes": { "type": "integer", "description": "Size of the file in bytes" }, "created_at": { "type": "string", "format": "date-time" }, "downloadable": { "type": "boolean" } } } }, "application/octet-stream": { "schema": { "type": "string", "format": "binary", "description": "Raw binary file content" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/anthropic/v1/files/{file_id}": { "delete": { "operationId": "anthropicDeleteFile", "summary": "Delete file (Anthropic format)", "description": "Deletes an uploaded file.\n", "tags": [ "Anthropic Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID to delete" }, { "name": "x-model-provider", "in": "header", "schema": { "type": "string" }, "description": "Provider for the file" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "file_deleted" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models/{model}:generateContent": { "post": { "operationId": "geminiGenerateContent", "summary": "Generate content (Gemini format)", "description": "Generates content using Google Gemini API format.\nThe model is specified in the URL path.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action (e.g., gemini-pro:generateContent)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models/{model}:streamGenerateContent": { "post": { "operationId": "geminiStreamGenerateContent", "summary": "Stream generate content (Gemini format)", "description": "Streams content generation using Google Gemini API format.\nThe model is specified in the URL path.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action (e.g., gemini-pro:streamGenerateContent)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models/{model}:embedContent": { "post": { "operationId": "geminiEmbedContent", "summary": "Embed content (Gemini format)", "description": "Creates embeddings using Google Gemini API format.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action (e.g., embedding-001:embedContent)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiEmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models/{model}:countTokens": { "post": { "operationId": "geminiCountTokens", "summary": "Count tokens (Gemini format)", "description": "Counts tokens using Google Gemini API format.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action (e.g., gemini-pro:countTokens)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "contents": { "type": "array", "items": { "$ref": "#/components/schemas/GeminiContent" } }, "generateContentRequest": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "totalTokens": { "type": "integer", "description": "Number of tokens that the model tokenizes the prompt into" }, "cachedContentTokenCount": { "type": "integer", "description": "Number of tokens in the cached part of the prompt" }, "promptTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities processed in the request input" }, "cacheTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities in the cached content" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models/{model}:predict": { "post": { "operationId": "geminiGenerateImage", "summary": "Generate image (Gemini format)", "description": "For Imagen models, use the `:predict` suffix (e.g., `imagen-3.0-generate-001:predict`).\nFor Gemini models, use `:generateContent` with `generationConfig.responseModalities: [\"IMAGE\"]` in the request body.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action suffix. For Imagen models, use `:predict` (e.g., `imagen-3.0-generate-001:predict`).\nFor Gemini models with image generation, use `:generateContent` (e.g., `gemini-1.5-pro:generateContent`).\n" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful response. Returns JSON with generated image data in `candidates[0].content.parts[0].inlineData`.\nWhen streaming, events are sent via Server-Sent Events (SSE).\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } }, "text/event-stream": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/models": { "get": { "operationId": "geminiListModels", "summary": "List models (Gemini format)", "description": "Lists available models in Google Gemini API format.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "pageSize", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of models to return" }, { "name": "pageToken", "in": "query", "schema": { "type": "string" }, "description": "Page token for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/upload/v1beta/files": { "post": { "operationId": "geminiUploadFile", "summary": "Upload file (Gemini format)", "description": "Uploads a file using Google Gemini API format.\n\nThis is a multipart upload with two parts:\n- \"metadata\": JSON object containing file metadata\n- \"file\": Binary file content\n\nNote: Direct file content download is not supported by Gemini Files API.\nUse the file.uri field from the response to access uploaded files.\n", "tags": [ "GenAI Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "description": "Multipart upload for Gemini Files API. Send two parts: - \"metadata\": JSON object {\"file\": {\"displayName\": \"\"}} - \"file\": binary content Note: Direct file content download is not supported by Gemini Files API. Use the file.uri field from the response to access the file.\n", "required": [ "file" ], "properties": { "metadata": { "type": "object", "description": "JSON metadata part; see encoding at the path for contentType application/json.", "properties": { "file": { "type": "object", "properties": { "displayName": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "file": { "type": "string", "format": "binary" } }, "additionalProperties": false }, "encoding": { "metadata": { "contentType": "application/json" } } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "file": { "type": "object", "properties": { "name": { "type": "string", "description": "File resource name (e.g., files/abc123)" }, "displayName": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "string", "description": "Size in bytes (returned as string by Gemini API)" }, "createTime": { "type": "string", "format": "date-time" }, "updateTime": { "type": "string", "format": "date-time" }, "expirationTime": { "type": "string", "format": "date-time" }, "sha256Hash": { "type": "string" }, "uri": { "type": "string", "description": "URI for accessing the file content" }, "state": { "type": "string", "enum": [ "STATE_UNSPECIFIED", "PROCESSING", "ACTIVE", "FAILED" ] }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }, "videoMetadata": { "type": "object", "properties": { "videoDuration": { "type": "string" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/files": { "get": { "operationId": "geminiListFiles", "summary": "List files (Gemini format)", "description": "Lists uploaded files in Google Gemini API format.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "pageSize", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of files to return" }, { "name": "pageToken", "in": "query", "schema": { "type": "string" }, "description": "Page token for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "files": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "File resource name (e.g., files/abc123)" }, "displayName": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "string", "description": "Size in bytes (returned as string by Gemini API)" }, "createTime": { "type": "string", "format": "date-time" }, "updateTime": { "type": "string", "format": "date-time" }, "expirationTime": { "type": "string", "format": "date-time" }, "sha256Hash": { "type": "string" }, "uri": { "type": "string", "description": "URI for accessing the file content" }, "state": { "type": "string", "enum": [ "STATE_UNSPECIFIED", "PROCESSING", "ACTIVE", "FAILED" ] }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }, "videoMetadata": { "type": "object", "properties": { "videoDuration": { "type": "string" } } } } } }, "nextPageToken": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/genai/v1beta/files/{file_id}": { "get": { "operationId": "geminiRetrieveFile", "summary": "Retrieve file (Gemini format)", "description": "Retrieves file metadata in Google Gemini API format.\n\nNote: This endpoint returns file metadata only. Direct file content\ndownload is not supported by Gemini Files API. Use the file.uri\nfield from the response to access the file content.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "File resource name (e.g., files/abc123)" }, "displayName": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "string", "description": "Size in bytes (returned as string by Gemini API)" }, "createTime": { "type": "string", "format": "date-time" }, "updateTime": { "type": "string", "format": "date-time" }, "expirationTime": { "type": "string", "format": "date-time" }, "sha256Hash": { "type": "string" }, "uri": { "type": "string", "description": "URI for accessing the file content" }, "state": { "type": "string", "enum": [ "STATE_UNSPECIFIED", "PROCESSING", "ACTIVE", "FAILED" ] }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }, "videoMetadata": { "type": "object", "properties": { "videoDuration": { "type": "string" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "delete": { "operationId": "geminiDeleteFile", "summary": "Delete file (Gemini format)", "description": "Deletes a file in Google Gemini API format.\n", "tags": [ "GenAI Integration" ], "parameters": [ { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "File ID to delete" } ], "responses": { "200": { "description": "Successful response (empty)", "content": { "application/json": { "schema": { "type": "object", "description": "Empty response on successful deletion" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model/{modelId}/converse": { "post": { "operationId": "bedrockConverse", "summary": "Converse with model (Bedrock format)", "description": "Sends messages to a model using AWS Bedrock Converse API format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID (e.g., anthropic.claude-3-sonnet-20240229-v1:0)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model/{modelId}/converse-stream": { "post": { "operationId": "bedrockConverseStream", "summary": "Stream converse with model (Bedrock format)", "description": "Streams messages from a model using AWS Bedrock Converse API format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID (e.g., anthropic.claude-3-sonnet-20240229-v1:0)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "application/x-amz-eventstream": { "schema": { "type": "object", "description": "Flat structure for streaming events matching actual Bedrock API response", "properties": { "role": { "type": "string", "description": "For messageStart events" }, "contentBlockIndex": { "type": "integer", "description": "For content block events" }, "delta": { "type": "object", "properties": { "text": { "type": "string" }, "reasoningContent": { "type": "object", "properties": { "text": { "type": "string" }, "signature": { "type": "string" } } }, "toolUse": { "type": "object", "properties": { "input": { "type": "string" } } } } }, "stopReason": { "type": "string", "description": "For messageStop events" }, "start": { "type": "object", "properties": { "toolUse": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "name": { "type": "string" } } } } }, "usage": { "type": "object", "properties": { "inputTokens": { "type": "integer" }, "outputTokens": { "type": "integer" }, "totalTokens": { "type": "integer" }, "cacheReadInputTokens": { "type": "integer" }, "cacheWriteInputTokens": { "type": "integer" } } }, "metrics": { "type": "object", "properties": { "latencyMs": { "type": "integer" } } }, "trace": { "type": "object" }, "additionalModelResponseFields": { "type": "object" }, "invokeModelRawChunk": { "type": "string", "format": "byte", "description": "Raw bytes for legacy invoke stream" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model/{modelId}/invoke": { "post": { "operationId": "bedrockInvokeModel", "summary": "Invoke model (Bedrock format)", "description": "Invokes a model using AWS Bedrock InvokeModel API format.\nAccepts raw model-specific request body.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID (e.g., anthropic.claude-3-sonnet-20240229-v1:0)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockInvokeRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockInvokeResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model/{modelId}/invoke-with-response-stream": { "post": { "operationId": "bedrockInvokeModelStream", "summary": "Invoke model with streaming (Bedrock format)", "description": "Invokes a model with streaming using AWS Bedrock InvokeModelWithResponseStream API format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID (e.g., anthropic.claude-3-sonnet-20240229-v1:0)" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockInvokeRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "application/x-amz-eventstream": { "schema": { "type": "object", "description": "AWS event stream format" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model-invocation-jobs": { "post": { "operationId": "bedrockCreateBatchJob", "summary": "Create batch inference job (Bedrock format)", "description": "Creates a batch inference job using AWS Bedrock format.\n", "tags": [ "Bedrock Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockBatchJobRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockBatchJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "bedrockListBatchJobs", "summary": "List batch inference jobs (Bedrock format)", "description": "Lists batch inference jobs using AWS Bedrock format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "maxResults", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of results to return" }, { "name": "nextToken", "in": "query", "schema": { "type": "string" }, "description": "Token for pagination" }, { "name": "statusEquals", "in": "query", "schema": { "type": "string", "enum": [ "Submitted", "InProgress", "Completed", "Failed", "Stopping", "Stopped", "PartiallyCompleted", "Expired", "Validating", "Scheduled" ] }, "description": "Filter by status" }, { "name": "nameContains", "in": "query", "schema": { "type": "string" }, "description": "Filter by job name containing this string" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "invocationJobSummaries": { "type": "array", "items": { "type": "object", "properties": { "jobArn": { "type": "string" }, "jobName": { "type": "string" }, "modelId": { "type": "string" }, "status": { "type": "string" }, "submitTime": { "type": "string", "format": "date-time" }, "lastModifiedTime": { "type": "string", "format": "date-time" }, "endTime": { "type": "string", "format": "date-time" }, "message": { "type": "string" } } } }, "nextToken": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model-invocation-jobs/{jobIdentifier}": { "get": { "operationId": "bedrockRetrieveBatchJob", "summary": "Retrieve batch inference job (Bedrock format)", "description": "Retrieves a batch inference job using AWS Bedrock format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "jobIdentifier", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Job identifier" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockBatchJobResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/bedrock/model-invocation-jobs/{jobIdentifier}/stop": { "post": { "operationId": "bedrockCancelBatchJob", "summary": "Cancel batch inference job (Bedrock format)", "description": "Cancels a batch inference job using AWS Bedrock format.\n", "tags": [ "Bedrock Integration" ], "parameters": [ { "name": "jobIdentifier", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Job identifier to cancel" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "jobArn": { "type": "string" }, "status": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/cohere/v2/chat": { "post": { "operationId": "cohereChatV2", "summary": "Chat with model (Cohere v2 format)", "description": "Sends a chat request using Cohere v2 API format.\n", "tags": [ "Cohere Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "message-start", "content-start", "content-delta", "content-end", "tool-plan-delta", "tool-call-start", "tool-call-delta", "tool-call-end", "citation-start", "citation-end", "message-end", "debug" ], "description": "Type of streaming event" }, "id": { "type": "string", "description": "Event ID (for message-start)" }, "index": { "type": "integer", "description": "Index for indexed events" }, "delta": { "type": "object", "properties": { "message": { "type": "object", "properties": { "role": { "type": "string", "description": "Message role (for message-start)" }, "content": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } } } ], "description": "Content for content events" }, "tool_plan": { "type": "string", "description": "Tool plan content (for tool-plan-delta)" }, "tool_calls": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } ], "description": "Tool calls (for tool-call events)" }, "citations": { "oneOf": [ { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } }, { "type": "array", "items": { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } } } ], "description": "Citations (for citation events)" } } }, "finish_reason": { "type": "string", "enum": [ "COMPLETE", "STOP_SEQUENCE", "MAX_TOKENS", "TOOL_CALL", "ERROR", "TIMEOUT" ] }, "usage": { "type": "object", "properties": { "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "cached_tokens": { "type": "integer", "description": "Cached tokens" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/cohere/v2/embed": { "post": { "operationId": "cohereEmbedV2", "summary": "Create embeddings (Cohere v2 format)", "description": "Creates embeddings using Cohere v2 API format.\n", "tags": [ "Cohere Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/cohere/v1/tokenize": { "post": { "operationId": "cohereTokenize", "summary": "Tokenize text (Cohere format)", "description": "Tokenizes text using Cohere v1 API format.\n", "tags": [ "Cohere Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/completions": { "post": { "operationId": "litellmOpenAITextCompletions", "summary": "Text completions (LiteLLM - OpenAI format)", "description": "Creates a text completion using OpenAI-compatible format via LiteLLM.\nThis is the legacy completions API.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAITextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/chat/completions": { "post": { "operationId": "litellmOpenAIChatCompletions", "summary": "Chat completions (LiteLLM - OpenAI format)", "description": "Creates a chat completion using OpenAI-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/embeddings": { "post": { "operationId": "litellmOpenAIEmbeddings", "summary": "Create embeddings (LiteLLM - OpenAI format)", "description": "Creates embeddings using OpenAI-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/models": { "get": { "operationId": "litellmOpenAIListModels", "summary": "List models (LiteLLM - OpenAI format)", "description": "Lists available models using OpenAI-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/responses": { "post": { "operationId": "litellmOpenAIResponses", "summary": "Create response (LiteLLM - OpenAI Responses API)", "description": "Creates a response using OpenAI Responses API format via LiteLLM.\nSupports streaming via SSE.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/responses/input_tokens": { "post": { "operationId": "litellmOpenAICountInputTokens", "summary": "Count input tokens (LiteLLM - OpenAI format)", "description": "Counts the number of tokens in a Responses API request via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/audio/speech": { "post": { "operationId": "litellmOpenAISpeech", "summary": "Create speech (LiteLLM - OpenAI TTS)", "description": "Generates audio from text using OpenAI TTS via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAISpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/v1/audio/transcriptions": { "post": { "operationId": "litellmOpenAITranscriptions", "summary": "Create transcription (LiteLLM - OpenAI Whisper)", "description": "Transcribes audio into text using OpenAI Whisper via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/OpenAITranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/anthropic/v1/messages": { "post": { "operationId": "litellmAnthropicMessages", "summary": "Create message (LiteLLM - Anthropic format)", "description": "Creates a message using Anthropic-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message_start", "content_block_start", "content_block_delta", "content_block_stop", "message_delta", "message_stop", "ping", "error" ] }, "message": { "$ref": "#/components/schemas/AnthropicMessageResponse" }, "index": { "type": "integer" }, "content_block": { "$ref": "#/components/schemas/AnthropicContentBlock" }, "delta": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text_delta", "input_json_delta", "thinking_delta", "signature_delta" ] }, "text": { "type": "string" }, "partial_json": { "type": "string" }, "thinking": { "type": "string" }, "signature": { "type": "string" }, "stop_reason": { "type": "string" }, "stop_sequence": { "type": "string" } } }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cache_creation_input_tokens": { "type": "integer" }, "cache_read_input_tokens": { "type": "integer" }, "cache_creation": { "type": "object", "properties": { "ephemeral_5m_input_tokens": { "type": "integer" }, "ephemeral_1h_input_tokens": { "type": "integer" } } } } }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/genai/v1beta/models": { "get": { "operationId": "litellmGeminiListModels", "summary": "List models (LiteLLM - Gemini format)", "description": "Lists available models in Google Gemini API format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "parameters": [ { "name": "pageSize", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of models to return" }, { "name": "pageToken", "in": "query", "schema": { "type": "string" }, "description": "Page token for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/genai/v1beta/models/{model}:generateContent": { "post": { "operationId": "litellmGeminiGenerateContent", "summary": "Generate content (LiteLLM - Gemini format)", "description": "Generates content using Google Gemini-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/genai/v1beta/models/{model}:streamGenerateContent": { "post": { "operationId": "litellmGeminiStreamGenerateContent", "summary": "Stream generate content (LiteLLM - Gemini format)", "description": "Streams content generation using Google Gemini-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/bedrock/model/{modelId}/converse": { "post": { "operationId": "litellmBedrockConverse", "summary": "Converse with model (LiteLLM - Bedrock format)", "description": "Sends messages using AWS Bedrock Converse-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/bedrock/model/{modelId}/converse-stream": { "post": { "operationId": "litellmBedrockConverseStream", "summary": "Stream converse with model (LiteLLM - Bedrock format)", "description": "Streams messages using AWS Bedrock Converse-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "application/x-amz-eventstream": { "schema": { "type": "object", "description": "Flat structure for streaming events matching actual Bedrock API response", "properties": { "role": { "type": "string", "description": "For messageStart events" }, "contentBlockIndex": { "type": "integer", "description": "For content block events" }, "delta": { "type": "object", "properties": { "text": { "type": "string" }, "reasoningContent": { "type": "object", "properties": { "text": { "type": "string" }, "signature": { "type": "string" } } }, "toolUse": { "type": "object", "properties": { "input": { "type": "string" } } } } }, "stopReason": { "type": "string", "description": "For messageStop events" }, "start": { "type": "object", "properties": { "toolUse": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "name": { "type": "string" } } } } }, "usage": { "type": "object", "properties": { "inputTokens": { "type": "integer" }, "outputTokens": { "type": "integer" }, "totalTokens": { "type": "integer" }, "cacheReadInputTokens": { "type": "integer" }, "cacheWriteInputTokens": { "type": "integer" } } }, "metrics": { "type": "object", "properties": { "latencyMs": { "type": "integer" } } }, "trace": { "type": "object" }, "additionalModelResponseFields": { "type": "object" }, "invokeModelRawChunk": { "type": "string", "format": "byte", "description": "Raw bytes for legacy invoke stream" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/cohere/v2/chat": { "post": { "operationId": "litellmCohereChat", "summary": "Chat with model (LiteLLM - Cohere format)", "description": "Sends a chat request using Cohere-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "message-start", "content-start", "content-delta", "content-end", "tool-plan-delta", "tool-call-start", "tool-call-delta", "tool-call-end", "citation-start", "citation-end", "message-end", "debug" ], "description": "Type of streaming event" }, "id": { "type": "string", "description": "Event ID (for message-start)" }, "index": { "type": "integer", "description": "Index for indexed events" }, "delta": { "type": "object", "properties": { "message": { "type": "object", "properties": { "role": { "type": "string", "description": "Message role (for message-start)" }, "content": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } } } ], "description": "Content for content events" }, "tool_plan": { "type": "string", "description": "Tool plan content (for tool-plan-delta)" }, "tool_calls": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } ], "description": "Tool calls (for tool-call events)" }, "citations": { "oneOf": [ { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } }, { "type": "array", "items": { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } } } ], "description": "Citations (for citation events)" } } }, "finish_reason": { "type": "string", "enum": [ "COMPLETE", "STOP_SEQUENCE", "MAX_TOKENS", "TOOL_CALL", "ERROR", "TIMEOUT" ] }, "usage": { "type": "object", "properties": { "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "cached_tokens": { "type": "integer", "description": "Cached tokens" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/cohere/v2/embed": { "post": { "operationId": "litellmCohereEmbed", "summary": "Create embeddings (LiteLLM - Cohere format)", "description": "Creates embeddings using Cohere-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/litellm/cohere/v1/tokenize": { "post": { "operationId": "litellmCohereTokenize", "summary": "Tokenize text (LiteLLM - Cohere format)", "description": "Tokenizes text using Cohere-compatible format via LiteLLM.\n", "tags": [ "LiteLLM Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/completions": { "post": { "operationId": "langchainOpenAITextCompletions", "summary": "Text completions (LangChain - OpenAI format)", "description": "Creates a text completion using OpenAI-compatible format via LangChain.\nThis is the legacy completions API.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAITextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/chat/completions": { "post": { "operationId": "langchainOpenAIChatCompletions", "summary": "Chat completions (LangChain - OpenAI format)", "description": "Creates a chat completion using OpenAI-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/embeddings": { "post": { "operationId": "langchainOpenAIEmbeddings", "summary": "Create embeddings (LangChain - OpenAI format)", "description": "Creates embeddings using OpenAI-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/models": { "get": { "operationId": "langchainOpenAIListModels", "summary": "List models (LangChain - OpenAI format)", "description": "Lists available models using OpenAI-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/responses": { "post": { "operationId": "langchainOpenAIResponses", "summary": "Create response (LangChain - OpenAI Responses API)", "description": "Creates a response using OpenAI Responses API format via LangChain.\nSupports streaming via SSE.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/responses/input_tokens": { "post": { "operationId": "langchainOpenAICountInputTokens", "summary": "Count input tokens (LangChain - OpenAI format)", "description": "Counts the number of tokens in a Responses API request via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/audio/speech": { "post": { "operationId": "langchainOpenAISpeech", "summary": "Create speech (LangChain - OpenAI TTS)", "description": "Generates audio from text using OpenAI TTS via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAISpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/v1/audio/transcriptions": { "post": { "operationId": "langchainOpenAITranscriptions", "summary": "Create transcription (LangChain - OpenAI Whisper)", "description": "Transcribes audio into text using OpenAI Whisper via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/OpenAITranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/anthropic/v1/messages": { "post": { "operationId": "langchainAnthropicMessages", "summary": "Create message (LangChain - Anthropic format)", "description": "Creates a message using Anthropic-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message_start", "content_block_start", "content_block_delta", "content_block_stop", "message_delta", "message_stop", "ping", "error" ] }, "message": { "$ref": "#/components/schemas/AnthropicMessageResponse" }, "index": { "type": "integer" }, "content_block": { "$ref": "#/components/schemas/AnthropicContentBlock" }, "delta": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text_delta", "input_json_delta", "thinking_delta", "signature_delta" ] }, "text": { "type": "string" }, "partial_json": { "type": "string" }, "thinking": { "type": "string" }, "signature": { "type": "string" }, "stop_reason": { "type": "string" }, "stop_sequence": { "type": "string" } } }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cache_creation_input_tokens": { "type": "integer" }, "cache_read_input_tokens": { "type": "integer" }, "cache_creation": { "type": "object", "properties": { "ephemeral_5m_input_tokens": { "type": "integer" }, "ephemeral_1h_input_tokens": { "type": "integer" } } } } }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/anthropic/v1/messages/count_tokens": { "post": { "operationId": "langchainAnthropicCountTokens", "summary": "Count tokens (LangChain - Anthropic format)", "description": "Counts tokens using Anthropic-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/AnthropicMessageRequest" } ] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/genai/v1beta/models": { "get": { "operationId": "langchainGeminiListModels", "summary": "List models (LangChain - Gemini format)", "description": "Lists available models in Google Gemini API format via LangChain.\n", "tags": [ "LangChain Integration" ], "parameters": [ { "name": "pageSize", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of models to return" }, { "name": "pageToken", "in": "query", "schema": { "type": "string" }, "description": "Page token for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/genai/v1beta/models/{model}:generateContent": { "post": { "operationId": "langchainGeminiGenerateContent", "summary": "Generate content (LangChain - Gemini format)", "description": "Generates content using Google Gemini-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/genai/v1beta/models/{model}:streamGenerateContent": { "post": { "operationId": "langchainGeminiStreamGenerateContent", "summary": "Stream generate content (LangChain - Gemini format)", "description": "Streams content generation using Google Gemini-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/bedrock/model/{modelId}/converse": { "post": { "operationId": "langchainBedrockConverse", "summary": "Converse with model (LangChain - Bedrock format)", "description": "Sends messages using AWS Bedrock Converse-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/bedrock/model/{modelId}/converse-stream": { "post": { "operationId": "langchainBedrockConverseStream", "summary": "Stream converse with model (LangChain - Bedrock format)", "description": "Streams messages using AWS Bedrock Converse-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "application/x-amz-eventstream": { "schema": { "type": "object", "description": "Flat structure for streaming events matching actual Bedrock API response", "properties": { "role": { "type": "string", "description": "For messageStart events" }, "contentBlockIndex": { "type": "integer", "description": "For content block events" }, "delta": { "type": "object", "properties": { "text": { "type": "string" }, "reasoningContent": { "type": "object", "properties": { "text": { "type": "string" }, "signature": { "type": "string" } } }, "toolUse": { "type": "object", "properties": { "input": { "type": "string" } } } } }, "stopReason": { "type": "string", "description": "For messageStop events" }, "start": { "type": "object", "properties": { "toolUse": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "name": { "type": "string" } } } } }, "usage": { "type": "object", "properties": { "inputTokens": { "type": "integer" }, "outputTokens": { "type": "integer" }, "totalTokens": { "type": "integer" }, "cacheReadInputTokens": { "type": "integer" }, "cacheWriteInputTokens": { "type": "integer" } } }, "metrics": { "type": "object", "properties": { "latencyMs": { "type": "integer" } } }, "trace": { "type": "object" }, "additionalModelResponseFields": { "type": "object" }, "invokeModelRawChunk": { "type": "string", "format": "byte", "description": "Raw bytes for legacy invoke stream" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/cohere/v2/chat": { "post": { "operationId": "langchainCohereChat", "summary": "Chat with model (LangChain - Cohere format)", "description": "Sends a chat request using Cohere-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "message-start", "content-start", "content-delta", "content-end", "tool-plan-delta", "tool-call-start", "tool-call-delta", "tool-call-end", "citation-start", "citation-end", "message-end", "debug" ], "description": "Type of streaming event" }, "id": { "type": "string", "description": "Event ID (for message-start)" }, "index": { "type": "integer", "description": "Index for indexed events" }, "delta": { "type": "object", "properties": { "message": { "type": "object", "properties": { "role": { "type": "string", "description": "Message role (for message-start)" }, "content": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } } } ], "description": "Content for content events" }, "tool_plan": { "type": "string", "description": "Tool plan content (for tool-plan-delta)" }, "tool_calls": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } ], "description": "Tool calls (for tool-call events)" }, "citations": { "oneOf": [ { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } }, { "type": "array", "items": { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } } } ], "description": "Citations (for citation events)" } } }, "finish_reason": { "type": "string", "enum": [ "COMPLETE", "STOP_SEQUENCE", "MAX_TOKENS", "TOOL_CALL", "ERROR", "TIMEOUT" ] }, "usage": { "type": "object", "properties": { "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "cached_tokens": { "type": "integer", "description": "Cached tokens" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/cohere/v2/embed": { "post": { "operationId": "langchainCohereEmbed", "summary": "Create embeddings (LangChain - Cohere format)", "description": "Creates embeddings using Cohere-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/langchain/cohere/v1/tokenize": { "post": { "operationId": "langchainCohereTokenize", "summary": "Tokenize text (LangChain - Cohere format)", "description": "Tokenizes text using Cohere-compatible format via LangChain.\n", "tags": [ "LangChain Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/completions": { "post": { "operationId": "pydanticaiOpenAITextCompletions", "summary": "Text completions (PydanticAI - OpenAI format)", "description": "Creates a text completion using OpenAI-compatible format via PydanticAI.\nThis is the legacy completions API.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAITextCompletionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TextCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming text completion response", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/chat/completions": { "post": { "operationId": "pydanticaiOpenAIChatCompletions", "summary": "Chat completions (PydanticAI - OpenAI format)", "description": "Creates a chat completion using OpenAI-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatCompletionResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming chat completion response (SSE format)", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/embeddings": { "post": { "operationId": "pydanticaiOpenAIEmbeddings", "summary": "Create embeddings (PydanticAI - OpenAI format)", "description": "Creates embeddings using OpenAI-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/models": { "get": { "operationId": "pydanticaiOpenAIListModels", "summary": "List models (PydanticAI - OpenAI format)", "description": "Lists available models using OpenAI-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/responses": { "post": { "operationId": "pydanticaiOpenAIResponses", "summary": "Create response (PydanticAI - OpenAI Responses API)", "description": "Creates a response using OpenAI Responses API format via PydanticAI.\nSupports streaming via SSE.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResponsesResponse" } }, "text/event-stream": { "schema": { "type": "object", "description": "Streaming responses API response (SSE format)", "properties": { "type": { "type": "string", "enum": [ "response.ping", "response.created", "response.in_progress", "response.completed", "response.failed", "response.incomplete", "response.output_item.added", "response.output_item.done", "response.content_part.added", "response.content_part.done", "response.output_text.delta", "response.output_text.done", "response.refusal.delta", "response.refusal.done", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.file_search_call.in_progress", "response.file_search_call.searching", "response.file_search_call.results.added", "response.file_search_call.results.completed", "response.web_search_call.searching", "response.web_search_call.results.added", "response.web_search_call.results.completed", "response.web_fetch_call.in_progress", "response.web_fetch_call.fetching", "response.web_fetch_call.completed", "response.reasoning_summary_part.added", "response.reasoning_summary_part.done", "response.reasoning_summary_text.delta", "response.reasoning_summary_text.done", "response.image_generation_call.completed", "response.image_generation_call.generating", "response.image_generation_call.in_progress", "response.image_generation_call.partial_image", "response.mcp_call_arguments.delta", "response.mcp_call_arguments.done", "response.mcp_call.completed", "response.mcp_call.failed", "response.mcp_call.in_progress", "response.mcp_list_tools.completed", "response.mcp_list_tools.failed", "response.mcp_list_tools.in_progress", "response.code_interpreter_call.in_progress", "response.code_interpreter_call.interpreting", "response.code_interpreter_call.completed", "response.code_interpreter_call_code.delta", "response.code_interpreter_call_code.done", "response.output_text.annotation.added", "response.output_text.annotation.done", "response.queued", "response.custom_tool_call_input.delta", "response.custom_tool_call_input.done", "error" ] }, "sequence_number": { "type": "integer" }, "response": { "$ref": "#/components/schemas/ResponsesResponse" }, "output_index": { "type": "integer" }, "item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } }, "content_index": { "type": "integer" }, "item_id": { "type": "string" }, "part": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } }, "delta": { "type": "string" }, "signature": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "text": { "type": "string" }, "refusal": { "type": "string" }, "arguments": { "type": "string" }, "partial_image_b64": { "type": "string" }, "partial_image_index": { "type": "integer" }, "annotation": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } }, "annotation_index": { "type": "integer" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/responses/input_tokens": { "post": { "operationId": "pydanticaiOpenAICountInputTokens", "summary": "Count input tokens (PydanticAI - OpenAI format)", "description": "Counts the number of tokens in a Responses API request via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAIResponsesRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/audio/speech": { "post": { "operationId": "pydanticaiOpenAISpeech", "summary": "Create speech (PydanticAI - OpenAI TTS)", "description": "Generates audio from text using OpenAI TTS via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OpenAISpeechRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "audio/mpeg": { "schema": { "type": "string", "format": "binary" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "speech.audio.delta", "speech.audio.done" ] }, "audio": { "type": "string", "format": "byte" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/v1/audio/transcriptions": { "post": { "operationId": "pydanticaiOpenAITranscriptions", "summary": "Create transcription (PydanticAI - OpenAI Whisper)", "description": "Transcribes audio into text using OpenAI Whisper via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/OpenAITranscriptionRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptionResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "transcript.text.delta", "transcript.text.done" ] }, "delta": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/anthropic/v1/messages": { "post": { "operationId": "pydanticaiAnthropicMessages", "summary": "Create message (PydanticAI - Anthropic format)", "description": "Creates a message using Anthropic-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnthropicMessageResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message_start", "content_block_start", "content_block_delta", "content_block_stop", "message_delta", "message_stop", "ping", "error" ] }, "message": { "$ref": "#/components/schemas/AnthropicMessageResponse" }, "index": { "type": "integer" }, "content_block": { "$ref": "#/components/schemas/AnthropicContentBlock" }, "delta": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text_delta", "input_json_delta", "thinking_delta", "signature_delta" ] }, "text": { "type": "string" }, "partial_json": { "type": "string" }, "thinking": { "type": "string" }, "signature": { "type": "string" }, "stop_reason": { "type": "string" }, "stop_sequence": { "type": "string" } } }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cache_creation_input_tokens": { "type": "integer" }, "cache_read_input_tokens": { "type": "integer" }, "cache_creation": { "type": "object", "properties": { "ephemeral_5m_input_tokens": { "type": "integer" }, "ephemeral_1h_input_tokens": { "type": "integer" } } } } }, "error": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "default": "error" }, "error": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type (e.g., invalid_request_error, api_error)" }, "message": { "type": "string", "description": "Error message" } } } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/genai/v1beta/models": { "get": { "operationId": "pydanticaiGeminiListModels", "summary": "List models (PydanticAI - Gemini format)", "description": "Lists available models in Google Gemini API format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "parameters": [ { "name": "pageSize", "in": "query", "schema": { "type": "integer" }, "description": "Maximum number of models to return" }, { "name": "pageToken", "in": "query", "schema": { "type": "string" }, "description": "Page token for pagination" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiListModelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/genai/v1beta/models/{model}:generateContent": { "post": { "operationId": "pydanticaiGeminiGenerateContent", "summary": "Generate content (PydanticAI - Gemini format)", "description": "Generates content using Google Gemini-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/genai/v1beta/models/{model}:streamGenerateContent": { "post": { "operationId": "pydanticaiGeminiStreamGenerateContent", "summary": "Stream generate content (PydanticAI - Gemini format)", "description": "Streams content generation using Google Gemini-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "parameters": [ { "name": "model", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model name with action" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiGenerationRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/GeminiGenerationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GeminiError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/bedrock/model/{modelId}/converse": { "post": { "operationId": "pydanticaiBedrockConverse", "summary": "Converse with model (PydanticAI - Bedrock format)", "description": "Sends messages using AWS Bedrock Converse-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/bedrock/model/{modelId}/converse-stream": { "post": { "operationId": "pydanticaiBedrockConverseStream", "summary": "Stream converse with model (PydanticAI - Bedrock format)", "description": "Streams messages using AWS Bedrock Converse-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "parameters": [ { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Model ID" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockConverseRequest" } } } }, "responses": { "200": { "description": "Successful streaming response", "content": { "application/x-amz-eventstream": { "schema": { "type": "object", "description": "Flat structure for streaming events matching actual Bedrock API response", "properties": { "role": { "type": "string", "description": "For messageStart events" }, "contentBlockIndex": { "type": "integer", "description": "For content block events" }, "delta": { "type": "object", "properties": { "text": { "type": "string" }, "reasoningContent": { "type": "object", "properties": { "text": { "type": "string" }, "signature": { "type": "string" } } }, "toolUse": { "type": "object", "properties": { "input": { "type": "string" } } } } }, "stopReason": { "type": "string", "description": "For messageStop events" }, "start": { "type": "object", "properties": { "toolUse": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "name": { "type": "string" } } } } }, "usage": { "type": "object", "properties": { "inputTokens": { "type": "integer" }, "outputTokens": { "type": "integer" }, "totalTokens": { "type": "integer" }, "cacheReadInputTokens": { "type": "integer" }, "cacheWriteInputTokens": { "type": "integer" } } }, "metrics": { "type": "object", "properties": { "latencyMs": { "type": "integer" } } }, "trace": { "type": "object" }, "additionalModelResponseFields": { "type": "object" }, "invokeModelRawChunk": { "type": "string", "format": "byte", "description": "Raw bytes for legacy invoke stream" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BedrockError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/cohere/v2/chat": { "post": { "operationId": "pydanticaiCohereChat", "summary": "Chat with model (PydanticAI - Cohere format)", "description": "Sends a chat request using Cohere-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereChatResponse" } }, "text/event-stream": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "message-start", "content-start", "content-delta", "content-end", "tool-plan-delta", "tool-call-start", "tool-call-delta", "tool-call-end", "citation-start", "citation-end", "message-end", "debug" ], "description": "Type of streaming event" }, "id": { "type": "string", "description": "Event ID (for message-start)" }, "index": { "type": "integer", "description": "Index for indexed events" }, "delta": { "type": "object", "properties": { "message": { "type": "object", "properties": { "role": { "type": "string", "description": "Message role (for message-start)" }, "content": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "thinking": { "type": "string" } } } } ], "description": "Content for content events" }, "tool_plan": { "type": "string", "description": "Tool plan content (for tool-plan-delta)" }, "tool_calls": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } ], "description": "Tool calls (for tool-call events)" }, "citations": { "oneOf": [ { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } }, { "type": "array", "items": { "type": "object", "properties": { "start": { "type": "integer", "description": "Start position of cited text" }, "end": { "type": "integer", "description": "End position of cited text" }, "text": { "type": "string", "description": "Cited text" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tool", "document" ], "description": "Source type" }, "id": { "type": "string", "description": "Source ID (nullable)" }, "tool_output": { "type": "object", "description": "Tool output (for tool sources)" }, "document": { "type": "object", "description": "Document data (for document sources)" } } } }, "content_index": { "type": "integer", "description": "Content index of the citation" }, "type": { "type": "string", "enum": [ "TEXT_CONTENT", "THINKING_CONTENT", "PLAN" ], "description": "Type of citation" } } } } ], "description": "Citations (for citation events)" } } }, "finish_reason": { "type": "string", "enum": [ "COMPLETE", "STOP_SEQUENCE", "MAX_TOKENS", "TOOL_CALL", "ERROR", "TIMEOUT" ] }, "usage": { "type": "object", "properties": { "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "cached_tokens": { "type": "integer", "description": "Cached tokens" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/cohere/v2/embed": { "post": { "operationId": "pydanticaiCohereEmbed", "summary": "Create embeddings (PydanticAI - Cohere format)", "description": "Creates embeddings using Cohere-compatible format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereEmbeddingResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/pydanticai/cohere/v1/tokenize": { "post": { "operationId": "pydanticaiCohereTokenize", "summary": "Tokenize text (PydanticAI - Cohere format)", "description": "Tokenizes text using Cohere v1 API format via PydanticAI.\n", "tags": [ "PydanticAI Integration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensRequest" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereCountTokensResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CohereError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/health": { "get": { "operationId": "getHealth", "summary": "Health check", "description": "Returns the health status of the Bifrost server. Checks connectivity to config store,\nlog store, and vector store if configured.\n", "tags": [ "Health" ], "responses": { "200": { "description": "Server is healthy", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } }, "503": { "description": "Service unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/config": { "get": { "operationId": "getConfig", "summary": "Get configuration", "description": "Retrieves the current Bifrost configuration including client config, framework config,\nauth config, and connection status for various stores.\n", "tags": [ "Configuration" ], "parameters": [ { "name": "from_db", "in": "query", "description": "If true, fetch configuration directly from the database", "schema": { "type": "string", "enum": [ "true", "false" ] } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetConfigResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateConfig", "summary": "Update configuration", "description": "Updates the Bifrost configuration. Supports hot-reloading of certain settings\nlike drop_excess_requests. Some settings may require a restart to take effect.\n", "tags": [ "Configuration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateConfigRequest" } } } }, "responses": { "200": { "description": "Configuration updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/version": { "get": { "operationId": "getVersion", "summary": "Get version", "description": "Returns the current Bifrost version information.", "tags": [ "Configuration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Version" } } } } } } }, "/api/proxy-config": { "get": { "operationId": "getProxyConfig", "summary": "Get proxy configuration", "description": "Retrieves the current global proxy configuration.", "tags": [ "Configuration" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Global proxy configuration", "properties": { "enabled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "http", "socks5", "tcp" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string", "description": "Password (redacted as in responses)" }, "no_proxy": { "type": "string" }, "timeout": { "type": "integer" }, "skip_tls_verify": { "type": "boolean" }, "enable_for_scim": { "type": "boolean" }, "enable_for_inference": { "type": "boolean" }, "enable_for_api": { "type": "boolean" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "503": { "description": "Config store not available", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateProxyConfig", "summary": "Update proxy configuration", "description": "Updates the global proxy configuration.", "tags": [ "Configuration" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Global proxy configuration", "properties": { "enabled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "http", "socks5", "tcp" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string", "description": "Password (redacted as in responses)" }, "no_proxy": { "type": "string" }, "timeout": { "type": "integer" }, "skip_tls_verify": { "type": "boolean" }, "enable_for_scim": { "type": "boolean" }, "enable_for_inference": { "type": "boolean" }, "enable_for_api": { "type": "boolean" } } } } } }, "responses": { "200": { "description": "Proxy configuration updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/pricing/force-sync": { "post": { "operationId": "forceSyncPricing", "summary": "Force pricing sync", "description": "Triggers an immediate pricing sync and resets the pricing sync timer.", "tags": [ "Configuration" ], "responses": { "200": { "description": "Pricing sync triggered successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "503": { "description": "Config store not available", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/users": { "get": { "operationId": "listUsers", "summary": "List users", "description": "Returns a paginated list of users with optional search.", "tags": [ "Users" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number (1-based)", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of users per page (max 100)", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "search", "in": "query", "description": "Search by name or email", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "users": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique user identifier" }, "name": { "type": "string", "description": "User's display name" }, "email": { "type": "string", "format": "email", "description": "User's email address" }, "role_id": { "type": "integer", "nullable": true, "description": "ID of the assigned RBAC role" }, "role": { "type": "object", "nullable": true, "description": "RBAC role details", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" }, "is_system_role": { "type": "boolean" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "teams": { "type": "array", "description": "Teams the user belongs to.", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID" }, "name": { "type": "string", "description": "Team name" }, "business_unit_id": { "type": "string", "nullable": true, "description": "Business unit ID associated with this team (if any)" }, "business_unit_name": { "type": "string", "nullable": true, "description": "Business unit name associated with this team (if any)" } } } }, "access_profile": { "type": "object", "nullable": true, "description": "Active or fallback user access profile, if assigned.", "properties": { "id": { "type": "integer" }, "user_id": { "type": "string" }, "parent_profile_id": { "type": "integer", "nullable": true }, "name": { "type": "string" }, "is_active": { "type": "boolean" }, "expires_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } } } } }, "total": { "type": "integer", "description": "Total number of users matching the query" }, "page": { "type": "integer", "description": "Current page number" }, "limit": { "type": "integer", "description": "Number of users per page" }, "total_pages": { "type": "integer", "description": "Total number of pages" }, "has_more": { "type": "boolean", "description": "Whether more pages are available" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createUser", "summary": "Create user", "description": "Manually creates a new user in the organization.", "tags": [ "Users" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "email" ], "properties": { "name": { "type": "string", "description": "User's display name" }, "email": { "type": "string", "format": "email", "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", "description": "User's email address (must be unique)" }, "role_id": { "type": "integer", "description": "Optional RBAC role ID to assign" } } } } } }, "responses": { "200": { "description": "User created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "user": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique user identifier" }, "name": { "type": "string", "description": "User's display name" }, "email": { "type": "string", "format": "email", "description": "User's email address" }, "role_id": { "type": "integer", "nullable": true, "description": "ID of the assigned RBAC role" }, "role": { "type": "object", "nullable": true, "description": "RBAC role details", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" }, "is_system_role": { "type": "boolean" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "teams": { "type": "array", "description": "Teams the user belongs to.", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID" }, "name": { "type": "string", "description": "Team name" }, "business_unit_id": { "type": "string", "nullable": true, "description": "Business unit ID associated with this team (if any)" }, "business_unit_name": { "type": "string", "nullable": true, "description": "Business unit name associated with this team (if any)" } } } }, "access_profile": { "type": "object", "nullable": true, "description": "Active or fallback user access profile, if assigned.", "properties": { "id": { "type": "integer" }, "user_id": { "type": "string" }, "parent_profile_id": { "type": "integer", "nullable": true }, "name": { "type": "string" }, "is_active": { "type": "boolean" }, "expires_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "409": { "description": "User with this email already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/users/{id}": { "delete": { "operationId": "deleteUser", "summary": "Delete user", "description": "Permanently removes a user from the organization. This cascades to delete the user's governance settings (budget/rate limits), team memberships, access profiles, and OIDC sessions. Cannot delete yourself.\n", "tags": [ "Users" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "User ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "User deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request (e.g. cannot delete yourself)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/users/me/permissions": { "get": { "operationId": "getCurrentUserPermissions", "summary": "Get current user permissions", "description": "Returns the RBAC permissions for the authenticated user. When SCIM is not enabled, returns full permissions for all resources. Otherwise returns the permissions associated with the user's assigned role.\n", "tags": [ "Users" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "permissions": { "type": "object", "description": "Map of resource names to their permitted operations. When SCIM is disabled, returns full permissions for all resources.\n", "additionalProperties": { "type": "object", "additionalProperties": { "type": "boolean" } } } } } } } }, "401": { "description": "Unauthorized (user not authenticated)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/users/{id}/role": { "put": { "operationId": "assignUserRole", "summary": "Assign role to user", "description": "Assigns an RBAC role to a user. This also auto-assigns the default access profile for the new role and reloads the RBAC permission cache.\n", "tags": [ "Users" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "User ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "role_id" ], "properties": { "role_id": { "type": "integer", "description": "ID of the RBAC role to assign" } } } } } }, "responses": { "200": { "description": "Role assigned successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "User or role not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/users/{id}/teams": { "get": { "operationId": "getUserTeams", "summary": "Get user's teams", "description": "Returns the list of teams a user belongs to, including the membership source.", "tags": [ "Users" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "User ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "teams": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID" }, "name": { "type": "string", "description": "Team name" }, "source": { "type": "string", "description": "How the user was added to this team (e.g. \"manual\", \"scim_sync\")" } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateUserTeams", "summary": "Update user's team assignments", "description": "Replaces the user's manual team assignments. Synced team memberships (from SCIM providers) are preserved and cannot be removed via this endpoint.\n", "tags": [ "Users" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "User ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "team_ids" ], "properties": { "team_ids": { "type": "array", "items": { "type": "string" }, "description": "List of team IDs to assign (replaces existing manual assignments; synced memberships are preserved)" } } } } } }, "responses": { "200": { "description": "Teams updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request (e.g. team not found)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/teams": { "get": { "operationId": "listTeams", "summary": "List teams", "description": "Returns a paginated list of teams with optional search.", "tags": [ "Teams" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number (1-based)", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of teams per page (max 100)", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }, { "name": "search", "in": "query", "description": "Search by team name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "teams": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID (derived from name)" }, "name": { "type": "string", "description": "Team name" }, "member_count": { "type": "integer", "description": "Number of members in the team" }, "virtual_key_count": { "type": "integer", "description": "Number of virtual keys assigned to the team" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } } }, "total": { "type": "integer" }, "page": { "type": "integer" }, "limit": { "type": "integer" }, "total_pages": { "type": "integer", "description": "Total number of pages" }, "has_more": { "type": "boolean", "description": "Whether more pages are available" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createTeam", "summary": "Create team", "description": "Creates a new team. The team ID is derived from the name.", "tags": [ "Teams" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "Team name (must be unique)" } } } } } }, "responses": { "200": { "description": "Team created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "409": { "description": "Team with this name already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/teams/{id}": { "get": { "operationId": "getTeam", "summary": "Get team", "description": "Returns details of a specific team including member count.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Team ID (derived from name)" }, "name": { "type": "string", "description": "Team name" }, "member_count": { "type": "integer", "description": "Number of members in the team" }, "virtual_key_count": { "type": "integer", "description": "Number of virtual keys assigned to the team" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateTeam", "summary": "Update team", "description": "Updates a team. Note that renaming teams is not allowed.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "Updated team description" } } } } } }, "responses": { "200": { "description": "Team updated successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } } } } } }, "400": { "description": "Bad request (e.g. renaming not allowed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteTeam", "summary": "Delete team", "description": "Permanently removes a team.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Team deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/teams/{id}/members": { "get": { "operationId": "getTeamMembers", "summary": "List team members", "description": "Returns all members of a team with their user details and membership source.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "members": { "type": "array", "items": { "type": "object", "properties": { "user_id": { "type": "string" }, "user_name": { "type": "string" }, "user_email": { "type": "string" }, "source": { "type": "string", "description": "How the member was added (e.g. \"manual\", \"scim_sync\")" } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "addTeamMember", "summary": "Add team member", "description": "Adds a user to a team. Both the team and user must exist.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "user_id" ], "properties": { "user_id": { "type": "string", "description": "ID of the user to add to the team" } } } } } }, "responses": { "200": { "description": "Member added successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Team or user not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "409": { "description": "User is already a member of this team", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/teams/{id}/members/{userId}": { "delete": { "operationId": "removeTeamMember", "summary": "Remove team member", "description": "Removes a user from a team.", "tags": [ "Teams" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } }, { "name": "userId", "in": "path", "required": true, "description": "User ID to remove", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Member removed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Membership not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/session/login": { "post": { "operationId": "login", "summary": "Login", "description": "Authenticates a user and returns a session token.\nSets a cookie with the session token for subsequent requests.\n", "tags": [ "Session" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "Login successful", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "401": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "403": { "description": "Authentication is not enabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/session/logout": { "post": { "operationId": "logout", "summary": "Logout", "description": "Logs out the current user and invalidates the session token.", "tags": [ "Session" ], "responses": { "200": { "description": "Logout successful", "content": { "application/json": { "schema": { "type": "object", "description": "Logout response", "properties": { "message": { "type": "string", "example": "Logout successful" } } } } } }, "403": { "description": "Authentication is not enabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/session/is-auth-enabled": { "get": { "operationId": "isAuthEnabled", "summary": "Check if authentication is enabled", "description": "Returns whether authentication is enabled and if the current token is valid.", "tags": [ "Session" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IsAuthEnabledResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/session/ws-ticket": { "post": { "operationId": "issueWSTicket", "summary": "Issue WebSocket ticket", "description": "Issues a short-lived ticket for authenticating WebSocket connections.\nThe ticket can be used as a query parameter when upgrading to WebSocket.\n", "tags": [ "Session" ], "responses": { "200": { "description": "Ticket issued successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "ticket": { "type": "string", "description": "Short-lived WebSocket authentication ticket" } } } } } }, "403": { "description": "Authentication is not enabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/providers": { "get": { "operationId": "listProviders", "summary": "List all providers", "description": "Returns a list of all configured providers with their configurations and status.", "tags": [ "Providers" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListProvidersResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "addProvider", "summary": "Add a new provider", "description": "Adds a new provider with the specified configuration.", "tags": [ "Providers" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddProviderRequest" } } } }, "responses": { "200": { "description": "Provider added successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "409": { "description": "Provider already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/providers/{provider}": { "get": { "operationId": "getProvider", "summary": "Get a specific provider", "description": "Returns the configuration for a specific provider.", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateProvider", "summary": "Update a provider", "description": "Updates a provider's configuration. Expects ALL fields to be provided,\nincluding both edited and non-edited fields. Partial updates are not supported.\n", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateProviderRequest" } } } }, "responses": { "200": { "description": "Provider updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteProvider", "summary": "Delete a provider", "description": "Removes a provider from the configuration.", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Provider deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/providers/{provider}/keys": { "get": { "operationId": "listProviderKeys", "summary": "List keys for a provider", "description": "Returns all keys configured for a specific provider.", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListProviderKeysResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createProviderKey", "summary": "Create a key for a provider", "description": "Creates a new API key for the specified provider. The key `id` is auto-generated\nif omitted. `enabled` defaults to `true` if omitted. `value` is required and must\nnot be empty. Keys cannot be created on keyless providers.\n", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "responses": { "200": { "description": "Key created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "409": { "description": "Key ID already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/providers/{provider}/keys/{key_id}": { "get": { "operationId": "getProviderKey", "summary": "Get a specific key for a provider", "description": "Returns a single key for the specified provider.", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } }, { "name": "key_id", "in": "path", "required": true, "description": "Key ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider or key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateProviderKey", "summary": "Update a key for a provider", "description": "Updates an existing key. Send the full key object. Redacted values sent back\nunchanged are automatically preserved (the server merges them with the stored\nraw values).\n", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } }, { "name": "key_id", "in": "path", "required": true, "description": "Key ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "responses": { "200": { "description": "Key updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider or key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteProviderKey", "summary": "Delete a key from a provider", "description": "Deletes a key from the specified provider. Returns the deleted key.", "tags": [ "Providers" ], "parameters": [ { "name": "provider", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } }, { "name": "key_id", "in": "path", "required": true, "description": "Key ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Key deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Key" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider or key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/keys": { "get": { "operationId": "listKeys", "summary": "List all keys", "description": "Returns a list of all configured API keys across all providers.", "tags": [ "Providers" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Key" } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/models": { "get": { "operationId": "listModelsManagement", "summary": "List models", "description": "Lists available models with optional filtering by query, provider, or keys.\n", "tags": [ "Providers" ], "parameters": [ { "name": "query", "in": "query", "description": "Filter models by name (case-insensitive partial match)", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "description": "Filter by specific provider name", "schema": { "type": "string" } }, { "name": "keys", "in": "query", "description": "Comma-separated list of key IDs to filter models accessible by those keys", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "limit", "in": "query", "description": "Maximum number of results to return (default 5)", "schema": { "type": "integer", "default": 5 } }, { "name": "unfiltered", "in": "query", "description": "If true, return all models including those filtered out by provider-level restrictions", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "List models response", "properties": { "models": { "type": "array", "items": { "type": "object", "description": "Model information", "properties": { "name": { "type": "string" }, "provider": { "type": "string" }, "accessible_by_keys": { "type": "array", "items": { "type": "string" } } } } }, "total": { "type": "integer" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/models/details": { "get": { "operationId": "listModelDetailsManagement", "summary": "List model details", "description": "Lists available models with capability metadata, when available from the model catalog, with optional filtering by query, provider, or keys.\n", "tags": [ "Providers" ], "parameters": [ { "name": "query", "in": "query", "description": "Filter models by name (case-insensitive partial match)", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "description": "Filter by specific provider name", "schema": { "type": "string" } }, { "name": "keys", "in": "query", "description": "Comma-separated list of key IDs to filter models accessible by those keys", "style": "form", "explode": false, "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "limit", "in": "query", "description": "Maximum number of results to return (default 20)", "schema": { "type": "integer", "default": 20 } }, { "name": "unfiltered", "in": "query", "description": "If true, return all models including those filtered out by provider-level restrictions", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "List model details response", "properties": { "models": { "type": "array", "items": { "type": "object", "description": "Model details with capability metadata", "properties": { "name": { "type": "string" }, "provider": { "type": "string" }, "context_length": { "type": "integer" }, "max_input_tokens": { "type": "integer" }, "max_output_tokens": { "type": "integer" }, "architecture": { "type": "object", "properties": { "modality": { "type": "string" }, "tokenizer": { "type": "string" }, "instruct_type": { "type": "string" }, "input_modalities": { "type": "array", "items": { "type": "string" } }, "output_modalities": { "type": "array", "items": { "type": "string" } } } }, "accessible_by_keys": { "type": "array", "items": { "type": "string" } } } } }, "total": { "type": "integer" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/models/parameters": { "get": { "operationId": "getModelParameters", "summary": "Get model parameters", "description": "Returns the available parameter definitions for models.", "tags": [ "Providers" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/models/base": { "get": { "operationId": "listBaseModels", "summary": "List base models", "description": "Returns a list of base models from the model catalog.", "tags": [ "Providers" ], "parameters": [ { "name": "query", "in": "query", "description": "Filter models by name", "schema": { "type": "string" } }, { "name": "provider", "in": "query", "description": "Filter by provider", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Maximum number of results to return", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/plugins": { "get": { "operationId": "listPlugins", "summary": "List all plugins", "description": "Returns a list of all plugins with their configurations and status.\nThe `actualName` field contains the plugin name from `GetName()` (used as the map key),\nwhile `name` contains the display name from the configuration.\nThe `types` array in the status shows which interfaces the plugin implements (llm, mcp, http).\n", "tags": [ "Plugins" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPluginsResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createPlugin", "summary": "Create a new plugin", "description": "Creates a new plugin with the specified configuration.", "tags": [ "Plugins" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePluginRequest" } } } }, "responses": { "201": { "description": "Plugin created successfully", "content": { "application/json": { "schema": { "type": "object", "description": "Plugin operation response", "properties": { "message": { "type": "string" }, "plugin": { "$ref": "#/components/schemas/Plugin" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "409": { "description": "Plugin already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/plugins/{name}": { "get": { "operationId": "getPlugin", "summary": "Get a specific plugin", "description": "Returns the configuration for a specific plugin.\nThe response includes the plugin status with types array showing which interfaces\nthe plugin implements (llm, mcp, http). The `actualName` field shows the plugin name\nfrom GetName() (used as the map key), which may differ from the display name (`name`).\n", "tags": [ "Plugins" ], "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Plugin display name (the config field `name`, not the internal `actualName` from GetName())", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Plugin" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Plugin not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updatePlugin", "summary": "Update a plugin", "description": "Updates a plugin's configuration. Will reload or stop the plugin based on enabled status.\nThe response `actualName` field shows the plugin name from GetName() (used as the map key),\nwhich may differ from the display name (`name`).\n", "tags": [ "Plugins" ], "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Plugin display name (the config field `name`, not the internal `actualName` from GetName())", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePluginRequest" } } } }, "responses": { "200": { "description": "Plugin updated successfully", "content": { "application/json": { "schema": { "type": "object", "description": "Plugin operation response", "properties": { "message": { "type": "string" }, "plugin": { "$ref": "#/components/schemas/Plugin" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Plugin not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deletePlugin", "summary": "Delete a plugin", "description": "Removes a plugin from the configuration and stops it if running.", "tags": [ "Plugins" ], "parameters": [ { "name": "name", "in": "path", "required": true, "description": "Plugin display name (the config field `name`, not the internal `actualName` from GetName())", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Plugin deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Plugin not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/v1/mcp/tool/execute": { "post": { "operationId": "executeMCPTool", "summary": "Execute MCP tool", "description": "Executes an MCP tool and returns the result.", "tags": [ "MCP" ], "parameters": [ { "name": "format", "in": "query", "required": false, "description": "Format of the tool execution request/response.\n", "schema": { "type": "string", "enum": [ "chat", "responses" ], "default": "chat" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteToolRequest" }, "examples": { "chat": { "summary": "Chat format example", "value": { "id": "call_123", "type": "function", "function": { "name": "get_weather", "arguments": "{\"location\": \"San Francisco\"}" } } }, "responses": { "summary": "Responses format example", "value": { "call_id": "call_123", "name": "get_weather", "arguments": "{\"location\": \"San Francisco\"}" } } } } } }, "responses": { "200": { "description": "Tool executed successfully", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ChatMessage", "title": "Chat (Default)", "description": "Chat format response" }, { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } }, "title": "Responses", "description": "Responses format response" } ], "description": "MCP tool execution response.\n" }, "examples": { "chat": { "summary": "Chat format response", "value": { "name": "get_weather", "role": "tool", "tool_call_id": "call_123", "content": "The weather in San Francisco is 72°F and sunny." } }, "responses": { "summary": "Responses format response", "value": { "id": "msg_123", "type": "function_call_output", "status": "completed", "role": "assistant", "call_id": "call_123", "name": "get_weather", "arguments": "{\"location\": \"San Francisco\"}", "content": "The weather in San Francisco is 72°F and sunny." } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/api/mcp/clients": { "get": { "operationId": "getMCPClients", "summary": "List MCP clients", "description": "Returns a list of all configured MCP clients with their tools and connection state.", "tags": [ "MCP" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MCPClient" } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp/client": { "post": { "operationId": "addMCPClient", "summary": "Add MCP client", "description": "Adds a new MCP client with the specified configuration.\nNote: tool_pricing is not available when creating a new client as tools are fetched after client creation.\n", "tags": [ "MCP" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "oneOf": [ { "allOf": [ { "type": "object", "required": [ "name", "connection_type" ], "properties": { "client_id": { "type": "string", "description": "Unique identifier for the MCP client (optional, auto-generated if not provided)" }, "name": { "type": "string", "description": "Display name for the MCP client" }, "is_code_mode_client": { "type": "boolean" }, "is_ping_available": { "type": "boolean", "default": true, "description": "Whether the MCP server supports ping for health checks.\nIf true, uses lightweight ping method for health checks.\nIf false, uses listTools method for health checks instead.\n" }, "connection_type": { "type": "string", "enum": [ "http", "stdio", "sse", "inprocess" ], "description": "Connection type for MCP client" }, "auth_type": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for the MCP connection" }, "oauth_config_id": { "type": "string", "description": "OAuth config ID for OAuth authentication.\nSet after OAuth flow is completed. References the oauth_configs table.\nOnly relevant when auth_type is \"oauth\".\n" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom headers to include in requests.\nOnly used when auth_type is \"headers\".\n" }, "oauth_config": { "$ref": "#/components/schemas/OAuthConfigRequest", "description": "OAuth configuration for initiating OAuth flow.\nOnly include this when creating a client with auth_type \"oauth\".\nThis will trigger the OAuth flow and return an authorization URL.\n" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Include-only list for tools.\n[\"*\"] => all tools are included\n[] => no tools are included\n[\"tool1\", \"tool2\"] => include only the specified tools\n" }, "tools_to_auto_execute": { "type": "array", "items": { "type": "string" }, "description": "List of tools that can be auto-executed without user approval.\nMust be a subset of tools_to_execute.\n[\"*\"] => all executable tools can be auto-executed\n[] => no tools are auto-executed\n[\"tool1\", \"tool2\"] => only specified tools can be auto-executed\n" }, "allow_on_all_virtual_keys": { "type": "boolean", "default": false, "description": "When true, this MCP client's tools are available to all virtual keys by default,\nwithout requiring an explicit virtual key assignment.\nAn explicit virtual key config always overrides this setting for that key.\n" } } }, { "type": "object", "required": [ "connection_string" ], "properties": { "connection_type": { "type": "string", "enum": [ "http" ] }, "connection_string": { "type": "string", "description": "HTTP URL (required for HTTP connection type)" } } } ] }, { "allOf": [ { "type": "object", "required": [ "name", "connection_type" ], "properties": { "client_id": { "type": "string", "description": "Unique identifier for the MCP client (optional, auto-generated if not provided)" }, "name": { "type": "string", "description": "Display name for the MCP client" }, "is_code_mode_client": { "type": "boolean" }, "is_ping_available": { "type": "boolean", "default": true, "description": "Whether the MCP server supports ping for health checks.\nIf true, uses lightweight ping method for health checks.\nIf false, uses listTools method for health checks instead.\n" }, "connection_type": { "type": "string", "enum": [ "http", "stdio", "sse", "inprocess" ], "description": "Connection type for MCP client" }, "auth_type": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for the MCP connection" }, "oauth_config_id": { "type": "string", "description": "OAuth config ID for OAuth authentication.\nSet after OAuth flow is completed. References the oauth_configs table.\nOnly relevant when auth_type is \"oauth\".\n" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom headers to include in requests.\nOnly used when auth_type is \"headers\".\n" }, "oauth_config": { "$ref": "#/components/schemas/OAuthConfigRequest", "description": "OAuth configuration for initiating OAuth flow.\nOnly include this when creating a client with auth_type \"oauth\".\nThis will trigger the OAuth flow and return an authorization URL.\n" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Include-only list for tools.\n[\"*\"] => all tools are included\n[] => no tools are included\n[\"tool1\", \"tool2\"] => include only the specified tools\n" }, "tools_to_auto_execute": { "type": "array", "items": { "type": "string" }, "description": "List of tools that can be auto-executed without user approval.\nMust be a subset of tools_to_execute.\n[\"*\"] => all executable tools can be auto-executed\n[] => no tools are auto-executed\n[\"tool1\", \"tool2\"] => only specified tools can be auto-executed\n" }, "allow_on_all_virtual_keys": { "type": "boolean", "default": false, "description": "When true, this MCP client's tools are available to all virtual keys by default,\nwithout requiring an explicit virtual key assignment.\nAn explicit virtual key config always overrides this setting for that key.\n" } } }, { "type": "object", "required": [ "connection_string" ], "properties": { "connection_type": { "type": "string", "enum": [ "sse" ] }, "connection_string": { "type": "string", "description": "SSE URL (required for SSE connection type)" } } } ] }, { "allOf": [ { "type": "object", "required": [ "name", "connection_type" ], "properties": { "client_id": { "type": "string", "description": "Unique identifier for the MCP client (optional, auto-generated if not provided)" }, "name": { "type": "string", "description": "Display name for the MCP client" }, "is_code_mode_client": { "type": "boolean" }, "is_ping_available": { "type": "boolean", "default": true, "description": "Whether the MCP server supports ping for health checks.\nIf true, uses lightweight ping method for health checks.\nIf false, uses listTools method for health checks instead.\n" }, "connection_type": { "type": "string", "enum": [ "http", "stdio", "sse", "inprocess" ], "description": "Connection type for MCP client" }, "auth_type": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for the MCP connection" }, "oauth_config_id": { "type": "string", "description": "OAuth config ID for OAuth authentication.\nSet after OAuth flow is completed. References the oauth_configs table.\nOnly relevant when auth_type is \"oauth\".\n" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom headers to include in requests.\nOnly used when auth_type is \"headers\".\n" }, "oauth_config": { "$ref": "#/components/schemas/OAuthConfigRequest", "description": "OAuth configuration for initiating OAuth flow.\nOnly include this when creating a client with auth_type \"oauth\".\nThis will trigger the OAuth flow and return an authorization URL.\n" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Include-only list for tools.\n[\"*\"] => all tools are included\n[] => no tools are included\n[\"tool1\", \"tool2\"] => include only the specified tools\n" }, "tools_to_auto_execute": { "type": "array", "items": { "type": "string" }, "description": "List of tools that can be auto-executed without user approval.\nMust be a subset of tools_to_execute.\n[\"*\"] => all executable tools can be auto-executed\n[] => no tools are auto-executed\n[\"tool1\", \"tool2\"] => only specified tools can be auto-executed\n" }, "allow_on_all_virtual_keys": { "type": "boolean", "default": false, "description": "When true, this MCP client's tools are available to all virtual keys by default,\nwithout requiring an explicit virtual key assignment.\nAn explicit virtual key config always overrides this setting for that key.\n" } } }, { "type": "object", "required": [ "stdio_config" ], "properties": { "connection_type": { "type": "string", "enum": [ "stdio" ] }, "stdio_config": { "type": "object", "description": "STDIO configuration (required for STDIO connection type)", "properties": { "command": { "type": "string", "description": "Executable command to run" }, "args": { "type": "array", "items": { "type": "string" }, "description": "Command line arguments" }, "envs": { "type": "array", "items": { "type": "string" }, "description": "Environment variables required" } } } } } ] } ], "discriminator": { "propertyName": "connection_type", "mapping": { "http": "#/MCPClientCreateRequestHTTP", "sse": "#/MCPClientCreateRequestSSE", "stdio": "#/MCPClientCreateRequestSTDIO" } }, "description": "MCP client configuration for creating a new client (tool_pricing not available at creation).\nThe schema varies based on connection_type:\n- HTTP/SSE: connection_string is required\n- STDIO: stdio_config is required\n- InProcess: server instance must be provided programmatically (Go package only)\n" } } } }, "responses": { "200": { "description": "MCP client added successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp/client/{id}": { "put": { "operationId": "editMCPClient", "summary": "Edit MCP client", "description": "Updates an existing MCP client's configuration.\nUnlike client creation, tool_pricing can be included to set per-tool execution costs since tools are already fetched.\nOptionally provide vk_configs to manage which virtual keys have access to this MCP server and with which tools. When provided, this fully replaces all existing VK assignments in a single atomic transaction.\n", "tags": [ "MCP" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "MCP client ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "MCP client configuration for updating an existing client (includes tool_pricing)", "properties": { "client_id": { "type": "string", "description": "Unique identifier for the MCP client" }, "name": { "type": "string", "description": "Display name for the MCP client" }, "is_code_mode_client": { "type": "boolean", "description": "Whether this client is available in code mode" }, "connection_type": { "type": "string", "enum": [ "http", "stdio", "sse", "inprocess" ], "description": "Connection type for MCP client" }, "connection_string": { "type": "string", "description": "HTTP or SSE URL (required for HTTP or SSE connections)" }, "stdio_config": { "type": "object", "description": "STDIO configuration for MCP client", "properties": { "command": { "type": "string", "description": "Executable command to run" }, "args": { "type": "array", "items": { "type": "string" }, "description": "Command line arguments" }, "envs": { "type": "array", "items": { "type": "string" }, "description": "Environment variables required" } } }, "auth_type": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for the MCP connection" }, "oauth_config_id": { "type": "string", "description": "OAuth config ID for OAuth authentication.\nReferences the oauth_configs table.\nOnly relevant when auth_type is \"oauth\".\n" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom headers to include in requests.\nOnly used when auth_type is \"headers\".\n" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Include-only list for tools.\n[\"*\"] => all tools are included\n[] => no tools are included\n[\"tool1\", \"tool2\"] => include only the specified tools\n" }, "tools_to_auto_execute": { "type": "array", "items": { "type": "string" }, "description": "List of tools that can be auto-executed without user approval.\nMust be a subset of tools_to_execute.\n[\"*\"] => all executable tools can be auto-executed\n[] => no tools are auto-executed\n[\"tool1\", \"tool2\"] => only specified tools can be auto-executed\n" }, "tool_pricing": { "type": "object", "additionalProperties": { "type": "number", "format": "double" }, "description": "Per-tool cost in USD for execution.\nKey is the tool name, value is the cost per execution.\nExample: {\"read_file\": 0.001, \"write_file\": 0.002}\nNote: Only available when updating an existing client after tools have been fetched.\n" }, "allow_on_all_virtual_keys": { "type": "boolean", "default": false, "description": "When true, this MCP client's tools are accessible to all virtual keys without requiring\nexplicit per-key assignment. All tools are allowed by default. If a virtual key has an\nexplicit MCP config for this client, that config takes precedence and overrides this behaviour.\n" }, "vk_configs": { "type": "array", "items": { "type": "object", "description": "Per-virtual-key tool access configuration for an MCP client", "required": [ "virtual_key_id", "tools_to_execute" ], "properties": { "virtual_key_id": { "type": "string", "description": "ID of the virtual key" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Tools this virtual key is allowed to call on this MCP server.\n[\"*\"] => all tools allowed\n[\"tool1\", \"tool2\"] => only the specified tools\n" } } }, "description": "When provided, replaces all virtual key assignments for this MCP client.\nEach entry specifies a virtual key and the tools it is allowed to call.\nTo remove all VK access, provide an empty array [].\nOmit this field to leave existing VK assignments unchanged.\n" } } } } } }, "responses": { "200": { "description": "MCP client updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "removeMCPClient", "summary": "Remove MCP client", "description": "Removes an MCP client from the configuration.", "tags": [ "MCP" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "MCP client ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "MCP client removed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp/client/{id}/reconnect": { "post": { "operationId": "reconnectMCPClient", "summary": "Reconnect MCP client", "description": "Reconnects an MCP client that is in an error or disconnected state.", "tags": [ "MCP" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "MCP client ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "MCP client reconnected successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp/client/{id}/complete-oauth": { "post": { "operationId": "completeMCPClientOAuth", "summary": "Complete MCP client OAuth flow", "description": "Completes the OAuth flow for an MCP client after the user has authorized the request.\nThis endpoint should be called after the OAuth provider redirects back to the callback endpoint\nand the OAuth token has been stored. It retrieves the pending MCP client configuration and\nestablishes the connection with the OAuth-provided credentials.\n", "tags": [ "MCP", "OAuth" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "MCP client ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "MCP client connected successfully with OAuth", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "OAuth not authorized yet or MCP client not found in pending OAuth clients", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "MCP client not found in pending OAuth clients or OAuth config not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/oauth/callback": { "get": { "operationId": "handleOAuthCallback", "summary": "OAuth callback endpoint", "description": "Handles the OAuth provider callback after user authorization.\nThis endpoint processes the authorization code and exchanges it for an access token.\nOn success, displays an HTML page that closes the authorization window.\n", "tags": [ "OAuth" ], "parameters": [ { "name": "state", "in": "query", "required": true, "description": "State parameter for OAuth security (CSRF protection)", "schema": { "type": "string" } }, { "name": "code", "in": "query", "required": true, "description": "Authorization code from the OAuth provider", "schema": { "type": "string" } }, { "name": "error", "in": "query", "required": false, "description": "Error code if authorization failed", "schema": { "type": "string" } }, { "name": "error_description", "in": "query", "required": false, "description": "Error description if authorization failed", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OAuth authorization successful. Returns HTML page that closes the authorization window.", "content": { "text/html": { "schema": { "type": "string" } } } }, "400": { "description": "OAuth authorization failed or missing required parameters", "content": { "text/html": { "schema": { "type": "string" } } } } } } }, "/api/oauth/config/{id}/status": { "get": { "operationId": "getOAuthConfigStatus", "summary": "Get OAuth config status", "description": "Retrieves the current status of an OAuth configuration.\nShows whether the OAuth flow is pending, authorized, or failed,\nand includes token expiration and scopes if authorized.\n", "tags": [ "OAuth" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "OAuth config ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OAuth config status retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthConfigStatus" } } } }, "404": { "description": "OAuth config not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "revokeOAuthConfig", "summary": "Revoke OAuth config", "description": "Revokes an OAuth configuration and its associated access token.\nAfter revocation, the MCP client will no longer be able to use this OAuth token.\n", "tags": [ "OAuth" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "OAuth config ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OAuth token revoked successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/oauth/per-user/register": { "post": { "operationId": "registerPerUserOAuthClient", "summary": "Register OAuth client (RFC 7591)", "description": "Dynamic Client Registration per RFC 7591. MCP clients (Claude Code, Cursor, etc.)\ncall this endpoint to obtain a `client_id` before initiating the authorization flow.\n\nThis endpoint is only available when at least one MCP client is configured with\n`auth_type: per_user_oauth`. Returns `404` otherwise.\n\nAuthentication is not required — this is part of the unauthenticated OAuth bootstrap flow.\n", "tags": [ "OAuth", "Per-User OAuth" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Dynamic Client Registration request per RFC 7591.\nMCP clients (Claude Code, Cursor, etc.) call this to obtain a client_id\nbefore initiating the authorization flow.\n", "required": [ "redirect_uris" ], "properties": { "client_name": { "type": "string", "description": "Human-readable name of the client application", "example": "Claude Code" }, "redirect_uris": { "type": "array", "items": { "type": "string" }, "description": "List of allowed redirect URIs for this client", "example": [ "http://localhost:54321/callback" ] }, "grant_types": { "type": "array", "items": { "type": "string" }, "description": "Supported grant types. Defaults to [\"authorization_code\"]", "example": [ "authorization_code" ] }, "response_types": { "type": "array", "items": { "type": "string" }, "description": "Supported response types", "example": [ "code" ] }, "token_endpoint_auth_method": { "type": "string", "description": "Token endpoint authentication method. Always \"none\" (public client)", "example": "none" }, "scope": { "type": "string", "description": "Space-separated list of requested scopes", "example": "mcp:read mcp:write" } } }, "example": { "client_name": "Claude Code", "redirect_uris": [ "http://localhost:54321/callback" ], "grant_types": [ "authorization_code" ], "response_types": [ "code" ], "token_endpoint_auth_method": "none" } } } }, "responses": { "201": { "description": "Client registered successfully", "content": { "application/json": { "schema": { "type": "object", "description": "Dynamic Client Registration response per RFC 7591", "properties": { "client_id": { "type": "string", "description": "Issued client identifier", "example": "550e8400-e29b-41d4-a716-446655440000" }, "client_name": { "type": "string", "description": "Human-readable name of the client application" }, "redirect_uris": { "type": "array", "items": { "type": "string" }, "description": "Registered redirect URIs" }, "grant_types": { "type": "array", "items": { "type": "string" }, "description": "Registered grant types" }, "response_types": { "type": "array", "items": { "type": "string" }, "description": "Registered response types" }, "token_endpoint_auth_method": { "type": "string", "description": "Token endpoint authentication method (always \"none\")" } } }, "example": { "client_id": "550e8400-e29b-41d4-a716-446655440000", "client_name": "Claude Code", "redirect_uris": [ "http://localhost:54321/callback" ], "grant_types": [ "authorization_code" ], "token_endpoint_auth_method": "none" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "No per-user OAuth MCP clients configured", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Config store is disabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } } } } }, "/api/oauth/per-user/authorize": { "get": { "operationId": "authorizePerUserOAuth", "summary": "Authorization endpoint (OAuth 2.1)", "description": "OAuth 2.1 authorization endpoint. Validates the request parameters, creates a\nbrowser-bound `PendingFlow` record (15-minute TTL), and redirects the user to\nthe Bifrost consent screen at `/oauth/consent?flow_id=xxx`.\n\n**PKCE is required** — `code_challenge` and `code_challenge_method=S256` must\nbe provided. Plain code challenges are not supported.\n\nA `__bifrost_flow_secret` HttpOnly SameSite=Lax cookie is set on redirect to\nbind the consent flow to the initiating browser session (CSRF protection).\n\nAuthentication is not required — this is part of the unauthenticated OAuth bootstrap flow.\n", "tags": [ "OAuth", "Per-User OAuth" ], "parameters": [ { "name": "response_type", "in": "query", "required": true, "description": "Must be `code`", "schema": { "type": "string", "enum": [ "code" ] } }, { "name": "client_id", "in": "query", "required": true, "description": "Client ID obtained from the registration endpoint", "schema": { "type": "string" } }, { "name": "redirect_uri", "in": "query", "required": true, "description": "Must match a URI registered for this client", "schema": { "type": "string" } }, { "name": "code_challenge", "in": "query", "required": true, "description": "PKCE code challenge (Base64URL-encoded SHA-256 of the code verifier)", "schema": { "type": "string" } }, { "name": "code_challenge_method", "in": "query", "required": true, "description": "Must be `S256`", "schema": { "type": "string", "enum": [ "S256" ] } }, { "name": "state", "in": "query", "required": false, "description": "Opaque value to maintain state between request and callback (CSRF protection)", "schema": { "type": "string" } } ], "responses": { "302": { "description": "Redirect to consent screen at `/oauth/consent?flow_id=xxx`", "headers": { "Location": { "schema": { "type": "string" }, "description": "URL of the consent screen" }, "Set-Cookie": { "schema": { "type": "string" }, "description": "`__bifrost_flow_secret` HttpOnly SameSite=Lax cookie for browser binding" } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "No per-user OAuth MCP clients configured, or unknown client_id", "content": { "text/plain": { "schema": { "type": "string" } } } }, "503": { "description": "Config store is disabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } } } } }, "/api/oauth/per-user/token": { "post": { "operationId": "exchangePerUserOAuthToken", "summary": "Token endpoint (OAuth 2.1)", "description": "OAuth 2.1 token endpoint. Exchanges a single-use authorization code (5-minute TTL)\nfor a Bifrost-issued access token (24-hour TTL) using PKCE verification.\n\nThe request body must be `application/x-www-form-urlencoded`.\n\nThe returned `access_token` is the Bearer token to use on subsequent `/mcp` requests.\nIt carries the user's upstream service tokens (Notion, GitHub, etc.) linked to their\nidentity (Virtual Key or User ID) from the consent flow.\n\nAuthentication is not required — this is part of the unauthenticated OAuth bootstrap flow.\n", "tags": [ "OAuth", "Per-User OAuth" ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "grant_type", "code", "code_verifier" ], "properties": { "grant_type": { "type": "string", "description": "Must be `authorization_code`", "enum": [ "authorization_code" ] }, "code": { "type": "string", "description": "Authorization code received in the redirect callback" }, "redirect_uri": { "type": "string", "description": "Must match the redirect_uri used in the authorize request (if provided)" }, "client_id": { "type": "string", "description": "Client ID (optional — code is already bound to the client)" }, "code_verifier": { "type": "string", "description": "PKCE code verifier — the raw secret whose SHA-256 matches the code_challenge" } } } } } }, "responses": { "200": { "description": "Token issued successfully", "content": { "application/json": { "schema": { "type": "object", "description": "OAuth 2.1 token response from the token endpoint", "properties": { "access_token": { "type": "string", "description": "Bifrost-issued access token (24h TTL). Use as Bearer token on /mcp requests." }, "token_type": { "type": "string", "description": "Token type, always \"Bearer\"", "example": "Bearer" }, "expires_in": { "type": "integer", "description": "Seconds until the access token expires (86400 for 24h)", "example": 86400 }, "scope": { "type": "string", "description": "Space-separated scopes granted" } } }, "example": { "access_token": "abc123xyz...", "token_type": "Bearer", "expires_in": 86400, "scope": "mcp:read mcp:write" } } } }, "400": { "description": "Invalid grant, expired code, PKCE failure, or unsupported grant type", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "enum": [ "invalid_grant", "invalid_request", "unsupported_grant_type" ] }, "error_description": { "type": "string" } } } } } }, "404": { "description": "No per-user OAuth MCP clients configured", "content": { "text/plain": { "schema": { "type": "string" } } } }, "500": { "description": "Server error or session creation failed", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "enum": [ "server_error" ] }, "error_description": { "type": "string" } } } } } } } } }, "/api/oauth/per-user/upstream/authorize": { "get": { "operationId": "authorizeUpstreamPerUserOAuth", "summary": "Upstream OAuth proxy — authorize with upstream service", "description": "Initiates an OAuth flow with an upstream MCP service (Notion, GitHub, etc.)\non behalf of the current user. Used during the consent flow (via \"Connect\" buttons\non the MCPs page) and at runtime when a tool call is made to an unauthenticated service.\n\n**Consent flow** — provide `flow_id` (from the pending consent flow). The browser-binding\ncookie (`__bifrost_flow_secret`) is validated.\n\n**Runtime flow** — provide `session` (the Bifrost session ID from the token endpoint).\nUsed when a service was skipped during consent and needs to be connected later.\n\nOn success, redirects the user to the upstream provider's authorize URL. After the user\ngrants access, the upstream callback lands at `/api/oauth/callback`, stores the upstream\ntoken against the user's identity, and redirects back to the consent screen (consent flow)\nor returns an authorization success page (runtime flow).\n\nAuthentication is not required — cookie/session validation is performed instead.\n", "tags": [ "OAuth", "Per-User OAuth" ], "parameters": [ { "name": "mcp_client_id", "in": "query", "required": true, "description": "ID of the per-user OAuth MCP client to authenticate with", "schema": { "type": "string" } }, { "name": "flow_id", "in": "query", "required": false, "description": "Pending consent flow ID. Required if `session` is not provided.\nThe `__bifrost_flow_secret` cookie must be present and match the flow.\n", "schema": { "type": "string" } }, { "name": "session", "in": "query", "required": false, "description": "Bifrost session ID (from the token endpoint). Required if `flow_id` is not provided.\nUsed for runtime (post-consent) upstream authorization.\n", "schema": { "type": "string" } } ], "responses": { "302": { "description": "Redirect to upstream OAuth provider's authorize URL", "headers": { "Location": { "schema": { "type": "string" }, "description": "Upstream provider authorization URL with PKCE parameters" } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "401": { "description": "Invalid or expired flow/session", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "403": { "description": "Browser-binding cookie mismatch (CSRF protection)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "404": { "description": "MCP client not found or not configured for per-user OAuth", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "503": { "description": "Config store is disabled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } } } } }, "/oauth/consent": { "get": { "operationId": "getConsentIdentityPage", "summary": "Consent identity selection page", "description": "Renders the identity selection screen where the user chooses how to identify\nthemselves for the session: Virtual Key, User ID, or Skip (session-only auth).\n\nThe `__bifrost_flow_secret` HttpOnly cookie set during `/api/oauth/per-user/authorize`\nmust be present — it binds the consent flow to the initiating browser.\n\nThe Skip option is only shown when `enforce_auth_on_inference` is `false` in config.\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "parameters": [ { "name": "flow_id", "in": "query", "required": true, "description": "Pending flow ID from the authorize redirect", "schema": { "type": "string" } }, { "name": "error", "in": "query", "required": false, "description": "Error message to display (used on redirect-back from failed form submissions)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Identity selection HTML page", "content": { "text/html": { "schema": { "type": "string" } } } }, "400": { "description": "Missing or expired flow_id", "content": { "text/plain": { "schema": { "type": "string" } } } }, "403": { "description": "Browser-binding cookie mismatch", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/oauth/consent/mcps": { "get": { "operationId": "getConsentMCPsPage", "summary": "Consent MCP services page", "description": "Renders the MCP services connection screen. Shows all per-user OAuth MCP servers\navailable on the user's Virtual Key (or all servers if no VK was selected).\nEach service shows a \"Connect\" link or a \"Connected ✓\" badge.\n\nRequires the `__bifrost_flow_secret` browser-binding cookie.\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "parameters": [ { "name": "flow_id", "in": "query", "required": true, "description": "Pending flow ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "MCP services connection HTML page", "content": { "text/html": { "schema": { "type": "string" } } } }, "400": { "description": "Missing or expired flow_id", "content": { "text/plain": { "schema": { "type": "string" } } } }, "403": { "description": "Browser-binding cookie mismatch", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/api/oauth/per-user/consent/vk": { "post": { "operationId": "submitConsentVirtualKey", "summary": "Submit Virtual Key identity", "description": "Validates the submitted Virtual Key and links it to the pending flow as the user's\nidentity. On success, redirects to the MCPs page. On failure, redirects back to the\nidentity page with an error message.\n\nRequest body is `application/x-www-form-urlencoded` (browser form submission).\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "flow_id", "vk" ], "properties": { "flow_id": { "type": "string", "description": "Pending flow ID" }, "vk": { "type": "string", "description": "Virtual Key value (validated against the database)" } } } } } }, "responses": { "302": { "description": "Redirect to `/oauth/consent/mcps?flow_id=xxx` on success, or back to\n`/oauth/consent?flow_id=xxx&error=...` on failure.\n", "headers": { "Location": { "schema": { "type": "string" } } } } } } }, "/api/oauth/per-user/consent/user-id": { "post": { "operationId": "submitConsentUserID", "summary": "Submit User ID identity", "description": "Links a self-declared User ID to the pending flow as the user's identity.\nOn success, redirects to the MCPs page.\n\nThe User ID is self-declared with no server-side verification — it matches\nthe trust model of the `X-Bf-User-Id` header in the LLM Gateway path.\n\nRequest body is `application/x-www-form-urlencoded` (browser form submission).\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "flow_id", "user_id" ], "properties": { "flow_id": { "type": "string", "description": "Pending flow ID" }, "user_id": { "type": "string", "description": "Self-declared user identifier (max 255 characters)" } } } } } }, "responses": { "302": { "description": "Redirect to `/oauth/consent/mcps?flow_id=xxx` on success, or back to\n`/oauth/consent?flow_id=xxx&error=...` on failure.\n", "headers": { "Location": { "schema": { "type": "string" } } } } } } }, "/api/oauth/per-user/consent/skip": { "post": { "operationId": "skipConsentIdentity", "summary": "Skip identity selection", "description": "Skips identity selection and proceeds directly to the MCPs page. Upstream service\ntokens will be stored against the session token only (not a persistent identity),\nso they will not carry over to other sessions or the LLM Gateway.\n\nOnly available when `enforce_auth_on_inference` is `false` in config. Returns a\nredirect back to the identity page with an error if auth enforcement is enabled.\n\nRequest body is `application/x-www-form-urlencoded` (browser form submission).\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "flow_id" ], "properties": { "flow_id": { "type": "string", "description": "Pending flow ID" } } } } } }, "responses": { "302": { "description": "Redirect to `/oauth/consent/mcps?flow_id=xxx` on success, or back to\n`/oauth/consent?flow_id=xxx&error=...` if identity enforcement is required.\n", "headers": { "Location": { "schema": { "type": "string" } } } } } } }, "/api/oauth/per-user/consent/submit": { "post": { "operationId": "submitConsent", "summary": "Finalize consent flow", "description": "Finalizes the consent flow atomically:\n1. Creates a `TablePerUserOAuthSession` (24h Bifrost session token)\n2. Transfers upstream tokens from the flow proxy to the session\n3. Issues a single-use `TablePerUserOAuthCode` (5-minute TTL, PKCE-bound)\n4. Deletes the `PendingFlow`\n5. Redirects to the MCP client's `redirect_uri` with `code` and `state`\n\nThe MCP client then exchanges the code at `/api/oauth/per-user/token`.\n\nRequest body is `application/x-www-form-urlencoded` (browser form submission).\n", "tags": [ "Per-User OAuth", "Consent Flow" ], "requestBody": { "required": true, "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "flow_id" ], "properties": { "flow_id": { "type": "string", "description": "Pending flow ID" } } } } } }, "responses": { "302": { "description": "Redirect to the MCP client's registered `redirect_uri` with\n`?code=xxx&state=yyy` query parameters.\n", "headers": { "Location": { "schema": { "type": "string" }, "description": "MCP client callback URL with code and state" } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "403": { "description": "Browser-binding cookie mismatch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "409": { "description": "Consent flow already submitted (duplicate submission prevention)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "410": { "description": "Consent flow expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/.well-known/oauth-protected-resource": { "get": { "operationId": "getOAuthProtectedResourceMetadata", "summary": "Protected Resource Metadata (RFC 9728)", "description": "Returns the OAuth 2.0 Protected Resource Metadata document per RFC 9728.\n\nMCP clients fetch this after receiving a `401` response from `/mcp` (with a\n`WWW-Authenticate: Bearer resource_metadata=\".../.well-known/oauth-protected-resource\"`\nheader). The response tells the client which authorization server(s) protect the\n`/mcp` resource so it can proceed with discovery.\n\nReturns `404` when no MCP clients are configured with `auth_type: per_user_oauth`.\n", "tags": [ "OAuth", "Per-User OAuth" ], "responses": { "200": { "description": "Protected resource metadata", "content": { "application/json": { "schema": { "type": "object", "description": "OAuth 2.0 Protected Resource Metadata per RFC 9728.\nReturned by /.well-known/oauth-protected-resource to tell MCP clients\nwhich authorization server(s) protect the /mcp endpoint.\n", "properties": { "resource": { "type": "string", "description": "URL of the protected resource (Bifrost's /mcp endpoint)", "example": "https://your-bifrost-domain.com/mcp" }, "authorization_servers": { "type": "array", "items": { "type": "string" }, "description": "List of authorization server issuer URLs", "example": [ "https://your-bifrost-domain.com" ] }, "scopes_supported": { "type": "array", "items": { "type": "string" }, "description": "Scopes supported by this resource", "example": [ "mcp:read", "mcp:write" ] }, "bearer_methods_supported": { "type": "array", "items": { "type": "string" }, "description": "Supported methods for passing Bearer tokens", "example": [ "header" ] } } }, "example": { "resource": "https://your-bifrost-domain.com/mcp", "authorization_servers": [ "https://your-bifrost-domain.com" ], "scopes_supported": [ "mcp:read", "mcp:write" ], "bearer_methods_supported": [ "header" ] } } } }, "404": { "description": "No per-user OAuth MCP clients configured", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/.well-known/oauth-authorization-server": { "get": { "operationId": "getOAuthAuthorizationServerMetadata", "summary": "Authorization Server Metadata (RFC 8414)", "description": "Returns the OAuth 2.0 Authorization Server Metadata document per RFC 8414.\n\nAfter fetching the Protected Resource Metadata, MCP clients fetch this endpoint\nto discover Bifrost's OAuth endpoints (register, authorize, token) and capabilities\n(PKCE methods, grant types, etc.).\n\nReturns `404` when no MCP clients are configured with `auth_type: per_user_oauth`.\n", "tags": [ "OAuth", "Per-User OAuth" ], "responses": { "200": { "description": "Authorization server metadata", "content": { "application/json": { "schema": { "type": "object", "description": "OAuth 2.0 Authorization Server Metadata per RFC 8414.\nReturned by /.well-known/oauth-authorization-server to let MCP clients\ndiscover Bifrost's OAuth endpoints and capabilities.\n", "properties": { "issuer": { "type": "string", "description": "Authorization server issuer URL (Bifrost base URL)", "example": "https://your-bifrost-domain.com" }, "authorization_endpoint": { "type": "string", "description": "Authorization endpoint URL", "example": "https://your-bifrost-domain.com/api/oauth/per-user/authorize" }, "token_endpoint": { "type": "string", "description": "Token endpoint URL", "example": "https://your-bifrost-domain.com/api/oauth/per-user/token" }, "registration_endpoint": { "type": "string", "description": "Dynamic client registration endpoint URL", "example": "https://your-bifrost-domain.com/api/oauth/per-user/register" }, "response_types_supported": { "type": "array", "items": { "type": "string" }, "example": [ "code" ] }, "grant_types_supported": { "type": "array", "items": { "type": "string" }, "example": [ "authorization_code" ] }, "code_challenge_methods_supported": { "type": "array", "items": { "type": "string" }, "description": "Supported PKCE methods (only S256)", "example": [ "S256" ] }, "token_endpoint_auth_methods_supported": { "type": "array", "items": { "type": "string" }, "description": "Supported token endpoint auth methods (public clients only)", "example": [ "none" ] }, "scopes_supported": { "type": "array", "items": { "type": "string" }, "example": [ "mcp:read", "mcp:write" ] } } }, "example": { "issuer": "https://your-bifrost-domain.com", "authorization_endpoint": "https://your-bifrost-domain.com/api/oauth/per-user/authorize", "token_endpoint": "https://your-bifrost-domain.com/api/oauth/per-user/token", "registration_endpoint": "https://your-bifrost-domain.com/api/oauth/per-user/register", "response_types_supported": [ "code" ], "grant_types_supported": [ "authorization_code" ], "code_challenge_methods_supported": [ "S256" ], "token_endpoint_auth_methods_supported": [ "none" ], "scopes_supported": [ "mcp:read", "mcp:write" ] } } } }, "404": { "description": "No per-user OAuth MCP clients configured", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/api/governance/virtual-keys": { "get": { "operationId": "listVirtualKeys", "summary": "List virtual keys", "description": "Returns a list of all virtual keys with their configurations.", "tags": [ "Governance" ], "parameters": [ { "name": "from_memory", "in": "query", "description": "If true, returns virtual keys from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListVirtualKeysResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createVirtualKey", "summary": "Create virtual key", "description": "Creates a new virtual key with the specified configuration.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateVirtualKeyRequest" } } } }, "responses": { "200": { "description": "Virtual key created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VirtualKeyResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/virtual-keys/quota": { "get": { "operationId": "getVirtualKeyQuota", "summary": "Get virtual key quota", "description": "Returns the budget and rate limit quota for the authenticated virtual key.\nThis is a self-service endpoint — no admin authentication required.\nThe virtual key value itself (provided via header) is the credential.\n", "tags": [ "Governance" ], "security": [ { "VirtualKeyAuth": [] }, { "BearerAuth": [] }, { "ApiKeyAuth": [] } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Virtual key quota response (self-service, no admin auth required)", "properties": { "virtual_key_name": { "type": "string", "description": "Name of the virtual key" }, "is_active": { "type": "boolean", "description": "Whether the virtual key is active" }, "budgets": { "type": "array", "description": "Budget quotas assigned to this virtual key", "items": { "$ref": "#/components/schemas/Budget" } }, "rate_limit": { "$ref": "#/components/schemas/RateLimit" } } } } } }, "401": { "description": "Missing or invalid virtual key", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/virtual-keys/{vk_id}": { "get": { "operationId": "getVirtualKey", "summary": "Get virtual key", "description": "Returns a specific virtual key by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "vk_id", "in": "path", "required": true, "description": "Virtual key ID", "schema": { "type": "string" } }, { "name": "from_memory", "in": "query", "description": "If true, returns virtual key from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "virtual_key": { "$ref": "#/components/schemas/VirtualKey" } } } } } }, "404": { "description": "Virtual key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateVirtualKey", "summary": "Update virtual key", "description": "Updates an existing virtual key's configuration.", "tags": [ "Governance" ], "parameters": [ { "name": "vk_id", "in": "path", "required": true, "description": "Virtual key ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateVirtualKeyRequest" } } } }, "responses": { "200": { "description": "Virtual key updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VirtualKeyResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Virtual key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteVirtualKey", "summary": "Delete virtual key", "description": "Deletes a virtual key.", "tags": [ "Governance" ], "parameters": [ { "name": "vk_id", "in": "path", "required": true, "description": "Virtual key ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Virtual key deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Virtual key not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/teams": { "get": { "operationId": "listTeams", "summary": "List teams", "description": "Returns a list of all teams.", "tags": [ "Governance" ], "parameters": [ { "name": "customer_id", "in": "query", "description": "Filter teams by customer ID", "schema": { "type": "string" } }, { "name": "from_memory", "in": "query", "description": "If true, returns teams from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListTeamsResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createTeam", "summary": "Create team", "description": "Creates a new team.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTeamRequest" } } } }, "responses": { "200": { "description": "Team created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TeamResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/teams/{team_id}": { "get": { "operationId": "getTeam", "summary": "Get team", "description": "Returns a specific team by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "team_id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } }, { "name": "from_memory", "in": "query", "description": "If true, returns team from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "team": { "$ref": "#/components/schemas/Team" } } } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateTeam", "summary": "Update team", "description": "Updates an existing team.", "tags": [ "Governance" ], "parameters": [ { "name": "team_id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTeamRequest" } } } }, "responses": { "200": { "description": "Team updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TeamResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteTeam", "summary": "Delete team", "description": "Deletes a team.", "tags": [ "Governance" ], "parameters": [ { "name": "team_id", "in": "path", "required": true, "description": "Team ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Team deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Team not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/customers": { "get": { "operationId": "listCustomers", "summary": "List customers", "description": "Returns a list of all customers.", "tags": [ "Governance" ], "parameters": [ { "name": "from_memory", "in": "query", "description": "If true, returns customers from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListCustomersResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createCustomer", "summary": "Create customer", "description": "Creates a new customer.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomerRequest" } } } }, "responses": { "200": { "description": "Customer created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/customers/{customer_id}": { "get": { "operationId": "getCustomer", "summary": "Get customer", "description": "Returns a specific customer by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "customer_id", "in": "path", "required": true, "description": "Customer ID", "schema": { "type": "string" } }, { "name": "from_memory", "in": "query", "description": "If true, returns customer from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "customer": { "$ref": "#/components/schemas/Customer" } } } } } }, "404": { "description": "Customer not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateCustomer", "summary": "Update customer", "description": "Updates an existing customer.", "tags": [ "Governance" ], "parameters": [ { "name": "customer_id", "in": "path", "required": true, "description": "Customer ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCustomerRequest" } } } }, "responses": { "200": { "description": "Customer updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CustomerResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Customer not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteCustomer", "summary": "Delete customer", "description": "Deletes a customer.", "tags": [ "Governance" ], "parameters": [ { "name": "customer_id", "in": "path", "required": true, "description": "Customer ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Customer deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Customer not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManagementErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/budgets": { "get": { "operationId": "listBudgets", "summary": "List budgets", "description": "Returns a list of all budgets. Use the `from_memory` query parameter to get data from in-memory cache.", "tags": [ "Governance" ], "parameters": [ { "name": "from_memory", "in": "query", "description": "If true, returns budgets from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListBudgetsResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/rate-limits": { "get": { "operationId": "listRateLimits", "summary": "List rate limits", "description": "Returns a list of all rate limits. Use the `from_memory` query parameter to get data from in-memory cache.", "tags": [ "Governance" ], "parameters": [ { "name": "from_memory", "in": "query", "description": "If true, returns rate limits from in-memory cache instead of database", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListRateLimitsResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/routing-rules": { "get": { "operationId": "listRoutingRules", "summary": "List routing rules", "description": "Returns a list of all routing rules configured for intelligent request routing across providers.", "tags": [ "Governance" ], "parameters": [ { "name": "scope", "in": "query", "description": "Filter routing rules by scope (global, team, customer, virtual_key)", "schema": { "type": "string" } }, { "name": "scope_id", "in": "query", "description": "Filter routing rules by scope ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListRoutingRulesResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createRoutingRule", "summary": "Create routing rule", "description": "Creates a new CEL-based routing rule for intelligent request routing. Provider and model can be left empty to use the incoming request values.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateRoutingRuleRequest" } } } }, "responses": { "200": { "description": "Routing rule created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RoutingRuleResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/routing-rules/{rule_id}": { "get": { "operationId": "getRoutingRule", "summary": "Get routing rule", "description": "Returns a specific routing rule by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "rule_id", "in": "path", "required": true, "description": "Routing rule ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "rule": { "$ref": "#/components/schemas/RoutingRule" } } } } } }, "404": { "description": "Routing rule not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateRoutingRule", "summary": "Update routing rule", "description": "Updates an existing routing rule's configuration.", "tags": [ "Governance" ], "parameters": [ { "name": "rule_id", "in": "path", "required": true, "description": "Routing rule ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateRoutingRuleRequest" } } } }, "responses": { "200": { "description": "Routing rule updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RoutingRuleResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Routing rule not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteRoutingRule", "summary": "Delete routing rule", "description": "Deletes a routing rule.", "tags": [ "Governance" ], "parameters": [ { "name": "rule_id", "in": "path", "required": true, "description": "Routing rule ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Routing rule deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Routing rule not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/model-configs": { "get": { "operationId": "listModelConfigs", "summary": "List model configs", "description": "Returns a list of all model configurations with their budget and rate limit settings.", "tags": [ "Governance" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListModelConfigsResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createModelConfig", "summary": "Create model config", "description": "Creates a new model configuration with budget and rate limit settings.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateModelConfigRequest" } } } }, "responses": { "200": { "description": "Model config created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelConfigResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/model-configs/{mc_id}": { "get": { "operationId": "getModelConfig", "summary": "Get model config", "description": "Returns a specific model configuration by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "mc_id", "in": "path", "required": true, "description": "Model config ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "model_config": { "$ref": "#/components/schemas/ModelConfig" } } } } } }, "404": { "description": "Model config not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateModelConfig", "summary": "Update model config", "description": "Updates an existing model configuration's budget and rate limit settings.", "tags": [ "Governance" ], "parameters": [ { "name": "mc_id", "in": "path", "required": true, "description": "Model config ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateModelConfigRequest" } } } }, "responses": { "200": { "description": "Model config updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelConfigResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Model config not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteModelConfig", "summary": "Delete model config", "description": "Deletes a model configuration.", "tags": [ "Governance" ], "parameters": [ { "name": "mc_id", "in": "path", "required": true, "description": "Model config ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Model config deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Model config not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/providers": { "get": { "operationId": "listProviderGovernance", "summary": "List provider governance", "description": "Returns a list of all providers with their governance settings (budget and rate limits).", "tags": [ "Governance" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListProviderGovernanceResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/providers/{provider_name}": { "put": { "operationId": "updateProviderGovernance", "summary": "Update provider governance", "description": "Updates governance settings (budget and rate limits) for a specific provider.", "tags": [ "Governance" ], "parameters": [ { "name": "provider_name", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateProviderGovernanceRequest" } } } }, "responses": { "200": { "description": "Provider governance updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderGovernanceResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteProviderGovernance", "summary": "Delete provider governance", "description": "Removes governance settings (budget and rate limits) for a specific provider.", "tags": [ "Governance" ], "parameters": [ { "name": "provider_name", "in": "path", "required": true, "description": "Provider name", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Provider governance deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Provider not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/pricing-overrides": { "get": { "operationId": "listPricingOverrides", "summary": "List pricing overrides", "description": "Returns all pricing overrides, optionally filtered by scope.", "tags": [ "Governance" ], "parameters": [ { "name": "scope_kind", "in": "query", "description": "Filter by scope kind", "schema": { "type": "string", "enum": [ "global", "provider", "provider_key", "virtual_key", "virtual_key_provider", "virtual_key_provider_key" ] } }, { "name": "virtual_key_id", "in": "query", "description": "Filter by virtual key ID (for virtual_key* scopes)", "schema": { "type": "string" } }, { "name": "provider_id", "in": "query", "description": "Filter by provider ID", "schema": { "type": "string" } }, { "name": "provider_key_id", "in": "query", "description": "Filter by provider key ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListPricingOverridesResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createPricingOverride", "summary": "Create pricing override", "description": "Creates a new pricing override. The most specific matching scope always wins during cost resolution.", "tags": [ "Governance" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePricingOverrideRequest" } } } }, "responses": { "201": { "description": "Pricing override created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PricingOverrideResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/governance/pricing-overrides/{id}": { "put": { "operationId": "updatePricingOverride", "summary": "Update pricing override", "description": "Updates an existing pricing override. Omitted fields are merged from the existing record. The `patch` field is always replaced in full when provided.", "tags": [ "Governance" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Pricing override ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePricingOverrideRequest" } } } }, "responses": { "200": { "description": "Pricing override updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PricingOverrideResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Pricing override not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deletePricingOverride", "summary": "Delete pricing override", "description": "Deletes a pricing override by ID.", "tags": [ "Governance" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Pricing override ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Pricing override deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs": { "get": { "operationId": "getLogs", "summary": "Get logs", "description": "Retrieves logs with filtering, search, and pagination via query parameters.\n", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by (routing-rule, governance, or loadbalancing)", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Number of logs to return (default 50, max 1000)", "schema": { "type": "integer", "default": 50, "maximum": 1000 } }, { "name": "offset", "in": "query", "description": "Number of logs to skip", "schema": { "type": "integer", "default": 0 } }, { "name": "sort_by", "in": "query", "description": "Field to sort by", "schema": { "type": "string", "enum": [ "timestamp", "latency", "tokens", "cost" ], "default": "timestamp" } }, { "name": "order", "in": "query", "description": "Sort order", "schema": { "type": "string", "enum": [ "asc", "desc" ], "default": "desc" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchLogsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteLogs", "summary": "Delete logs", "description": "Deletes logs by their IDs.", "tags": [ "Logging" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteLogsRequest" } } } }, "responses": { "200": { "description": "Logs deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/{id}": { "get": { "operationId": "getLogById", "summary": "Get a single log entry", "description": "Retrieves a single log entry by its ID.", "tags": [ "Logging" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Log entry ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogEntry" } } } }, "404": { "description": "Log not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/stats": { "get": { "operationId": "getLogsStats", "summary": "Get log statistics", "description": "Returns statistics for logs matching the specified filters.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by (routing-rule, governance, or loadbalancing)", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LogStats" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram": { "get": { "operationId": "getLogsHistogram", "summary": "Get request count histogram", "description": "Returns time-bucketed request counts. Bucket size is auto-calculated from the time range.\n", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed request count histogram", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed request count", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "count": { "type": "integer", "format": "int64" }, "success": { "type": "integer", "format": "int64" }, "error": { "type": "integer", "format": "int64" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/tokens": { "get": { "operationId": "getLogsTokenHistogram", "summary": "Get token usage histogram", "description": "Returns time-bucketed token usage (prompt, completion, total).", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed token usage histogram", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed token usage", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "prompt_tokens": { "type": "integer", "format": "int64" }, "completion_tokens": { "type": "integer", "format": "int64" }, "total_tokens": { "type": "integer", "format": "int64" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/cost": { "get": { "operationId": "getLogsCostHistogram", "summary": "Get cost histogram", "description": "Returns time-bucketed cost data with model breakdown.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed cost histogram with model breakdown", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed cost data with model breakdown", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "total_cost": { "type": "number" }, "by_model": { "type": "object", "additionalProperties": { "type": "number" }, "description": "Cost breakdown by model name" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" }, "models": { "type": "array", "items": { "type": "string" }, "description": "List of models present in the histogram" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/models": { "get": { "operationId": "getLogsModelHistogram", "summary": "Get model usage histogram", "description": "Returns time-bucketed model usage with success/error breakdown.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed model usage histogram", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed model usage with success/error breakdown", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "by_model": { "type": "object", "additionalProperties": { "type": "object", "description": "Usage statistics for a single model", "properties": { "total": { "type": "integer", "format": "int64" }, "success": { "type": "integer", "format": "int64" }, "error": { "type": "integer", "format": "int64" } } }, "description": "Usage breakdown by model name" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" }, "models": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/latency": { "get": { "operationId": "getLogsLatencyHistogram", "summary": "Get latency histogram", "description": "Returns time-bucketed latency percentiles (avg, p90, p95, p99).", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed latency histogram", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed latency percentiles", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "avg_latency": { "type": "number" }, "p90_latency": { "type": "number" }, "p95_latency": { "type": "number" }, "p99_latency": { "type": "number" }, "total_requests": { "type": "integer", "format": "int64" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/cost/by-provider": { "get": { "operationId": "getLogsProviderCostHistogram", "summary": "Get cost histogram by provider", "description": "Returns time-bucketed cost data with provider breakdown.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed cost histogram with provider breakdown", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed cost data with provider breakdown", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "total_cost": { "type": "number" }, "by_provider": { "type": "object", "additionalProperties": { "type": "number" }, "description": "Cost breakdown by provider name" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" }, "providers": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/tokens/by-provider": { "get": { "operationId": "getLogsProviderTokenHistogram", "summary": "Get token histogram by provider", "description": "Returns time-bucketed token usage with provider breakdown.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed token histogram with provider breakdown", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed token usage with provider breakdown", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "by_provider": { "type": "object", "additionalProperties": { "type": "object", "description": "Token statistics for a single provider", "properties": { "prompt_tokens": { "type": "integer", "format": "int64" }, "completion_tokens": { "type": "integer", "format": "int64" }, "total_tokens": { "type": "integer", "format": "int64" } } }, "description": "Token usage breakdown by provider name" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" }, "providers": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/histogram/latency/by-provider": { "get": { "operationId": "getLogsProviderLatencyHistogram", "summary": "Get latency histogram by provider", "description": "Returns time-bucketed latency percentiles with provider breakdown.", "tags": [ "Logging" ], "parameters": [ { "name": "providers", "in": "query", "description": "Comma-separated list of providers to filter by", "schema": { "type": "string" } }, { "name": "models", "in": "query", "description": "Comma-separated list of models to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string" } }, { "name": "objects", "in": "query", "description": "Comma-separated list of object types to filter by", "schema": { "type": "string" } }, { "name": "selected_key_ids", "in": "query", "description": "Comma-separated list of selected key IDs to filter by", "schema": { "type": "string" } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_rule_ids", "in": "query", "description": "Comma-separated list of routing rule IDs to filter by", "schema": { "type": "string" } }, { "name": "routing_engine_used", "in": "query", "description": "Comma-separated list of routing engines to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "min_tokens", "in": "query", "description": "Minimum tokens filter", "schema": { "type": "integer" } }, { "name": "max_tokens", "in": "query", "description": "Maximum tokens filter", "schema": { "type": "integer" } }, { "name": "min_cost", "in": "query", "description": "Minimum cost filter", "schema": { "type": "number" } }, { "name": "max_cost", "in": "query", "description": "Maximum cost filter", "schema": { "type": "number" } }, { "name": "missing_cost_only", "in": "query", "description": "Only show logs with missing cost", "schema": { "type": "boolean" } }, { "name": "content_search", "in": "query", "description": "Search in request/response content", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Time-bucketed latency histogram with provider breakdown", "properties": { "buckets": { "type": "array", "items": { "type": "object", "description": "Time-bucketed latency data with provider breakdown", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "by_provider": { "type": "object", "additionalProperties": { "type": "object", "description": "Latency statistics for a single provider", "properties": { "avg_latency": { "type": "number" }, "p90_latency": { "type": "number" }, "p95_latency": { "type": "number" }, "p99_latency": { "type": "number" }, "total_requests": { "type": "integer", "format": "int64" } } }, "description": "Latency breakdown by provider name" } } } }, "bucket_size_seconds": { "type": "integer", "format": "int64" }, "providers": { "type": "array", "items": { "type": "string" } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/dropped": { "get": { "operationId": "getDroppedRequests", "summary": "Get dropped requests count", "description": "Returns the number of dropped requests.", "tags": [ "Logging" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Dropped requests response", "properties": { "dropped_requests": { "type": "integer", "format": "int64" } } } } } } } } }, "/api/logs/filterdata": { "get": { "operationId": "getAvailableFilterData", "summary": "Get available filter data", "description": "Returns all unique filter data from logs (models, keys, virtual keys).", "tags": [ "Logging" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Available filter data response", "properties": { "models": { "type": "array", "items": { "type": "string" } }, "selected_keys": { "type": "array", "items": { "$ref": "#/components/schemas/Key" } }, "virtual_keys": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualKey" } }, "routing_rules": { "type": "array", "items": { "$ref": "#/components/schemas/RoutingRule" }, "description": "Available routing rules for filtering" }, "routing_engines": { "type": "array", "items": { "type": "string" }, "description": "Available routing engine types (routing-rule, governance, loadbalancing)" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/logs/recalculate-cost": { "post": { "operationId": "recalculateLogCosts", "summary": "Recalculate log costs", "description": "Recomputes missing costs in batches. Processes logs with missing cost values\nand updates them based on current pricing data.\n", "tags": [ "Logging" ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecalculateCostRequest" } } } }, "responses": { "200": { "description": "Costs recalculated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecalculateCostResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp-logs": { "get": { "operationId": "getMCPLogs", "summary": "Get MCP tool logs", "description": "Retrieves MCP tool execution logs with filtering, search, and pagination via query parameters.\n", "tags": [ "Logging" ], "parameters": [ { "name": "tool_names", "in": "query", "description": "Comma-separated list of tool names to filter by", "schema": { "type": "string" } }, { "name": "server_labels", "in": "query", "description": "Comma-separated list of server labels to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by (processing, success, error)", "schema": { "type": "string", "enum": [ "processing", "success", "error" ] } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "llm_request_ids", "in": "query", "description": "Comma-separated list of LLM request IDs to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter (milliseconds)", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter (milliseconds)", "schema": { "type": "number" } }, { "name": "content_search", "in": "query", "description": "Search in tool arguments and results", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "Number of logs to return (default 50, max 1000)", "schema": { "type": "integer", "default": 50, "maximum": 1000 } }, { "name": "offset", "in": "query", "description": "Number of logs to skip", "schema": { "type": "integer", "default": 0 } }, { "name": "sort_by", "in": "query", "description": "Field to sort by", "schema": { "type": "string", "enum": [ "timestamp", "latency", "cost" ], "default": "timestamp" } }, { "name": "order", "in": "query", "description": "Sort order", "schema": { "type": "string", "enum": [ "asc", "desc" ], "default": "desc" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Search MCP logs response", "properties": { "logs": { "type": "array", "items": { "type": "object", "description": "MCP tool execution log entry", "properties": { "id": { "type": "string", "description": "Unique identifier for the log entry" }, "llm_request_id": { "type": "string", "description": "Links to the LLM request that triggered this tool call" }, "timestamp": { "type": "string", "format": "date-time", "description": "When the tool execution started" }, "tool_name": { "type": "string", "description": "Name of the MCP tool that was executed" }, "server_label": { "type": "string", "description": "Label of the MCP server that provided the tool" }, "virtual_key_id": { "type": "string", "description": "ID of the virtual key used for this tool execution" }, "virtual_key_name": { "type": "string", "description": "Name of the virtual key used for this tool execution" }, "arguments": { "type": "object", "additionalProperties": true, "description": "Tool execution arguments" }, "result": { "type": "object", "additionalProperties": true, "description": "Tool execution result" }, "error_details": { "$ref": "#/components/schemas/BifrostError" }, "latency": { "type": "number", "description": "Execution time in milliseconds" }, "cost": { "type": "number", "description": "Cost in dollars for this tool execution" }, "status": { "type": "string", "enum": [ "processing", "success", "error" ], "description": "Execution status" }, "metadata": { "type": "object", "additionalProperties": true, "description": "Custom metadata captured from request headers (configured via logging_headers or x-bf-lh-* prefix)" }, "created_at": { "type": "string", "format": "date-time", "description": "When the log entry was created" }, "virtual_key": { "type": "object", "additionalProperties": true, "description": "Full virtual key object (populated when virtual_key_id is set)" } } } }, "pagination": { "type": "object", "required": [ "total_count" ], "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "sort_by": { "type": "string" }, "order": { "type": "string" }, "total_count": { "type": "integer", "format": "int64", "description": "Total number of items matching the query" } } }, "stats": { "type": "object", "description": "MCP tool log statistics", "properties": { "total_executions": { "type": "integer", "description": "Total number of tool executions" }, "success_rate": { "type": "number", "description": "Success rate percentage" }, "average_latency": { "type": "number", "description": "Average execution latency in milliseconds" }, "total_cost": { "type": "number", "description": "Total cost in dollars for all executions" } } }, "has_logs": { "type": "boolean", "description": "Whether any logs exist in the system" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteMCPLogs", "summary": "Delete MCP tool logs", "description": "Deletes MCP tool logs by their IDs.", "tags": [ "Logging" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "Delete MCP logs request", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "string" }, "description": "Array of log IDs to delete" } } } } } }, "responses": { "200": { "description": "MCP tool logs deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp-logs/stats": { "get": { "operationId": "getMCPLogsStats", "summary": "Get MCP tool log statistics", "description": "Returns statistics for MCP tool logs matching the specified filters.", "tags": [ "Logging" ], "parameters": [ { "name": "tool_names", "in": "query", "description": "Comma-separated list of tool names to filter by", "schema": { "type": "string" } }, { "name": "server_labels", "in": "query", "description": "Comma-separated list of server labels to filter by", "schema": { "type": "string" } }, { "name": "status", "in": "query", "description": "Comma-separated list of statuses to filter by", "schema": { "type": "string", "enum": [ "processing", "success", "error" ] } }, { "name": "virtual_key_ids", "in": "query", "description": "Comma-separated list of virtual key IDs to filter by", "schema": { "type": "string" } }, { "name": "llm_request_ids", "in": "query", "description": "Comma-separated list of LLM request IDs to filter by", "schema": { "type": "string" } }, { "name": "start_time", "in": "query", "description": "Start time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "end_time", "in": "query", "description": "End time filter (RFC3339 format)", "schema": { "type": "string", "format": "date-time" } }, { "name": "min_latency", "in": "query", "description": "Minimum latency filter", "schema": { "type": "number" } }, { "name": "max_latency", "in": "query", "description": "Maximum latency filter", "schema": { "type": "number" } }, { "name": "content_search", "in": "query", "description": "Search in tool arguments and results", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "MCP tool log statistics", "properties": { "total_executions": { "type": "integer", "description": "Total number of tool executions" }, "success_rate": { "type": "number", "description": "Success rate percentage" }, "average_latency": { "type": "number", "description": "Average execution latency in milliseconds" }, "total_cost": { "type": "number", "description": "Total cost in dollars for all executions" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/mcp-logs/filterdata": { "get": { "operationId": "getMCPLogsFilterData", "summary": "Get available MCP log filter data", "description": "Returns all unique filter data from MCP tool logs (tool names, server labels).", "tags": [ "Logging" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "description": "Available MCP log filter data", "properties": { "tool_names": { "type": "array", "items": { "type": "string" }, "description": "All unique tool names" }, "server_labels": { "type": "array", "items": { "type": "string" }, "description": "All unique server labels" }, "virtual_keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Virtual key ID" }, "name": { "type": "string", "description": "Virtual key name" }, "value": { "type": "string", "description": "Virtual key value (redacted if applicable)" } } }, "description": "All unique virtual keys" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/folders": { "get": { "operationId": "listFolders", "summary": "List folders", "description": "Returns all prompt folders.", "tags": [ "Prompt Repository" ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "folders": { "type": "array", "items": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createFolder", "summary": "Create folder", "description": "Creates a new prompt folder.", "tags": [ "Prompt Repository" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } } } }, "responses": { "200": { "description": "Folder created", "content": { "application/json": { "schema": { "type": "object", "properties": { "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/folders/{id}": { "get": { "operationId": "getFolder", "summary": "Get folder", "description": "Returns a folder by ID.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } } } } } } }, "404": { "description": "Folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updateFolder", "summary": "Update folder", "description": "Updates a folder's name or description.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string", "nullable": true } } } } } }, "responses": { "200": { "description": "Folder updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "404": { "description": "Folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deleteFolder", "summary": "Delete folder", "description": "Deletes a folder and cascades to contained prompts.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Folder deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Folder not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/prompts": { "get": { "operationId": "listPrompts", "summary": "List prompts", "description": "Returns all prompts, optionally filtered by folder.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "folder_id", "in": "query", "description": "Filter by folder ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "type": "object", "description": "Prompt", "properties": { "id": { "type": "string", "description": "Unique prompt ID (UUID)" }, "name": { "type": "string" }, "folder_id": { "type": "string", "nullable": true }, "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "versions": { "type": "array", "items": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "sessions": { "type": "array", "items": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "latest_version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createPrompt", "summary": "Create prompt", "description": "Creates a new prompt.", "tags": [ "Prompt Repository" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "folder_id": { "type": "string" } } } } } }, "responses": { "200": { "description": "Prompt created", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt": { "type": "object", "description": "Prompt", "properties": { "id": { "type": "string", "description": "Unique prompt ID (UUID)" }, "name": { "type": "string" }, "folder_id": { "type": "string", "nullable": true }, "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "versions": { "type": "array", "items": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "sessions": { "type": "array", "items": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "latest_version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/prompts/{id}": { "get": { "operationId": "getPrompt", "summary": "Get prompt", "description": "Returns a prompt by ID with its latest version.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt": { "type": "object", "description": "Prompt", "properties": { "id": { "type": "string", "description": "Unique prompt ID (UUID)" }, "name": { "type": "string" }, "folder_id": { "type": "string", "nullable": true }, "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "versions": { "type": "array", "items": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "sessions": { "type": "array", "items": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "latest_version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } } }, "404": { "description": "Prompt not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updatePrompt", "summary": "Update prompt", "description": "Updates a prompt's name or folder.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "folder_id": { "type": "string", "nullable": true } } } } } }, "responses": { "200": { "description": "Prompt updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompt": { "type": "object", "description": "Prompt", "properties": { "id": { "type": "string", "description": "Unique prompt ID (UUID)" }, "name": { "type": "string" }, "folder_id": { "type": "string", "nullable": true }, "folder": { "type": "object", "description": "Prompt folder", "properties": { "id": { "type": "string", "description": "Unique folder ID (UUID)" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "prompts_count": { "type": "integer", "description": "Number of prompts in this folder (virtual field)" } } }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "versions": { "type": "array", "items": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "sessions": { "type": "array", "items": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } }, "latest_version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deletePrompt", "summary": "Delete prompt", "description": "Deletes a prompt and all its versions and sessions.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Prompt deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Prompt not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/prompts/{id}/versions": { "get": { "operationId": "listPromptVersions", "summary": "List prompt versions", "description": "Returns all versions for a prompt.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Prompt ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "versions": { "type": "array", "items": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createPromptVersion", "summary": "Create prompt version", "description": "Creates a new version for a prompt.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Prompt ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "commit_message", "messages", "model_params", "provider", "model" ], "properties": { "commit_message": { "type": "string" }, "messages": { "type": "array", "items": { "type": "object", "additionalProperties": true }, "description": "Array of message objects" }, "model_params": { "type": "object", "additionalProperties": true }, "provider": { "type": "string" }, "model": { "type": "string" } } } } } }, "responses": { "200": { "description": "Version created", "content": { "application/json": { "schema": { "type": "object", "properties": { "version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/versions/{id}": { "get": { "operationId": "getPromptVersion", "summary": "Get prompt version", "description": "Returns a specific version by ID.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Version ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "404": { "description": "Version not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deletePromptVersion", "summary": "Delete prompt version", "description": "Deletes a specific version.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Version ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Version deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Version not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/prompts/{id}/sessions": { "get": { "operationId": "listPromptSessions", "summary": "List prompt sessions", "description": "Returns all sessions for a prompt.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Prompt ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "sessions": { "type": "array", "items": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "post": { "operationId": "createPromptSession", "summary": "Create prompt session", "description": "Creates a new playground session for a prompt.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Prompt ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "model_params", "provider", "model" ], "properties": { "name": { "type": "string" }, "version_id": { "type": "integer", "description": "Fork from this version" }, "messages": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "model_params": { "type": "object", "additionalProperties": true }, "provider": { "type": "string" }, "model": { "type": "string" } } } } } }, "responses": { "200": { "description": "Session created", "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/sessions/{id}": { "get": { "operationId": "getPromptSession", "summary": "Get prompt session", "description": "Returns a specific session by ID.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Session ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "404": { "description": "Session not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "put": { "operationId": "updatePromptSession", "summary": "Update prompt session", "description": "Updates a session's messages, model params, etc.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Session ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "messages", "model_params", "provider", "model" ], "properties": { "name": { "type": "string" }, "messages": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "model_params": { "type": "object", "additionalProperties": true }, "provider": { "type": "string" }, "model": { "type": "string" } } } } } }, "responses": { "200": { "description": "Session updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } }, "delete": { "operationId": "deletePromptSession", "summary": "Delete prompt session", "description": "Deletes a specific session.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Session ID", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Session deleted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageResponse" } } } }, "404": { "description": "Session not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/sessions/{id}/rename": { "put": { "operationId": "renamePromptSession", "summary": "Rename prompt session", "description": "Renames a session.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Session ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } } } } }, "responses": { "200": { "description": "Session renamed", "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "type": "object", "description": "Prompt playground session", "properties": { "id": { "type": "integer", "description": "Auto-increment session ID" }, "prompt_id": { "type": "string" }, "version_id": { "type": "integer", "nullable": true, "description": "Version this session was forked from" }, "name": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt session", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/prompt-repo/sessions/{id}/commit": { "post": { "operationId": "commitPromptSession", "summary": "Commit session as version", "description": "Commits the current session state as a new prompt version.", "tags": [ "Prompt Repository" ], "parameters": [ { "name": "id", "in": "path", "required": true, "description": "Session ID", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "commit_message" ], "properties": { "commit_message": { "type": "string" } } } } } }, "responses": { "200": { "description": "Version created from session", "content": { "application/json": { "schema": { "type": "object", "properties": { "version": { "type": "object", "description": "Prompt version (immutable snapshot)", "properties": { "id": { "type": "integer", "description": "Auto-increment version ID" }, "prompt_id": { "type": "string" }, "version_number": { "type": "integer" }, "commit_message": { "type": "string" }, "model_params": { "type": "object", "additionalProperties": true, "description": "Model parameters (flexible JSON object)" }, "provider": { "type": "string" }, "model": { "type": "string" }, "is_latest": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "messages": { "type": "array", "items": { "type": "object", "description": "Message within a prompt version", "properties": { "id": { "type": "integer" }, "order_index": { "type": "integer" }, "message": { "type": "object", "additionalProperties": true, "description": "Opaque message content (JSON)" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/cache/clear/{requestId}": { "delete": { "operationId": "clearCacheByRequestId", "summary": "Clear cache by request ID", "description": "Clears cache entries associated with a specific request ID.", "tags": [ "Cache" ], "parameters": [ { "name": "requestId", "in": "path", "required": true, "description": "Request ID to clear cache for", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Cache cleared successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClearCacheResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/api/cache/clear-by-key/{cacheKey}": { "delete": { "operationId": "clearCacheByCacheKey", "summary": "Clear cache by cache key", "description": "Clears a cache entry by its direct cache key.", "tags": [ "Cache" ], "parameters": [ { "name": "cacheKey", "in": "path", "required": true, "description": "Cache key to clear", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Cache cleared successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClearCacheResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } } } }, "/ws": { "get": { "operationId": "websocketConnect", "summary": "WebSocket connection", "description": "Upgrades to a WebSocket connection for real-time updates.\nServer pushes log events, MCP log events, and store update notifications.\nHeartbeat pings are sent every 30 seconds.\n", "tags": [ "Infrastructure" ], "responses": { "101": { "description": "WebSocket upgrade successful" } } } }, "/mcp": { "post": { "operationId": "mcpServerMessage", "summary": "MCP protocol message", "description": "Receives a JSON-RPC 2.0 message for the MCP protocol server.\nReturns a JSON-RPC 2.0 response, or null for notifications.\n", "tags": [ "Infrastructure" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "description": "JSON-RPC 2.0 request", "properties": { "jsonrpc": { "type": "string", "enum": [ "2.0" ] }, "method": { "type": "string" }, "params": { "type": "object" }, "id": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] } } } } } }, "responses": { "200": { "description": "JSON-RPC 2.0 response", "content": { "application/json": { "schema": { "type": "object", "properties": { "jsonrpc": { "type": "string", "enum": [ "2.0" ] }, "result": { "type": "object" }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }, "id": { "oneOf": [ { "type": "string" }, { "type": "integer" } ] } } } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] }, "get": { "operationId": "mcpServerSSE", "summary": "MCP protocol SSE stream", "description": "Opens a Server-Sent Events stream for the MCP protocol server.\nReturns `Content-Type: text/event-stream`.\n", "tags": [ "Infrastructure" ], "responses": { "200": { "description": "SSE stream opened", "content": { "text/event-stream": { "schema": { "type": "string" } } } } }, "security": [ { "BearerAuth": [] }, { "BasicAuth": [] }, { "VirtualKeyAuth": [] }, { "ApiKeyAuth": [] } ] } }, "/metrics": { "get": { "operationId": "getMetrics", "summary": "Prometheus metrics", "description": "Returns Prometheus-formatted metrics for monitoring.", "tags": [ "Infrastructure" ], "responses": { "200": { "description": "Prometheus metrics", "content": { "text/plain": { "schema": { "type": "string" } } } } } } } }, "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer token authentication. Use your provider API key or Bifrost authentication token.\nVirtual keys (prefixed with `sk-bf-`) can also be passed here.\n" }, "BasicAuth": { "type": "http", "scheme": "basic", "description": "Basic authentication using username and password.\n" }, "VirtualKeyAuth": { "type": "apiKey", "in": "header", "name": "x-bf-vk", "description": "Bifrost Virtual Key for governance, routing, and access control. Supported on all inference endpoints (`/v1/*`, `/openai/*`, `/anthropic/*`, `/bedrock/*`, `/cohere/*`, `/genai/*`, `/langchain/*`, `/litellm/*`, `/pydanticai/*`, `/mcp`), not on management APIs (`/api/*`).\nExample: `sk-bf-*` prefixed keys.\n" }, "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-api-key", "description": "API key authentication via the `x-api-key` header.\nVirtual keys (prefixed with `sk-bf-`) can also be passed here.\n" } }, "parameters": { "AsyncJobId": { "name": "job_id", "in": "path", "required": true, "description": "The unique identifier of the async job", "schema": { "type": "string" } }, "AsyncResultTTL": { "name": "x-bf-async-job-result-ttl", "in": "header", "required": false, "description": "Time-to-live in seconds for the job result after completion. Defaults to 3600 (1 hour).\nAfter expiry, the job result is automatically cleaned up.\n", "schema": { "type": "integer", "default": 3600 } } }, "responses": { "BadRequest": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "NotFound": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } }, "InternalError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BifrostError" } } } } }, "schemas": { "ModelProvider": { "type": "string", "description": "AI model provider identifier", "enum": [ "openai", "azure", "anthropic", "bedrock", "cohere", "vertex", "vllm", "mistral", "ollama", "groq", "sgl", "parasail", "perplexity", "replicate", "cerebras", "gemini", "openrouter", "elevenlabs", "huggingface", "nebius", "xai", "runway", "fireworks" ] }, "Fallback": { "type": "object", "description": "Fallback model configuration", "required": [ "provider", "model" ], "properties": { "provider": { "$ref": "#/components/schemas/ModelProvider" }, "model": { "type": "string", "description": "Model name" } } }, "BifrostError": { "type": "object", "description": "Error response from Bifrost", "properties": { "event_id": { "type": "string" }, "type": { "type": "string" }, "is_bifrost_error": { "type": "boolean" }, "status_code": { "type": "integer" }, "error": { "$ref": "#/components/schemas/ErrorField" }, "extra_fields": { "$ref": "#/components/schemas/BifrostErrorExtraFields" } } }, "ErrorField": { "type": "object", "properties": { "type": { "type": "string" }, "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "event_id": { "type": "string" } } }, "BifrostErrorExtraFields": { "type": "object", "properties": { "provider": { "$ref": "#/components/schemas/ModelProvider" }, "model_requested": { "type": "string" }, "request_type": { "type": "string" } } }, "BifrostResponseExtraFields": { "type": "object", "description": "Additional fields included in responses", "properties": { "request_type": { "type": "string", "description": "Type of request that was made" }, "provider": { "$ref": "#/components/schemas/ModelProvider" }, "model_requested": { "type": "string", "description": "The model that was requested" }, "model_deployment": { "type": "string", "description": "The actual model deployment used" }, "latency": { "type": "integer", "format": "int64", "description": "Request latency in milliseconds" }, "chunk_index": { "type": "integer", "description": "Index of the chunk for streaming responses" }, "raw_request": { "type": "object", "description": "Raw request if enabled" }, "raw_response": { "type": "object", "description": "Raw response if enabled" }, "cache_debug": { "$ref": "#/components/schemas/BifrostCacheDebug" } } }, "BifrostCacheDebug": { "type": "object", "properties": { "cache_hit": { "type": "boolean" }, "cache_id": { "type": "string" }, "hit_type": { "type": "string" }, "requested_provider": { "type": "string" }, "requested_model": { "type": "string" }, "provider_used": { "type": "string" }, "model_used": { "type": "string" }, "input_tokens": { "type": "integer" }, "threshold": { "type": "number" }, "similarity": { "type": "number" } } }, "CacheControl": { "type": "object", "description": "Cache control settings for content blocks", "properties": { "type": { "type": "string", "enum": [ "ephemeral" ] }, "ttl": { "type": "string", "description": "Time to live (e.g., \"1m\", \"1h\")" } } }, "AsyncJobStatus": { "type": "string", "description": "The status of an async job", "enum": [ "pending", "processing", "completed", "failed" ] }, "AsyncJobResponse": { "type": "object", "description": "Response returned when creating or polling an async job", "required": [ "id", "status", "created_at" ], "properties": { "id": { "type": "string", "description": "Unique identifier for the async job" }, "status": { "$ref": "#/components/schemas/AsyncJobStatus" }, "expires_at": { "type": "string", "format": "date-time", "description": "When the job result expires and will be cleaned up" }, "created_at": { "type": "string", "format": "date-time", "description": "When the job was created" }, "completed_at": { "type": "string", "format": "date-time", "description": "When the job completed (successfully or with failure)" }, "status_code": { "type": "integer", "description": "HTTP status code of the completed operation" }, "result": { "description": "The result of the completed operation (shape depends on the request type)" }, "error": { "$ref": "#/components/schemas/BifrostError" } } }, "BifrostLLMUsage": { "type": "object", "description": "Token usage information", "properties": { "prompt_tokens": { "type": "integer", "description": "Total input tokens including any prompt-cache tokens (read + write). Subtract prompt_tokens_details.cached_read_tokens and prompt_tokens_details.cached_write_tokens to get the non-cached portion.\n" }, "prompt_tokens_details": { "$ref": "#/components/schemas/ChatPromptTokensDetails" }, "completion_tokens": { "type": "integer", "description": "Number of output/completion tokens generated." }, "completion_tokens_details": { "$ref": "#/components/schemas/ChatCompletionTokensDetails" }, "total_tokens": { "type": "integer" }, "cost": { "$ref": "#/components/schemas/BifrostCost" } } }, "ChatPromptTokensDetails": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "cached_read_tokens": { "type": "integer", "description": "Tokens served from the prompt cache (cache hit). These tokens are already included in prompt_tokens and are billed at the reduced cache-read rate. Populated for all providers that support prompt caching (Anthropic, Bedrock, OpenAI, Gemini, xAI, etc.).\n" }, "cached_write_tokens": { "type": "integer", "description": "Tokens written to the prompt cache on this request (cache creation / write). These tokens are already included in prompt_tokens and are billed at the cache-creation rate. Populated for providers that separately report cache write tokens (Anthropic, Bedrock).\n" } } }, "ChatCompletionTokensDetails": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "accepted_prediction_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "citation_tokens": { "type": "integer" }, "num_search_queries": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "rejected_prediction_tokens": { "type": "integer" } } }, "BifrostCost": { "type": "object", "description": "Cost breakdown for the request", "properties": { "input_tokens_cost": { "type": "number" }, "output_tokens_cost": { "type": "number" }, "reasoning_tokens_cost": { "type": "number", "description": "Cost for reasoning/thinking tokens (reasoning models)" }, "citation_tokens_cost": { "type": "number", "description": "Cost for citation tokens" }, "search_queries_cost": { "type": "number", "description": "Cost for web search queries" }, "request_cost": { "type": "number" }, "total_cost": { "type": "number" } } }, "ListModelsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Model" } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" }, "next_page_token": { "type": "string" } } }, "Model": { "type": "object", "properties": { "id": { "type": "string", "description": "Model ID in provider/model format" }, "canonical_slug": { "type": "string" }, "name": { "type": "string" }, "deployment": { "type": "string" }, "created": { "type": "integer", "format": "int64" }, "context_length": { "type": "integer" }, "max_input_tokens": { "type": "integer" }, "max_output_tokens": { "type": "integer" }, "architecture": { "type": "object", "properties": { "modality": { "type": "string" }, "tokenizer": { "type": "string" }, "instruct_type": { "type": "string" }, "input_modalities": { "type": "array", "items": { "type": "string" } }, "output_modalities": { "type": "array", "items": { "type": "string" } } } }, "pricing": { "type": "object", "properties": { "prompt": { "type": "string" }, "completion": { "type": "string" }, "request": { "type": "string" }, "image": { "type": "string" }, "web_search": { "type": "string" }, "internal_reasoning": { "type": "string" }, "input_cache_read": { "type": "string" }, "input_cache_write": { "type": "string" } } }, "top_provider": { "type": "object", "properties": { "is_moderated": { "type": "boolean" }, "context_length": { "type": "integer" }, "max_completion_tokens": { "type": "integer" } } }, "per_request_limits": { "type": "object", "properties": { "prompt_tokens": { "type": "integer" }, "completion_tokens": { "type": "integer" } } }, "supported_parameters": { "type": "array", "items": { "type": "string" } }, "default_parameters": { "type": "object", "properties": { "temperature": { "type": "number" }, "top_p": { "type": "number" }, "frequency_penalty": { "type": "number" } } }, "hugging_face_id": { "type": "string" }, "description": { "type": "string" }, "owned_by": { "type": "string" }, "supported_methods": { "type": "array", "items": { "type": "string" } } } }, "ChatCompletionRequest": { "type": "object", "required": [ "model", "messages" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format (e.g., openai/gpt-4)", "example": "openai/gpt-4" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessage" }, "description": "List of messages in the conversation" }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback models in provider/model format" }, "stream": { "type": "boolean", "description": "Whether to stream the response" }, "frequency_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "logit_bias": { "type": "object", "additionalProperties": { "type": "number" } }, "logprobs": { "type": "boolean" }, "max_completion_tokens": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": true }, "modalities": { "type": "array", "items": { "type": "string" } }, "parallel_tool_calls": { "type": "boolean" }, "presence_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "prompt_cache_key": { "type": "string" }, "reasoning": { "type": "object", "properties": { "effort": { "type": "string", "description": "Reasoning effort level", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ] }, "max_tokens": { "type": "integer" } } }, "response_format": { "type": "object", "description": "Format for the response" }, "safety_identifier": { "type": "string" }, "service_tier": { "type": "string" }, "stream_options": { "type": "object", "properties": { "include_obfuscation": { "type": "boolean" }, "include_usage": { "type": "boolean" } } }, "store": { "type": "boolean" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "tool_choice": { "oneOf": [ { "type": "string", "enum": [ "none", "auto", "required" ] }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "none", "any", "required", "function", "allowed_tools", "custom" ] }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "allowed_tools": { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "auto", "required" ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } } } } } } } } } ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "custom" ] }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" } } }, "custom": { "type": "object", "properties": { "format": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "grammar": { "type": "object", "required": [ "definition", "syntax" ], "properties": { "definition": { "type": "string" }, "syntax": { "type": "string", "enum": [ "lark", "regex" ] } } } } } } }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } }, "seed": { "type": "integer", "description": "Deterministic sampling seed" }, "top_p": { "type": "number", "minimum": 0, "maximum": 1, "description": "Nucleus sampling parameter" }, "top_logprobs": { "type": "integer", "minimum": 0, "maximum": 20, "description": "Number of most likely tokens to return at each position" }, "stop": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Up to 4 sequences where the API will stop generating tokens" }, "prediction": { "type": "object", "description": "Predicted output content for the model to reference (OpenAI only). Can reduce latency.", "properties": { "type": { "type": "string", "description": "Always \"content\"" }, "content": { "description": "Predicted content (string or array of content parts)", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "additionalProperties": true } } ] } } }, "prompt_cache_retention": { "type": "string", "enum": [ "in-memory", "24h" ], "description": "Prompt cache retention policy" }, "web_search_options": { "type": "object", "description": "Web search options for chat completions (OpenAI only)", "properties": { "search_context_size": { "type": "string", "enum": [ "low", "medium", "high" ], "description": "Amount of search context to include" }, "user_location": { "type": "object", "properties": { "type": { "type": "string", "description": "Location type (e.g., \"approximate\")" }, "approximate": { "type": "object", "properties": { "city": { "type": "string" }, "country": { "type": "string", "description": "Two-letter ISO country code (e.g., \"US\")" }, "region": { "type": "string", "description": "Region or state (e.g., \"California\")" }, "timezone": { "type": "string", "description": "IANA timezone (e.g., \"America/Los_Angeles\")" } } } } } } }, "truncation": { "type": "string" }, "user": { "type": "string" }, "verbosity": { "type": "string", "enum": [ "low", "medium", "high" ] } } }, "ChatCompletionResponse": { "type": "object", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "service_tier": { "type": "string" }, "system_fingerprint": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" }, "search_results": { "type": "array", "items": { "$ref": "#/components/schemas/PerplexitySearchResult" } }, "videos": { "type": "array", "items": { "$ref": "#/components/schemas/PerplexityVideoResult" } }, "citations": { "type": "array", "items": { "type": "string" } } } }, "ChatMessage": { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "assistant", "user", "system", "tool", "developer" ] }, "name": { "type": "string" }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "input_audio", "file", "refusal" ] }, "text": { "type": "string" }, "refusal": { "type": "string" }, "image_url": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string" }, "detail": { "type": "string", "enum": [ "low", "high", "auto" ] } } }, "input_audio": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "string" }, "format": { "type": "string" } } }, "file": { "type": "object", "properties": { "file_data": { "type": "string" }, "file_id": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" } } }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ], "description": "Message content - can be a string or array of content blocks" }, "tool_call_id": { "type": "string", "description": "For tool messages" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "url_citation": { "type": "object", "properties": { "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "title": { "type": "string" }, "url": { "type": "string" }, "sources": { "type": "object" }, "type": { "type": "string" } } } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } } }, "PerplexitySearchResult": { "type": "object", "description": "Search result from Perplexity AI search", "properties": { "title": { "type": "string" }, "url": { "type": "string" }, "date": { "type": "string" }, "last_updated": { "type": "string" }, "snippet": { "type": "string" }, "source": { "type": "string" } } }, "PerplexityVideoResult": { "type": "object", "properties": { "url": { "type": "string" }, "thumbnail_url": { "type": "string" }, "thumbnail_width": { "type": "integer" }, "thumbnail_height": { "type": "integer" }, "duration": { "type": "number" } } }, "TextCompletionRequest": { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "prompt": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Prompt input - can be a string or array of strings" }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "stream": { "type": "boolean" }, "best_of": { "type": "integer" }, "echo": { "type": "boolean" }, "frequency_penalty": { "type": "number" }, "logit_bias": { "type": "object", "additionalProperties": { "type": "number" } }, "logprobs": { "type": "integer" }, "max_tokens": { "type": "integer" }, "n": { "type": "integer" }, "presence_penalty": { "type": "number" }, "seed": { "type": "integer" }, "stop": { "type": "array", "items": { "type": "string" } }, "suffix": { "type": "string" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "user": { "type": "string" } } }, "TextCompletionResponse": { "type": "object", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "finish_reason": { "type": "string" }, "log_probs": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } }, "text_offset": { "type": "array", "items": { "type": "integer" } }, "token_logprobs": { "type": "array", "items": { "type": "number" } }, "tokens": { "type": "array", "items": { "type": "string" } }, "top_logprobs": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } }, "text": { "type": "string", "description": "For text completions" }, "message": { "$ref": "#/components/schemas/ChatMessage", "description": "For non-streaming chat completions" }, "delta": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "string" }, "refusal": { "type": "string" }, "audio": { "type": "object", "properties": { "id": { "type": "string" }, "data": { "type": "string" }, "expires_at": { "type": "integer" }, "transcript": { "type": "string" } } }, "reasoning": { "type": "string" }, "reasoning_details": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string", "enum": [ "reasoning.summary", "reasoning.encrypted", "reasoning.text" ] }, "summary": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "data": { "type": "string" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } }, "description": "For streaming chat completions" } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "system_fingerprint": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "ResponsesRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "input": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } } ], "description": "Input - can be a string or array of messages" }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "stream": { "type": "boolean" }, "background": { "type": "boolean" }, "conversation": { "type": "string" }, "include": { "type": "array", "items": { "type": "string" } }, "instructions": { "type": "string" }, "max_output_tokens": { "type": "integer" }, "max_tool_calls": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": true }, "parallel_tool_calls": { "type": "boolean" }, "previous_response_id": { "type": "string" }, "prompt_cache_key": { "type": "string" }, "reasoning": { "type": "object", "properties": { "effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ] }, "generate_summary": { "type": "string", "deprecated": true }, "summary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] }, "max_tokens": { "type": "integer" } } }, "safety_identifier": { "type": "string" }, "service_tier": { "type": "string" }, "stream_options": { "type": "object", "properties": { "include_obfuscation": { "type": "boolean" } } }, "store": { "type": "boolean" }, "temperature": { "type": "number" }, "text": { "type": "object", "properties": { "format": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "json_schema", "json_object" ] }, "name": { "type": "string" }, "schema": { "type": "object" }, "strict": { "type": "boolean" } } }, "verbosity": { "type": "string", "enum": [ "low", "medium", "high" ] } } }, "top_logprobs": { "type": "integer" }, "top_p": { "type": "number" }, "tool_choice": { "oneOf": [ { "type": "string", "enum": [ "none", "auto", "required" ] }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "none", "auto", "any", "required", "function", "allowed_tools", "file_search", "web_search_preview", "computer_use_preview", "code_interpreter", "image_generation", "mcp", "custom" ] }, "mode": { "type": "string" }, "name": { "type": "string" }, "server_label": { "type": "string" }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "mcp", "image_generation" ] }, "name": { "type": "string" }, "server_label": { "type": "string" } } } } } } ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "file_search", "computer_use_preview", "web_search", "web_fetch", "mcp", "code_interpreter", "image_generation", "local_shell", "custom", "web_search_preview", "memory", "tool_search" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" }, "vector_store_ids": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "object" }, "max_num_results": { "type": "integer" }, "ranking_options": { "type": "object" }, "display_height": { "type": "integer" }, "display_width": { "type": "integer" }, "environment": { "type": "string" }, "enable_zoom": { "type": "boolean" }, "search_context_size": { "type": "string" }, "user_location": { "type": "object" }, "server_label": { "type": "string" }, "server_url": { "type": "string" }, "allowed_tools": { "type": "object" }, "authorization": { "type": "string" }, "connector_id": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "require_approval": { "type": "object" }, "server_description": { "type": "string" }, "container": { "type": "object" }, "background": { "type": "string" }, "input_fidelity": { "type": "string" }, "input_image_mask": { "type": "object" }, "moderation": { "type": "string" }, "output_compression": { "type": "integer" }, "output_format": { "type": "string" }, "partial_images": { "type": "integer" }, "quality": { "type": "string" }, "size": { "type": "string" }, "format": { "type": "object" } } } }, "truncation": { "type": "string" } } }, "ResponsesResponse": { "type": "object", "properties": { "id": { "type": "string" }, "background": { "type": "boolean" }, "conversation": { "type": "object" }, "created_at": { "type": "integer" }, "error": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "include": { "type": "array", "items": { "type": "string" } }, "incomplete_details": { "type": "object", "required": [ "reason" ], "properties": { "reason": { "type": "string" } } }, "instructions": { "type": "object" }, "max_output_tokens": { "type": "integer" }, "max_tool_calls": { "type": "integer" }, "metadata": { "type": "object" }, "model": { "type": "string" }, "output": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } }, "parallel_tool_calls": { "type": "boolean" }, "previous_response_id": { "type": "string" }, "prompt": { "type": "object" }, "prompt_cache_key": { "type": "string" }, "reasoning": { "type": "object", "properties": { "effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ] }, "generate_summary": { "type": "string", "deprecated": true }, "summary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] }, "max_tokens": { "type": "integer" } } }, "safety_identifier": { "type": "string" }, "service_tier": { "type": "string" }, "status": { "type": "string", "enum": [ "completed", "failed", "in_progress", "canceled", "queued", "incomplete" ] }, "stop_reason": { "type": "string" }, "store": { "type": "boolean" }, "temperature": { "type": "number" }, "text": { "type": "object", "properties": { "format": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "json_schema", "json_object" ] }, "name": { "type": "string" }, "schema": { "type": "object" }, "strict": { "type": "boolean" } } }, "verbosity": { "type": "string", "enum": [ "low", "medium", "high" ] } } }, "top_logprobs": { "type": "integer" }, "top_p": { "type": "number" }, "tool_choice": { "oneOf": [ { "type": "string", "enum": [ "none", "auto", "required" ] }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "none", "auto", "any", "required", "function", "allowed_tools", "file_search", "web_search_preview", "computer_use_preview", "code_interpreter", "image_generation", "mcp", "custom" ] }, "mode": { "type": "string" }, "name": { "type": "string" }, "server_label": { "type": "string" }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "mcp", "image_generation" ] }, "name": { "type": "string" }, "server_label": { "type": "string" } } } } } } ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "file_search", "computer_use_preview", "web_search", "web_fetch", "mcp", "code_interpreter", "image_generation", "local_shell", "custom", "web_search_preview", "memory", "tool_search" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" }, "vector_store_ids": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "object" }, "max_num_results": { "type": "integer" }, "ranking_options": { "type": "object" }, "display_height": { "type": "integer" }, "display_width": { "type": "integer" }, "environment": { "type": "string" }, "enable_zoom": { "type": "boolean" }, "search_context_size": { "type": "string" }, "user_location": { "type": "object" }, "server_label": { "type": "string" }, "server_url": { "type": "string" }, "allowed_tools": { "type": "object" }, "authorization": { "type": "string" }, "connector_id": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "require_approval": { "type": "object" }, "server_description": { "type": "string" }, "container": { "type": "object" }, "background": { "type": "string" }, "input_fidelity": { "type": "string" }, "input_image_mask": { "type": "object" }, "moderation": { "type": "string" }, "output_compression": { "type": "integer" }, "output_format": { "type": "string" }, "partial_images": { "type": "integer" }, "quality": { "type": "string" }, "size": { "type": "string" }, "format": { "type": "object" } } } }, "truncation": { "type": "string" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "input_tokens_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "cached_read_tokens": { "type": "integer", "description": "Tokens served from the prompt cache (cache hit), billed at the reduced cache-read rate. Already included in the parent input_tokens total.\n" }, "cached_write_tokens": { "type": "integer", "description": "Tokens written to the prompt cache on this request, billed at the cache-creation rate. Already included in the parent input_tokens total. Populated for providers that separately report cache write tokens (Anthropic, Bedrock).\n" } } }, "output_tokens": { "type": "integer" }, "output_tokens_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "accepted_prediction_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "rejected_prediction_tokens": { "type": "integer" }, "citation_tokens": { "type": "integer" }, "num_search_queries": { "type": "integer" } } }, "total_tokens": { "type": "integer" }, "cost": { "$ref": "#/components/schemas/BifrostCost" } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" }, "search_results": { "type": "array", "items": { "$ref": "#/components/schemas/PerplexitySearchResult" } }, "videos": { "type": "array", "items": { "$ref": "#/components/schemas/PerplexityVideoResult" } }, "citations": { "type": "array", "items": { "type": "string" } } } }, "RerankRequest": { "type": "object", "required": [ "model", "query", "documents" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format", "example": "cohere/rerank-v3.5" }, "query": { "type": "string", "minLength": 1, "description": "Query used to score and reorder documents" }, "documents": { "type": "array", "description": "Documents to rerank", "minItems": 1, "items": { "$ref": "#/components/schemas/RerankDocument" } }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback models in provider/model format" }, "top_n": { "type": "integer", "minimum": 1, "description": "Maximum number of ranked results to return" }, "max_tokens_per_doc": { "type": "integer", "minimum": 1, "description": "Maximum tokens to consider per document (provider-dependent)" }, "priority": { "type": "integer", "description": "Request priority hint (provider-dependent)" }, "return_documents": { "type": "boolean", "description": "Whether to include document content in each result" } } }, "RerankResponse": { "type": "object", "required": [ "results", "model" ], "properties": { "id": { "type": "string", "description": "Unique identifier for the rerank response" }, "results": { "type": "array", "description": "Ranked results ordered by relevance score descending", "items": { "$ref": "#/components/schemas/RerankResult" } }, "model": { "type": "string", "description": "Model used to perform reranking" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "RerankDocument": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "minLength": 1, "description": "Document text content" }, "id": { "type": "string", "minLength": 1, "description": "Optional document identifier" }, "meta": { "type": "object", "description": "Optional document metadata", "additionalProperties": true } } }, "RerankResult": { "type": "object", "required": [ "index", "relevance_score" ], "properties": { "index": { "type": "integer", "minimum": 0, "description": "Index into the original documents array" }, "relevance_score": { "type": "number", "description": "Relevance score for this document" }, "document": { "$ref": "#/components/schemas/RerankDocument" } } }, "EmbeddingRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "input": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "array", "items": { "type": "integer" } }, { "type": "array", "items": { "type": "array", "items": { "type": "integer" } } } ], "description": "Input for embedding - text or token arrays" }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "encoding_format": { "type": "string", "enum": [ "float", "base64" ] }, "dimensions": { "type": "integer" } } }, "EmbeddingResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "integer" }, "object": { "type": "string" }, "embedding": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "number" } }, { "type": "array", "items": { "type": "array", "items": { "type": "number" } } } ] } } } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "SpeechRequest": { "type": "object", "required": [ "model", "input", "voice" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "input": { "type": "string", "description": "Text to convert to speech" }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "stream_format": { "type": "string", "enum": [ "sse" ], "description": "Set to \"sse\" to enable streaming" }, "voice": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "speaker", "voice" ], "properties": { "speaker": { "type": "string" }, "voice": { "type": "string" } } } } ] }, "instructions": { "type": "string" }, "response_format": { "type": "string", "enum": [ "mp3", "opus", "aac", "flac", "wav", "pcm" ] }, "speed": { "type": "number", "minimum": 0.25, "maximum": 4.0 }, "language_code": { "type": "string" }, "pronunciation_dictionary_locators": { "type": "array", "items": { "type": "object", "required": [ "pronunciation_dictionary_id" ], "properties": { "pronunciation_dictionary_id": { "type": "string" }, "version_id": { "type": "string" } } } }, "enable_logging": { "type": "boolean" }, "optimize_streaming_latency": { "type": "boolean" }, "with_timestamps": { "type": "boolean" } } }, "SpeechResponse": { "type": "object", "properties": { "audio": { "type": "string", "format": "byte", "description": "Audio data (binary)" }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "alignment": { "type": "object", "properties": { "char_start_times_ms": { "type": "array", "items": { "type": "number" } }, "char_end_times_ms": { "type": "array", "items": { "type": "number" } }, "characters": { "type": "array", "items": { "type": "string" } } } }, "normalized_alignment": { "type": "object", "properties": { "char_start_times_ms": { "type": "array", "items": { "type": "number" } }, "char_end_times_ms": { "type": "array", "items": { "type": "number" } }, "characters": { "type": "array", "items": { "type": "string" } } } }, "audio_base64": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "TranscriptionRequest": { "type": "object", "required": [ "model", "file" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "file": { "type": "string", "format": "binary", "description": "Audio file to transcribe" }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "stream": { "type": "boolean" }, "language": { "type": "string" }, "prompt": { "type": "string" }, "response_format": { "type": "string", "enum": [ "json", "text", "srt", "verbose_json", "vtt" ] }, "file_format": { "type": "string" } } }, "TranscriptionResponse": { "type": "object", "properties": { "duration": { "type": "number" }, "language": { "type": "string" }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string" }, "logprob": { "type": "number" }, "bytes": { "type": "array", "items": { "type": "integer" } } } } }, "segments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "seek": { "type": "integer" }, "start": { "type": "number" }, "end": { "type": "number" }, "text": { "type": "string" }, "tokens": { "type": "array", "items": { "type": "integer" } }, "temperature": { "type": "number" }, "avg_logprob": { "type": "number" }, "compression_ratio": { "type": "number" }, "no_speech_prob": { "type": "number" } } } }, "task": { "type": "string" }, "text": { "type": "string" }, "usage": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "tokens", "duration" ] }, "input_tokens": { "type": "integer" }, "input_token_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" } } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "seconds": { "type": "integer" } } }, "words": { "type": "array", "items": { "type": "object", "properties": { "word": { "type": "string" }, "start": { "type": "number" }, "end": { "type": "number" } } } }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "CountTokensRequest": { "type": "object", "required": [ "model", "messages" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "messages": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "file_search", "computer_use_preview", "web_search", "web_fetch", "mcp", "code_interpreter", "image_generation", "local_shell", "custom", "web_search_preview", "memory", "tool_search" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" }, "vector_store_ids": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "object" }, "max_num_results": { "type": "integer" }, "ranking_options": { "type": "object" }, "display_height": { "type": "integer" }, "display_width": { "type": "integer" }, "environment": { "type": "string" }, "enable_zoom": { "type": "boolean" }, "search_context_size": { "type": "string" }, "user_location": { "type": "object" }, "server_label": { "type": "string" }, "server_url": { "type": "string" }, "allowed_tools": { "type": "object" }, "authorization": { "type": "string" }, "connector_id": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "require_approval": { "type": "object" }, "server_description": { "type": "string" }, "container": { "type": "object" }, "background": { "type": "string" }, "input_fidelity": { "type": "string" }, "input_image_mask": { "type": "object" }, "moderation": { "type": "string" }, "output_compression": { "type": "integer" }, "output_format": { "type": "string" }, "partial_images": { "type": "integer" }, "quality": { "type": "string" }, "size": { "type": "string" }, "format": { "type": "object" } } } }, "instructions": { "type": "string" }, "text": { "type": "string" } } }, "CountTokensResponse": { "type": "object", "properties": { "object": { "type": "string" }, "model": { "type": "string" }, "input_tokens": { "type": "integer" }, "input_tokens_details": { "type": "object", "properties": { "text_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "cached_read_tokens": { "type": "integer", "description": "Tokens served from the prompt cache (cache hit), billed at the reduced cache-read rate. Already included in the parent input_tokens total.\n" }, "cached_write_tokens": { "type": "integer", "description": "Tokens written to the prompt cache on this request, billed at the cache-creation rate. Already included in the parent input_tokens total. Populated for providers that separately report cache write tokens (Anthropic, Bedrock).\n" } } }, "tokens": { "type": "array", "items": { "type": "integer" } }, "token_strings": { "type": "array", "items": { "type": "string" } }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "BatchCreateRequest": { "type": "object", "required": [ "model" ], "properties": { "model": { "type": "string", "description": "Model in provider/model format" }, "input_file_id": { "type": "string", "description": "OpenAI-style file ID" }, "requests": { "type": "array", "items": { "type": "object", "required": [ "custom_id" ], "properties": { "custom_id": { "type": "string" }, "method": { "type": "string" }, "url": { "type": "string" }, "body": { "type": "object" }, "params": { "type": "object" } } }, "description": "Anthropic-style inline requests" }, "endpoint": { "type": "string", "enum": [ "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/responses", "/v1/messages" ] }, "completion_window": { "type": "string", "description": "e.g., \"24h\"" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } } } }, "BatchCreateResponse": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "endpoint": { "type": "string" }, "input_file_id": { "type": "string" }, "completion_window": { "type": "string" }, "status": { "type": "string", "enum": [ "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "canceled", "ended" ] }, "request_counts": { "type": "object", "properties": { "total": { "type": "integer" }, "completed": { "type": "integer" }, "failed": { "type": "integer" }, "succeeded": { "type": "integer" }, "expired": { "type": "integer" }, "canceled": { "type": "integer" }, "pending": { "type": "integer" } } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "created_at": { "type": "integer", "format": "int64" }, "expires_at": { "type": "integer", "format": "int64" }, "output_file_id": { "type": "string" }, "error_file_id": { "type": "string" }, "processing_status": { "type": "string" }, "results_url": { "type": "string" }, "operation_name": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "BatchListResponse": { "type": "object", "properties": { "object": { "type": "string" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/BatchRetrieveResponse" } }, "first_id": { "type": "string" }, "last_id": { "type": "string" }, "has_more": { "type": "boolean" }, "next_cursor": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "BatchRetrieveResponse": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "endpoint": { "type": "string" }, "input_file_id": { "type": "string" }, "completion_window": { "type": "string" }, "status": { "type": "string", "enum": [ "validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "canceled", "ended" ] }, "request_counts": { "type": "object", "properties": { "total": { "type": "integer" }, "completed": { "type": "integer" }, "failed": { "type": "integer" }, "succeeded": { "type": "integer" }, "expired": { "type": "integer" }, "canceled": { "type": "integer" }, "pending": { "type": "integer" } } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "created_at": { "type": "integer", "format": "int64" }, "expires_at": { "type": "integer", "format": "int64" }, "in_progress_at": { "type": "integer", "format": "int64" }, "finalizing_at": { "type": "integer", "format": "int64" }, "completed_at": { "type": "integer", "format": "int64" }, "failed_at": { "type": "integer", "format": "int64" }, "expired_at": { "type": "integer", "format": "int64" }, "cancelling_at": { "type": "integer", "format": "int64" }, "cancelled_at": { "type": "integer", "format": "int64" }, "output_file_id": { "type": "string" }, "error_file_id": { "type": "string" }, "errors": { "type": "object", "properties": { "object": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "line": { "type": "integer" } } } } } }, "processing_status": { "type": "string" }, "results_url": { "type": "string" }, "archived_at": { "type": "integer", "format": "int64" }, "operation_name": { "type": "string" }, "done": { "type": "boolean" }, "progress": { "type": "integer" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "FileUploadRequest": { "type": "object", "required": [ "file", "purpose" ], "properties": { "file": { "type": "string", "format": "binary" }, "purpose": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] }, "provider": { "$ref": "#/components/schemas/ModelProvider" } } }, "FileUploadResponse": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "bytes": { "type": "integer", "format": "int64" }, "created_at": { "type": "integer", "format": "int64" }, "filename": { "type": "string" }, "purpose": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] }, "status": { "type": "string", "enum": [ "uploaded", "processed", "processing", "error", "deleted" ] }, "status_details": { "type": "string" }, "expires_at": { "type": "integer", "format": "int64" }, "storage_backend": { "type": "string" }, "storage_uri": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "FileListResponse": { "type": "object", "properties": { "object": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" }, "bytes": { "type": "integer", "format": "int64" }, "created_at": { "type": "integer", "format": "int64" }, "filename": { "type": "string" }, "purpose": { "type": "string", "enum": [ "batch", "assistants", "fine-tune", "vision", "batch_output", "user_data", "responses", "evals" ] }, "status": { "type": "string", "enum": [ "uploaded", "processed", "processing", "error", "deleted" ] }, "status_details": { "type": "string" }, "expires_at": { "type": "integer", "format": "int64" } } } }, "has_more": { "type": "boolean" }, "after": { "type": "string" }, "extra_fields": { "$ref": "#/components/schemas/BifrostResponseExtraFields" } } }, "OpenAIChatRequest": { "type": "object", "required": [ "model", "messages" ], "properties": { "model": { "type": "string", "description": "Model identifier (e.g., gpt-4, gpt-3.5-turbo)", "example": "gpt-4" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/OpenAIMessage" }, "description": "List of messages in the conversation" }, "stream": { "type": "boolean", "description": "Whether to stream the response" }, "max_tokens": { "type": "integer", "description": "Maximum tokens to generate (legacy, use max_completion_tokens)" }, "max_completion_tokens": { "type": "integer", "description": "Maximum tokens to generate" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "type": "number" }, "frequency_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "presence_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "logit_bias": { "type": "object", "additionalProperties": { "type": "number" } }, "logprobs": { "type": "boolean" }, "top_logprobs": { "type": "integer" }, "n": { "type": "integer" }, "stop": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "seed": { "type": "integer" }, "user": { "type": "string" }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "custom" ] }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" } } }, "custom": { "type": "object", "properties": { "format": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "grammar": { "type": "object", "required": [ "definition", "syntax" ], "properties": { "definition": { "type": "string" }, "syntax": { "type": "string", "enum": [ "lark", "regex" ] } } } } } } }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } }, "tool_choice": { "oneOf": [ { "type": "string", "enum": [ "none", "auto", "required" ] }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "none", "any", "required", "function", "allowed_tools", "custom" ] }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } }, "allowed_tools": { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "auto", "required" ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" } } } } } } } } } } ] }, "parallel_tool_calls": { "type": "boolean" }, "response_format": { "type": "object", "description": "Format for the response" }, "reasoning_effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ], "description": "OpenAI reasoning effort level" }, "service_tier": { "type": "string" }, "stream_options": { "type": "object", "properties": { "include_obfuscation": { "type": "boolean" }, "include_usage": { "type": "boolean" } } }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback models" } } }, "OpenAIMessage": { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "tool", "developer" ] }, "name": { "type": "string" }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "input_audio", "file", "refusal" ] }, "text": { "type": "string" }, "refusal": { "type": "string" }, "image_url": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string" }, "detail": { "type": "string", "enum": [ "low", "high", "auto" ] } } }, "input_audio": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "string" }, "format": { "type": "string" } } }, "file": { "type": "object", "properties": { "file_data": { "type": "string" }, "file_id": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" } } }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ], "description": "Message content - can be a string or array of content blocks" }, "tool_call_id": { "type": "string", "description": "For tool messages" }, "refusal": { "type": "string" }, "reasoning": { "type": "string" }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "url_citation": { "type": "object", "properties": { "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "title": { "type": "string" }, "url": { "type": "string" }, "sources": { "type": "object" }, "type": { "type": "string" } } } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } } } }, "OpenAITextCompletionRequest": { "type": "object", "required": [ "model", "prompt" ], "properties": { "model": { "type": "string", "description": "Model identifier", "example": "gpt-3.5-turbo-instruct" }, "prompt": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "The prompt(s) to generate completions for" }, "stream": { "type": "boolean", "description": "Whether to stream the response" }, "max_tokens": { "type": "integer" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "type": "number" }, "frequency_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "presence_penalty": { "type": "number", "minimum": -2.0, "maximum": 2.0 }, "logit_bias": { "type": "object", "additionalProperties": { "type": "number" } }, "logprobs": { "type": "integer" }, "n": { "type": "integer" }, "stop": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "suffix": { "type": "string" }, "echo": { "type": "boolean" }, "best_of": { "type": "integer" }, "user": { "type": "string" }, "seed": { "type": "integer" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "OpenAIResponsesRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "model": { "type": "string", "description": "Model identifier", "example": "gpt-4" }, "input": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } } ], "description": "Input - can be a string or array of messages" }, "stream": { "type": "boolean" }, "instructions": { "type": "string", "description": "System instructions for the model" }, "max_output_tokens": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": true }, "parallel_tool_calls": { "type": "boolean" }, "previous_response_id": { "type": "string" }, "reasoning": { "type": "object", "properties": { "effort": { "type": "string", "enum": [ "none", "minimal", "low", "medium", "high", "xhigh" ] }, "generate_summary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] }, "summary": { "type": "string", "enum": [ "auto", "concise", "detailed" ] }, "max_tokens": { "type": "integer" } } }, "store": { "type": "boolean" }, "temperature": { "type": "number", "minimum": 0, "maximum": 2 }, "text": { "type": "object", "properties": { "format": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "json_object", "json_schema" ] }, "json_schema": { "type": "object", "properties": { "name": { "type": "string" }, "schema": { "type": "object" }, "strict": { "type": "boolean" } } } } } } }, "tool_choice": { "oneOf": [ { "type": "string", "enum": [ "none", "auto", "required" ] }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "none", "auto", "any", "required", "function", "allowed_tools", "file_search", "web_search_preview", "computer_use_preview", "code_interpreter", "image_generation", "mcp", "custom" ] }, "mode": { "type": "string" }, "name": { "type": "string" }, "server_label": { "type": "string" }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "mcp", "image_generation" ] }, "name": { "type": "string" }, "server_label": { "type": "string" } } } } } } ] }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "file_search", "computer_use_preview", "web_search", "web_fetch", "mcp", "code_interpreter", "image_generation", "local_shell", "custom", "web_search_preview", "memory", "tool_search" ] }, "name": { "type": "string" }, "description": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" }, "vector_store_ids": { "type": "array", "items": { "type": "string" } }, "filters": { "type": "object" }, "max_num_results": { "type": "integer" }, "ranking_options": { "type": "object" }, "display_height": { "type": "integer" }, "display_width": { "type": "integer" }, "environment": { "type": "string" }, "enable_zoom": { "type": "boolean" }, "search_context_size": { "type": "string" }, "user_location": { "type": "object" }, "server_label": { "type": "string" }, "server_url": { "type": "string" }, "allowed_tools": { "type": "object" }, "authorization": { "type": "string" }, "connector_id": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "require_approval": { "type": "object" }, "server_description": { "type": "string" }, "container": { "type": "object" }, "background": { "type": "string" }, "input_fidelity": { "type": "string" }, "input_image_mask": { "type": "object" }, "moderation": { "type": "string" }, "output_compression": { "type": "integer" }, "output_format": { "type": "string" }, "partial_images": { "type": "integer" }, "quality": { "type": "string" }, "size": { "type": "string" }, "format": { "type": "object" } } } }, "top_p": { "type": "number" }, "truncation": { "type": "string", "enum": [ "auto", "disabled" ] }, "user": { "type": "string" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "OpenAIEmbeddingRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "model": { "type": "string", "description": "Model identifier", "example": "text-embedding-3-small" }, "input": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Input text to embed" }, "encoding_format": { "type": "string", "enum": [ "float", "base64" ] }, "dimensions": { "type": "integer", "description": "Number of dimensions for the embedding" }, "user": { "type": "string" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "OpenAISpeechRequest": { "type": "object", "required": [ "model", "input" ], "properties": { "model": { "type": "string", "description": "Model identifier (e.g., tts-1, tts-1-hd)", "example": "tts-1" }, "input": { "type": "string", "description": "Text to convert to speech" }, "voice": { "type": "string", "description": "Voice to use", "enum": [ "alloy", "echo", "fable", "onyx", "nova", "shimmer" ] }, "response_format": { "type": "string", "enum": [ "mp3", "opus", "aac", "flac", "wav", "pcm" ] }, "speed": { "type": "number", "minimum": 0.25, "maximum": 4.0 }, "stream_format": { "type": "string", "enum": [ "sse" ], "description": "Set to 'sse' for streaming" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "OpenAITranscriptionRequest": { "type": "object", "required": [ "model", "file" ], "properties": { "model": { "type": "string", "description": "Model identifier (e.g., whisper-1)", "example": "whisper-1" }, "file": { "type": "string", "format": "binary", "description": "Audio file to transcribe" }, "language": { "type": "string", "description": "Language of the audio (ISO 639-1)" }, "prompt": { "type": "string", "description": "Prompt to guide transcription" }, "response_format": { "type": "string", "enum": [ "json", "text", "srt", "verbose_json", "vtt" ] }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "timestamp_granularities": { "type": "array", "items": { "type": "string", "enum": [ "word", "segment" ] } }, "stream": { "type": "boolean" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "OpenAIListModelsResponse": { "type": "object", "properties": { "object": { "type": "string", "default": "list" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Model identifier" }, "object": { "type": "string", "default": "model" }, "owned_by": { "type": "string" }, "created": { "type": "integer", "format": "int64" }, "active": { "type": "boolean", "description": "GROQ-specific field" }, "context_window": { "type": "integer", "description": "GROQ-specific field" } } } } } }, "AnthropicMessageRequest": { "type": "object", "required": [ "model", "max_tokens", "messages" ], "properties": { "model": { "type": "string", "description": "Model identifier (e.g., claude-3-opus-20240229)", "example": "claude-3-opus-20240229" }, "max_tokens": { "type": "integer", "description": "Maximum tokens to generate" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/AnthropicMessage" }, "description": "List of messages in the conversation" }, "system": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/components/schemas/AnthropicContentBlock" } } ], "description": "System prompt" }, "cache_control": { "$ref": "#/components/schemas/CacheControl", "description": "Automatic caching directives for the whole request" }, "metadata": { "type": "object", "properties": { "user_id": { "type": "string" } } }, "stream": { "type": "boolean", "description": "Whether to stream the response" }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "top_p": { "type": "number" }, "top_k": { "type": "integer" }, "stop_sequences": { "type": "array", "items": { "type": "string" } }, "tools": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "custom", "bash_20250124", "computer_20250124", "computer_20251124", "code_execution_20250522", "code_execution_20250825", "code_execution_20260120", "text_editor_20250124", "text_editor_20250429", "text_editor_20250728", "web_search_20250305", "web_search_20260209", "web_fetch_20250910", "web_fetch_20260209", "web_fetch_20260309", "memory_20250818", "tool_search_tool_bm25", "tool_search_tool_bm25_20251119", "tool_search_tool_regex", "tool_search_tool_regex_20251119" ] }, "name": { "type": "string", "description": "Tool name (for custom tools)" }, "description": { "type": "string" }, "input_schema": { "type": "object", "description": "JSON Schema for tool input" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "display_width_px": { "type": "integer" }, "display_height_px": { "type": "integer" }, "display_number": { "type": "integer" }, "enable_zoom": { "type": "boolean" }, "max_uses": { "type": "integer" }, "allowed_domains": { "type": "array", "items": { "type": "string" } }, "blocked_domains": { "type": "array", "items": { "type": "string" } }, "user_location": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "approximate" ] }, "city": { "type": "string" }, "country": { "type": "string" }, "timezone": { "type": "string" } } } } } }, "tool_choice": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "auto", "any", "tool", "none" ] }, "name": { "type": "string", "description": "Required when type is 'tool'" }, "disable_parallel_tool_use": { "type": "boolean" } } } ] }, "mcp_servers": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string" }, "authorization_token": { "type": "string", "description": "Authorization token for the MCP server" }, "tool_configuration": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "allowed_tools": { "type": "array", "items": { "type": "string" } } } } } }, "description": "MCP servers configuration (requires beta header)" }, "thinking": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "enabled", "disabled" ] }, "budget_tokens": { "type": "integer" } } }, "output_format": { "type": "object", "description": "Structured output format (requires beta header)" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "AnthropicMessage": { "type": "object", "required": [ "role", "content" ], "properties": { "role": { "type": "string", "enum": [ "user", "assistant" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/components/schemas/AnthropicContentBlock" } } ], "description": "Content - can be a string or array of content blocks" } } }, "AnthropicContentBlock": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image", "document", "tool_use", "server_tool_use", "tool_result", "web_search_result", "mcp_tool_use", "mcp_tool_result", "thinking", "redacted_thinking" ] }, "text": { "type": "string", "description": "For text content" }, "thinking": { "type": "string", "description": "For thinking content" }, "signature": { "type": "string", "description": "For signature content" }, "data": { "type": "string", "description": "For data content (encrypted data for redacted thinking)" }, "tool_use_id": { "type": "string", "description": "For tool_result content" }, "id": { "type": "string", "description": "For tool_use content" }, "name": { "type": "string", "description": "For tool_use content" }, "input": { "type": "object", "description": "For tool_use content" }, "server_name": { "type": "string", "description": "For mcp_tool_use content" }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "$ref": "#/components/schemas/AnthropicContentBlock" } } ], "description": "For tool_result content" }, "source": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "base64", "url", "text", "content_block" ] }, "media_type": { "type": "string", "description": "MIME type (e.g., image/jpeg, application/pdf)" }, "data": { "type": "string", "description": "Base64-encoded data (for base64 type)" }, "url": { "type": "string", "description": "URL (for url type)" } }, "description": "For image/document content" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" }, "citations": { "type": "object", "properties": { "enabled": { "type": "boolean" } }, "description": "For document content" }, "context": { "type": "string", "description": "For document content" }, "title": { "type": "string", "description": "For document content" } } }, "AnthropicMessageResponse": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "default": "message" }, "role": { "type": "string", "default": "assistant" }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/AnthropicContentBlock" } }, "model": { "type": "string" }, "stop_reason": { "type": "string", "enum": [ "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal", "model_context_window_exceeded", null ] }, "stop_sequence": { "type": "string", "nullable": true }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "cache_creation_input_tokens": { "type": "integer" }, "cache_read_input_tokens": { "type": "integer" }, "cache_creation": { "type": "object", "properties": { "ephemeral_5m_input_tokens": { "type": "integer" }, "ephemeral_1h_input_tokens": { "type": "integer" } } } } } } }, "AnthropicTextRequest": { "type": "object", "required": [ "model", "prompt", "max_tokens_to_sample" ], "properties": { "model": { "type": "string", "description": "Model identifier" }, "prompt": { "type": "string", "description": "The prompt to complete" }, "max_tokens_to_sample": { "type": "integer", "description": "Maximum tokens to generate" }, "stream": { "type": "boolean" }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "top_p": { "type": "number" }, "top_k": { "type": "integer" }, "stop_sequences": { "type": "array", "items": { "type": "string" } }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "AnthropicListModelsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Model identifier" }, "type": { "type": "string", "default": "model" }, "display_name": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" } } } }, "has_more": { "type": "boolean" }, "first_id": { "type": "string" }, "last_id": { "type": "string" } } }, "GeminiSchema": { "type": "object", "description": "Schema object for defining input/output data types (OpenAPI 3.0 subset)", "properties": { "type": { "type": "string", "enum": [ "TYPE_UNSPECIFIED", "STRING", "NUMBER", "INTEGER", "BOOLEAN", "ARRAY", "OBJECT", "NULL" ], "description": "The type of the data" }, "format": { "type": "string", "description": "Format of the data (e.g., float, double, int32, int64, email, byte)" }, "title": { "type": "string", "description": "The title of the Schema" }, "description": { "type": "string", "description": "The description of the data" }, "nullable": { "type": "boolean", "description": "Indicates if the value may be null" }, "enum": { "type": "array", "items": { "type": "string" }, "description": "Possible values for primitive types with enum format" }, "properties": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/GeminiSchema" }, "description": "Properties of Type.OBJECT" }, "required": { "type": "array", "items": { "type": "string" }, "description": "Required properties of Type.OBJECT" }, "items": { "$ref": "#/components/schemas/GeminiSchema", "description": "Schema of the elements of Type.ARRAY" }, "minItems": { "type": "integer", "description": "Minimum number of elements for Type.ARRAY" }, "maxItems": { "type": "integer", "description": "Maximum number of elements for Type.ARRAY" }, "minLength": { "type": "integer", "description": "Minimum length of Type.STRING" }, "maxLength": { "type": "integer", "description": "Maximum length of Type.STRING" }, "minimum": { "type": "number", "description": "Minimum value of Type.INTEGER and Type.NUMBER" }, "maximum": { "type": "number", "description": "Maximum value of Type.INTEGER and Type.NUMBER" }, "pattern": { "type": "string", "description": "Pattern to restrict a string to a regular expression" }, "default": { "description": "Default value of the data" }, "example": { "description": "Example of the object (only populated when object is root)" }, "anyOf": { "type": "array", "items": { "$ref": "#/components/schemas/GeminiSchema" }, "description": "Value should be validated against any of the subschemas" }, "propertyOrdering": { "type": "array", "items": { "type": "string" }, "description": "Order of the properties (not standard OpenAPI)" }, "minProperties": { "type": "integer", "description": "Minimum number of properties for Type.OBJECT" }, "maxProperties": { "type": "integer", "description": "Maximum number of properties for Type.OBJECT" } } }, "GeminiGenerationRequest": { "type": "object", "properties": { "model": { "type": "string", "description": "Model field for explicit model specification" }, "contents": { "type": "array", "items": { "$ref": "#/components/schemas/GeminiContent" }, "description": "Content for the model to process" }, "systemInstruction": { "$ref": "#/components/schemas/GeminiContent", "description": "System instruction for the model" }, "generationConfig": { "type": "object", "properties": { "temperature": { "type": "number", "description": "Controls the randomness of predictions" }, "topP": { "type": "number", "description": "Nucleus sampling parameter" }, "topK": { "type": "integer", "description": "Top-k sampling parameter" }, "candidateCount": { "type": "integer", "description": "Number of candidates to generate. Defaults to 1" }, "maxOutputTokens": { "type": "integer", "description": "Maximum number of output tokens to generate per message" }, "stopSequences": { "type": "array", "items": { "type": "string" }, "description": "Stop sequences" }, "responseMimeType": { "type": "string", "description": "Output response mimetype (text/plain, application/json)" }, "responseSchema": { "$ref": "#/components/schemas/GeminiSchema", "description": "Schema for JSON response (OpenAPI 3.0 subset)" }, "responseJsonSchema": { "type": "object", "description": "Alternative to responseSchema using JSON Schema format" }, "responseModalities": { "type": "array", "items": { "type": "string", "enum": [ "MODALITY_UNSPECIFIED", "TEXT", "IMAGE", "AUDIO" ] }, "description": "The modalities of the response" }, "speechConfig": { "type": "object", "properties": { "voiceConfig": { "type": "object", "properties": { "prebuiltVoiceConfig": { "type": "object", "properties": { "voiceName": { "type": "string", "description": "The name of the prebuilt voice to use" } } } } }, "multiSpeakerVoiceConfig": { "type": "object", "properties": { "speakerVoiceConfigs": { "type": "array", "items": { "type": "object", "properties": { "speaker": { "type": "string", "description": "The name of the speaker (should match prompt)" }, "voiceConfig": { "type": "object", "properties": { "prebuiltVoiceConfig": { "type": "object", "properties": { "voiceName": { "type": "string", "description": "The name of the prebuilt voice to use" } } } } } } } } } }, "languageCode": { "type": "string", "description": "Language code (ISO 639) for speech synthesis. Only available for Live API" } } }, "thinkingConfig": { "type": "object", "properties": { "includeThoughts": { "type": "boolean", "description": "Whether to include thoughts in the response" }, "thinkingBudget": { "type": "integer", "description": "Thinking budget in tokens" }, "thinkingLevel": { "type": "string", "enum": [ "THINKING_LEVEL_UNSPECIFIED", "LOW", "HIGH" ], "description": "Thinking level preset" } } }, "frequencyPenalty": { "type": "number", "description": "Frequency penalty for token generation" }, "presencePenalty": { "type": "number", "description": "Presence penalty for token generation" }, "seed": { "type": "integer", "description": "Seed for deterministic generation" }, "logprobs": { "type": "integer", "description": "Number of log probabilities to return" }, "responseLogprobs": { "type": "boolean", "description": "If true, export logprobs results in response" }, "audioTimestamp": { "type": "boolean", "description": "If enabled, audio timestamp will be included in request" }, "mediaResolution": { "type": "string", "description": "Media resolution specification" }, "routingConfig": { "type": "object", "properties": { "autoMode": { "type": "object", "properties": { "modelRoutingPreference": { "type": "string", "description": "Model routing preference" } } }, "manualMode": { "type": "object", "properties": { "modelName": { "type": "string", "description": "Model name to use" } } } } }, "modelSelectionConfig": { "type": "object", "properties": { "featureSelectionPreference": { "type": "string", "description": "Options for feature selection preference" } } }, "enableAffectiveDialog": { "type": "boolean", "description": "If enabled, model will detect emotions and adapt responses" } } }, "safetySettings": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string", "description": "Harm category" }, "threshold": { "type": "string", "description": "The harm block threshold" }, "method": { "type": "string", "description": "Determines if harm block uses probability or probability and severity scores" } } } }, "tools": { "type": "array", "items": { "type": "object", "properties": { "functionDeclarations": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Function name. Must start with letter/underscore, a-z, A-Z, 0-9, underscores, dots, dashes. Max 64 chars" }, "description": { "type": "string", "description": "Description and purpose of the function" }, "parameters": { "$ref": "#/components/schemas/GeminiSchema" }, "parametersJsonSchema": { "type": "object", "description": "Alternative to parameters using JSON Schema format" }, "response": { "$ref": "#/components/schemas/GeminiSchema", "description": "Output schema for the function" }, "responseJsonSchema": { "type": "object", "description": "Alternative to response using JSON Schema format" }, "behavior": { "type": "string", "enum": [ "UNSPECIFIED", "BLOCKING", "NON_BLOCKING" ], "description": "Function behavior mode. BLOCKING waits for response, NON_BLOCKING continues conversation" } } } }, "googleSearch": { "type": "object", "properties": { "timeRangeFilter": { "type": "object", "properties": { "startTime": { "type": "string", "format": "date-time" }, "endTime": { "type": "string", "format": "date-time" } } }, "excludeDomains": { "type": "array", "items": { "type": "string" }, "description": "List of domains to exclude from search results (max 2000)" } } }, "googleSearchRetrieval": { "type": "object", "properties": { "dynamicRetrievalConfig": { "type": "object", "properties": { "mode": { "type": "string", "description": "The mode of the predictor for dynamic retrieval" }, "dynamicThreshold": { "type": "number", "description": "Threshold for dynamic retrieval" } } } } }, "retrieval": { "type": "object", "properties": { "disableAttribution": { "type": "boolean", "deprecated": true, "description": "Deprecated. This option is no longer supported" }, "externalApi": { "type": "object", "properties": { "endpoint": { "type": "string", "description": "The endpoint of the external API" }, "apiSpec": { "type": "string", "enum": [ "API_SPEC_UNSPECIFIED", "SIMPLE_SEARCH", "ELASTIC_SEARCH" ] }, "authConfig": { "type": "object", "properties": { "authType": { "type": "string", "enum": [ "AUTH_TYPE_UNSPECIFIED", "NO_AUTH", "API_KEY_AUTH", "HTTP_BASIC_AUTH", "GOOGLE_SERVICE_ACCOUNT_AUTH", "OAUTH", "OIDC_AUTH" ] }, "apiKeyConfig": { "type": "object", "properties": { "apiKeyString": { "type": "string" } } }, "googleServiceAccountConfig": { "type": "object", "properties": { "serviceAccount": { "type": "string" } } }, "httpBasicAuthConfig": { "type": "object", "properties": { "credentialSecret": { "type": "string" } } }, "oauthConfig": { "type": "object", "properties": { "accessToken": { "type": "string" }, "serviceAccount": { "type": "string" } } }, "oidcConfig": { "type": "object", "properties": { "idToken": { "type": "string" }, "serviceAccount": { "type": "string" } } } } }, "elasticSearchParams": { "type": "object", "properties": { "index": { "type": "string", "description": "The ElasticSearch index to use" }, "numHits": { "type": "integer", "description": "Number of hits (chunks) to request" }, "searchTemplate": { "type": "string", "description": "The ElasticSearch search template to use" } } } } }, "vertexAiSearch": { "type": "object", "properties": { "datastore": { "type": "string", "description": "Fully-qualified Vertex AI Search data store resource ID" }, "engine": { "type": "string", "description": "Fully-qualified Vertex AI Search engine resource ID" }, "filter": { "type": "string", "description": "Filter strings to be passed to the search API" }, "maxResults": { "type": "integer", "description": "Number of search results to return (max 10, default 10)" }, "dataStoreSpecs": { "type": "array", "items": { "type": "object", "properties": { "dataStore": { "type": "string", "description": "Full resource name of DataStore" }, "filter": { "type": "string", "description": "Filter specification for documents in the data store" } } } } } }, "vertexRagStore": { "type": "object", "properties": { "ragCorpora": { "type": "array", "items": { "type": "string" }, "deprecated": true, "description": "Deprecated. Use ragResources instead" }, "ragResources": { "type": "array", "items": { "type": "object", "properties": { "ragCorpus": { "type": "string", "description": "RAGCorpora resource name" }, "ragFileIds": { "type": "array", "items": { "type": "string" }, "description": "rag_file_id. Files should be in the same rag_corpus" } } } }, "ragRetrievalConfig": { "type": "object", "properties": { "topK": { "type": "integer", "description": "The number of contexts to retrieve" }, "filter": { "type": "object", "properties": { "metadataFilter": { "type": "string", "description": "String for metadata filtering" }, "vectorDistanceThreshold": { "type": "number", "description": "Only returns contexts with vector distance smaller than threshold" }, "vectorSimilarityThreshold": { "type": "number", "description": "Only returns contexts with vector similarity larger than threshold" } } }, "hybridSearch": { "type": "object", "properties": { "alpha": { "type": "number", "description": "Weight between dense and sparse vector search (0-1). 0 = sparse only, 1 = dense only" } } }, "ranking": { "type": "object", "properties": { "llmRanker": { "type": "object", "properties": { "modelName": { "type": "string" } } }, "rankService": { "type": "object", "properties": { "modelName": { "type": "string" } } } } } } }, "similarityTopK": { "type": "integer", "description": "Number of top k results to return from selected corpora" }, "storeContext": { "type": "boolean", "description": "For Gemini Multimodal Live API - memorize interactions" }, "vectorDistanceThreshold": { "type": "number", "description": "Only return results with vector distance smaller than threshold" } } } } }, "codeExecution": { "type": "object", "description": "Enables code execution by the model" }, "enterpriseWebSearch": { "type": "object", "properties": { "excludeDomains": { "type": "array", "items": { "type": "string" }, "description": "List of domains to exclude (max 2000)" } } }, "googleMaps": { "type": "object", "properties": { "authConfig": { "type": "object", "properties": { "authType": { "type": "string", "enum": [ "AUTH_TYPE_UNSPECIFIED", "NO_AUTH", "API_KEY_AUTH", "HTTP_BASIC_AUTH", "GOOGLE_SERVICE_ACCOUNT_AUTH", "OAUTH", "OIDC_AUTH" ] }, "apiKeyConfig": { "type": "object", "properties": { "apiKeyString": { "type": "string" } } }, "googleServiceAccountConfig": { "type": "object", "properties": { "serviceAccount": { "type": "string" } } }, "httpBasicAuthConfig": { "type": "object", "properties": { "credentialSecret": { "type": "string" } } }, "oauthConfig": { "type": "object", "properties": { "accessToken": { "type": "string" }, "serviceAccount": { "type": "string" } } }, "oidcConfig": { "type": "object", "properties": { "idToken": { "type": "string" }, "serviceAccount": { "type": "string" } } } } } } }, "urlContext": { "type": "object", "description": "Tool to support URL context retrieval" }, "computerUse": { "type": "object", "properties": { "environment": { "type": "string", "enum": [ "ENVIRONMENT_UNSPECIFIED", "ENVIRONMENT_BROWSER" ], "description": "The environment being operated" } } } } } }, "toolConfig": { "type": "object", "properties": { "functionCallingConfig": { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "MODE_UNSPECIFIED", "AUTO", "ANY", "NONE", "VALIDATED" ], "description": "Function calling mode" }, "allowedFunctionNames": { "type": "array", "items": { "type": "string" }, "description": "Function names to call when mode is ANY" } } }, "retrievalConfig": { "type": "object", "properties": { "latLng": { "type": "object", "properties": { "latitude": { "type": "number", "description": "Latitude in degrees [-90.0, +90.0]" }, "longitude": { "type": "number", "description": "Longitude in degrees [-180.0, +180.0]" } } }, "languageCode": { "type": "string" } } } } }, "cachedContent": { "type": "string", "description": "Cached content resource name" }, "labels": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Labels for the request" }, "requests": { "type": "array", "items": { "$ref": "#/components/schemas/GeminiEmbeddingRequest" }, "description": "Batch embedding requests" }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "GeminiGenerationResponse": { "type": "object", "properties": { "candidates": { "type": "array", "items": { "type": "object", "properties": { "content": { "$ref": "#/components/schemas/GeminiContent" }, "finishReason": { "type": "string", "enum": [ "FINISH_REASON_UNSPECIFIED", "STOP", "MAX_TOKENS", "SAFETY", "RECITATION", "LANGUAGE", "OTHER", "BLOCKLIST", "PROHIBITED_CONTENT", "SPII", "MALFORMED_FUNCTION_CALL", "IMAGE_SAFETY", "UNEXPECTED_TOOL_CALL" ] }, "finishMessage": { "type": "string", "description": "Human-readable finish message" }, "tokenCount": { "type": "integer", "description": "Number of tokens for this candidate" }, "safetyRatings": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string", "description": "Harm category" }, "probability": { "type": "string", "description": "Harm probability level" }, "probabilityScore": { "type": "number", "description": "Harm probability score" }, "severity": { "type": "string", "description": "Harm severity level" }, "severityScore": { "type": "number", "description": "Harm severity score" }, "blocked": { "type": "boolean", "description": "Whether content was filtered" }, "overwrittenThreshold": { "type": "string", "description": "Overwritten threshold for safety category (for Gemini 2.0 image output with minors detected)" } } } }, "citationMetadata": { "type": "object", "description": "Source attribution of the generated content" }, "index": { "type": "integer", "description": "Index of the candidate" }, "groundingMetadata": { "type": "object", "description": "Metadata specifying sources used to ground generated content" }, "urlContextMetadata": { "type": "object", "properties": { "urlMetadata": { "type": "array", "items": { "type": "object", "properties": { "retrievedUrl": { "type": "string" }, "urlRetrievalStatus": { "type": "string" } } } } } }, "avgLogprobs": { "type": "number", "description": "Average log probability score of the candidate" }, "logprobsResult": { "type": "object", "properties": { "chosenCandidates": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string", "description": "The candidate's token string value" }, "tokenId": { "type": "integer", "description": "The candidate's token ID value" }, "logProbability": { "type": "number", "description": "The candidate's log probability" } } } }, "topCandidates": { "type": "array", "items": { "type": "object", "properties": { "candidates": { "type": "array", "items": { "type": "object", "properties": { "token": { "type": "string", "description": "The candidate's token string value" }, "tokenId": { "type": "integer", "description": "The candidate's token ID value" }, "logProbability": { "type": "number", "description": "The candidate's log probability" } } } } } } } } } } } }, "promptFeedback": { "type": "object", "properties": { "blockReason": { "type": "string" }, "blockReasonMessage": { "type": "string", "description": "Human-readable block reason message" }, "safetyRatings": { "type": "array", "items": { "type": "object", "properties": { "category": { "type": "string", "description": "Harm category" }, "probability": { "type": "string", "description": "Harm probability level" }, "probabilityScore": { "type": "number", "description": "Harm probability score" }, "severity": { "type": "string", "description": "Harm severity level" }, "severityScore": { "type": "number", "description": "Harm severity score" }, "blocked": { "type": "boolean", "description": "Whether content was filtered" }, "overwrittenThreshold": { "type": "string", "description": "Overwritten threshold for safety category (for Gemini 2.0 image output with minors detected)" } } } } } }, "usageMetadata": { "type": "object", "properties": { "promptTokenCount": { "type": "integer", "description": "Number of tokens in the prompt (includes cached content)" }, "candidatesTokenCount": { "type": "integer", "description": "Number of tokens in the response(s)" }, "totalTokenCount": { "type": "integer", "description": "Total token count for prompt, response candidates, and tool-use prompts" }, "cachedContentTokenCount": { "type": "integer", "description": "Number of tokens in the cached part of the input" }, "thoughtsTokenCount": { "type": "integer", "description": "Number of tokens in thoughts output" }, "toolUsePromptTokenCount": { "type": "integer", "description": "Number of tokens in tool-use prompts" }, "trafficType": { "type": "string", "description": "Traffic type (Pay-As-You-Go or Provisioned Throughput)" }, "cacheTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities of the cached content in the request input" }, "candidatesTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities returned in the response" }, "promptTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities processed in the request input" }, "toolUsePromptTokensDetails": { "type": "array", "items": { "type": "object", "properties": { "modality": { "type": "string", "description": "The modality (TEXT, IMAGE, AUDIO, etc.)" }, "tokenCount": { "type": "integer" } } }, "description": "Modalities processed for tool-use request inputs" } } }, "modelVersion": { "type": "string", "description": "The model version used to generate the response" }, "responseId": { "type": "string", "description": "Response ID for identifying each response (encoding of event_id)" }, "createTime": { "type": "string", "format": "date-time", "description": "Timestamp when the request was made to the server" } } }, "GeminiContent": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "user", "model" ], "description": "The producer of the content. Must be either 'user' or 'model'" }, "parts": { "type": "array", "items": { "$ref": "#/components/schemas/GeminiPart" }, "description": "List of parts that constitute a single message" } } }, "GeminiPart": { "type": "object", "properties": { "text": { "type": "string", "description": "Text part (can be code)" }, "thought": { "type": "boolean", "description": "Indicates if the part is thought from the model" }, "thoughtSignature": { "type": "string", "format": "byte", "description": "Opaque signature for thought that can be reused in subsequent requests" }, "inlineData": { "type": "object", "properties": { "mimeType": { "type": "string", "description": "The IANA standard MIME type of the source data" }, "data": { "type": "string", "format": "byte", "description": "Base64-encoded raw bytes" }, "displayName": { "type": "string", "description": "Display name of the blob (not currently used in GenerateContent calls)" } } }, "fileData": { "type": "object", "properties": { "mimeType": { "type": "string", "description": "The IANA standard MIME type of the source data" }, "fileUri": { "type": "string", "description": "URI of the file" }, "displayName": { "type": "string", "description": "Display name of the file data" } } }, "functionCall": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique ID of the function call. If populated, client should return response with matching id" }, "name": { "type": "string", "description": "The name of the function to call. Matches FunctionDeclaration.name" }, "args": { "type": "object", "description": "Function parameters and values in JSON object format" } } }, "functionResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the function call this response is for. Matches FunctionCall.id" }, "name": { "type": "string", "description": "The name of the function. Matches FunctionDeclaration.name and FunctionCall.name" }, "response": { "type": "object", "description": "Function response in JSON object format. Use \"output\" key for output and \"error\" key for error details" }, "willContinue": { "type": "boolean", "description": "Signals that function call continues (NON_BLOCKING only). If false, future responses will not be considered" }, "scheduling": { "type": "string", "description": "How the response should be scheduled (NON_BLOCKING only). Defaults to WHEN_IDLE" } } }, "executableCode": { "type": "object", "properties": { "language": { "type": "string", "description": "Programming language of the code" }, "code": { "type": "string", "description": "The code to be executed" } } }, "codeExecutionResult": { "type": "object", "properties": { "outcome": { "type": "string", "enum": [ "OUTCOME_UNSPECIFIED", "OUTCOME_OK", "OUTCOME_FAILED", "OUTCOME_DEADLINE_EXCEEDED" ], "description": "Outcome of the code execution" }, "output": { "type": "string", "description": "Contains stdout when successful, stderr or other description otherwise" } } }, "videoMetadata": { "type": "object", "properties": { "fps": { "type": "number", "description": "Frame rate of the video. Range is (0.0, 24.0]" }, "startOffset": { "type": "string", "description": "Start offset of the video" }, "endOffset": { "type": "string", "description": "End offset of the video" } } } } }, "GeminiEmbeddingRequest": { "type": "object", "properties": { "model": { "type": "string" }, "content": { "$ref": "#/components/schemas/GeminiContent" }, "taskType": { "type": "string" }, "title": { "type": "string" }, "outputDimensionality": { "type": "integer" } } }, "GeminiEmbeddingResponse": { "type": "object", "properties": { "embeddings": { "type": "array", "items": { "type": "object", "properties": { "values": { "type": "array", "items": { "type": "number" } }, "statistics": { "type": "object", "properties": { "tokenCount": { "type": "integer" } } } } } }, "metadata": { "type": "object", "properties": { "billableCharacterCount": { "type": "integer" } } } } }, "GeminiListModelsResponse": { "type": "object", "properties": { "models": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Model resource name (e.g., models/gemini-pro)" }, "baseModelId": { "type": "string" }, "version": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "inputTokenLimit": { "type": "integer" }, "outputTokenLimit": { "type": "integer" }, "supportedGenerationMethods": { "type": "array", "items": { "type": "string" } }, "thinking": { "type": "boolean", "description": "Whether the model supports thinking mode" }, "temperature": { "type": "number", "description": "Default temperature for the model" }, "maxTemperature": { "type": "number", "description": "Maximum allowed temperature for the model" }, "topP": { "type": "number", "description": "Default nucleus-sampling value" }, "topK": { "type": "integer", "description": "Default top-k sampling value" } } } }, "nextPageToken": { "type": "string" } } }, "GeminiError": { "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "status": { "type": "string" }, "details": { "type": "array", "items": { "type": "object", "properties": { "@type": { "type": "string", "description": "Type identifier for the error details" }, "fieldViolations": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" } } } } } } } } } } }, "BedrockConverseRequest": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/components/schemas/BedrockMessage" }, "description": "Array of messages for the conversation" }, "system": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "guardContent": { "type": "object", "properties": { "text": { "type": "object", "properties": { "text": { "type": "string" }, "qualifiers": { "type": "array", "items": { "type": "string" } } } } } }, "cachePoint": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "default" ] } } } } }, "description": "System messages/prompts" }, "inferenceConfig": { "type": "object", "properties": { "maxTokens": { "type": "integer" }, "temperature": { "type": "number" }, "topP": { "type": "number" }, "stopSequences": { "type": "array", "items": { "type": "string" } } } }, "toolConfig": { "type": "object", "properties": { "tools": { "type": "array", "items": { "type": "object", "properties": { "toolSpec": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "inputSchema": { "type": "object", "properties": { "json": { "type": "object" } } } } }, "cachePoint": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "default" ] } } } } } }, "toolChoice": { "type": "object", "properties": { "auto": { "type": "object" }, "any": { "type": "object" }, "tool": { "type": "object", "properties": { "name": { "type": "string" } } } } } } }, "guardrailConfig": { "type": "object", "properties": { "guardrailIdentifier": { "type": "string" }, "guardrailVersion": { "type": "string" }, "trace": { "type": "string", "enum": [ "enabled", "disabled" ] } } }, "additionalModelRequestFields": { "type": "object", "description": "Model-specific parameters" }, "additionalModelResponseFieldPaths": { "type": "array", "items": { "type": "string" } }, "performanceConfig": { "type": "object", "properties": { "latency": { "type": "string", "enum": [ "standard", "optimized" ] } } }, "promptVariables": { "type": "object", "additionalProperties": { "type": "object", "properties": { "text": { "type": "string" } } } }, "requestMetadata": { "type": "object", "additionalProperties": { "type": "string" } }, "serviceTier": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "reserved", "priority", "default", "flex" ] } } }, "fallbacks": { "type": "array", "items": { "type": "string" } } } }, "BedrockConverseResponse": { "type": "object", "properties": { "output": { "type": "object", "properties": { "message": { "$ref": "#/components/schemas/BedrockMessage" } } }, "stopReason": { "type": "string", "enum": [ "end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened", "content_filtered" ] }, "usage": { "type": "object", "properties": { "inputTokens": { "type": "integer" }, "outputTokens": { "type": "integer" }, "totalTokens": { "type": "integer" }, "cacheReadInputTokens": { "type": "integer" }, "cacheWriteInputTokens": { "type": "integer" } } }, "metrics": { "type": "object", "properties": { "latencyMs": { "type": "integer" } } }, "additionalModelResponseFields": { "type": "object" }, "trace": { "type": "object" }, "performanceConfig": { "type": "object", "properties": { "latency": { "type": "string", "enum": [ "standard", "optimized" ] } } }, "serviceTier": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "reserved", "priority", "default", "flex" ] } } } } }, "BedrockMessage": { "type": "object", "required": [ "role", "content" ], "properties": { "role": { "type": "string", "enum": [ "user", "assistant" ] }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/BedrockContentBlock" } } } }, "BedrockContentBlock": { "type": "object", "properties": { "text": { "type": "string" }, "image": { "type": "object", "properties": { "format": { "type": "string", "enum": [ "jpeg", "png", "gif", "webp" ] }, "source": { "type": "object", "properties": { "bytes": { "type": "string", "format": "byte" } } } } }, "document": { "type": "object", "properties": { "format": { "type": "string", "enum": [ "pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md" ] }, "name": { "type": "string" }, "source": { "type": "object", "properties": { "bytes": { "type": "string", "format": "byte" }, "text": { "type": "string", "description": "Plain text content (for text-based documents)" } } } } }, "toolUse": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "name": { "type": "string" }, "input": { "type": "object" } } }, "toolResult": { "type": "object", "properties": { "toolUseId": { "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/components/schemas/BedrockContentBlock" } }, "status": { "type": "string", "enum": [ "success", "error" ] } } }, "guardContent": { "type": "object", "properties": { "text": { "type": "object", "properties": { "text": { "type": "string" }, "qualifiers": { "type": "array", "items": { "type": "string" } } } } } }, "reasoningContent": { "type": "object", "properties": { "reasoningText": { "type": "object", "properties": { "text": { "type": "string" }, "signature": { "type": "string" } } } } }, "json": { "type": "object", "description": "JSON content for tool call results" }, "cachePoint": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "default" ] } } } } }, "BedrockInvokeRequest": { "type": "object", "description": "Raw model invocation request. The body format depends on the model provider.\nFor Anthropic models, use Anthropic format. For other models, use their native format.\n", "properties": { "prompt": { "type": "string", "description": "Text prompt to complete" }, "max_tokens": { "type": "integer" }, "max_tokens_to_sample": { "type": "integer", "description": "Anthropic-style max tokens" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "top_k": { "type": "integer" }, "stop": { "type": "array", "items": { "type": "string" } }, "stop_sequences": { "type": "array", "items": { "type": "string" }, "description": "Anthropic-style stop sequences" }, "messages": { "type": "array", "items": { "type": "object" }, "description": "For Claude 3 models" }, "system": { "description": "System prompt (string or array of strings)", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "anthropic_version": { "type": "string" } } }, "BedrockInvokeResponse": { "type": "object", "description": "Raw model response. Format depends on the model provider.", "additionalProperties": true }, "BedrockBatchJobRequest": { "type": "object", "required": [ "roleArn", "inputDataConfig", "outputDataConfig" ], "properties": { "modelId": { "type": "string", "description": "Model ID for the batch job (optional, can be specified in request)" }, "jobName": { "type": "string", "description": "Name for the batch job" }, "roleArn": { "type": "string", "description": "IAM role ARN for the job" }, "inputDataConfig": { "type": "object", "properties": { "s3InputDataConfig": { "type": "object", "properties": { "s3Uri": { "type": "string", "description": "S3 URI for input data" } } } } }, "outputDataConfig": { "type": "object", "properties": { "s3OutputDataConfig": { "type": "object", "properties": { "s3Uri": { "type": "string", "description": "S3 URI for output data" } } } } }, "timeoutDurationInHours": { "type": "integer", "description": "Timeout in hours" }, "tags": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } } } } }, "BedrockBatchJobResponse": { "type": "object", "properties": { "jobArn": { "type": "string" }, "status": { "type": "string", "enum": [ "Submitted", "InProgress", "Completed", "Failed", "Stopping", "Stopped", "PartiallyCompleted", "Expired", "Validating", "Scheduled" ] }, "jobName": { "type": "string" }, "modelId": { "type": "string" }, "roleArn": { "type": "string" }, "inputDataConfig": { "type": "object" }, "outputDataConfig": { "type": "object" }, "vpcConfig": { "type": "object", "properties": { "securityGroupIds": { "type": "array", "items": { "type": "string" } }, "subnetIds": { "type": "array", "items": { "type": "string" } } } }, "submitTime": { "type": "string", "format": "date-time" }, "lastModifiedTime": { "type": "string", "format": "date-time" }, "endTime": { "type": "string", "format": "date-time" }, "message": { "type": "string" }, "clientRequestToken": { "type": "string" }, "jobExpirationTime": { "type": "string", "format": "date-time" }, "timeoutDurationInHours": { "type": "integer" } } }, "BedrockError": { "type": "object", "properties": { "message": { "type": "string" }, "type": { "type": "string" } } }, "CohereChatRequest": { "type": "object", "required": [ "model", "messages" ], "properties": { "model": { "type": "string", "description": "Model to use for chat completion", "example": "command-r-plus" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/CohereMessage" }, "description": "Array of message objects" }, "tools": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": { "type": "object" } } } } } }, "tool_choice": { "type": "string", "enum": [ "AUTO", "NONE", "REQUIRED" ], "description": "Tool choice mode - AUTO lets the model decide, NONE disables tools, REQUIRED forces tool use" }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "p": { "type": "number", "description": "Top-p sampling" }, "k": { "type": "integer", "description": "Top-k sampling" }, "max_tokens": { "type": "integer" }, "stop_sequences": { "type": "array", "items": { "type": "string" } }, "frequency_penalty": { "type": "number" }, "presence_penalty": { "type": "number" }, "stream": { "type": "boolean" }, "safety_mode": { "type": "string", "enum": [ "CONTEXTUAL", "STRICT", "NONE" ] }, "log_probs": { "type": "boolean" }, "strict_tool_choice": { "type": "boolean" }, "thinking": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "enabled", "disabled" ] }, "token_budget": { "type": "integer", "minimum": 1 } } }, "response_format": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "text", "json_object" ], "description": "Response format type" }, "schema": { "type": "object", "description": "JSON schema for structured output (used with json_object type)" } } } } }, "CohereChatResponse": { "type": "object", "properties": { "id": { "type": "string" }, "finish_reason": { "type": "string", "enum": [ "COMPLETE", "STOP_SEQUENCE", "MAX_TOKENS", "TOOL_CALL", "ERROR", "TIMEOUT" ] }, "message": { "type": "object", "properties": { "role": { "type": "string" }, "content": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "image_url": { "type": "object", "properties": { "url": { "type": "string" } } }, "thinking": { "type": "string" }, "document": { "type": "object", "properties": { "data": { "type": "object" }, "id": { "type": "string" } } } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } }, "tool_plan": { "type": "string" } } }, "usage": { "type": "object", "properties": { "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "cached_tokens": { "type": "integer", "description": "Cached tokens" } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "token_ids": { "type": "array", "items": { "type": "integer" }, "description": "Token IDs of each token in text chunk" }, "text": { "type": "string", "description": "Text chunk for log probabilities" }, "logprobs": { "type": "array", "items": { "type": "number" }, "description": "Log probability of each token" } } }, "description": "Log probabilities (if requested)" } } }, "CohereMessage": { "type": "object", "required": [ "role" ], "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "tool" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "image_url": { "type": "object", "properties": { "url": { "type": "string" } } }, "thinking": { "type": "string" }, "document": { "type": "object", "properties": { "data": { "type": "object" }, "id": { "type": "string" } } } } } } ], "description": "Message content - can be a string or array of content blocks" }, "tool_calls": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "function" ] }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } }, "tool_call_id": { "type": "string" }, "tool_plan": { "type": "string", "description": "Chain-of-thought style reflection (assistant only)" } } }, "CohereEmbeddingRequest": { "type": "object", "required": [ "model", "input_type" ], "properties": { "model": { "type": "string", "description": "ID of an available embedding model", "example": "embed-english-v3.0" }, "input_type": { "type": "string", "description": "Specifies the type of input passed to the model. Required for embedding models v3 and higher." }, "texts": { "type": "array", "items": { "type": "string" }, "description": "Array of strings to embed. Maximum 96 texts per call. At least one of texts, images, or inputs is required.", "maxItems": 96 }, "images": { "type": "array", "items": { "type": "string" }, "description": "Array of image data URIs for multimodal embedding. Maximum 1 image per call. Supports JPEG, PNG, WebP, GIF up to 5MB.", "maxItems": 1 }, "inputs": { "type": "array", "items": { "type": "object", "properties": { "content": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "text", "image_url", "thinking", "document" ] }, "text": { "type": "string" }, "image_url": { "type": "object", "properties": { "url": { "type": "string" } } }, "thinking": { "type": "string" }, "document": { "type": "object", "properties": { "data": { "type": "object" }, "id": { "type": "string" } } } } }, "description": "Array of content blocks (reuses chat content blocks)" } } }, "description": "Array of mixed text/image components for embedding. Maximum 96 per call.", "maxItems": 96 }, "embedding_types": { "type": "array", "items": { "type": "string" }, "description": "Specifies the return format types (float, int8, uint8, binary, ubinary, base64). Defaults to float if unspecified." }, "output_dimension": { "type": "integer", "description": "Number of dimensions for output embeddings (256, 512, 1024, 1536). Available only for embed-v4 and newer models." }, "max_tokens": { "type": "integer", "description": "Maximum tokens to embed per input before truncation." }, "truncate": { "type": "string", "description": "Handling for inputs exceeding token limits. Defaults to END." } } }, "CohereEmbeddingResponse": { "type": "object", "properties": { "id": { "type": "string", "description": "Response ID" }, "embeddings": { "type": "object", "description": "Embedding data object with different types", "properties": { "float": { "type": "array", "items": { "type": "array", "items": { "type": "number" } }, "description": "Float embeddings" }, "int8": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } }, "description": "Int8 embeddings" }, "uint8": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } }, "description": "Uint8 embeddings" }, "binary": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } }, "description": "Binary embeddings" }, "ubinary": { "type": "array", "items": { "type": "array", "items": { "type": "integer" } }, "description": "Unsigned binary embeddings" }, "base64": { "type": "array", "items": { "type": "string" }, "description": "Base64-encoded embeddings" } } }, "response_type": { "type": "string", "description": "Response type (embeddings_floats, embeddings_by_type)" }, "texts": { "type": "array", "items": { "type": "string" }, "description": "Original text entries" }, "images": { "type": "array", "items": { "type": "object", "description": "Image information in the response", "properties": { "width": { "type": "integer", "description": "Width in pixels" }, "height": { "type": "integer", "description": "Height in pixels" }, "format": { "type": "string", "description": "Image format" }, "bit_depth": { "type": "integer", "description": "Bit depth" } } }, "description": "Original image entries" }, "meta": { "type": "object", "description": "Metadata in embedding response", "properties": { "api_version": { "type": "object", "description": "API version information", "properties": { "version": { "type": "string", "description": "API version" }, "is_deprecated": { "type": "boolean", "description": "Deprecation status" }, "is_experimental": { "type": "boolean", "description": "Experimental status" } } }, "billed_units": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of billed input tokens" }, "output_tokens": { "type": "integer", "description": "Number of billed output tokens" }, "search_units": { "type": "integer", "description": "Number of billed search units" }, "classifications": { "type": "integer", "description": "Number of billed classification units" } } }, "tokens": { "type": "object", "properties": { "input_tokens": { "type": "integer", "description": "Number of input tokens used" }, "output_tokens": { "type": "integer", "description": "Number of output tokens produced" } } }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Any warnings" } } } } }, "CohereCountTokensRequest": { "type": "object", "required": [ "text", "model" ], "properties": { "model": { "type": "string", "description": "Model whose tokenizer should be used", "example": "command-r-plus" }, "text": { "type": "string", "description": "Text to tokenize (1-65536 characters)", "minLength": 1, "maxLength": 65536 } } }, "CohereCountTokensResponse": { "type": "object", "properties": { "tokens": { "type": "array", "items": { "type": "integer" }, "description": "Token IDs" }, "token_strings": { "type": "array", "items": { "type": "string" }, "description": "Token strings" }, "meta": { "type": "object", "description": "Metadata returned by the tokenize endpoint", "properties": { "api_version": { "type": "object", "description": "API version metadata", "properties": { "version": { "type": "string", "description": "API version" } } } } } } }, "CohereError": { "type": "object", "properties": { "type": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Error message" }, "code": { "type": "string", "description": "Optional error code" } } }, "SuccessResponse": { "type": "object", "description": "Generic success response", "properties": { "status": { "type": "string", "example": "success" }, "message": { "type": "string", "example": "Operation completed successfully" } } }, "ManagementErrorResponse": { "$ref": "#/components/schemas/BifrostError", "type": "object", "description": "Error response" }, "MessageResponse": { "type": "object", "description": "Simple message response", "properties": { "message": { "type": "string" } } }, "HealthResponse": { "type": "object", "description": "Health check response", "properties": { "status": { "type": "string", "enum": [ "ok" ], "example": "ok" }, "components": { "type": "object", "description": "Health status of individual components (config_store, log_store, vector_store)", "additionalProperties": { "type": "string" } } } }, "GetConfigResponse": { "type": "object", "description": "Configuration response", "properties": { "client_config": { "type": "object", "description": "Client configuration", "properties": { "drop_excess_requests": { "type": "boolean", "description": "Whether to drop excess requests when rate limited" }, "prometheus_labels": { "type": "array", "items": { "type": "string" }, "description": "Custom Prometheus labels" }, "allowed_origins": { "type": "array", "items": { "type": "string" }, "description": "Allowed CORS origins" }, "initial_pool_size": { "type": "integer", "description": "Initial connection pool size" }, "enable_logging": { "type": "boolean", "description": "Whether logging is enabled" }, "disable_content_logging": { "type": "boolean", "description": "Whether content logging is disabled" }, "enforce_auth_on_inference": { "type": "boolean", "description": "Whether to enforce virtual key authentication on inference requests" }, "enforce_governance_header": { "type": "boolean", "deprecated": true, "description": "Deprecated: use enforce_auth_on_inference instead" }, "allow_direct_keys": { "type": "boolean", "description": "Whether to allow direct API keys" }, "max_request_body_size_mb": { "type": "integer", "description": "Maximum request body size in MB" }, "compat": { "type": "object", "description": "Compat plugin configuration", "properties": { "convert_text_to_chat": { "type": "boolean", "description": "Convert text completion requests to chat" }, "convert_chat_to_responses": { "type": "boolean", "description": "Convert chat completion requests to responses" }, "should_drop_params": { "type": "boolean", "description": "Drop unsupported parameters based on model catalog" }, "should_convert_params": { "type": "boolean", "default": false, "description": "Converts model parameter values that are not supported by the model" } }, "additionalProperties": false }, "log_retention_days": { "type": "integer", "description": "Number of days to retain logs" }, "header_filter_config": { "type": "object", "description": "Header filter configuration", "properties": { "allowlist": { "type": "array", "items": { "type": "string" } }, "denylist": { "type": "array", "items": { "type": "string" } } } }, "mcp_agent_depth": { "type": "integer", "description": "Depth of MCP agent" }, "mcp_tool_execution_timeout": { "type": "integer", "description": "Timeout for MCP tool execution in seconds" }, "mcp_code_mode_binding_level": { "type": "string", "description": "Binding level for MCP code mode" }, "required_headers": { "type": "array", "items": { "type": "string" }, "description": "Headers that must be present on every request. Requests missing any of these headers are rejected with 400. Case-insensitive matching." }, "logging_headers": { "type": "array", "items": { "type": "string" }, "description": "Headers to capture in log metadata. Values are extracted from incoming requests and stored in the metadata field of log entries. Case-insensitive matching. No restart required." } } }, "framework_config": { "type": "object", "description": "Framework configuration", "properties": { "id": { "type": "integer", "description": "Unique identifier for the framework config" }, "pricing_url": { "type": "string", "description": "URL for pricing data" }, "pricing_sync_interval": { "type": "integer", "format": "int64", "description": "Pricing sync interval in seconds" } } }, "auth_config": { "type": "object", "description": "Authentication configuration", "properties": { "admin_username": { "type": "string" }, "admin_password": { "type": "string", "description": "Password (redacted as in responses)" }, "is_enabled": { "type": "boolean" }, "disable_auth_on_inference": { "type": "boolean" } } }, "is_db_connected": { "type": "boolean" }, "is_cache_connected": { "type": "boolean" }, "is_logs_connected": { "type": "boolean" }, "proxy_config": { "type": "object", "description": "Global proxy configuration", "properties": { "enabled": { "type": "boolean" }, "type": { "type": "string", "enum": [ "http", "socks5", "tcp" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string", "description": "Password (redacted as in responses)" }, "no_proxy": { "type": "string" }, "timeout": { "type": "integer" }, "skip_tls_verify": { "type": "boolean" }, "enable_for_scim": { "type": "boolean" }, "enable_for_inference": { "type": "boolean" }, "enable_for_api": { "type": "boolean" } } }, "restart_required": { "type": "object", "description": "Restart required configuration", "properties": { "required": { "type": "boolean" }, "reason": { "type": "string" } } } } }, "UpdateConfigRequest": { "type": "object", "description": "Update configuration request", "properties": { "client_config": { "type": "object", "description": "Client configuration", "properties": { "drop_excess_requests": { "type": "boolean", "description": "Whether to drop excess requests when rate limited" }, "prometheus_labels": { "type": "array", "items": { "type": "string" }, "description": "Custom Prometheus labels" }, "allowed_origins": { "type": "array", "items": { "type": "string" }, "description": "Allowed CORS origins" }, "initial_pool_size": { "type": "integer", "description": "Initial connection pool size" }, "enable_logging": { "type": "boolean", "description": "Whether logging is enabled" }, "disable_content_logging": { "type": "boolean", "description": "Whether content logging is disabled" }, "enforce_auth_on_inference": { "type": "boolean", "description": "Whether to enforce virtual key authentication on inference requests" }, "enforce_governance_header": { "type": "boolean", "deprecated": true, "description": "Deprecated: use enforce_auth_on_inference instead" }, "allow_direct_keys": { "type": "boolean", "description": "Whether to allow direct API keys" }, "max_request_body_size_mb": { "type": "integer", "description": "Maximum request body size in MB" }, "compat": { "type": "object", "description": "Compat plugin configuration", "properties": { "convert_text_to_chat": { "type": "boolean", "description": "Convert text completion requests to chat" }, "convert_chat_to_responses": { "type": "boolean", "description": "Convert chat completion requests to responses" }, "should_drop_params": { "type": "boolean", "description": "Drop unsupported parameters based on model catalog" }, "should_convert_params": { "type": "boolean", "default": false, "description": "Converts model parameter values that are not supported by the model" } }, "additionalProperties": false }, "log_retention_days": { "type": "integer", "description": "Number of days to retain logs" }, "header_filter_config": { "type": "object", "description": "Header filter configuration", "properties": { "allowlist": { "type": "array", "items": { "type": "string" } }, "denylist": { "type": "array", "items": { "type": "string" } } } }, "mcp_agent_depth": { "type": "integer", "description": "Depth of MCP agent" }, "mcp_tool_execution_timeout": { "type": "integer", "description": "Timeout for MCP tool execution in seconds" }, "mcp_code_mode_binding_level": { "type": "string", "description": "Binding level for MCP code mode" }, "required_headers": { "type": "array", "items": { "type": "string" }, "description": "Headers that must be present on every request. Requests missing any of these headers are rejected with 400. Case-insensitive matching." }, "logging_headers": { "type": "array", "items": { "type": "string" }, "description": "Headers to capture in log metadata. Values are extracted from incoming requests and stored in the metadata field of log entries. Case-insensitive matching. No restart required." } } }, "framework_config": { "type": "object", "description": "Framework configuration", "properties": { "id": { "type": "integer", "description": "Unique identifier for the framework config" }, "pricing_url": { "type": "string", "description": "URL for pricing data" }, "pricing_sync_interval": { "type": "integer", "format": "int64", "description": "Pricing sync interval in seconds" } } }, "auth_config": { "type": "object", "description": "Authentication configuration", "properties": { "admin_username": { "type": "string" }, "admin_password": { "type": "string", "description": "Password (redacted as in responses)" }, "is_enabled": { "type": "boolean" }, "disable_auth_on_inference": { "type": "boolean" } } } } }, "Version": { "type": "string", "description": "Version information", "example": "1.0.0" }, "LoginRequest": { "type": "object", "description": "Login request", "required": [ "username", "password" ], "properties": { "username": { "type": "string" }, "password": { "type": "string" } } }, "LoginResponse": { "type": "object", "description": "Login response", "properties": { "message": { "type": "string", "example": "Login successful" }, "token": { "type": "string", "description": "Session token" } } }, "IsAuthEnabledResponse": { "type": "object", "description": "Auth enabled status response", "properties": { "is_auth_enabled": { "type": "boolean" }, "has_valid_token": { "type": "boolean" } } }, "ProviderResponse": { "type": "object", "description": "Provider configuration response", "properties": { "name": { "$ref": "#/components/schemas/ModelProvider" }, "network_config": { "$ref": "#/components/schemas/NetworkConfig" }, "concurrency_and_buffer_size": { "$ref": "#/components/schemas/ConcurrencyAndBufferSize" }, "proxy_config": { "type": "object", "description": "Proxy configuration", "properties": { "type": { "type": "string", "enum": [ "none", "http", "socks5", "environment" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string" }, "ca_cert_pem": { "type": "string" } } }, "send_back_raw_request": { "type": "boolean" }, "send_back_raw_response": { "type": "boolean" }, "store_raw_request_response": { "type": "boolean" }, "custom_provider_config": { "type": "object", "description": "Custom provider configuration", "properties": { "is_key_less": { "type": "boolean" }, "base_provider_type": { "$ref": "#/components/schemas/ModelProvider" }, "allowed_requests": { "type": "object", "description": "Allowed request types for custom providers", "properties": { "list_models": { "type": "boolean" }, "text_completion": { "type": "boolean" }, "text_completion_stream": { "type": "boolean" }, "chat_completion": { "type": "boolean" }, "chat_completion_stream": { "type": "boolean" }, "responses": { "type": "boolean" }, "responses_stream": { "type": "boolean" }, "count_tokens": { "type": "boolean" }, "embedding": { "type": "boolean" }, "speech": { "type": "boolean" }, "speech_stream": { "type": "boolean" }, "transcription": { "type": "boolean" }, "transcription_stream": { "type": "boolean" }, "image_generation": { "type": "boolean" }, "image_generation_stream": { "type": "boolean" }, "batch_create": { "type": "boolean" }, "batch_list": { "type": "boolean" }, "batch_retrieve": { "type": "boolean" }, "batch_cancel": { "type": "boolean" }, "batch_results": { "type": "boolean" }, "file_upload": { "type": "boolean" }, "file_list": { "type": "boolean" }, "file_retrieve": { "type": "boolean" }, "file_delete": { "type": "boolean" }, "file_content": { "type": "boolean" } } }, "request_path_overrides": { "type": "object", "additionalProperties": { "type": "string" } } } }, "provider_status": { "type": "string", "enum": [ "active", "error", "deleted" ], "description": "Status of the provider" }, "status": { "type": "string", "description": "Operational status (e.g., list_models_failed)" }, "description": { "type": "string", "description": "Error/status description" }, "config_hash": { "type": "string", "description": "Hash of config.json version, used for change detection" } } }, "ListProvidersResponse": { "type": "object", "description": "List providers response", "properties": { "providers": { "type": "array", "items": { "$ref": "#/components/schemas/ProviderResponse" } }, "total": { "type": "integer" } } }, "AddProviderRequest": { "type": "object", "description": "Add provider request. Keys are managed separately via /api/providers/{provider}/keys.", "required": [ "provider" ], "properties": { "provider": { "$ref": "#/components/schemas/ModelProvider" }, "network_config": { "$ref": "#/components/schemas/NetworkConfig" }, "concurrency_and_buffer_size": { "$ref": "#/components/schemas/ConcurrencyAndBufferSize" }, "proxy_config": { "type": "object", "description": "Proxy configuration", "properties": { "type": { "type": "string", "enum": [ "none", "http", "socks5", "environment" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string" }, "ca_cert_pem": { "type": "string" } } }, "send_back_raw_request": { "type": "boolean" }, "send_back_raw_response": { "type": "boolean" }, "store_raw_request_response": { "type": "boolean" }, "custom_provider_config": { "type": "object", "description": "Custom provider configuration", "properties": { "is_key_less": { "type": "boolean" }, "base_provider_type": { "$ref": "#/components/schemas/ModelProvider" }, "allowed_requests": { "type": "object", "description": "Allowed request types for custom providers", "properties": { "list_models": { "type": "boolean" }, "text_completion": { "type": "boolean" }, "text_completion_stream": { "type": "boolean" }, "chat_completion": { "type": "boolean" }, "chat_completion_stream": { "type": "boolean" }, "responses": { "type": "boolean" }, "responses_stream": { "type": "boolean" }, "count_tokens": { "type": "boolean" }, "embedding": { "type": "boolean" }, "speech": { "type": "boolean" }, "speech_stream": { "type": "boolean" }, "transcription": { "type": "boolean" }, "transcription_stream": { "type": "boolean" }, "image_generation": { "type": "boolean" }, "image_generation_stream": { "type": "boolean" }, "batch_create": { "type": "boolean" }, "batch_list": { "type": "boolean" }, "batch_retrieve": { "type": "boolean" }, "batch_cancel": { "type": "boolean" }, "batch_results": { "type": "boolean" }, "file_upload": { "type": "boolean" }, "file_list": { "type": "boolean" }, "file_retrieve": { "type": "boolean" }, "file_delete": { "type": "boolean" }, "file_content": { "type": "boolean" } } }, "request_path_overrides": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "UpdateProviderRequest": { "type": "object", "description": "Update provider request. Keys are managed separately via /api/providers/{provider}/keys.", "properties": { "network_config": { "$ref": "#/components/schemas/NetworkConfig" }, "concurrency_and_buffer_size": { "$ref": "#/components/schemas/ConcurrencyAndBufferSize" }, "proxy_config": { "type": "object", "description": "Proxy configuration", "properties": { "type": { "type": "string", "enum": [ "none", "http", "socks5", "environment" ] }, "url": { "type": "string" }, "username": { "type": "string" }, "password": { "type": "string" }, "ca_cert_pem": { "type": "string" } } }, "send_back_raw_request": { "type": "boolean" }, "send_back_raw_response": { "type": "boolean" }, "store_raw_request_response": { "type": "boolean" }, "custom_provider_config": { "type": "object", "description": "Custom provider configuration", "properties": { "is_key_less": { "type": "boolean" }, "base_provider_type": { "$ref": "#/components/schemas/ModelProvider" }, "allowed_requests": { "type": "object", "description": "Allowed request types for custom providers", "properties": { "list_models": { "type": "boolean" }, "text_completion": { "type": "boolean" }, "text_completion_stream": { "type": "boolean" }, "chat_completion": { "type": "boolean" }, "chat_completion_stream": { "type": "boolean" }, "responses": { "type": "boolean" }, "responses_stream": { "type": "boolean" }, "count_tokens": { "type": "boolean" }, "embedding": { "type": "boolean" }, "speech": { "type": "boolean" }, "speech_stream": { "type": "boolean" }, "transcription": { "type": "boolean" }, "transcription_stream": { "type": "boolean" }, "image_generation": { "type": "boolean" }, "image_generation_stream": { "type": "boolean" }, "batch_create": { "type": "boolean" }, "batch_list": { "type": "boolean" }, "batch_retrieve": { "type": "boolean" }, "batch_cancel": { "type": "boolean" }, "batch_results": { "type": "boolean" }, "file_upload": { "type": "boolean" }, "file_list": { "type": "boolean" }, "file_retrieve": { "type": "boolean" }, "file_delete": { "type": "boolean" }, "file_content": { "type": "boolean" } } }, "request_path_overrides": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "Key": { "type": "object", "description": "API key configuration", "properties": { "id": { "type": "string", "description": "Unique identifier for the key" }, "name": { "type": "string", "description": "Name of the key" }, "value": { "type": "object", "description": "API key value (redacted in responses)", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "models": { "type": "array", "items": { "type": "string" }, "description": "List of models this key can access (whitelist)" }, "blacklisted_models": { "type": "array", "items": { "type": "string" }, "description": "List of models this key cannot access (blacklist)" }, "weight": { "type": "number", "description": "Weight for load balancing" }, "aliases": { "type": "object", "propertyNames": { "minLength": 1 }, "additionalProperties": { "type": "string", "minLength": 1 }, "description": "Model alias mappings — maps a user-facing model name to a provider-specific identifier (deployment name, inference profile ID, fine-tuned model ID, etc.)" }, "azure_key_config": { "type": "object", "description": "Azure-specific key configuration", "properties": { "endpoint": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "api_version": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "client_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "client_secret": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "tenant_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "scopes": { "type": "array", "items": { "type": "string" }, "description": "List of scopes to use for authentication" } } }, "vertex_key_config": { "type": "object", "description": "Vertex-specific key configuration", "properties": { "project_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "project_number": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "region": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "auth_credentials": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } } } }, "bedrock_key_config": { "type": "object", "description": "AWS Bedrock-specific key configuration", "properties": { "access_key": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "secret_key": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "session_token": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "region": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "arn": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "batch_s3_config": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "type": "object", "properties": { "bucket_name": { "type": "string" }, "prefix": { "type": "string" }, "is_default": { "type": "boolean" } } } } } } } }, "vllm_key_config": { "type": "object", "description": "VLLM-specific key configuration", "properties": { "url": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "model_name": { "type": "string" } }, "required": [ "url" ] }, "ollama_key_config": { "type": "object", "description": "Ollama-specific key configuration", "properties": { "url": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } } }, "required": [ "url" ] }, "sgl_key_config": { "type": "object", "description": "SGLang-specific key configuration", "properties": { "url": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } } }, "required": [ "url" ] }, "replicate_key_config": { "type": "object", "description": "Replicate-specific key configuration", "properties": { "use_deployments_endpoint": { "type": "boolean", "description": "Whether to use the deployments endpoint instead of the models endpoint" } } }, "enabled": { "type": "boolean", "description": "Whether the key is active (defaults to true)" }, "use_for_batch_api": { "type": "boolean", "description": "Whether this key can be used for batch API operations" }, "config_hash": { "type": "string", "description": "Hash of config.json version, used for change detection" }, "status": { "type": "string", "description": "Status of key (e.g., success, list_models_failed)" }, "description": { "type": "string", "description": "Error or status description for the key" } } }, "ListProviderKeysResponse": { "type": "object", "description": "Response for listing keys for a provider", "properties": { "keys": { "type": "array", "items": { "$ref": "#/components/schemas/Key" } }, "total": { "type": "integer" } } }, "NetworkConfig": { "type": "object", "description": "Network configuration for provider connections", "properties": { "base_url": { "type": "string", "description": "Base URL for the provider (optional)" }, "extra_headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Additional headers to include in requests" }, "default_request_timeout_in_seconds": { "type": "integer", "description": "Default timeout for requests" }, "max_retries": { "type": "integer", "description": "Maximum number of retries" }, "retry_backoff_initial": { "type": "integer", "format": "int64", "description": "Initial backoff duration in milliseconds" }, "retry_backoff_max": { "type": "integer", "format": "int64", "description": "Maximum backoff duration in milliseconds" }, "insecure_skip_verify": { "type": "boolean", "description": "Disable TLS certificate verification for provider connections. This bypasses server certificate validation and should be used only as a last resort when a trusted CA chain cannot be configured. Prefer ca_cert_pem for self-signed or private CA deployments." }, "ca_cert_pem": { "type": "string", "description": "PEM-encoded CA certificate to trust for provider endpoint connections (e.g. self-signed or internal CA)" } } }, "ConcurrencyAndBufferSize": { "type": "object", "description": "Concurrency settings", "properties": { "concurrency": { "type": "integer", "description": "Number of concurrent operations" }, "buffer_size": { "type": "integer", "description": "Size of the buffer" } } }, "Plugin": { "type": "object", "description": "Plugin configuration", "properties": { "id": { "type": "integer", "description": "Plugin ID (auto-generated)" }, "name": { "type": "string", "description": "Display name of the plugin (from config)" }, "actualName": { "type": "string", "description": "Actual plugin name from GetName() (used as map key in plugin status). Only populated for active plugins." }, "enabled": { "type": "boolean" }, "config": { "type": "object", "additionalProperties": true }, "isCustom": { "type": "boolean" }, "path": { "type": "string" }, "status": { "type": "object", "description": "Current plugin status including types array (only populated for active plugins)", "properties": { "name": { "type": "string", "description": "Display name of the plugin" }, "status": { "type": "string", "enum": [ "active", "error", "disabled", "loading", "uninitialized", "unloaded", "loaded" ] }, "logs": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "description": "Plugin types indicating which interfaces the plugin implements", "items": { "type": "string", "enum": [ "llm", "mcp", "http", "observability" ] } } }, "example": { "name": "my_custom_plugin", "status": "active", "logs": [ "plugin my_custom_plugin initialized successfully" ], "types": [ "llm", "http" ] } }, "created_at": { "type": "string", "format": "date-time" }, "version": { "type": "integer", "format": "int16" }, "updated_at": { "type": "string", "format": "date-time" }, "config_hash": { "type": "string" } }, "example": { "name": "my_custom_plugin", "actualName": "MyCustomPlugin", "enabled": true, "config": { "api_key": "xxx" }, "isCustom": true, "path": "/plugins/my_custom_plugin.so", "status": { "name": "my_custom_plugin", "status": "active", "logs": [ "plugin my_custom_plugin initialized successfully" ], "types": [ "llm", "http" ] } } }, "ListPluginsResponse": { "type": "object", "description": "List plugins response", "properties": { "plugins": { "type": "array", "items": { "$ref": "#/components/schemas/Plugin" } }, "count": { "type": "integer" } } }, "CreatePluginRequest": { "type": "object", "description": "Create plugin request", "required": [ "name" ], "properties": { "name": { "type": "string" }, "enabled": { "type": "boolean" }, "config": { "type": "object", "additionalProperties": true }, "path": { "type": "string" } } }, "UpdatePluginRequest": { "type": "object", "description": "Update plugin request", "properties": { "enabled": { "type": "boolean" }, "config": { "type": "object", "additionalProperties": true }, "path": { "type": "string" } } }, "MCPClient": { "type": "object", "description": "Connected MCP client with its tools", "properties": { "config": { "$ref": "#/components/schemas/MCPClientConfig" }, "tools": { "type": "array", "items": { "type": "object", "description": "Tool function definition", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": true }, "strict": { "type": "boolean" } } } }, "state": { "type": "string", "enum": [ "connected", "disconnected", "error" ], "description": "Connection state of an MCP client" }, "vk_configs": { "type": "array", "items": { "type": "object", "description": "Per-virtual-key tool access configuration as returned in list/get responses", "properties": { "virtual_key_id": { "type": "string", "description": "ID of the virtual key" }, "virtual_key_name": { "type": "string", "description": "Display name of the virtual key" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Tools this virtual key is allowed to call on this MCP client.\n[\"*\"] => all tools allowed\n[\"tool1\", \"tool2\"] => only the specified tools\n" } } }, "description": "Virtual key assignments for this MCP client" } } }, "MCPClientConfig": { "type": "object", "description": "Full MCP client configuration (used in responses)", "properties": { "client_id": { "type": "string", "description": "Unique identifier for the MCP client" }, "name": { "type": "string", "description": "Display name for the MCP client" }, "is_code_mode_client": { "type": "boolean", "description": "Whether this client is available in code mode" }, "connection_type": { "type": "string", "enum": [ "http", "stdio", "sse", "inprocess" ], "description": "Connection type for MCP client" }, "connection_string": { "type": "string", "description": "HTTP or SSE URL (required for HTTP or SSE connections)" }, "stdio_config": { "type": "object", "description": "STDIO configuration for MCP client", "properties": { "command": { "type": "string", "description": "Executable command to run" }, "args": { "type": "array", "items": { "type": "string" }, "description": "Command line arguments" }, "envs": { "type": "array", "items": { "type": "string" }, "description": "Environment variables required" } } }, "auth_type": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for the MCP connection" }, "oauth_config_id": { "type": "string", "description": "OAuth config ID for OAuth authentication.\nReferences the oauth_configs table.\nOnly set when auth_type is \"oauth\".\n" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom headers to include in requests.\nOnly used when auth_type is \"headers\".\n" }, "tools_to_execute": { "type": "array", "items": { "type": "string" }, "description": "Include-only list for tools.\n[\"*\"] => all tools are included\n[] => no tools are included\n[\"tool1\", \"tool2\"] => include only the specified tools\n" }, "tools_to_auto_execute": { "type": "array", "items": { "type": "string" }, "description": "List of tools that can be auto-executed without user approval.\nMust be a subset of tools_to_execute.\n[\"*\"] => all executable tools can be auto-executed\n[] => no tools are auto-executed\n[\"tool1\", \"tool2\"] => only specified tools can be auto-executed\n" }, "tool_pricing": { "type": "object", "additionalProperties": { "type": "number", "format": "double" }, "description": "Per-tool cost in USD for execution.\nKey is the tool name, value is the cost per execution.\nExample: {\"read_file\": 0.001, \"write_file\": 0.002}\n" }, "allow_on_all_virtual_keys": { "type": "boolean", "default": false, "description": "When true, this MCP client's tools are accessible to all virtual keys without requiring\nexplicit per-key assignment. All tools are allowed by default. If a virtual key has an\nexplicit MCP config for this client, that config takes precedence and overrides this behaviour.\n" } } }, "ExecuteToolRequest": { "oneOf": [ { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } }, "title": "Chat (Default)", "description": "Chat format - uses ChatAssistantMessageToolCall schema" }, { "type": "object", "description": "Responses format - uses ResponsesToolMessage schema", "required": [ "name" ], "properties": { "call_id": { "type": "string", "description": "Common call ID for tool calls and outputs" }, "name": { "type": "string", "description": "Tool function name (required for execution)" }, "arguments": { "type": "string", "description": "Tool function arguments as JSON string" }, "output": { "type": "object", "description": "Tool execution output", "additionalProperties": true }, "action": { "type": "object", "description": "Tool action configuration", "additionalProperties": true }, "error": { "type": "string", "description": "Error message if tool execution failed" } }, "title": "Responses" } ], "description": "MCP tool execution request. The schema depends on the `format` query parameter:\n- `format=chat` or empty (default): Use `ChatAssistantMessageToolCall` schema\n- `format=responses`: Use `ResponsesToolMessage` schema\n" }, "MCPAuthType": { "type": "string", "enum": [ "none", "headers", "oauth", "per_user_oauth" ], "description": "Authentication type for MCP connections:\n- none: No authentication\n- headers: Header-based authentication (API keys, custom headers, etc.)\n- oauth: OAuth 2.0 authentication (shared admin token)\n- per_user_oauth: Per-user OAuth 2.1 (each end-user authenticates individually)\n" }, "OAuthConfigRequest": { "type": "object", "description": "OAuth configuration for MCP client creation", "properties": { "client_id": { "type": "string", "description": "OAuth client ID. Optional if client supports dynamic client registration (RFC 7591).\nIf not provided, the server_url must be set for OAuth discovery and dynamic registration.\n" }, "client_secret": { "type": "string", "description": "OAuth client secret. Optional for public clients using PKCE or clients obtained via dynamic registration.\n" }, "authorize_url": { "type": "string", "description": "OAuth authorization endpoint URL. Optional - will be discovered from server_url if not provided.\n" }, "token_url": { "type": "string", "description": "OAuth token endpoint URL. Optional - will be discovered from server_url if not provided.\n" }, "registration_url": { "type": "string", "description": "Dynamic client registration endpoint URL (RFC 7591). Optional - will be discovered from server_url if not provided.\n" }, "scopes": { "type": "array", "items": { "type": "string" }, "description": "OAuth scopes requested. Optional - can be discovered from server_url if not provided.\nExample: [\"read\", \"write\"]\n" } } }, "OAuthFlowInitiation": { "type": "object", "description": "Response when initiating an OAuth flow", "properties": { "status": { "type": "string", "enum": [ "pending_oauth" ] }, "message": { "type": "string" }, "oauth_config_id": { "type": "string", "description": "ID of the OAuth config created for this flow" }, "authorize_url": { "type": "string", "description": "URL to redirect the user to for authorization" }, "expires_at": { "type": "string", "format": "date-time", "description": "When the OAuth authorization request expires" }, "mcp_client_id": { "type": "string", "description": "The MCP client ID that initiated this OAuth flow" } } }, "OAuthConfigStatus": { "type": "object", "description": "Status of an OAuth configuration", "properties": { "id": { "type": "string", "description": "OAuth config ID" }, "status": { "type": "string", "enum": [ "pending", "authorized", "failed" ], "description": "Current status of the OAuth flow:\n- pending: User has not yet authorized\n- authorized: User authorized and token is stored\n- failed: Authorization failed\n" }, "created_at": { "type": "string", "format": "date-time", "description": "When this OAuth config was created" }, "expires_at": { "type": "string", "format": "date-time", "description": "When this OAuth config expires (becomes invalid if not completed)" }, "token_id": { "type": "string", "description": "ID of the associated OAuth token (only present if status is authorized)" }, "token_expires_at": { "type": "string", "format": "date-time", "description": "When the OAuth access token expires (only present if status is authorized)" }, "token_scopes": { "type": "array", "items": { "type": "string" }, "description": "Scopes granted in the OAuth token (only present if status is authorized)" } } }, "OAuthToken": { "type": "object", "description": "OAuth access and refresh tokens", "properties": { "id": { "type": "string", "description": "Unique token identifier" }, "access_token": { "type": "string", "description": "OAuth access token" }, "refresh_token": { "type": "string", "description": "OAuth refresh token for obtaining new access tokens" }, "token_type": { "type": "string", "description": "Token type (typically \"Bearer\")" }, "expires_at": { "type": "string", "format": "date-time", "description": "When the access token expires" }, "scopes": { "type": "array", "items": { "type": "string" }, "description": "Scopes granted in this token" }, "last_refreshed_at": { "type": "string", "format": "date-time", "description": "When the token was last refreshed" } } }, "VirtualKey": { "type": "object", "description": "Virtual key configuration", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "value": { "type": "string" }, "description": { "type": "string" }, "is_active": { "type": "boolean" }, "provider_configs": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualKeyProviderConfig" } }, "mcp_configs": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualKeyMCPConfig" } } } }, "VirtualKeyResponse": { "type": "object", "description": "Virtual key operation response", "properties": { "message": { "type": "string" }, "virtual_key": { "$ref": "#/components/schemas/VirtualKey" } } }, "VirtualKeyProviderConfig": { "type": "object", "description": "Provider configuration for a virtual key", "properties": { "id": { "type": "integer" }, "virtual_key_id": { "type": "string" }, "provider": { "type": "string" }, "weight": { "type": "number", "nullable": true, "description": "Weight for provider load balancing. Null means excluded from weighted routing." }, "allowed_models": { "type": "array", "items": { "type": "string" } }, "budget_id": { "type": "string" }, "rate_limit_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/Budget" }, "rate_limit": { "$ref": "#/components/schemas/RateLimit" }, "keys": { "type": "array", "items": { "$ref": "#/components/schemas/TableKey" } } } }, "VirtualKeyMCPConfig": { "type": "object", "description": "MCP configuration for a virtual key", "properties": { "id": { "type": "integer" }, "mcp_client_name": { "type": "string" }, "tools_to_execute": { "type": "array", "items": { "type": "string" } } } }, "ListVirtualKeysResponse": { "type": "object", "description": "List virtual keys response", "properties": { "virtual_keys": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualKey" } }, "count": { "type": "integer" } } }, "CreateVirtualKeyRequest": { "type": "object", "description": "Create virtual key request", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "provider_configs": { "type": "array", "description": "Provider configurations (empty means no providers allowed, deny-by-default)", "items": { "type": "object", "properties": { "provider": { "type": "string" }, "weight": { "type": "number", "nullable": true, "description": "Weight for load balancing. Null means excluded from weighted routing." }, "allowed_models": { "type": "array", "items": { "type": "string" } }, "budget": { "$ref": "#/components/schemas/CreateBudgetRequest" }, "rate_limit": { "$ref": "#/components/schemas/CreateRateLimitRequest" }, "key_ids": { "type": "array", "items": { "type": "string" } } } } }, "mcp_configs": { "type": "array", "description": "MCP configurations (empty means no MCP tools allowed, deny-by-default)", "items": { "type": "object", "properties": { "mcp_client_name": { "type": "string" }, "tools_to_execute": { "type": "array", "items": { "type": "string" } } } } }, "team_id": { "type": "string" }, "customer_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/CreateBudgetRequest" }, "rate_limit": { "$ref": "#/components/schemas/CreateRateLimitRequest" }, "is_active": { "type": "boolean" } } }, "UpdateVirtualKeyRequest": { "type": "object", "description": "Update virtual key request", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "provider_configs": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "provider": { "type": "string" }, "weight": { "type": "number", "nullable": true, "description": "Weight for load balancing. Null means excluded from weighted routing." }, "allowed_models": { "type": "array", "items": { "type": "string" } }, "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest" }, "rate_limit": { "$ref": "#/components/schemas/UpdateRateLimitRequest" }, "key_ids": { "type": "array", "items": { "type": "string" } } } } }, "mcp_configs": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "mcp_client_name": { "type": "string" }, "tools_to_execute": { "type": "array", "items": { "type": "string" } } } } }, "team_id": { "type": "string" }, "customer_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest" }, "rate_limit": { "$ref": "#/components/schemas/UpdateRateLimitRequest" }, "is_active": { "type": "boolean" } } }, "Team": { "type": "object", "description": "Team configuration", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "customer_id": { "type": "string" }, "budget_id": { "type": "string" }, "customer": { "$ref": "#/components/schemas/Customer" }, "budget": { "$ref": "#/components/schemas/Budget" }, "virtual_keys": { "type": "array", "nullable": true, "description": "Virtual keys assigned to this team. This field may be omitted or returned as null in some responses (for example, when a team is embedded inside a virtual-key response) to avoid nested `virtual_keys` recursion.\n", "items": { "$ref": "#/components/schemas/VirtualKey" } }, "profile": { "type": "object", "additionalProperties": true }, "config": { "type": "object", "additionalProperties": true }, "claims": { "type": "object", "additionalProperties": true }, "config_hash": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "TeamResponse": { "type": "object", "description": "Team operation response", "properties": { "message": { "type": "string" }, "team": { "$ref": "#/components/schemas/Team" } } }, "ListTeamsResponse": { "type": "object", "description": "List teams response", "properties": { "teams": { "type": "array", "items": { "$ref": "#/components/schemas/Team" } }, "count": { "type": "integer" } } }, "CreateTeamRequest": { "type": "object", "description": "Create team request", "required": [ "name" ], "properties": { "name": { "type": "string" }, "customer_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/CreateBudgetRequest" } } }, "UpdateTeamRequest": { "type": "object", "description": "Update team request", "properties": { "name": { "type": "string" }, "customer_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest" } } }, "Customer": { "type": "object", "description": "Customer configuration", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "budget_id": { "type": "string" }, "budget": { "$ref": "#/components/schemas/Budget" }, "teams": { "type": "array", "items": { "$ref": "#/components/schemas/Team" } }, "virtual_keys": { "type": "array", "items": { "$ref": "#/components/schemas/VirtualKey" } }, "config_hash": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "CustomerResponse": { "type": "object", "description": "Customer operation response", "properties": { "message": { "type": "string" }, "customer": { "$ref": "#/components/schemas/Customer" } } }, "ListCustomersResponse": { "type": "object", "description": "List customers response", "properties": { "customers": { "type": "array", "items": { "$ref": "#/components/schemas/Customer" } }, "count": { "type": "integer" } } }, "CreateCustomerRequest": { "type": "object", "description": "Create customer request", "required": [ "name" ], "properties": { "name": { "type": "string" }, "budget": { "$ref": "#/components/schemas/CreateBudgetRequest" } } }, "UpdateCustomerRequest": { "type": "object", "description": "Update customer request", "properties": { "name": { "type": "string" }, "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest" } } }, "Budget": { "type": "object", "description": "Budget configuration", "properties": { "id": { "type": "string" }, "max_limit": { "type": "number", "description": "Maximum budget in dollars" }, "reset_duration": { "type": "string", "description": "Reset duration (e.g., \"30s\", \"5m\", \"1h\", \"1d\", \"1w\", \"1M\")" }, "calendar_aligned": { "type": "boolean", "description": "When true, resets align to calendar period boundaries in UTC (not rolling from last reset)", "default": false }, "last_reset": { "type": "string", "format": "date-time" }, "current_usage": { "type": "number" }, "config_hash": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "RateLimit": { "type": "object", "description": "Rate limit configuration", "properties": { "id": { "type": "string" }, "token_max_limit": { "type": "integer", "format": "int64" }, "token_reset_duration": { "type": "string" }, "token_current_usage": { "type": "integer", "format": "int64" }, "token_last_reset": { "type": "string", "format": "date-time" }, "request_max_limit": { "type": "integer", "format": "int64", "nullable": true }, "request_reset_duration": { "type": "string", "nullable": true }, "request_current_usage": { "type": "integer", "format": "int64" }, "request_last_reset": { "type": "string", "format": "date-time" }, "config_hash": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "ListBudgetsResponse": { "type": "object", "description": "List budgets response", "properties": { "budgets": { "type": "array", "items": { "$ref": "#/components/schemas/Budget" } }, "count": { "type": "integer" } } }, "ListRateLimitsResponse": { "type": "object", "description": "List rate limits response", "properties": { "rate_limits": { "type": "array", "items": { "$ref": "#/components/schemas/RateLimit" } }, "count": { "type": "integer" } } }, "CreateBudgetRequest": { "type": "object", "description": "Create budget request", "required": [ "max_limit", "reset_duration" ], "properties": { "max_limit": { "type": "number" }, "reset_duration": { "type": "string" }, "calendar_aligned": { "type": "boolean", "default": false, "description": "When true, usage resets at the start of each calendar period in UTC instead of on a rolling window from last reset. Only valid with reset durations that use day, week, month, or year suffixes (`d`, `w`, `M`, `Y`). For example `1d` resets at midnight UTC; `1w` at Monday 00:00 UTC; `1M` on the first day of each month; `1Y` on January 1. Sub-day durations (e.g. `1h`) cannot use calendar alignment.\n" } } }, "UpdateBudgetRequest": { "type": "object", "description": "Update budget request", "properties": { "max_limit": { "type": "number" }, "reset_duration": { "type": "string" }, "calendar_aligned": { "type": "boolean", "nullable": true, "description": "Set to true or false to enable or disable calendar-aligned resets. Only valid with reset durations that use day, week, month, or year suffixes (`d`, `w`, `M`, `Y`); sub-day durations (e.g. `1h`, `30m`) are invalid with calendar alignment and the API rejects that combination. When enabling on an existing budget, current usage is reset to zero and last_reset snaps to the current period start.\n" } } }, "CreateRateLimitRequest": { "type": "object", "description": "Create rate limit request", "properties": { "token_max_limit": { "type": "integer", "format": "int64" }, "token_reset_duration": { "type": "string" }, "request_max_limit": { "type": "integer", "format": "int64" }, "request_reset_duration": { "type": "string" } } }, "UpdateRateLimitRequest": { "type": "object", "description": "Update rate limit request", "properties": { "token_max_limit": { "type": "integer", "format": "int64" }, "token_reset_duration": { "type": "string" }, "request_max_limit": { "type": "integer", "format": "int64" }, "request_reset_duration": { "type": "string" } } }, "RoutingRule": { "type": "object", "description": "CEL-based routing rule for intelligent request routing", "properties": { "id": { "type": "string", "description": "Unique identifier for the routing rule" }, "name": { "type": "string", "description": "Name of the routing rule" }, "description": { "type": "string", "description": "Description of what the rule does" }, "enabled": { "type": "boolean", "description": "Whether the rule is enabled and active" }, "cel_expression": { "type": "string", "description": "CEL (Common Expression Language) expression for matching" }, "targets": { "type": "array", "description": "Weighted routing targets; weights must sum to 1; target is selected probabilistically at request time", "items": { "type": "object", "description": "A single weighted routing target within a routing rule", "required": [ "weight" ], "dependentRequired": { "key_id": [ "provider" ] }, "properties": { "provider": { "type": "string", "description": "Target provider (omit or empty to use the incoming request provider)", "nullable": true }, "model": { "type": "string", "description": "Target model (omit or empty to use the incoming request model)", "nullable": true }, "key_id": { "type": "string", "description": "UUID of the API key to pin for this target (omit for load-balanced key selection)", "nullable": true }, "weight": { "type": "number", "format": "double", "exclusiveMinimum": 0, "description": "Probability weight for this target (must be > 0; all target weights in a rule must sum to 1, e.g. 0.7 + 0.3 = 1.0)", "example": 0.5 } } } }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback providers in format \"provider/model\"" }, "scope": { "type": "string", "enum": [ "global", "team", "customer", "virtual_key" ], "description": "Scope level for the rule" }, "scope_id": { "type": "string", "description": "ID for the scope (empty for global scope)", "nullable": true }, "priority": { "type": "integer", "description": "Priority for rule evaluation (lower number = higher priority)" }, "query": { "type": "object", "description": "Visual rule tree structure from query builder", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } }, "oneOf": [ { "type": "object", "properties": { "scope": { "type": "string", "enum": [ "global" ] } }, "required": [ "scope" ], "description": "Global scope routing rule" }, { "type": "object", "properties": { "scope": { "type": "string", "enum": [ "team", "customer", "virtual_key" ] }, "scope_id": { "type": "string" } }, "required": [ "scope", "scope_id" ], "description": "Scoped routing rule (requires scope_id)" } ] }, "RoutingRuleResponse": { "type": "object", "description": "Response containing created/updated routing rule", "properties": { "message": { "type": "string" }, "rule": { "$ref": "#/components/schemas/RoutingRule" } } }, "ListRoutingRulesResponse": { "type": "object", "description": "Response containing list of routing rules", "properties": { "rules": { "type": "array", "items": { "$ref": "#/components/schemas/RoutingRule" } }, "count": { "type": "integer", "description": "Number of routing rules returned" } } }, "CreateRoutingRuleRequest": { "type": "object", "description": "Request to create a routing rule", "required": [ "name", "cel_expression", "scope", "priority", "targets" ], "properties": { "name": { "type": "string", "description": "Name of the routing rule" }, "description": { "type": "string", "description": "Optional description" }, "enabled": { "type": "boolean", "description": "Whether the rule is enabled" }, "cel_expression": { "type": "string", "description": "CEL expression for matching" }, "targets": { "type": "array", "minItems": 1, "description": "Weighted routing targets; weights must sum to 1; target is selected probabilistically at request time", "items": { "type": "object", "description": "A single weighted routing target within a routing rule", "required": [ "weight" ], "dependentRequired": { "key_id": [ "provider" ] }, "properties": { "provider": { "type": "string", "description": "Target provider (omit or empty to use the incoming request provider)", "nullable": true }, "model": { "type": "string", "description": "Target model (omit or empty to use the incoming request model)", "nullable": true }, "key_id": { "type": "string", "description": "UUID of the API key to pin for this target (omit for load-balanced key selection)", "nullable": true }, "weight": { "type": "number", "format": "double", "exclusiveMinimum": 0, "description": "Probability weight for this target (must be > 0; all target weights in a rule must sum to 1, e.g. 0.7 + 0.3 = 1.0)", "example": 0.5 } } } }, "fallbacks": { "type": "array", "items": { "type": "string" }, "description": "Fallback providers in format \"provider/model\"" }, "scope": { "type": "string", "enum": [ "global", "team", "customer", "virtual_key" ], "description": "Scope level for the rule" }, "scope_id": { "type": "string", "description": "ID for the scope (required if scope is not global)", "nullable": true }, "priority": { "type": "integer", "description": "Priority for rule evaluation (lower number = higher priority)" }, "query": { "type": "object", "description": "Visual rule tree structure", "nullable": true } }, "oneOf": [ { "type": "object", "properties": { "scope": { "type": "string", "enum": [ "global" ] } }, "required": [ "scope" ], "description": "Global scope routing rule" }, { "type": "object", "properties": { "scope": { "type": "string", "enum": [ "team", "customer", "virtual_key" ] }, "scope_id": { "type": "string" } }, "required": [ "scope", "scope_id" ], "description": "Scoped routing rule (requires scope_id)" } ] }, "UpdateRoutingRuleRequest": { "type": "object", "description": "Request to update a routing rule (all fields optional; providing `targets` replaces all existing targets)", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "cel_expression": { "type": "string" }, "targets": { "type": "array", "minItems": 1, "description": "Replaces all existing targets when provided; weights must sum to 1", "items": { "type": "object", "description": "A single weighted routing target within a routing rule", "required": [ "weight" ], "dependentRequired": { "key_id": [ "provider" ] }, "properties": { "provider": { "type": "string", "description": "Target provider (omit or empty to use the incoming request provider)", "nullable": true }, "model": { "type": "string", "description": "Target model (omit or empty to use the incoming request model)", "nullable": true }, "key_id": { "type": "string", "description": "UUID of the API key to pin for this target (omit for load-balanced key selection)", "nullable": true }, "weight": { "type": "number", "format": "double", "exclusiveMinimum": 0, "description": "Probability weight for this target (must be > 0; all target weights in a rule must sum to 1, e.g. 0.7 + 0.3 = 1.0)", "example": 0.5 } } } }, "fallbacks": { "type": "array", "items": { "type": "string" } }, "priority": { "type": "integer" }, "query": { "type": "object", "nullable": true } } }, "TableKey": { "type": "object", "description": "Table key configuration", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "provider_id": { "type": "integer" }, "provider": { "type": "string" }, "key_id": { "type": "string" }, "value": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } } }, "models": { "type": "array", "items": { "type": "string" } }, "weight": { "type": "number", "nullable": true }, "enabled": { "type": "boolean", "default": true, "nullable": true }, "use_for_batch_api": { "type": "boolean", "default": false, "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }, "config_hash": { "type": "string", "nullable": true }, "azure_endpoint": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "azure_api_version": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "azure_client_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "azure_client_secret": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "azure_tenant_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "vertex_project_id": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "vertex_project_number": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "vertex_region": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "vertex_auth_credentials": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "bedrock_access_key": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "bedrock_secret_key": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "bedrock_session_token": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "bedrock_region": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true }, "bedrock_arn": { "type": "object", "description": "Environment variable configuration", "properties": { "value": { "type": "string" }, "env_var": { "type": "string" }, "from_env": { "type": "boolean" } }, "nullable": true } } }, "ModelConfig": { "type": "object", "description": "Model configuration with budget and rate limit settings", "properties": { "id": { "type": "string", "description": "Unique identifier for the model config" }, "model_name": { "type": "string", "description": "Name of the model" }, "provider": { "type": "string", "description": "Provider name (optional - applies to all providers if not specified)" }, "budget": { "$ref": "#/components/schemas/Budget", "description": "Budget configuration for this model" }, "rate_limit": { "$ref": "#/components/schemas/RateLimit", "description": "Rate limit configuration for this model" }, "created_at": { "type": "string", "format": "date-time", "description": "When this model config was created" }, "updated_at": { "type": "string", "format": "date-time", "description": "When this model config was last updated" } } }, "ModelConfigResponse": { "type": "object", "description": "Response containing a created/updated model config", "properties": { "message": { "type": "string" }, "model_config": { "$ref": "#/components/schemas/ModelConfig" } } }, "ListModelConfigsResponse": { "type": "object", "description": "Response containing list of model configs", "properties": { "model_configs": { "type": "array", "items": { "$ref": "#/components/schemas/ModelConfig" } }, "count": { "type": "integer", "description": "Number of model configs returned" } } }, "CreateModelConfigRequest": { "type": "object", "description": "Request to create a new model config", "required": [ "model_name" ], "properties": { "model_name": { "type": "string", "description": "Name of the model (required)" }, "provider": { "type": "string", "description": "Provider name (optional - applies to all providers if not specified)" }, "budget": { "$ref": "#/components/schemas/CreateBudgetRequest", "description": "Budget configuration" }, "rate_limit": { "$ref": "#/components/schemas/CreateRateLimitRequest", "description": "Rate limit configuration" } } }, "UpdateModelConfigRequest": { "type": "object", "description": "Request to update an existing model config", "properties": { "model_name": { "type": "string", "description": "Name of the model" }, "provider": { "type": "string", "description": "Provider name" }, "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest", "description": "Budget configuration" }, "rate_limit": { "$ref": "#/components/schemas/UpdateRateLimitRequest", "description": "Rate limit configuration" } } }, "ProviderGovernance": { "type": "object", "description": "Provider-level governance settings (budget and rate limits)", "properties": { "provider": { "type": "string", "description": "Provider name" }, "budget": { "$ref": "#/components/schemas/Budget", "description": "Budget configuration for this provider" }, "rate_limit": { "$ref": "#/components/schemas/RateLimit", "description": "Rate limit configuration for this provider" } } }, "ProviderGovernanceResponse": { "type": "object", "description": "Response containing provider governance settings", "properties": { "provider": { "type": "string", "description": "Provider name" }, "budget": { "$ref": "#/components/schemas/Budget", "description": "Budget configuration" }, "rate_limit": { "$ref": "#/components/schemas/RateLimit", "description": "Rate limit configuration" } } }, "ListProviderGovernanceResponse": { "type": "object", "description": "Response containing list of provider governance settings", "properties": { "providers": { "type": "array", "items": { "$ref": "#/components/schemas/ProviderGovernanceResponse" } }, "count": { "type": "integer", "description": "Number of providers with governance settings" } } }, "UpdateProviderGovernanceRequest": { "type": "object", "description": "Request to update provider governance settings", "properties": { "budget": { "$ref": "#/components/schemas/UpdateBudgetRequest", "description": "Budget configuration" }, "rate_limit": { "$ref": "#/components/schemas/UpdateRateLimitRequest", "description": "Rate limit configuration" } } }, "PricingOverrideRequestType": { "type": "string", "description": "Request type for pricing override filtering. Stream variants are treated identically to their base type — specifying `chat_completion` covers both streaming and non-streaming chat requests.\n", "enum": [ "chat_completion", "text_completion", "responses", "embedding", "rerank", "speech", "transcription", "image_generation", "image_variation", "image_edit", "video_generation", "video_remix" ] }, "PricingPatch": { "type": "object", "description": "Pricing fields to override. Only non-zero/non-null fields are applied. All values are cost per unit in USD.\n", "properties": { "input_cost_per_token": { "type": "number", "minimum": 0 }, "output_cost_per_token": { "type": "number", "minimum": 0 }, "input_cost_per_token_batches": { "type": "number", "minimum": 0 }, "output_cost_per_token_batches": { "type": "number", "minimum": 0 }, "input_cost_per_token_priority": { "type": "number", "minimum": 0 }, "output_cost_per_token_priority": { "type": "number", "minimum": 0 }, "input_cost_per_character": { "type": "number", "minimum": 0 }, "input_cost_per_token_above_128k_tokens": { "type": "number", "minimum": 0 }, "output_cost_per_token_above_128k_tokens": { "type": "number", "minimum": 0 }, "input_cost_per_token_above_200k_tokens": { "type": "number", "minimum": 0 }, "output_cost_per_token_above_200k_tokens": { "type": "number", "minimum": 0 }, "cache_creation_input_token_cost": { "type": "number", "minimum": 0 }, "cache_read_input_token_cost": { "type": "number", "minimum": 0 }, "cache_creation_input_token_cost_above_200k_tokens": { "type": "number", "minimum": 0 }, "cache_read_input_token_cost_above_200k_tokens": { "type": "number", "minimum": 0 }, "cache_read_input_token_cost_priority": { "type": "number", "minimum": 0 }, "cache_read_input_image_token_cost": { "type": "number", "minimum": 0 }, "cache_creation_input_audio_token_cost": { "type": "number", "minimum": 0 }, "input_cost_per_image": { "type": "number", "minimum": 0 }, "output_cost_per_image": { "type": "number", "minimum": 0 }, "input_cost_per_pixel": { "type": "number", "minimum": 0 }, "output_cost_per_pixel": { "type": "number", "minimum": 0 }, "input_cost_per_image_token": { "type": "number", "minimum": 0 }, "output_cost_per_image_token": { "type": "number", "minimum": 0 }, "output_cost_per_image_low_quality": { "type": "number", "minimum": 0 }, "output_cost_per_image_medium_quality": { "type": "number", "minimum": 0 }, "output_cost_per_image_high_quality": { "type": "number", "minimum": 0 }, "output_cost_per_image_auto_quality": { "type": "number", "minimum": 0 }, "output_cost_per_image_premium_image": { "type": "number", "minimum": 0 }, "output_cost_per_image_above_512_and_512_pixels": { "type": "number", "minimum": 0 }, "output_cost_per_image_above_1024_and_1024_pixels": { "type": "number", "minimum": 0 }, "output_cost_per_image_above_2048_and_2048_pixels": { "type": "number", "minimum": 0 }, "output_cost_per_image_above_4096_and_4096_pixels": { "type": "number", "minimum": 0 }, "input_cost_per_audio_token": { "type": "number", "minimum": 0 }, "output_cost_per_audio_token": { "type": "number", "minimum": 0 }, "input_cost_per_audio_per_second": { "type": "number", "minimum": 0 }, "input_cost_per_second": { "type": "number", "minimum": 0 }, "input_cost_per_video_per_second": { "type": "number", "minimum": 0 }, "output_cost_per_video_per_second": { "type": "number", "minimum": 0 }, "output_cost_per_second": { "type": "number", "minimum": 0 }, "search_context_cost_per_query": { "type": "number", "minimum": 0 }, "code_interpreter_cost_per_session": { "type": "number", "minimum": 0 } } }, "PricingOverride": { "type": "object", "description": "A pricing override that applies custom rates to matching requests.", "properties": { "id": { "type": "string", "description": "Unique override ID (UUID)" }, "name": { "type": "string", "description": "Human-readable label" }, "scope_kind": { "type": "string", "enum": [ "global", "provider", "provider_key", "virtual_key", "virtual_key_provider", "virtual_key_provider_key" ], "description": "Scope that determines which requests this override applies to" }, "virtual_key_id": { "type": "string", "nullable": true, "description": "Required for virtual_key* scopes" }, "provider_id": { "type": "string", "nullable": true, "description": "Required for provider and virtual_key_provider scopes" }, "provider_key_id": { "type": "string", "nullable": true, "description": "Required for provider_key and virtual_key_provider_key scopes" }, "match_type": { "type": "string", "enum": [ "exact", "wildcard" ], "description": "How the pattern is matched against the model name" }, "pattern": { "type": "string", "description": "Model name or wildcard prefix (e.g. \"gpt-4o\" or \"claude-3*\")" }, "request_types": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/PricingOverrideRequestType" }, "description": "Request types this override applies to. At least one value is required." }, "pricing_patch": { "type": "string", "description": "JSON-encoded pricing fields to override (as stored in the database)" }, "patch": { "$ref": "#/components/schemas/PricingPatch", "description": "Decoded pricing fields (present in API responses)" }, "config_hash": { "type": "string", "nullable": true, "description": "Auto-managed hash for config-file-sourced overrides. Do not set manually." }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "CreatePricingOverrideRequest": { "type": "object", "description": "Request body for creating a pricing override.", "required": [ "name", "scope_kind", "match_type", "pattern", "request_types" ], "properties": { "name": { "type": "string", "description": "Human-readable label" }, "scope_kind": { "type": "string", "enum": [ "global", "provider", "provider_key", "virtual_key", "virtual_key_provider", "virtual_key_provider_key" ] }, "virtual_key_id": { "type": "string", "description": "Required for virtual_key* scopes" }, "provider_id": { "type": "string", "description": "Required for provider and virtual_key_provider scopes" }, "provider_key_id": { "type": "string", "description": "Required for provider_key and virtual_key_provider_key scopes" }, "match_type": { "type": "string", "enum": [ "exact", "wildcard" ] }, "pattern": { "type": "string", "description": "Model name or wildcard prefix ending with * (e.g. \"claude-3*\")" }, "request_types": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/PricingOverrideRequestType" }, "description": "Request types this override applies to. At least one value is required." }, "patch": { "$ref": "#/components/schemas/PricingPatch" } } }, "UpdatePricingOverrideRequest": { "type": "object", "description": "Request body for updating a pricing override. All fields are optional — omitted fields are merged from the existing record. The `patch` field is always replaced in full when provided.\n", "properties": { "name": { "type": "string", "description": "Human-readable label" }, "scope_kind": { "type": "string", "enum": [ "global", "provider", "provider_key", "virtual_key", "virtual_key_provider", "virtual_key_provider_key" ] }, "virtual_key_id": { "type": "string", "description": "Required for virtual_key* scopes" }, "provider_id": { "type": "string", "description": "Required for provider and virtual_key_provider scopes" }, "provider_key_id": { "type": "string", "description": "Required for provider_key and virtual_key_provider_key scopes" }, "match_type": { "type": "string", "enum": [ "exact", "wildcard" ] }, "pattern": { "type": "string", "description": "Model name or wildcard prefix ending with * (e.g. \"claude-3*\")" }, "request_types": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/PricingOverrideRequestType" }, "description": "Request types this override applies to." }, "patch": { "$ref": "#/components/schemas/PricingPatch" } } }, "PricingOverrideResponse": { "type": "object", "properties": { "message": { "type": "string" }, "pricing_override": { "$ref": "#/components/schemas/PricingOverride" } } }, "ListPricingOverridesResponse": { "type": "object", "properties": { "pricing_overrides": { "type": "array", "items": { "$ref": "#/components/schemas/PricingOverride" } }, "count": { "type": "integer", "description": "Total number of overrides returned" } } }, "LogEntry": { "type": "object", "description": "Log entry", "properties": { "id": { "type": "string" }, "parent_request_id": { "type": "string" }, "provider": { "type": "string" }, "model": { "type": "string" }, "status": { "type": "string", "enum": [ "processing", "success", "error" ] }, "object": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "number_of_retries": { "type": "integer" }, "fallback_index": { "type": "integer" }, "latency": { "type": "number" }, "cost": { "type": "number" }, "selected_key_id": { "type": "string" }, "selected_key_name": { "type": "string" }, "virtual_key_id": { "type": "string" }, "virtual_key_name": { "type": "string", "nullable": true }, "routing_engines_used": { "type": "array", "items": { "type": "string" }, "description": "Array of routing engines used for this request (routing-rule, governance, or loadbalancing)", "nullable": true }, "routing_rule_id": { "type": "string", "nullable": true }, "routing_rule_name": { "type": "string", "nullable": true }, "stream": { "type": "boolean" }, "raw_request": { "type": "string" }, "raw_response": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "token_usage": { "$ref": "#/components/schemas/BifrostLLMUsage" }, "error_details": { "$ref": "#/components/schemas/BifrostError" }, "input_history": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessage" } }, "responses_input_history": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } }, "output_message": { "$ref": "#/components/schemas/ChatMessage" }, "responses_output": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "message", "file_search_call", "computer_call", "computer_call_output", "web_search_call", "web_fetch_call", "function_call", "function_call_output", "code_interpreter_call", "local_shell_call", "local_shell_call_output", "mcp_call", "custom_tool_call", "custom_tool_call_output", "image_generation_call", "mcp_list_tools", "mcp_approval_request", "mcp_approval_responses", "reasoning", "item_reference", "refusal" ] }, "status": { "type": "string", "enum": [ "in_progress", "completed", "incomplete", "interpreting", "failed" ] }, "role": { "type": "string", "enum": [ "assistant", "user", "system", "developer" ] }, "content": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "input_text", "input_image", "input_file", "input_audio", "output_text", "refusal", "reasoning_text" ] }, "file_id": { "type": "string" }, "text": { "type": "string" }, "signature": { "type": "string" }, "image_url": { "type": "string" }, "detail": { "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "file_type": { "type": "string" }, "input_audio": { "type": "object", "required": [ "format", "data" ], "properties": { "format": { "type": "string", "enum": [ "mp3", "wav" ] }, "data": { "type": "string" } } }, "annotations": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "file_citation", "url_citation", "container_file_citation", "file_path" ] }, "index": { "type": "integer" }, "file_id": { "type": "string" }, "text": { "type": "string" }, "start_index": { "type": "integer" }, "end_index": { "type": "integer" }, "filename": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" }, "container_id": { "type": "string" } } } }, "logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } } } } } }, "refusal": { "type": "string" }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } } ] }, "call_id": { "type": "string" }, "name": { "type": "string" }, "arguments": { "type": "string" }, "output": { "type": "object" }, "action": { "type": "object" }, "error": { "type": "string" }, "queries": { "type": "array", "items": { "type": "string" } }, "results": { "type": "array", "items": { "type": "object" } }, "summary": { "type": "array", "items": { "type": "object", "required": [ "type", "text" ], "properties": { "type": { "type": "string", "enum": [ "summary_text" ] }, "text": { "type": "string" } } } }, "encrypted_content": { "type": "string" } } } }, "embedding_output": { "type": "array", "items": { "type": "array", "items": { "type": "number" } } }, "params": { "type": "object", "additionalProperties": true }, "tools": { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "function", "custom" ] }, "function": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": { "type": "object", "properties": { "type": { "type": "string" }, "description": { "type": "string" }, "required": { "type": "array", "items": { "type": "string" } }, "properties": { "type": "object", "additionalProperties": true }, "enum": { "type": "array", "items": { "type": "string" } }, "additionalProperties": { "type": "boolean" } } }, "strict": { "type": "boolean" } } }, "custom": { "type": "object", "properties": { "format": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string" }, "grammar": { "type": "object", "required": [ "definition", "syntax" ], "properties": { "definition": { "type": "string" }, "syntax": { "type": "string", "enum": [ "lark", "regex" ] } } } } } } }, "cache_control": { "$ref": "#/components/schemas/CacheControl" } } } }, "tool_calls": { "type": "array", "items": { "type": "object", "required": [ "function" ], "properties": { "index": { "type": "integer" }, "type": { "type": "string" }, "id": { "type": "string" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } } } } } }, "speech_input": { "type": "object", "additionalProperties": true }, "transcription_input": { "type": "object", "additionalProperties": true }, "image_generation_input": { "type": "object", "additionalProperties": true }, "speech_output": { "type": "object", "additionalProperties": true }, "transcription_output": { "type": "object", "additionalProperties": true }, "image_generation_output": { "type": "object", "additionalProperties": true }, "cache_debug": { "type": "object", "additionalProperties": true }, "metadata": { "type": "object", "additionalProperties": true, "description": "Custom metadata captured from request headers (configured via logging_headers or x-bf-lh-* prefix)" }, "selected_key": { "type": "object", "additionalProperties": true }, "virtual_key": { "type": "object", "additionalProperties": true }, "passthrough_request_body": { "type": "string", "description": "Raw passthrough request body (for passthrough integration routes)" }, "passthrough_response_body": { "type": "string", "description": "Raw passthrough response body (for passthrough integration routes)" }, "routing_engine_logs": { "type": "object", "additionalProperties": true, "description": "Detailed logs from the routing engine decision process" }, "is_large_payload_request": { "type": "boolean", "description": "Whether the request payload exceeded the large payload threshold" }, "is_large_payload_response": { "type": "boolean", "description": "Whether the response payload exceeded the large payload threshold" }, "rerank_output": { "type": "object", "additionalProperties": true, "description": "Rerank operation output" }, "video_generation_input": { "type": "object", "additionalProperties": true, "description": "Video generation request input" }, "video_generation_output": { "type": "object", "additionalProperties": true, "description": "Video generation response output" }, "video_retrieve_output": { "type": "object", "additionalProperties": true, "description": "Video retrieve response output" }, "video_list_output": { "type": "object", "additionalProperties": true, "description": "Video list response output" }, "video_delete_output": { "type": "object", "additionalProperties": true, "description": "Video delete response output" }, "video_download_output": { "type": "object", "additionalProperties": true, "description": "Video download response output" }, "list_models_output": { "type": "object", "additionalProperties": true, "description": "List models response output" } } }, "SearchLogsResponse": { "type": "object", "description": "Search logs response", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/LogEntry" } }, "pagination": { "type": "object", "description": "Pagination metadata for list responses", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "sort_by": { "type": "string", "enum": [ "timestamp", "latency", "tokens", "cost" ] }, "order": { "type": "string", "enum": [ "asc", "desc" ] }, "total_count": { "type": "integer", "format": "int64", "description": "Total number of items matching the query" } } }, "stats": { "$ref": "#/components/schemas/LogStats" }, "has_logs": { "type": "boolean", "description": "Whether any logs exist in the system" } } }, "LogStats": { "type": "object", "description": "Log statistics", "properties": { "total_requests": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_cost": { "type": "number" }, "average_latency": { "type": "number" }, "success_rate": { "type": "number" } } }, "DeleteLogsRequest": { "type": "object", "description": "Delete logs request", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "string" } } } }, "RecalculateCostRequest": { "type": "object", "description": "Recalculate cost request", "properties": { "filters": { "type": "object", "description": "Log search filters", "properties": { "providers": { "type": "array", "items": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "status": { "type": "array", "items": { "type": "string" } }, "objects": { "type": "array", "items": { "type": "string" } }, "selected_key_ids": { "type": "array", "items": { "type": "string" } }, "virtual_key_ids": { "type": "array", "items": { "type": "string" } }, "routing_rule_ids": { "type": "array", "items": { "type": "string" } }, "routing_engine_used": { "type": "array", "items": { "type": "string" }, "description": "Filter by routing engine (routing-rule, governance, or loadbalancing)" }, "start_time": { "type": "string", "format": "date-time" }, "end_time": { "type": "string", "format": "date-time" }, "min_latency": { "type": "number" }, "max_latency": { "type": "number" }, "min_tokens": { "type": "integer" }, "max_tokens": { "type": "integer" }, "min_cost": { "type": "number" }, "max_cost": { "type": "number" }, "missing_cost_only": { "type": "boolean" }, "content_search": { "type": "string" } } }, "limit": { "type": "integer", "description": "Maximum number of logs to process (default 200, max 1000)" } } }, "RecalculateCostResponse": { "type": "object", "description": "Recalculate cost response", "properties": { "total_matched": { "type": "integer" }, "updated": { "type": "integer" }, "skipped": { "type": "integer" }, "remaining": { "type": "integer" } } }, "ClearCacheResponse": { "type": "object", "description": "Clear cache response", "properties": { "message": { "type": "string", "example": "Cache cleared successfully" } } } } } }