{"servers":[{"url":"https://api.llmgateway.io"},{"url":"http://localhost:4001"}],"openapi":"3.0.0","info":{"version":"1.0.0","title":"LLM Gateway API","description":"OpenAI-compatible LLM gateway: chat completions, embeddings, images, audio, video, moderation, OCR and rerank across providers with one API key.\n\n**Authentication**: create an API key at https://llmgateway.io/dashboard and send it as `Authorization: Bearer <key>` (or `x-api-key`).\n\n**Deprecation policy**: https://docs.llmgateway.io/resources/api-versioning. No /v1 sunset is currently scheduled; notices describe the replacement and any retirement date. Deprecated endpoints use Deprecation and Link headers; scheduled retirements additionally use Sunset.\n\n**Versioning**: the API is versioned in the URL path (`/v1/...`). Backwards-incompatible changes only ship under a new path version. Model and provider deprecations are announced in the changelog (https://llmgateway.io/changelog) and deprecated entries remain listed in `/v1/models` with their deactivation date.\n\n**Rate limits**: requests are limited per organization and per endpoint. The structured `RateLimit-Policy` and `RateLimit` fields follow draft-ietf-httpapi-ratelimit-headers-11. 429 responses carry `Retry-After`, `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers (plus legacy `X-RateLimit-*`); back off until `Retry-After` elapses. Successful authenticated responses carry the organization requests-per-minute (RPM) policy, remaining request quota, and reset delay only when they passed an RPM quota check.\n\n**MCP**: a Model Context Protocol server (Streamable HTTP) is served at `/mcp`; OAuth metadata and scopes are published at `/.well-known/oauth-authorization-server` and `/.well-known/oauth-protected-resource`.\n\nThis document: https://api.llmgateway.io/openapi.json (mirrored at https://llmgateway.io/openapi.json)."},"externalDocs":{"url":"https://docs.llmgateway.io","description":"LLMGateway Documentation"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication using API keys"}},"schemas":{"OpenAIError":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string","nullable":true}},"required":["message","type","param","code"]}},"required":["error"],"description":"OpenAI-compatible error object."},"AnthropicError":{"type":"object","properties":{"type":{"type":"string","enum":["error"]},"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}},"required":["type","message"]}},"required":["type","error"],"description":"Anthropic-compatible error object."}},"parameters":{}},"paths":{"/":{"get":{"summary":"Health check","description":"Health check endpoint.","operationId":"health","parameters":[{"schema":{"type":"string","description":"Comma-separated list of health checks to skip. Options: redis, database","example":"redis,database"},"required":false,"name":"skip","in":"query"}],"responses":{"200":{"description":"Health check response.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"version":{"type":"string"},"health":{"type":"object","properties":{"status":{"type":"string"},"redis":{"type":"object","properties":{"connected":{"type":"boolean"},"error":{"type":"string"}},"required":["connected"]},"database":{"type":"object","properties":{"connected":{"type":"boolean"},"error":{"type":"string"}},"required":["connected"]}},"required":["status","redis","database"]}},"required":["message","version","health"]}}}},"503":{"description":"Service unavailable - Redis or database connection failed.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"version":{"type":"string"},"health":{"type":"object","properties":{"status":{"type":"string"},"redis":{"type":"object","properties":{"connected":{"type":"boolean"},"error":{"type":"string"}},"required":["connected"]},"database":{"type":"object","properties":{"connected":{"type":"boolean"},"error":{"type":"string"}},"required":["connected"]}},"required":["status","redis","database"]}},"required":["message","version","health"]}}}}}}},"/v1/chat/completions":{"post":{"operationId":"v1_chat_completions","summary":"Chat Completions","description":"Create a completion for the chat conversation","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","example":"gpt-5"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["developer","system","user","assistant","tool","function"],"example":"user"},"content":{"anyOf":[{"type":"string","example":"Hello!"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]},"prompt_cache_breakpoint":{"type":"object","properties":{"mode":{"type":"string","enum":["explicit"]}},"description":"OpenAI explicit prompt cache breakpoint marker (GPT-5.6 and later). Ends a cacheable prefix when the request sets prompt_cache_options.mode to 'explicit'. Stripped for providers/models without explicit prompt caching support."}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"type":"object","properties":{"url":{"type":"string"},"detail":{"type":"string","enum":["low","high","auto"]}},"required":["url"]},"prompt_cache_breakpoint":{"type":"object","properties":{"mode":{"type":"string","enum":["explicit"]}}}},"required":["type","image_url"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_audio"]},"input_audio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string","enum":["wav","mp3","aiff","aac","ogg","flac","m4a","mpeg","mpga","mp4","pcm","webm"]}},"required":["data","format"]},"prompt_cache_breakpoint":{"type":"object","properties":{"mode":{"type":"string","enum":["explicit"]}}}},"required":["type","input_audio"]},{"type":"object","properties":{"type":{"type":"string","enum":["file"]},"file":{"type":"object","properties":{"filename":{"type":"string"},"file_data":{"type":"string","description":"Base64-encoded data URL with MIME prefix, e.g. 'data:application/pdf;base64,<data>'."},"file_id":{"type":"string","description":"Reference to a file uploaded via the provider's Files API."}}},"prompt_cache_breakpoint":{"type":"object","properties":{"mode":{"type":"string","enum":["explicit"]}}}},"required":["type","file"]}]}},{"nullable":true}]},"name":{"type":"string"},"tool_call_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"}},"required":["name","arguments"]}},"required":["id","type","function"]},"description":"A list of tool calls generated by the model in this message.","example":[{"id":"call_abc123","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"Boston, MA\"}"}}]},"reasoning":{"type":"string"},"reasoning_content":{"type":"string"},"reasoning_details":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string"}}}},"phase":{"type":"string","enum":["commentary","final_answer"],"description":"OpenAI Responses assistant-message phase. Replayed upstream for OpenAI Responses API models; stripped for other providers."},"content_before_tool_calls":{"type":"boolean","description":"Marks assistant content that preceded the message's tool calls (pre-tool commentary on OpenAI Responses API models), so replay preserves the original item order. Stripped for other providers."},"message_items":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"phase":{"type":"string","enum":["commentary","final_answer"]},"preceding_tool_calls":{"type":"integer","minimum":0}},"required":["text"]},"description":"Separate phased assistant message items (e.g. commentary and final_answer) emitted by OpenAI Responses API models in a single turn. preceding_tool_calls records how many of the message's tool calls came before each item. Replayed upstream as individual message items in their original order; stripped for other providers."},"anthropic_native_blocks":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"]},"description":"Anthropic content blocks with no OpenAI-format equivalent. On an assistant message these are the server-side tool search blocks (`server_tool_use` + `tool_search_tool_result`), replayed ahead of the message's tool calls; on a tool message they are the `tool_result` content array, which is how a client-side tool search returns `tool_reference` blocks. Replayed on the Anthropic Messages API only and stripped for every other provider."},"tool_result_cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"],"description":"Prompt-cache breakpoint for the Anthropic `tool_result` block this tool message becomes. The OpenAI tool message shape has nowhere to carry it, so it rides here. Applied on the Anthropic Messages API only and stripped for every other provider."}},"required":["role"]}},"temperature":{"type":"number","nullable":true,"example":0.7},"max_tokens":{"type":"number","nullable":true,"example":1000},"top_p":{"type":"number","nullable":true,"example":0.9},"frequency_penalty":{"type":"number","nullable":true,"example":0},"presence_penalty":{"type":"number","nullable":true,"example":0},"response_format":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text","json_object"],"example":"json_object"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","additionalProperties":{"nullable":true}},"strict":{"type":"boolean"}},"required":["name","schema"]}},"required":["type","json_schema"]}]},"stream":{"type":"boolean","default":false},"n":{"type":"integer","nullable":true,"minimum":1,"maximum":128,"description":"How many chat completion choices to generate for each input message. Only accepted when the resolved model supports it upstream (currently OpenAI Chat Completions models and Google Gemini 2.5 models via `candidateCount`); requests for unsupported models are rejected with 400. Streaming is supported for OpenAI models: choice deltas are demultiplexed by `choices[].index` on a single SSE stream. Exceptions rejected with 400: `n > 1` with `stream: true` **and** function `tools` (the streaming tool-call aggregator can't disambiguate concurrent calls across choices; native `web_search` tools and the `web_search: true` flag are exempt), `n > 1` with `stream: true` on Google models (Gemini rejects candidateCount on streamGenerateContent), and `n > 8` on Google models (Gemini caps candidateCount at 8).","example":1},"prompt_cache_key":{"type":"string","nullable":true,"description":"OpenAI prompt caching key used to improve cache routing for requests with shared prompt prefixes.","example":"tenant-123"},"prompt_cache_retention":{"type":"string","nullable":true,"enum":["in_memory","24h"],"description":"OpenAI prompt cache retention policy. OpenAI supports in_memory and 24h for eligible models.","example":"24h"},"prompt_cache_options":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["implicit","explicit"]},"ttl":{"type":"string","enum":["30m"]}},"description":"OpenAI explicit prompt caching options (GPT-5.6 and later). mode 'implicit' (default) places an automatic cache breakpoint at the latest message; 'explicit' caches only content parts marked with prompt_cache_breakpoint. Only forwarded for OpenAI models that support explicit prompt caching.","example":{"mode":"explicit"}},"user":{"type":"string","nullable":true,"description":"OpenAI end-user identifier. Used as a fallback sticky-routing session key when no x-session-id header or prompt_cache_key is provided.","example":"user-123"},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name"]},"defer_loading":{"type":"boolean","description":"Anthropic only. Keeps the tool out of the rendered tools section so it never enters the cached prompt prefix, and loads it on demand once the tool search tool discovers it. Requires a `tool_search` tool in `tools`, and Anthropic rejects a request whose tools are all deferred. Stripped for every other provider, which receives the tool eagerly instead."},"cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"],"description":"Anthropic only. Cache breakpoint ending the tool-definitions prefix, which Anthropic renders before the system prompt and messages. Placed on the last tool it caches every tool up to and including that one, and counts toward Anthropic's limit of 4 breakpoints per request. Stripped for every other provider."}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_search"]},"tool_search_type":{"type":"string","pattern":"^tool_search_tool","description":"Anthropic tool search tool type, e.g. `tool_search_tool_regex_20251119` or `tool_search_tool_bm25_20251119`."},"name":{"type":"string"}},"required":["type","tool_search_type"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]},"user_location":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"}}},"search_context_size":{"type":"string","enum":["low","medium","high"]},"max_uses":{"type":"number"},"allowed_domains":{"type":"array","items":{"type":"string"}},"blocked_domains":{"type":"array","items":{"type":"string"}}},"required":["type"]}]}},"tool_choice":{"anyOf":[{"type":"string","enum":["auto"]},{"type":"string","enum":["none"]},{"type":"string","enum":["required"]},{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["type","function"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search"]}},"required":["type"]}],"description":"Controls which tool the model calls. `{\"type\": \"web_search\"}` demands a search instead of offering one, and requires a `web_search` tool in `tools`. Providers whose web search is model-elected are unaffected by it — the model already decides — but it is the only way to reach providers that can search solely on demand (currently Alibaba's DashScope and its resellers), which are otherwise skipped when routing a web search request."},"reasoning_effort":{"type":"string","nullable":true,"enum":["none","minimal","low","medium","high","xhigh","max"],"description":"Controls the reasoning effort for reasoning-capable models. `none` is only supported by OpenAI's newer reasoning models (e.g. gpt-5.4 and later); for other providers it disables reasoning. `max` is the highest tier (above `xhigh`), supported by Anthropic models and OpenAI GPT-5.6 models. The gateway never downgrades effort tiers: providers that accept an effort parameter receive the value unchanged (an unsupported value results in a provider error), while providers that take a thinking budget instead (e.g. Anthropic, Google) translate each tier to a native budget. The exact values each provider mapping accepts are exposed as `reasoning_efforts` on `/v1/models`.","example":"medium"},"reasoning":{"type":"object","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"Controls the reasoning effort. Alternative to top-level reasoning_effort. Cannot be used together with reasoning_effort. `max` is the highest tier (above `xhigh`), supported by Anthropic models and OpenAI GPT-5.6 models. Tiers are never downgraded by the gateway: enum-based providers receive the value unchanged (unsupported values result in a provider error), while budget-based providers (e.g. Anthropic, Google) translate the tier to a native thinking budget. See `reasoning_efforts` on `/v1/models` for the values each mapping accepts.","example":"medium"},"max_tokens":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Exact number of tokens to allocate for reasoning. When specified, overrides effort. Supported by Anthropic and Google thinking models.","example":4000},"context":{"type":"string","enum":["auto","current_turn","all_turns"],"description":"How much replayed reasoning the model considers (OpenAI Responses API models only). Omitting the field is equivalent to 'auto'. Forwarded upstream as reasoning.context; ignored by other providers.","example":"current_turn"}},"description":"Unified reasoning configuration object for controlling reasoning behavior"},"effort":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Controls the computational effort for supported models (currently only claude-opus-4-5-20251101)","example":"medium"},"verbosity":{"type":"string","nullable":true,"enum":["low","medium","high"],"description":"Controls how detailed the model's responses are. Only supported by OpenAI GPT-5 and later models; requests to models without verbosity support return a 400 error.","example":"low"},"service_tier":{"type":"string","enum":["auto","default","flex","priority"],"description":"Processing tier for the request. `flex` and `priority` are forwarded only for provider/model mappings that explicitly support the requested tier, such as supported OpenAI and Google mappings. `auto`/`default` use the standard on-demand tier. Unsupported tier requests return a 400 `unsupported_service_tier` error. On coding (dev) plans only `auto`, `default` and `flex` are allowed.","example":"flex"},"routing":{"type":"string","enum":["auto","price","throughput","latency"],"description":"Provider selection strategy for model-id routing, named after the factor it optimizes. `auto` (default) uses the full weighted smart-routing score. `price`, `throughput`, and `latency` each give a 90% relative weight to that factor while keeping a small uptime weight so requests still fall back to other providers when the top pick has extremely bad uptime. `latency` only biases streaming requests. Combining `routing` with a specific provider prefix (e.g. `openai/gpt-4o`) returns a 400. On coding (dev) plans only `auto` and `price` are allowed.","example":"price"},"free_models_only":{"type":"boolean","default":false,"description":"When used with auto routing, only route to free models (models with zero input and output pricing)","example":false},"onboarding":{"type":"boolean","default":false,"description":"Deprecated and ignored. This once skipped email verification for free model usage, but the flag is client-supplied, so any account could assert it. Onboarding is now recognized server-side by the API proxy; setting this grants nothing.","deprecated":true,"example":false},"no_reasoning":{"type":"boolean","default":false,"description":"When used with auto routing, exclude reasoning models from selection","example":false},"sensitive_word_check":{"type":"object","properties":{"status":{"type":"string","enum":["DISABLE","ENABLE"]}},"required":["status"]},"image_config":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"image_size":{"type":"string"},"image_quality":{"type":"string","enum":["low","medium","high","auto"]},"n":{"type":"number"},"seed":{"type":"number"}}},"web_search":{"type":"boolean","default":false,"description":"Enable native web search for models that support it. When enabled, the model can search the web for real-time information.","example":true},"plugins":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["response-healing"],"description":"Plugin identifier","example":"response-healing"}},"required":["id"]},"description":"Plugins to enable for this request. Currently supported: response-healing (automatically repairs malformed JSON responses when using response_format)","example":[{"id":"response-healing"}]}},"required":["model","messages"]}}}},"responses":{"200":{"description":"User response object or streaming response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created":{"type":"number"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"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"}},"required":["name","arguments"]}},"required":["id","type","function"]}},"images":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}},"required":["type","image_url"]}}},"required":["role","content"]},"finish_reason":{"type":"string"}},"required":["index","message","finish_reason"]}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"number"},"completion_tokens":{"type":"number"},"total_tokens":{"type":"number"},"reasoning_tokens":{"type":"number"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"number"},"cache_write_tokens":{"type":"number"},"cache_creation_tokens":{"type":"number"},"cache_creation":{"type":"object","properties":{"ephemeral_5m_input_tokens":{"type":"number"},"ephemeral_1h_input_tokens":{"type":"number"}},"required":["ephemeral_5m_input_tokens","ephemeral_1h_input_tokens"]},"audio_tokens":{"type":"number"},"video_tokens":{"type":"number"}},"required":["cached_tokens"]},"completion_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"number"},"image_tokens":{"type":"number"},"audio_tokens":{"type":"number"}}},"cost":{"type":"number","nullable":true},"cost_details":{"type":"object","properties":{"upstream_inference_cost":{"type":"number"},"upstream_inference_prompt_cost":{"type":"number"},"upstream_inference_completions_cost":{"type":"number"},"total_cost":{"type":"number","nullable":true},"input_cost":{"type":"number","nullable":true},"output_cost":{"type":"number","nullable":true},"cached_input_cost":{"type":"number","nullable":true},"cache_write_input_cost":{"type":"number","nullable":true},"request_cost":{"type":"number","nullable":true},"web_search_cost":{"type":"number","nullable":true},"image_input_cost":{"type":"number","nullable":true},"image_output_cost":{"type":"number","nullable":true},"audio_input_cost":{"type":"number","nullable":true},"data_storage_cost":{"type":"number","nullable":true}},"required":["upstream_inference_cost","upstream_inference_prompt_cost","upstream_inference_completions_cost"]},"info":{"type":"string"}},"required":["prompt_tokens","completion_tokens","total_tokens"]},"metadata":{"type":"object","properties":{"request_id":{"type":"string"},"requested_model":{"type":"string"},"requested_provider":{"type":"string","nullable":true},"used_model":{"type":"string"},"used_provider":{"type":"string"},"used_region":{"type":"string","nullable":true},"underlying_used_model":{"type":"string"},"log_id":{"type":"string"},"organization_id":{"type":"string"},"project_id":{"type":"string"},"discount":{"type":"number","nullable":true},"cached":{"type":"boolean","description":"True when the response was replayed from the gateway response cache instead of being generated upstream. Omitted otherwise."},"routing":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"region":{"type":"string"},"status_code":{"type":"number"},"error_type":{"type":"string"},"succeeded":{"type":"boolean"},"apiKeyHash":{"type":"string","description":"Stable fingerprint of the provider credential this attempt was sent with. Use it together with credentialSource to tell attempts apart when a request rotated keys."},"credentialSource":{"type":"string","enum":["byok","platform"],"description":"Whose provider credential served this attempt. `byok` is your organization's own provider key — the provider bills you directly and no credits are deducted. `platform` is an LLM Gateway credential, billed as credits. A hybrid-mode request whose own key fails falls back to `platform`, so both values can appear in one response."},"providerKeyId":{"type":"string","description":"Id of your provider key that served this attempt. Set only when credentialSource is `byok`."},"providerKeyLabel":{"type":"string","description":"Your provider key as it is named on the provider-keys page (its name, or its masked token when unnamed), so an attempt can be tied to a key without decoding the fingerprint. Set only when credentialSource is `byok`; LLM Gateway's own credentials are never described."},"logId":{"type":"string"}},"required":["provider","model","status_code","error_type","succeeded"]}}},"required":["request_id","requested_model","requested_provider","used_model","used_provider","underlying_used_model"]}},"required":["id","object","created","model","choices","usage","metadata"]}},"text/event-stream":{"schema":{"nullable":true}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/embeddings":{"post":{"operationId":"v1_embeddings","summary":"Embeddings","description":"Generate vector embeddings for one or more inputs using an OpenAI-compatible embeddings model.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"integer"}},{"type":"array","items":{"type":"array","items":{"type":"integer"}}}],"description":"Input text to embed. A single string, an array of strings, an array of token IDs, or an array of token-ID arrays. Cannot exceed the model's max input tokens (8192 for OpenAI text-embedding-3 and ada-002).","example":"The food was delicious and the waiter was friendly."},"model":{"type":"string","description":"ID of the embedding model to use.","example":"text-embedding-3-small"},"encoding_format":{"type":"string","enum":["float","base64"],"description":"Format of the returned embeddings. `float` returns plain arrays, `base64` returns a packed base64 string.","example":"float"},"dimensions":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Number of dimensions for the output embeddings. Only supported by models that allow shortening output (e.g. `text-embedding-3-*`, `gemini-embedding-*`, `qwen3-embedding-8b`).","example":1536},"user":{"type":"string","description":"Accepted for OpenAI compatibility. Upstream abuse attribution always uses LLM Gateway's opaque organization identifier."}},"required":["input","model"]}}}},"responses":{"200":{"description":"Embeddings response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","enum":["embedding"]},"embedding":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"string"}]},"index":{"type":"integer"}},"required":["object","embedding","index"]}},"model":{"type":"string"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"required":["prompt_tokens","total_tokens"]}},"description":"OpenAI-compatible embeddings response payload."}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/images/generations":{"post":{"operationId":"v1_images_generations","summary":"Create image","description":"Creates an image given a prompt. Internally routes to a chat completions model with image generation capabilities.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"description":"A text description of the desired image(s).","example":"A white siamese cat"},"model":{"type":"string","default":"auto","description":"The model to use for image generation. Defaults to auto which selects an appropriate image generation model.","example":"gemini-3.1-flash-image"},"n":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"The number of images to generate. Must be between 1 and 10.","example":1},"size":{"type":"string","description":"The size of the generated images. Supported sizes depend on the model and provider.","example":"1024x1024"},"quality":{"type":"string","enum":["standard","hd","low","medium","high","auto"],"description":"The quality of the image that will be generated. Supported values depend on the model and provider.","example":"standard"},"response_format":{"type":"string","enum":["b64_json"],"default":"b64_json","description":"The format in which the generated images are returned. Only b64_json is supported since images are generated via chat completions models.","example":"b64_json"},"style":{"type":"string","enum":["vivid","natural"],"description":"The style of the generated images.","example":"vivid"},"aspect_ratio":{"type":"string","description":"The aspect ratio of the generated images (e.g. '1:1', '16:9', '4:3', '5:4'). Takes precedence over size if both are provided.","example":"16:9"}},"required":["prompt"]}}}},"responses":{"200":{"description":"Image generation response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"b64_json":{"type":"string"},"revised_prompt":{"type":"string"}},"required":["b64_json"]}}},"required":["created","data"]}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/images/edits":{"post":{"operationId":"v1_images_edits","summary":"Edit image","description":"Creates an edited image from one or more source images and a prompt.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"object","properties":{"image_url":{"type":"string","description":"A fully qualified HTTPS URL or base64-encoded data URL.","example":"https://example.com/source-image.png"}},"required":["image_url"]},"minItems":1,"maxItems":16,"description":"Input image references to edit. Provide image_url as HTTPS URL or data URL."},"prompt":{"type":"string","minLength":1,"description":"A text description of the desired image edit.","example":"Add a watercolor effect to this image"},"background":{"type":"string","enum":["transparent","opaque","auto"],"description":"Background behavior for generated image output.","example":"transparent"},"input_fidelity":{"type":"string","enum":["high","low"],"description":"Controls fidelity to the original input image(s).","example":"high"},"model":{"type":"string","description":"The model to use for image editing.","example":"gemini-3-pro-image"},"n":{"type":"integer","minimum":1,"maximum":10,"description":"The number of edited images to generate.","example":1},"output_compression":{"type":"integer","minimum":0,"maximum":100,"description":"Compression level for jpeg or webp output.","example":100},"output_format":{"type":"string","enum":["png","jpeg","webp"],"description":"Output image format.","example":"png"},"quality":{"type":"string","enum":["low","medium","high","auto"],"description":"Output quality for image models.","example":"high"},"size":{"type":"string","description":"Requested output image size. Supported values depend on the model and provider.","example":"1024x1024"},"aspect_ratio":{"type":"string","description":"The aspect ratio of the edited images (e.g. '1:1', '16:9', '4:3', '5:4'). Takes precedence over size-derived defaults.","example":"16:9"}},"required":["images","prompt"]}}}},"responses":{"200":{"description":"Image edit response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"b64_json":{"type":"string"},"revised_prompt":{"type":"string"}},"required":["b64_json"]}},"background":{"type":"string","enum":["transparent","opaque"]},"output_format":{"type":"string","enum":["png","webp","jpeg"]},"quality":{"type":"string","enum":["low","medium","high"]},"size":{"type":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"number"},"input_tokens_details":{"type":"object","properties":{"image_tokens":{"type":"number"},"text_tokens":{"type":"number"}},"required":["image_tokens","text_tokens"]},"output_tokens":{"type":"number"},"total_tokens":{"type":"number"},"output_tokens_details":{"type":"object","properties":{"image_tokens":{"type":"number"},"text_tokens":{"type":"number"}},"required":["image_tokens","text_tokens"]}},"required":["input_tokens","input_tokens_details","output_tokens","total_tokens"]}},"required":["created","data"]}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/key":{"get":{"operationId":"v1_key_retrieve","summary":"Retrieve key status","description":"Returns usage information for the API key used to authenticate the request, including the organization's dev plan allowance and weekly premium-model usage. Lets clients that only hold an API key surface remaining quota without a dashboard session. Deliberately excludes billing details and the key token itself.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Status of the API key and its organization's dev plan.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"label":{"type":"string","description":"Description of the API key used for the request."},"usage":{"type":"string","description":"Total usage in USD accrued by this API key."},"limit":{"type":"string","nullable":true,"description":"Usage limit in USD set on this API key, if any."},"devPlan":{"type":"string","enum":["none","lite","pro","max"],"description":"Dev plan tier of the organization this key belongs to. 'none' for pay-as-you-go organizations."},"devPlanCreditsUsed":{"type":"string","description":"Plan credits used in the current billing cycle, in USD."},"devPlanCreditsLimit":{"type":"string","description":"Plan credit allowance per billing cycle, in USD."},"devPlanCreditsRemaining":{"type":"string","description":"Plan credits remaining in the current billing cycle."},"devPlanPremiumWeeklyLimit":{"type":"string","description":"Weekly fair-use allowance for premium models, in USD of plan credits."},"devPlanPremiumCreditsUsed":{"type":"string","description":"Premium-model plan credits used in the current weekly window."},"devPlanPremiumWeekResetsAt":{"type":"string","nullable":true,"description":"When the current premium weekly window resets (ISO 8601), or null when no window is active."}},"required":["label","usage","limit","devPlan","devPlanCreditsUsed","devPlanCreditsLimit","devPlanCreditsRemaining","devPlanPremiumWeeklyLimit","devPlanPremiumCreditsUsed","devPlanPremiumWeekResetsAt"]}},"required":["data"]}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/models":{"get":{"operationId":"v1_models","summary":"Models","description":"List all available models","parameters":[{"schema":{"type":"string","description":"Include deactivated models in the response","example":"false"},"required":false,"description":"Include deactivated models in the response","name":"include_deactivated","in":"query"},{"schema":{"type":"string","description":"Exclude deprecated models from the response","example":"false"},"required":false,"description":"Exclude deprecated models from the response","name":"exclude_deprecated","in":"query"},{"schema":{"type":"string","description":"Only return models and provider mappings whose provider does not train on API data","example":"false"},"required":false,"description":"Only return models and provider mappings whose provider does not train on API data","name":"no_training","in":"query"},{"schema":{"type":"string","description":"Return one entry per provider mapping with `provider/model-id` ids (the gateway's provider-pinned request format) instead of one aggregated entry per model. Each entry carries that specific mapping's pricing, context length, and capabilities.","example":"false"},"required":false,"description":"Return one entry per provider mapping with `provider/model-id` ids (the gateway's provider-pinned request format) instead of one aggregated entry per model. Each entry carries that specific mapping's pricing, context length, and capabilities.","name":"mapped","in":"query"}],"responses":{"200":{"description":"List of available models","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"display_name":{"type":"string","description":"Human-readable model label, mirroring `name`. Anthropic-format clients such as Claude Code read this field when populating their model picker from gateway model discovery."},"aliases":{"type":"array","items":{"type":"string"}},"created":{"type":"number"},"description":{"type":"string"},"family":{"type":"string"},"architecture":{"type":"object","properties":{"input_modalities":{"type":"array","items":{"type":"string","enum":["text","image","video","embedding","audio"]}},"output_modalities":{"type":"array","items":{"type":"string","enum":["text","image","video","embedding","audio","ocr","transcription","rerank"]}},"tokenizer":{"type":"string"}},"required":["input_modalities","output_modalities"]},"top_provider":{"type":"object","properties":{"is_moderated":{"type":"boolean"}},"required":["is_moderated"]},"providers":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"externalId":{"type":"string"},"supportedVideoSizes":{"type":"array","items":{"type":"string"}},"supportsVideoAudio":{"type":"boolean"},"supportsVideoWithoutAudio":{"type":"boolean"},"pricing":{"type":"object","properties":{"prompt":{"type":"string"},"completion":{"type":"string"},"image":{"type":"string"},"input_audio":{"type":"string"},"input_audio_cache_read":{"type":"string"},"output_audio":{"type":"string"},"per_second":{"type":"object","additionalProperties":{"type":"string"}},"per_image":{"type":"object","additionalProperties":{"type":"string"}},"request":{"type":"string"},"input_cache_read":{"type":"string"},"input_cache_write":{"type":"string"},"input_cache_write_1h":{"type":"string"},"ocr_page":{"type":"string"},"input_audio_hour":{"type":"string"}},"required":["prompt","completion"]},"streaming":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["only"]}]},"vision":{"type":"boolean"},"realtime":{"type":"boolean","description":"Whether this mapping is served via the /v1/realtime WebSocket endpoint instead of /v1/chat/completions."},"cancellation":{"type":"boolean"},"tools":{"type":"boolean"},"parallelToolCalls":{"type":"boolean"},"reasoning":{"type":"boolean"},"reasoning_efforts":{"type":"array","items":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"]},"description":"Exact reasoning_effort values this provider mapping accepts, in ascending order of effort. Omitted when the supported values are not declared for the mapping."},"min_cacheable_tokens":{"type":"number","description":"Minimum prompt length (in tokens) the provider requires before a prompt-cache write can occur. cache_control markers on shorter prompts are accepted but silently not cached by the provider."},"max_output":{"type":"number","description":"Maximum output tokens this provider mapping accepts as max_tokens; larger requests are rejected with HTTP 400. Omitted when the mapping declares no limit (any max_tokens is accepted)."},"stability":{"type":"string","enum":["stable","beta","unstable","experimental"]}},"required":["providerId","externalId","streaming","vision","cancellation","tools","parallelToolCalls","reasoning"]}},"pricing":{"type":"object","properties":{"prompt":{"type":"string"},"completion":{"type":"string"},"image":{"type":"string"},"input_audio":{"type":"string"},"input_audio_cache_read":{"type":"string"},"output_audio":{"type":"string"},"per_second":{"type":"object","additionalProperties":{"type":"string"}},"per_image":{"type":"object","additionalProperties":{"type":"string"}},"request":{"type":"string"},"input_cache_read":{"type":"string"},"input_cache_write":{"type":"string"},"input_cache_write_1h":{"type":"string"},"web_search":{"type":"string"},"internal_reasoning":{"type":"string"},"ocr_page":{"type":"string"},"input_audio_hour":{"type":"string"}},"required":["prompt","completion"]},"context_length":{"type":"number"},"max_output":{"type":"number","description":"Largest max_tokens value guaranteed to be accepted regardless of which provider mapping serves the request (the minimum across still-servable mappings that declare a limit; deactivated mappings are excluded). Omitted when no such mapping declares one."},"per_request_limits":{"type":"object","additionalProperties":{"type":"string"}},"supported_parameters":{"type":"array","items":{"type":"string"}},"json_output":{"type":"boolean"},"structured_outputs":{"type":"boolean"},"free":{"type":"boolean"},"deprecated_at":{"type":"string"},"deactivated_at":{"type":"string"},"stability":{"type":"string","enum":["stable","beta","unstable","experimental"]}},"required":["id","name","display_name","family","architecture","top_provider","providers","pricing","json_output","structured_outputs"]}}},"required":["data"]}}}},"429":{"description":"Rate limited. Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/moderations":{"post":{"operationId":"v1_moderations","summary":"Moderations","description":"Classify text or multimodal inputs with OpenAI moderation.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"anyOf":[{"type":"string","description":"Plain text input to classify.","example":"I want to harm someone."},{"type":"array","items":{"type":"string","description":"Plain text input to classify.","example":"I want to harm someone."}},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","image_url"],"description":"Input item type.","example":"text"},"text":{"type":"string","description":"Text content for `type: text` items.","example":"Please review this sentence."},"image_url":{"type":"object","properties":{"url":{"type":"string","description":"Image URL or data URL for `type: image_url` items.","example":"https://example.com/image.png"}},"required":["url"],"description":"Image payload for `type: image_url` items."}},"required":["type"],"description":"Multimodal moderation input item."}}],"description":"Plain text, an array of text strings, or an array of multimodal input items.","example":"I want to harm someone."},"model":{"type":"string","default":"omni-moderation-latest","description":"OpenAI moderation model. Defaults to omni-moderation-latest.","example":"omni-moderation-latest"}},"required":["input"]}}}},"responses":{"200":{"description":"Moderation response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Moderation response ID.","example":"modr-123"},"model":{"type":"string","description":"Moderation model used for the request.","example":"openai/openai-moderation"},"results":{"type":"array","items":{"type":"object","properties":{"flagged":{"type":"boolean","description":"Whether the input was flagged.","example":true},"categories":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Category flags returned by the moderation model.","example":{"violence":true,"self_harm":false}},"category_scores":{"type":"object","additionalProperties":{"type":"number"},"description":"Model confidence scores for each category.","example":{"violence":0.98,"self_harm":0.01}},"category_applied_input_types":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Input types that contributed to each category decision."}},"required":["flagged"],"description":"One moderation result entry."},"description":"Moderation results for the submitted input."}},"description":"Moderation response payload."}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/ocr":{"post":{"operationId":"v1_ocr","summary":"OCR","description":"Extract text and structure from a document or image as markdown using an OCR model.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"ID of the OCR model to use.","example":"mistral-ocr-latest"},"document":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["document_url"]},"document_url":{"type":"string","description":"URL or data URL of the PDF/document to process.","example":"https://arxiv.org/pdf/2201.04234"},"document_name":{"type":"string"}},"required":["type","document_url"]},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"anyOf":[{"type":"string"},{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}],"description":"URL or data URL of the image to process, or an object with a `url` field."}},"required":["type","image_url"]}],"description":"The document or image to run OCR on."},"id":{"type":"string"},"pages":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"string"}],"description":"Specific pages to process, as a list of page indices or a range string (e.g. '0-5')."},"include_image_base64":{"type":"boolean","description":"Whether to return extracted images as base64 in the response."},"image_limit":{"type":"integer"},"image_min_size":{"type":"integer"},"bbox_annotation_format":{"type":"object","additionalProperties":{"nullable":true}},"document_annotation_format":{"type":"object","additionalProperties":{"nullable":true}}},"required":["model","document"]}}}},"responses":{"200":{"description":"OCR response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"markdown":{"type":"string"},"images":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"dimensions":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}}},"model":{"type":"string"},"document_annotation":{"type":"string","nullable":true},"usage_info":{"type":"object","properties":{"pages_processed":{"type":"integer"},"doc_size_bytes":{"type":"integer","nullable":true}}}},"description":"OCR response payload returned by the upstream provider."}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/rerank":{"post":{"operationId":"v1_rerank","summary":"Rerank","description":"Rerank documents against a query using a cross-encoder reranker. Cohere-compatible API.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"ID of the rerank model to use.","example":"deepinfra/qwen3-reranker-8b"},"query":{"type":"string","minLength":1,"description":"The search query to rank documents against.","example":"What is the capital of France?"},"documents":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Array of document strings to rerank.","example":["Paris is the capital of France.","Berlin is the capital of Germany.","Madrid is the capital of Spain."]},"top_n":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Number of top results to return. Defaults to all documents when omitted.","example":2},"return_documents":{"type":"boolean","description":"Whether to include the document text in the response. Default false.","example":true},"max_chunks_per_doc":{"type":"integer","minimum":0,"exclusiveMinimum":true,"description":"Maximum number of chunks per document (accepted, but not all providers support this).","example":10}},"required":["model","query","documents"]}}}},"responses":{"200":{"description":"Rerank response with ranked results.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"relevance_score":{"type":"number"},"document":{"type":"string"}},"required":["index","relevance_score"]}},"meta":{"type":"object","properties":{"api_version":{"type":"object","properties":{"version":{"type":"string"}}},"billed_units":{"type":"object","properties":{"input_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}}},"required":["model","results"],"description":"Cohere-compatible rerank response payload."}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/messages":{"post":{"operationId":"v1_messages","summary":"Anthropic Messages","description":"Create a message using Anthropic's API format","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"The model to use for completion","example":"claude-3-5-sonnet-20241022"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool","function"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["image"]},"source":{"type":"object","properties":{"type":{"type":"string","enum":["base64"]},"media_type":{"type":"string"},"data":{"type":"string"}},"required":["type","media_type","data"]}},"required":["type","source"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"]},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","id","name","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_result"]},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}}]},"is_error":{"type":"boolean"},"cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]}},"required":["type","tool_use_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"]},"thinking":{"type":"string"},"signature":{"type":"string"}},"required":["type","thinking"]},{"type":"object","properties":{"type":{"type":"string","enum":["redacted_thinking"]},"data":{"type":"string"}},"required":["type","data"]},{"type":"object","properties":{"type":{"type":"string","enum":["server_tool_use"]},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","id","name"]},{"type":"object","properties":{"type":{"type":"string","enum":["web_search_tool_result"]},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]}},"required":["type","tool_use_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_search_tool_result"]},"tool_use_id":{"type":"string"},"content":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","tool_use_id"]}]}}]},"tool_call_id":{"type":"string"},"name":{"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"}},"required":["name","arguments"]}},"required":["id","type","function"]}},"function_call":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}}]}},"required":["name","arguments"]}},"required":["role","content"]},"description":"Array of message objects"},"max_tokens":{"type":"number","minimum":1,"description":"Maximum number of tokens to generate","example":1024},"system":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"cache_control":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]}},"required":["type","text"]}}],"description":"System prompt to provide context"},"temperature":{"type":"number","minimum":0,"maximum":1,"description":"Sampling temperature between 0 and 1","example":0.7},"tools":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["custom"]},"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":{"nullable":true}},"cache_control":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]},"defer_loading":{"type":"boolean"}},"required":["name","input_schema"]},{"type":"object","properties":{"type":{"type":"string","pattern":"^tool_search_tool"},"name":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"max_uses":{"type":"number"},"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"},"region":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"}}},"cache_control":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"type":"string","enum":["5m","1h"]}},"required":["type"]}},"required":["type","name"]}]},"description":"Available tools for the model to use"},"stream":{"type":"boolean","default":false,"description":"Whether to stream the response","example":false},"metadata":{"type":"object","properties":{"user_id":{"type":"string"}},"description":"Anthropic request metadata. Claude Code embeds the session id in user_id, which the gateway uses for sticky routing."},"thinking":{"type":"object","properties":{"type":{"type":"string"},"budget_tokens":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["type"],"description":"Anthropic extended-thinking configuration. Mapped onto the gateway's unified reasoning controls so the requested effort reaches the provider."},"output_config":{"type":"object","properties":{"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"]}},"description":"Anthropic output configuration. `effort` controls adaptive reasoning depth on Opus 4.7+ models."}},"required":["model","messages","max_tokens"]}}}},"responses":{"200":{"description":"Successful response","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["assistant"]},"model":{"type":"string"},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","tool_use","thinking","server_tool_use","web_search_tool_result","tool_search_tool_result"]},"text":{"type":"string"},"thinking":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"nullable":true}},"tool_use_id":{"type":"string"},"content":{"anyOf":[{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]}},"required":["type"]}},"stop_reason":{"type":"string","nullable":true,"enum":["end_turn","max_tokens","stop_sequence","tool_use","pause_turn","refusal"]},"stop_sequence":{"type":"string","nullable":true},"usage":{"type":"object","properties":{"input_tokens":{"type":"number"},"output_tokens":{"type":"number"},"cache_creation_input_tokens":{"type":"number","default":0},"cache_read_input_tokens":{"type":"number","default":0},"cache_creation":{"type":"object","properties":{"ephemeral_5m_input_tokens":{"type":"number"},"ephemeral_1h_input_tokens":{"type":"number"}},"required":["ephemeral_5m_input_tokens","ephemeral_1h_input_tokens"]}},"required":["input_tokens","output_tokens"]}},"required":["id","type","role","model","content","stop_reason","stop_sequence","usage"]}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}}}}},"/v1/audio/speech":{"post":{"operationId":"v1_audio_speech","summary":"Create speech","description":"Generates audio from input text (text-to-speech). Returns the audio file as binary data.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"ID of the speech generation (text-to-speech) model to use.","example":"gemini-2.5-flash-preview-tts"},"input":{"type":"string","minLength":1,"description":"The text to synthesize into speech.","example":"Hello, welcome to LLM Gateway!"},"voice":{"type":"string","description":"The prebuilt voice to use. Defaults to the model's default voice when omitted.","example":"Kore"},"response_format":{"type":"string","enum":["wav","pcm","mp3","opus","aac","flac"],"description":"The audio format of the returned audio. OpenAI models support mp3 (default), opus, aac, flac, wav and pcm. Gemini models emit PCM, so only wav (default) and pcm are supported.","example":"wav"},"speed":{"type":"number","minimum":0.25,"maximum":4,"description":"Playback speed hint. Forwarded to OpenAI models; not applied by Gemini speech models.","example":1},"instructions":{"type":"string","description":"Optional style/delivery instructions prepended to the input as a natural-language directive (e.g. 'Say cheerfully').","example":"Say in a warm, friendly tone"}},"required":["model","input"]}}}},"responses":{"200":{"description":"Generated audio.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"audio/wav":{"schema":{"nullable":true}},"audio/mpeg":{"schema":{"nullable":true}},"application/octet-stream":{"schema":{"nullable":true}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/audio/transcriptions":{"post":{"operationId":"v1_audio_transcriptions","summary":"Create transcription","description":"Transcribes audio into text (speech-to-text) with word-level timestamps. The request body is multipart/form-data carrying the audio file (or a URL to it).","security":[{"bearerAuth":[]}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"ID of the transcription (speech-to-text) model to use.","example":"grok-stt-1-0"},"file":{"type":"string","description":"The audio file to transcribe. Required unless `url` is provided.","format":"binary"},"url":{"type":"string","description":"URL of an audio file to download and transcribe upstream. Required unless `file` is provided."},"language":{"type":"string","description":"Language code (e.g. 'en'). When set, enables inverse text normalization so numbers and currencies are formatted in their written form.","example":"en"},"diarize":{"type":"string","description":"When 'true', enables speaker diarization; each word in the response includes a `speaker` field."},"filler_words":{"type":"string","description":"When 'true', filler words (e.g. 'uh', 'um') are kept in the transcript instead of being removed."},"keyterm":{"type":"string","description":"A key term to bias transcription toward (e.g. product names). Repeat the field for multiple terms."}},"required":["model"],"description":"Multipart form fields for the transcription request."}}}},"responses":{"200":{"description":"Transcription response.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"duration":{"type":"number"},"words":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"number"}}}},"channels":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"description":"Transcription payload: full transcript text, detected language, audio duration in seconds and word-level timestamps."}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/videos":{"post":{"operationId":"v1_videos_create","summary":"Create video","description":"Creates a new asynchronous video generation job using an OpenAI-compatible request format.","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","default":"veo-3.1-generate-preview","description":"The video generation model to use. Supports current Veo and Sora video models, including provider-prefixed variants like openai/sora-2 or google-vertex/veo-3.1-generate-preview.","example":"veo-3.1-generate-preview"},"prompt":{"type":"string","minLength":1,"description":"Text prompt describing the video to generate.","example":"A cinematic drone shot flying through a neon-lit futuristic city at night"},"size":{"type":"string","description":"Output resolution in OpenAI widthxheight format. Supported values depend on the selected model and provider mapping.","example":"1280x720"},"callback_url":{"type":"string","format":"uri","description":"LLMGateway extension. When set, a signed webhook is delivered after the job reaches a terminal state.","example":"https://example.com/webhooks/video"},"callback_secret":{"type":"string","minLength":1,"description":"LLMGateway extension. Shared secret used to sign webhook deliveries with HMAC-SHA256.","example":"whsec_test_secret"},"input_reference":{"anyOf":[{"type":"string"},{"type":"object","properties":{"image_url":{"type":"string"}},"required":["image_url"]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"image_url":{"type":"string"}},"required":["image_url"]}],"description":"Input image for image-to-video generation. Supports HTTPS URLs and base64 data URLs. Routed to provider-specific image-to-video generation when supported by the selected model.","example":{"image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}},"minItems":1,"maxItems":9}],"description":"Reference image input alias. Accepts HTTPS URLs or base64 data URLs and routes to provider-specific image-guided video generation when supported."},"last_frame":{"anyOf":[{"type":"string"},{"type":"object","properties":{"image_url":{"type":"string"}},"required":["image_url"]}],"description":"Optional ending frame for frame-to-video generation. Requires image and is routed to providers that support first/last-frame generation.","example":{"image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}},"seconds":{"type":"integer","minimum":1,"description":"Output duration in seconds. Supported values depend on the selected model and provider mapping.","example":8},"audio":{"type":"boolean","default":true,"description":"Whether the generated video should include audio. Support depends on the selected model and provider mapping.","example":true},"n":{"type":"integer"},"image":{"anyOf":[{"type":"string"},{"type":"object","properties":{"image_url":{"type":"string"}},"required":["image_url"]}],"description":"Input image for image-to-video generation. Supports HTTPS URLs and base64 data URLs. Routed to provider-specific image-to-video generation when supported by the selected model.","example":{"image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}},"reference_images":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"image_url":{"type":"string"}},"required":["image_url"]}],"description":"Input image for image-to-video generation. Supports HTTPS URLs and base64 data URLs. Routed to provider-specific image-to-video generation when supported by the selected model.","example":{"image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}},"minItems":1,"maxItems":9,"description":"Reference images for provider-specific asset or material-guided video generation. ByteDance Seedance 2.x models accept up to 9; other providers accept up to 3.","example":[{"image_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."}]},"reference_videos":{"type":"array","items":{"anyOf":[{"type":"string","format":"uri"},{"type":"object","properties":{"video_url":{"type":"string","format":"uri"}},"required":["video_url"]}],"description":"Reference video input for omni-reference video generation. Must be a publicly reachable HTTPS URL; base64 data URLs are not supported for videos.","example":{"video_url":"https://example.com/reference-motion.mp4"}},"minItems":1,"maxItems":3,"description":"One to three reference videos (HTTPS URLs) for omni-reference video generation. Currently only supported on ByteDance Seedance 2.x models and can be combined with reference_images.","example":[{"video_url":"https://example.com/reference-motion.mp4"}]},"reference_audios":{"type":"array","items":{"anyOf":[{"type":"string","format":"uri"},{"type":"object","properties":{"audio_url":{"type":"string","format":"uri"}},"required":["audio_url"]}],"description":"Reference audio input for omni-reference video generation. Must be a publicly reachable HTTPS URL; base64 data URLs are not supported for audio.","example":{"audio_url":"https://example.com/reference-track.mp3"}},"minItems":1,"maxItems":3,"description":"One to three reference audio clips (HTTPS URLs) for omni-reference video generation. Currently only supported on ByteDance Seedance 2.x models and can be combined with reference_images and reference_videos.","example":[{"audio_url":"https://example.com/reference-track.mp3"}]}},"required":["prompt","seconds"]}}}},"responses":{"200":{"description":"Video job created.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["video"]},"model":{"type":"string"},"status":{"type":"string","enum":["queued","in_progress","completed","failed","canceled","expired"]},"progress":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"created_at":{"type":"number"},"completed_at":{"type":"number","nullable":true},"expires_at":{"type":"number","nullable":true},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["message"]},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"},"mime_type":{"type":"string","nullable":true}},"required":["type","url"]}}},"required":["id","object","model","status","progress","created_at","completed_at","expires_at","error"]}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/videos/{video_id}":{"get":{"operationId":"v1_videos_retrieve","summary":"Retrieve video","description":"Retrieves the current state of a video generation job.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"video_id","in":"path"}],"responses":{"200":{"description":"Video job state.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["video"]},"model":{"type":"string"},"status":{"type":"string","enum":["queued","in_progress","completed","failed","canceled","expired"]},"progress":{"type":"integer","nullable":true,"minimum":0,"maximum":100},"created_at":{"type":"number"},"completed_at":{"type":"number","nullable":true},"expires_at":{"type":"number","nullable":true},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"nullable":true}},"required":["message"]},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["video"]},"url":{"type":"string","format":"uri"},"mime_type":{"type":"string","nullable":true}},"required":["type","url"]}}},"required":["id","object","model","status","progress","created_at","completed_at","expires_at","error"]}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/videos/logs/{log_id}/content":{"get":{"operationId":"v1_videos_log_content","summary":"Video log content","description":"Streams generated video content through a gateway-managed proxy URL keyed by log ID.","parameters":[{"schema":{"type":"string"},"required":true,"name":"log_id","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"token","in":"query"}],"responses":{"200":{"description":"Video bytes.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"video/mp4":{"schema":{"nullable":true}},"application/octet-stream":{"schema":{"nullable":true}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}},"/v1/videos/{video_id}/content":{"get":{"operationId":"v1_videos_content","summary":"Video content","description":"Streams the generated video content once the job has completed successfully.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"video_id","in":"path"}],"responses":{"200":{"description":"Video bytes.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."}},"content":{"video/mp4":{"schema":{"nullable":true}},"application/octet-stream":{"schema":{"nullable":true}}}},"400":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"402":{"description":"Insufficient credits or plan limits reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"403":{"description":"Forbidden request or upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"404":{"description":"Unknown model or upstream not-found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"408":{"description":"Request timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"410":{"description":"Archived or unavailable project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"429":{"description":"Rate limited (organization, endpoint, or upstream provider). Back off until Retry-After elapses.","headers":{"RateLimit-Policy":{"schema":{"type":"string"},"description":"Quota policy as an HTTP Structured Fields list, e.g. \"requests\";q=60;w=60."},"RateLimit":{"schema":{"type":"string"},"description":"Available quota and reset delay, e.g. \"requests\";r=59;t=60."},"RateLimit-Limit":{"schema":{"type":"string"},"description":"Request limit for the current window."},"RateLimit-Remaining":{"schema":{"type":"string"},"description":"Requests remaining in the current window."},"RateLimit-Reset":{"schema":{"type":"string"},"description":"Seconds until the current window resets."},"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"502":{"description":"Failed to connect to the upstream provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"503":{"description":"Service unavailable upstream response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"504":{"description":"Upstream provider timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}},"529":{"description":"Gateway overloaded.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIError"}}}}}}}}}