{"openapi":"3.1.0","info":{"title":"API Overview","version":"1.0.0"},"paths":{"/v1/models":{"get":{"operationId":"models_list","summary":"List public models or fetch a single model","description":"List all available public models. Supports filtering by provider or vendor, or fetching a single model by query parameter with ?model=<provider/model-name>. Results are paginated: a page holds at most 500 models, and larger catalogs are read by following next_cursor until has_more is false.","tags":["models"],"parameters":[{"name":"model","in":"query","description":"Fetch a single model by ID in format 'provider/model-name'","required":false,"schema":{"type":"string"}},{"name":"provider","in":"query","description":"Filter by provider","required":false,"schema":{"type":"string"}},{"name":"vendor","in":"query","description":"Filter by vendor","required":false,"schema":{"type":"string"}},{"name":"zero_data_retention","in":"query","description":"When true, list only models with at least one ZDR vendor; when false, only models with at least one non-ZDR vendor.","required":false,"schema":{"type":"boolean"}},{"name":"cursor","in":"query","description":"Pagination cursor. Pass the next_cursor returned by the previous page to fetch the models that follow it. Omit on the first request.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Models per page. Defaults to 50, minimum 1, maximum 500. A limit above 500 is rejected with 422; page through the rest with next_cursor rather than raising it.","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":50}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Models_list_Response_200"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/models/discounted":{"get":{"operationId":"models_listDiscounted","summary":"List discounted models","description":"List models your organization can use that are on a live promotion, with the list and promotional rates.","tags":["models"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountedModelsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/models/{model_id}":{"get":{"operationId":"models_retrieve","summary":"Get model","description":"Get one catalog model by ID; an unknown ID returns 404 `model_not_found`.","tags":["models"],"parameters":[{"name":"model_id","in":"path","description":"Model ID as `provider/model-name`, for example `openai/gpt-5.4`.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/vendors":{"get":{"operationId":"vendors_list","summary":"List vendors","description":"List execution vendors and the models they currently serve. Paginated the same way as /models: a page holds at most 500 vendors, and next_cursor walks the rest.","tags":["vendors"],"parameters":[{"name":"zero_data_retention","in":"query","description":"Filter vendors by zero data retention support.","required":false,"schema":{"type":"boolean"}},{"name":"cursor","in":"query","description":"Pagination cursor. Pass the next_cursor returned by the previous page to fetch the vendors that follow it. Omit on the first request.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Vendors per page. Defaults to 50, minimum 1, maximum 500. A limit above 500 is rejected with 422; page through the rest with next_cursor rather than raising it.","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":50}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicVendorsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/vendors/{vendor_id}":{"get":{"operationId":"vendors_retrieve","summary":"Fetch a single vendor by ID","description":"Fetch a single execution vendor by ID.","tags":["vendors"],"parameters":[{"name":"vendor_id","in":"path","description":"Vendor slug (e.g. `openai`, `anthropic`, `bedrock`, `azure`). Call `GET /v1/vendors` to list available slugs.","required":true,"schema":{"type":"string"}},{"name":"zero_data_retention","in":"query","description":"Return 404 unless the vendor matches this zero data retention filter.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicVendor"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/responses":{"post":{"operationId":"responses_create","summary":"Create response","description":"Create an LLM response in Gateway's native Responses shape. This is not OpenAI's\nResponses API: clients that implement it (the OpenAI SDK's `client.responses.*`,\nCodex) should use `POST /v1/openai/responses`, or send `X-Merge-Wire-Format: openai`\non this endpoint to receive the OpenAI shape. Codex is detected by its `originator`\nheader and served the OpenAI shape automatically.\n\nOpenAI-only request fields with a native equivalent are translated\n(`instructions` → leading system message, `reasoning.effort` → reasoning effort,\n`text.format` → `response_format`, `max_output_tokens` → `max_tokens`); any other\nOpenAI-only field is ignored and reported in `warnings` with code\n`openai_fields_ignored`.\n","tags":["responses"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRequest"}}}},"security":[{"BearerAuth":[]}]}},"/v1/responses/{response_id}":{"get":{"operationId":"responses_retrieve","summary":"Get stored response","description":"Retrieve a turn stored with `store: true`; an expired, unknown, or unstored ID returns 404 `response_not_found`.","tags":["responses"],"parameters":[{"name":"response_id","in":"path","description":"Response ID (`resp_...`).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The stored turn.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"delete":{"operationId":"responses_delete","summary":"Delete stored response","description":"Delete a stored turn before it expires, which ends the chain for any later `previous_response_id` that names it.","tags":["responses"],"parameters":[{"name":"response_id","in":"path","description":"Response ID (`resp_...`).","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion confirmation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/embeddings":{"post":{"operationId":"embeddings_create","summary":"Create Embedding","description":"Create text embeddings.\n\nReturns vector representations of the input text.","tags":["embeddings"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/images/generations":{"post":{"operationId":"images_generate","summary":"Generate images","description":"Generate images from a text prompt with a dedicated image model.","tags":["images"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/images/edits":{"post":{"operationId":"images_edit","summary":"Edit images","description":"Edit or combine uploaded reference images with a multipart request; streaming is not supported.","tags":["images"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"description":"Text description of the edit."},"model":{"type":"string","description":"Image model, for example `openai/gpt-image-2`."},"image":{"type":"array","items":{"type":"string","format":"binary"},"description":"One to 16 reference images (PNG, JPEG, or WebP)."},"image[]":{"type":"array","items":{"type":"string","format":"binary"},"description":"OpenAI SDK spelling of `image` for multiple uploads."},"mask":{"type":"string","format":"binary","description":"Mask whose transparent areas mark where the first image is edited."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"n":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"Number of images, 1 to 10."},"size":{"type":["string","null"]},"quality":{"type":["string","null"]},"background":{"type":["string","null"]},"input_fidelity":{"type":["string","null"]},"response_format":{"type":["string","null"]},"output_format":{"type":["string","null"]},"output_compression":{"type":["integer","null"],"minimum":0,"maximum":100},"moderation":{"type":["string","null"]},"user":{"type":["string","null"],"description":"End-user identifier forwarded to the provider."},"stream":{"type":["boolean","null"],"description":"Not supported; `true` returns 400 `stream_unsupported`."}},"required":["prompt","model"]}}}},"security":[{"BearerAuth":[]}]}},"/v1/audio/transcriptions":{"post":{"operationId":"audio_transcribe","summary":"Create transcription","description":"Transcribe an uploaded audio file with a multipart request.","tags":["audio"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Audio file to transcribe."},"model":{"type":"string","description":"Transcription model, for example `openai/whisper-1`."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"language":{"type":["string","null"],"description":"Language of the audio."},"prompt":{"type":["string","null"],"description":"Text to guide the transcription."},"response_format":{"type":["string","null"],"description":"Output format, for example `json` or `verbose_json`."},"temperature":{"type":["number","null"],"format":"double","description":"Sampling temperature."}},"required":["file","model"]}}}},"security":[{"BearerAuth":[]}]}},"/v1/audio/speech":{"post":{"operationId":"audio_speech","summary":"Create speech","description":"Synthesize speech from text and return the raw audio bytes, with the billed character count in the `X-Merge-Billed-Characters` header.","tags":["audio"],"responses":{"200":{"description":"Audio bytes in the requested `response_format` (default mp3).","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/videos":{"get":{"operationId":"videos_list","summary":"List videos","description":"List video jobs submitted in the last 24 hours, newest first. Each entry shows the status from the job's last poll.","tags":["videos"],"parameters":[{"name":"limit","in":"query","description":"Videos per page; values outside 1 to 100 are clamped.","required":false,"schema":{"type":"integer","default":20}},{"name":"after","in":"query","description":"Return videos after this video ID (the previous page's `last_id`).","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"`desc` for newest first, `asc` for oldest first.","required":false,"schema":{"$ref":"#/components/schemas/V1VideosGetParametersOrder","default":"desc"}}],"responses":{"200":{"description":"A page of video jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoListSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"post":{"operationId":"videos_create","summary":"Create video","description":"Start an asynchronous video generation job; poll it with `GET /v1/videos/{video_id}`.","tags":["videos"],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/videos/{video_id}":{"get":{"operationId":"videos_retrieve","summary":"Get video","description":"Get a video job's status.","tags":["videos"],"parameters":[{"name":"video_id","in":"path","description":"Video job ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"delete":{"operationId":"videos_delete","summary":"Delete video","description":"Delete a finished video job; a job that is still rendering returns 409. Usage and billing history are kept.","tags":["videos"],"parameters":[{"name":"video_id","in":"path","description":"Video job ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion confirmation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoDeleted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/videos/{video_id}/content":{"get":{"operationId":"videos_content","summary":"Download video","description":"Download a completed video as MP4 bytes.","tags":["videos"],"parameters":[{"name":"video_id","in":"path","description":"Video job ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The video file.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/batches":{"get":{"operationId":"batches_list","summary":"List batches","description":"List your organization's batches, newest first.","tags":["batches"],"parameters":[{"name":"limit","in":"query","description":"Batches per page; values outside 1 to 100 are clamped.","required":false,"schema":{"type":"integer","default":20}},{"name":"after","in":"query","description":"Return batches after this batch ID (the previous page's `last_id`).","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by status; repeat to match several.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"created_after","in":"query","description":"Only batches created at or after this time, as unix seconds or an ISO-8601 date or datetime (UTC when no offset is given).","required":false,"schema":{"type":"string"}},{"name":"created_before","in":"query","description":"Only batches created before this time, in the same formats as `created_after`.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchListSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"post":{"operationId":"batches_create","summary":"Create batch","description":"Submit a batch of requests that run asynchronously on one model at batch rates.","tags":["batches"],"responses":{"202":{"description":"The created batch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchObjectSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreateRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/batches/{batch_id}":{"get":{"operationId":"batches_retrieve","summary":"Get batch","description":"Get a batch's status.","tags":["batches"],"parameters":[{"name":"batch_id","in":"path","description":"Batch ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchObjectSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]},"delete":{"operationId":"batches_delete","summary":"Delete batch","description":"Delete a finished batch and, where the provider supports it, the provider's copy; an unfinished or still-billing batch returns 409.","tags":["batches"],"parameters":[{"name":"batch_id","in":"path","description":"Batch ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion confirmation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDeleted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/batches/{batch_id}/cancel":{"post":{"operationId":"batches_cancel","summary":"Cancel batch","description":"Cancel a batch; lines that already finished are kept and billed.","tags":["batches"],"parameters":[{"name":"batch_id","in":"path","description":"Batch ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchObjectSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/batches/{batch_id}/results":{"get":{"operationId":"batches_results","summary":"Get batch results","description":"Stream a completed batch's results as newline-delimited JSON, one line per request.","tags":["batches"],"parameters":[{"name":"batch_id","in":"path","description":"Batch ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"One JSON object per line.","content":{"application/json":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/decisions":{"post":{"operationId":"decisions_create","summary":"Create decision","description":"Ask a decision model typed questions about some state and get one typed answer per question.","tags":["decisions"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionResponseSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequestSchema"}}}},"security":[{"BearerAuth":[]}]}},"/v1/chat/completions":{"post":{"operationId":"chatCompletions_create","summary":"Create a chat completion","description":"OpenAI-compatible chat completions endpoint. Accepts the OpenAI chat completions request shape and routes to any catalogued model.\n\nAlso served at `/v1/openai/chat/completions`; both paths accept the same requests. This bare path matches the OpenAI SDK's default base URL shape, so pointing the SDK at `https://api-gateway.merge.dev/v1` works with no other changes.","tags":["chatCompletions"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIChatCompletionRequest"}}}},"security":[{"BearerAuth":[]}]}},"/v1/messages":{"post":{"operationId":"messages_create","summary":"Create a message","description":"Anthropic-compatible Messages endpoint. Accepts the Anthropic Messages request shape and routes to any catalogued model.\n\nAlso served at `/v1/anthropic/v1/messages`; both paths accept the same requests. This bare path is what the Anthropic SDK builds from a bare-host base URL, so pointing the SDK at `https://api-gateway.merge.dev` works with no other changes.","tags":["messages"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageRequest"}}}},"security":[{"BearerAuth":[]}]}},"/v1/messages/count_tokens":{"post":{"operationId":"messages_countTokens","summary":"Count tokens in a message","description":"Counts the input tokens a Messages request would consume, without calling a model.\n\nAlso served at `/v1/anthropic/v1/messages/count_tokens`; both paths accept the same requests.","tags":["messages"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicCountTokensResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicCountTokensRequest"}}}},"security":[{"BearerAuth":[]}]}},"/v1/routing/policies":{"get":{"operationId":"routing_listPolicies","summary":"List Routing Policies","description":"List routing policies available to the current user.\n\nReturns both org-specific policies and the managed (simulator) policy.","tags":["routing"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routing_listPolicies_Response_200"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/routing/strategies":{"get":{"operationId":"routing_listStrategies","summary":"List Routing Strategies","description":"List all available routing strategies with descriptions.","tags":["routing"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routing_listStrategies_Response_200"}}}}},"security":[{"BearerAuth":[]}]}},"/v1/tags":{"get":{"operationId":"tags_list","summary":"List Tags","description":"List all available tags.\n\nReturns tags available for the authenticated organization,\nincluding both global and org-scoped tags.","tags":["tags"],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagsListResponse"}}}}},"security":[{"BearerAuth":[]}]}}},"tags":[{"name":"models"},{"name":"vendors"},{"name":"responses"},{"name":"embeddings"},{"name":"images"},{"name":"audio"},{"name":"videos"},{"name":"batches"},{"name":"decisions"},{"name":"chatCompletions"},{"name":"messages"},{"name":"routing"},{"name":"tags"}],"servers":[{"url":"https://api-gateway.merge.dev","description":"Production"}],"components":{"schemas":{"PublicVendorModelInfoAvailabilityStatus":{"type":"string","enum":["available","deprecated"],"title":"PublicVendorModelInfoAvailabilityStatus"},"PublicVendorModelCapabilitiesInputItems":{"type":"string","enum":["text","image","document","audio","video","embedding"],"title":"PublicVendorModelCapabilitiesInputItems"},"PublicVendorModelCapabilitiesOutputItems":{"type":"string","enum":["text","tool_use","embedding","image","audio","video","decision"],"title":"PublicVendorModelCapabilitiesOutputItems"},"PublicReasoningCapabilities":{"type":"object","properties":{"configurable":{"type":"boolean","default":false,"description":"Whether reasoning can be configured on this route."},"disable_supported":{"type":"boolean","default":false,"description":"Whether reasoning can be turned off."},"default_enabled":{"type":"boolean","default":false,"description":"Whether reasoning is on by default."},"controls":{"type":"array","items":{"type":"string"},"description":"Request controls the route accepts for reasoning."},"effort_values":{"type":"array","items":{"type":"string"},"description":"Accepted reasoning effort values."},"output_style":{"type":["string","null"],"description":"How the route returns reasoning, when known."}},"description":"Reasoning controls a route supports.","title":"PublicReasoningCapabilities"},"PublicVendorModelCapabilities":{"type":"object","properties":{"input":{"type":"array","items":{"$ref":"#/components/schemas/PublicVendorModelCapabilitiesInputItems"}},"output":{"type":"array","items":{"$ref":"#/components/schemas/PublicVendorModelCapabilitiesOutputItems"}},"supports_tool_calling":{"type":"boolean"},"supports_tool_choice":{"type":"boolean","default":false},"supports_structured_outputs":{"type":"boolean"},"streaming":{"type":"boolean"},"supports_reasoning":{"type":"boolean","default":false,"description":"Whether the route supports reasoning."},"reasoning":{"oneOf":[{"$ref":"#/components/schemas/PublicReasoningCapabilities"},{"type":"null"}],"description":"Reasoning controls the route supports, when it supports reasoning."}},"required":["input","output","supports_tool_calling","supports_structured_outputs","streaming"],"description":"Per-route capability flags. Lists supported input/output content types (text, image, document, tool_use) and feature support (tool calling, tool choice, structured outputs, streaming).","title":"PublicVendorModelCapabilities"},"TierPricing":{"type":"object","properties":{"input_per_million":{"type":"number","format":"double"},"output_per_million":{"type":"number","format":"double"}},"required":["input_per_million","output_per_million"],"description":"Per-token pricing for a single service tier.","title":"TierPricing"},"ModelPricingUnit":{"type":"string","enum":["per_token","per_second","per_image","per_character"],"default":"per_token","description":"How the route bills: `per_token`, `per_second`, `per_image`, or `per_character`.","title":"ModelPricingUnit"},"SchedulePeriodPricing":{"type":"object","properties":{"name":{"type":"string","description":"Window name."},"timezone":{"type":"string","default":"UTC","description":"Timezone the windows are expressed in."},"days":{"type":["array","null"],"items":{"type":"string"},"description":"Days the windows apply on."},"windows":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Half-open `[start, end)` windows; a window whose end is at or before its start wraps midnight."},"input_per_million":{"type":["number","null"],"format":"double"},"output_per_million":{"type":["number","null"],"format":"double"},"cache_read_per_million":{"type":["number","null"],"format":"double"},"cache_write_per_million":{"type":["number","null"],"format":"double"}},"required":["name","windows"],"description":"Rates that replace the base ones inside a daily window; a null rate keeps the base rate.","title":"SchedulePeriodPricing"},"LongContextPricing":{"type":"object","properties":{"threshold_tokens":{"type":"integer","description":"Input token count above which these rates apply."},"input_per_million":{"type":["number","null"],"format":"double"},"output_per_million":{"type":["number","null"],"format":"double"},"cache_read_per_million":{"type":["number","null"],"format":"double"},"cache_write_per_million":{"type":["number","null"],"format":"double"}},"required":["threshold_tokens"],"description":"Rates for the whole request once its input exceeds `threshold_tokens`; a null rate keeps the base rate.","title":"LongContextPricing"},"ModelPricing":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"],"default":"USD"},"input_per_million":{"type":"number","format":"double"},"output_per_million":{"type":"number","format":"double"},"flex":{"oneOf":[{"$ref":"#/components/schemas/TierPricing"},{"type":"null"}],"description":"Per-token pricing for the flex tier on this route, or null if the route does not offer it."},"priority":{"oneOf":[{"$ref":"#/components/schemas/TierPricing"},{"type":"null"}],"description":"Per-token pricing for the priority tier on this route, or null if the route does not offer it."},"ultrafast":{"oneOf":[{"$ref":"#/components/schemas/TierPricing"},{"type":"null"}],"description":"Per-token pricing for OpenAI's ultrafast tier on this route, or null if the route does not offer it."},"unit":{"$ref":"#/components/schemas/ModelPricingUnit","default":"per_token","description":"How the route bills: `per_token`, `per_second`, `per_image`, or `per_character`."},"input_per_second":{"type":["number","null"],"format":"double","description":"USD per second of input, for duration-billed routes such as transcription."},"output_per_second":{"type":["number","null"],"format":"double","description":"USD per second of generated output, for duration-billed routes such as video."},"output_per_image":{"type":["number","null"],"format":"double","description":"USD per generated image, for flat-priced image routes."},"input_per_character":{"type":["number","null"],"format":"double","description":"USD per input character, for text-to-speech routes."},"output_per_audio_second":{"type":["number","null"],"format":"double","description":"Added USD per second of generated audio, for speech vendors that price by length."},"input_image_per_million":{"type":["number","null"],"format":"double","description":"USD per million image-input tokens on image routes that accept reference images; null means the text input rate applies."},"output_per_second_by_resolution":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Per-second rates keyed by output resolution; the flat rate is the default-resolution rate."},"output_per_image_by_resolution":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"},"description":"Per-image rates keyed by output resolution; the flat rate is the default-resolution rate."},"cache_read_per_million":{"type":["number","null"],"format":"double","description":"USD per million cached input tokens read."},"cache_write_per_million":{"type":["number","null"],"format":"double","description":"USD per million input tokens written to the prompt cache."},"batch":{"oneOf":[{"$ref":"#/components/schemas/TierPricing"},{"type":"null"}],"description":"Batch pricing, present only on routes that run `POST /v1/batches` jobs."},"schedule":{"type":["array","null"],"items":{"$ref":"#/components/schemas/SchedulePeriodPricing"},"description":"Time-of-day rate windows; the flat rates apply outside every window."},"long_context":{"oneOf":[{"$ref":"#/components/schemas/LongContextPricing"},{"type":"null"}],"description":"Rates that replace the base ones for the whole request once input passes a token threshold."}},"required":["input_per_million","output_per_million"],"description":"Pricing information for a model.","title":"ModelPricing"},"PublicVendorModelInfo":{"type":"object","properties":{"launch_date":{"type":["string","null"]},"context_window":{"type":"integer"},"max_output_tokens":{"type":"integer"},"availability_status":{"$ref":"#/components/schemas/PublicVendorModelInfoAvailabilityStatus"},"capabilities":{"$ref":"#/components/schemas/PublicVendorModelCapabilities"},"pricing":{"$ref":"#/components/schemas/ModelPricing"},"service_tiers":{"type":"array","items":{"type":"string"},"default":["standard"],"description":"Service tiers this route supports (always includes 'standard'). Presence of 'flex' means the route is priced for flex."},"zero_data_retention":{"type":"boolean","default":false,"description":"Whether this vendor route supports zero data retention."},"batch_endpoints":{"type":["array","null"],"items":{"type":"string"},"description":"Batch `endpoint` values this route runs, set only on batch-capable routes."}},"required":["context_window","max_output_tokens","availability_status","capabilities","pricing"],"description":"Per-vendor execution metadata for a model, including context window, max output tokens, capabilities, pricing, and availability. A single `PublicModel` carries one of these for each vendor that can execute it.","title":"PublicVendorModelInfo"},"PublicModelAvailabilityStatus":{"type":"string","enum":["available","deprecated"],"title":"PublicModelAvailabilityStatus"},"PublicModelAlias":{"type":"object","properties":{"model":{"type":"string","description":"Alias model ID."},"display_name":{"type":["string","null"]},"type":{"type":"string","description":"Alias type."},"description":{"type":["string","null"]}},"required":["model","type"],"description":"An alias that resolves to this model.","title":"PublicModelAlias"},"PublicModelSource":{"type":"string","enum":["self_hosted"],"description":"Set to `self_hosted` on models served by an endpoint your organization registered; absent for catalog models.","title":"PublicModelSource"},"PublicModel":{"type":"object","properties":{"model":{"type":"string","description":"Model ID in format 'provider/model-name'"},"provider":{"type":"string"},"display_name":{"type":"string"},"vendors":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PublicVendorModelInfo"}},"availability_status":{"$ref":"#/components/schemas/PublicModelAvailabilityStatus"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"aliases":{"type":"array","items":{"$ref":"#/components/schemas/PublicModelAlias"},"description":"Aliases that resolve to this model."},"access_required":{"type":"boolean","default":false,"description":"True when the model is listed but calls to it return 403 until access is granted."},"access_reason":{"type":["string","null"],"description":"Machine-readable reason access is required, matching the error `code` the model endpoints return; null otherwise."},"source":{"$ref":"#/components/schemas/PublicModelSource","description":"Set to `self_hosted` on models served by an endpoint your organization registered; absent for catalog models."}},"required":["model","provider","display_name","vendors","availability_status"],"description":"A canonical model in Merge Gateway's catalog. Identified by `model` (fully-qualified provider/model ID) and exposes the set of `vendors` that can execute it, each with its own capabilities, context window, pricing, and ZDR flag.","title":"PublicModel"},"PublicModelsListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicModel"}},"has_more":{"type":"boolean","default":false,"description":"True when more models remain beyond this page. Keep paging while this is true."},"next_cursor":{"type":["string","null"],"description":"Cursor to pass as ?cursor= to fetch the next page. Null on the last page."}},"required":["data"],"description":"Paginated response wrapper for `GET /v1/models`. Use the `next_cursor` field to page through results when `has_more` is true.","title":"PublicModelsListResponse"},"Models_list_Response_200":{"oneOf":[{"$ref":"#/components/schemas/PublicModelsListResponse"},{"$ref":"#/components/schemas/PublicModel"}],"title":"Models_list_Response_200"},"ValidationErrorLocItems":{"oneOf":[{"type":"string"},{"type":"integer"}],"title":"ValidationErrorLocItems"},"ValidationErrorCtx":{"type":"object","properties":{},"title":"ValidationErrorCtx"},"ValidationError":{"type":"object","properties":{"loc":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorLocItems"}},"msg":{"type":"string"},"type":{"type":"string"},"input":{"description":"Any type"},"ctx":{"$ref":"#/components/schemas/ValidationErrorCtx"}},"required":["loc","msg","type"],"description":"Single field-level validation error. `loc` is the JSON path to the offending field, `msg` is a human-readable explanation, and `type` is a stable machine-readable error code.","title":"ValidationError"},"HTTPValidationError":{"type":"object","properties":{"detail":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Validation error returned with HTTP 422 when the request body or query parameters are invalid.","title":"HTTPValidationError"},"DiscountedRate":{"type":"object","properties":{"list":{"type":"number","format":"double","description":"List price."},"promo":{"type":"number","format":"double","description":"Price the route bills now."}},"required":["list","promo"],"description":"One rate a promotion lowers.","title":"DiscountedRate"},"DiscountedModel":{"type":"object","properties":{"model":{"type":"string","description":"Model ID as `provider/model-name`."},"display_name":{"type":"string"},"provider":{"type":"string"},"provider_display_name":{"type":"string"},"vendor":{"type":"string","description":"Vendor route the promotion is on."},"vendor_display_name":{"type":"string"},"name":{"type":"string","description":"Promotion name."},"percent_off":{"type":["number","null"],"format":"double","description":"Headline discount percentage; null when none can be stated."},"starts_at":{"type":["string","null"],"description":"When the promotion started."},"ends_at":{"type":["string","null"],"description":"When the promotion ends; null means no scheduled end."},"rates":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DiscountedRate"},"description":"The rates the promotion lowers, keyed by the pricing field names on `GET /v1/models`."},"access_required":{"type":"boolean","default":false,"description":"True when the model is listed but calls to it return 403 until access is granted."}},"required":["model","display_name","provider","provider_display_name","vendor","vendor_display_name","name","rates"],"description":"A model on a live promotion; when several of its vendor routes are discounted, the deepest cut is shown.","title":"DiscountedModel"},"DiscountedModelsListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DiscountedModel"}}},"required":["data"],"description":"Models on a live promotion that your organization can use.","title":"DiscountedModelsListResponse"},"PublicVendorAvailabilityStatus":{"type":"string","enum":["active","degraded","unavailable"],"title":"PublicVendorAvailabilityStatus"},"PublicVendor":{"type":"object","properties":{"vendor":{"type":"string"},"name":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"supports_zdr":{"type":"boolean"},"supports_byok":{"type":"boolean"},"availability_status":{"$ref":"#/components/schemas/PublicVendorAvailabilityStatus"}},"required":["vendor","name","models","supports_zdr","supports_byok","availability_status"],"description":"An execution host that Merge Gateway can route to (e.g. `openai`, `bedrock`, `azure`). Lists the model IDs the vendor can serve plus its ZDR and BYOK support.","title":"PublicVendor"},"PublicVendorsListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PublicVendor"}},"has_more":{"type":"boolean","default":false,"description":"True when more vendors remain beyond this page. Keep paging while this is true."},"next_cursor":{"type":["string","null"],"description":"Cursor to pass as ?cursor= to fetch the next page. Null on the last page."}},"required":["data"],"description":"Paginated response wrapper for `GET /v1/vendors`. Use the `next_cursor` field to page through results when `has_more` is true.","title":"PublicVendorsListResponse"},"PriorityOrderEntry":{"type":"object","properties":{"model":{"type":"string","description":"Model id, `provider/model` or a bare base name that resolves the same way `model` does."},"priority":{"type":["integer","null"],"minimum":0,"description":"Lower tries first, as in the routing policies API's PRIORITY shape. Omit to use list order; explicit values sort ahead of list order."},"vendors":{"type":["array","null"],"items":{"type":"string"},"description":"Pin this entry to these execution hosts, in order of preference. Omit to allow every vendor that serves the model. Must not be empty when sent."}},"required":["model"],"description":"One entry of `priority_order`: a model, optionally pinned to vendors.","title":"PriorityOrderEntry"},"ResponseRequestPriorityOrderItems":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/PriorityOrderEntry"}],"title":"ResponseRequestPriorityOrderItems"},"ResponseRequestInputItemsDiscriminatorMappingMessageRole":{"type":"string","enum":["system","user","assistant","developer"],"description":"The role of the message author. `developer` is accepted as an alias for `system` (matching the OpenAI Responses API) and is treated as `system`","title":"ResponseRequestInputItemsDiscriminatorMappingMessageRole"},"DocumentContentSourceType":{"type":"string","enum":["base64","url"],"default":"base64","title":"DocumentContentSourceType"},"ImageContentSourceType":{"type":"string","enum":["base64","url"],"default":"base64","title":"ImageContentSourceType"},"ServerToolResultContentContent":{"oneOf":[{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}}},{"type":"object","additionalProperties":{"description":"Any type"}}],"description":"Provider result payload, to send back unchanged.","title":"ServerToolResultContentContent"},"VideoContentSourceType":{"type":"string","enum":["base64","url"],"default":"base64","description":"Whether `data` is base64 or a URL.","title":"VideoContentSourceType"},"ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items0":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["audio"],"default":"audio"},"format":{"type":"string","description":"Audio codec, for example `wav` or `mp3`."},"data":{"type":"string","description":"Base64-encoded audio."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","format","data"],"description":"Base64 audio input for audio-understanding models."},{"type":"object","properties":{"type":{"type":"string","enum":["document"],"default":"document"},"source_type":{"$ref":"#/components/schemas/DocumentContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'application/pdf'"},"data":{"type":"string","description":"Base64-encoded content or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Document content block (PDF, etc.) for document-understanding models."},{"type":"object","properties":{"type":{"type":"string","enum":["image"],"default":"image"},"source_type":{"$ref":"#/components/schemas/ImageContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'image/png', 'image/jpeg'"},"data":{"type":"string","description":"Base64-encoded image data or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Image content block with explicit source type."},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"],"description":"Discriminator value: image_url"},"url":{"type":"string"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","url"],"description":"Image URL content block for vision models."},{"type":"object","properties":{"type":{"type":"string","enum":["server_tool_result"],"default":"server_tool_result"},"tool_use_id":{"type":"string","description":"ID of the `server_tool_use` block this result answers."},"result_type":{"type":"string","description":"Provider result type."},"content":{"$ref":"#/components/schemas/ServerToolResultContentContent","description":"Provider result payload, to send back unchanged."}},"required":["type","tool_use_id","result_type","content"],"description":"The provider's result for a `server_tool_use` block, to send back unchanged."},{"type":"object","properties":{"type":{"type":"string","enum":["server_tool_use"],"default":"server_tool_use"},"id":{"type":"string","description":"Tool call ID."},"name":{"type":"string","description":"Tool name."},"input":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Tool input."}},"required":["type","id","name","input"],"description":"A tool call the provider ran itself; send it back unchanged, never run it."},{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Discriminator value: text"},"text":{"type":"string"},"annotations":{"type":["array","null"],"items":{"type":"object","additionalProperties":{"description":"Any type"}},"description":"Citations attached to this text, such as `url_citation` entries from web search."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","text"],"description":"Text content block."},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"],"default":"thinking"},"thinking":{"type":"string","description":"Reasoning text."},"signature":{"type":["string","null"],"description":"Provider signature to send back unchanged on later turns."},"redacted_data":{"type":["string","null"],"description":"Encrypted reasoning from a redacted thinking block, to send back unchanged on later turns."}},"required":["type","thinking"],"description":"A reasoning block from an earlier assistant turn, sent back unchanged in multi-turn tool conversations."},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"],"description":"Discriminator value: tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"description":"Any type"}}},"required":["type","id","name","input"],"description":"Tool use content block (in assistant output)."},{"type":"object","properties":{"type":{"type":"string","enum":["video"],"default":"video"},"source_type":{"$ref":"#/components/schemas/VideoContentSourceType","default":"base64","description":"Whether `data` is base64 or a URL."},"media_type":{"type":"string","description":"Video MIME type, for example `video/mp4`."},"data":{"type":"string","description":"Base64-encoded video, or an `https://` or `gs://` URL."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Video input for video-understanding models, as base64 or a URL."}],"discriminator":{"propertyName":"type"},"title":"ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items0"},"ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items":{"oneOf":[{"$ref":"#/components/schemas/ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items0"},{"type":"object","additionalProperties":{"description":"Any type"}}],"title":"ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items"},"ResponseRequestInputItemsDiscriminatorMappingMessageContent1":{"type":"array","items":{"$ref":"#/components/schemas/ResponseRequestInputItemsDiscriminatorMappingMessageContentOneOf1Items"},"title":"ResponseRequestInputItemsDiscriminatorMappingMessageContent1"},"ResponseRequestInputItemsDiscriminatorMappingMessageContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/ResponseRequestInputItemsDiscriminatorMappingMessageContent1"}],"title":"ResponseRequestInputItemsDiscriminatorMappingMessageContent"},"ToolResultInputContentOneOf1Items0":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["audio"],"default":"audio"},"format":{"type":"string","description":"Audio codec, for example `wav` or `mp3`."},"data":{"type":"string","description":"Base64-encoded audio."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","format","data"],"description":"Base64 audio input for audio-understanding models."},{"type":"object","properties":{"type":{"type":"string","enum":["document"],"default":"document"},"source_type":{"$ref":"#/components/schemas/DocumentContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'application/pdf'"},"data":{"type":"string","description":"Base64-encoded content or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Document content block (PDF, etc.) for document-understanding models."},{"type":"object","properties":{"type":{"type":"string","enum":["image"],"default":"image"},"source_type":{"$ref":"#/components/schemas/ImageContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'image/png', 'image/jpeg'"},"data":{"type":"string","description":"Base64-encoded image data or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Image content block with explicit source type."},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"],"description":"Discriminator value: image_url"},"url":{"type":"string"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","url"],"description":"Image URL content block for vision models."},{"type":"object","properties":{"type":{"type":"string","enum":["server_tool_result"],"default":"server_tool_result"},"tool_use_id":{"type":"string","description":"ID of the `server_tool_use` block this result answers."},"result_type":{"type":"string","description":"Provider result type."},"content":{"$ref":"#/components/schemas/ServerToolResultContentContent","description":"Provider result payload, to send back unchanged."}},"required":["type","tool_use_id","result_type","content"],"description":"The provider's result for a `server_tool_use` block, to send back unchanged."},{"type":"object","properties":{"type":{"type":"string","enum":["server_tool_use"],"default":"server_tool_use"},"id":{"type":"string","description":"Tool call ID."},"name":{"type":"string","description":"Tool name."},"input":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Tool input."}},"required":["type","id","name","input"],"description":"A tool call the provider ran itself; send it back unchanged, never run it."},{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Discriminator value: text"},"text":{"type":"string"},"annotations":{"type":["array","null"],"items":{"type":"object","additionalProperties":{"description":"Any type"}},"description":"Citations attached to this text, such as `url_citation` entries from web search."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","text"],"description":"Text content block."},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"],"default":"thinking"},"thinking":{"type":"string","description":"Reasoning text."},"signature":{"type":["string","null"],"description":"Provider signature to send back unchanged on later turns."},"redacted_data":{"type":["string","null"],"description":"Encrypted reasoning from a redacted thinking block, to send back unchanged on later turns."}},"required":["type","thinking"],"description":"A reasoning block from an earlier assistant turn, sent back unchanged in multi-turn tool conversations."},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"],"description":"Discriminator value: tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"description":"Any type"}}},"required":["type","id","name","input"],"description":"Tool use content block (in assistant output)."},{"type":"object","properties":{"type":{"type":"string","enum":["video"],"default":"video"},"source_type":{"$ref":"#/components/schemas/VideoContentSourceType","default":"base64","description":"Whether `data` is base64 or a URL."},"media_type":{"type":"string","description":"Video MIME type, for example `video/mp4`."},"data":{"type":"string","description":"Base64-encoded video, or an `https://` or `gs://` URL."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Video input for video-understanding models, as base64 or a URL."}],"discriminator":{"propertyName":"type"},"title":"ToolResultInputContentOneOf1Items0"},"ToolResultInputContentOneOf1Items":{"oneOf":[{"$ref":"#/components/schemas/ToolResultInputContentOneOf1Items0"},{"type":"object","additionalProperties":{"description":"Any type"}}],"title":"ToolResultInputContentOneOf1Items"},"ToolResultInputContent1":{"type":"array","items":{"$ref":"#/components/schemas/ToolResultInputContentOneOf1Items"},"title":"ToolResultInputContent1"},"ToolResultInputContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/ToolResultInputContent1"}],"title":"ToolResultInputContent"},"ResponseRequestInputItems":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"],"description":"Discriminator value: message"},"role":{"$ref":"#/components/schemas/ResponseRequestInputItemsDiscriminatorMappingMessageRole","description":"The role of the message author. `developer` is accepted as an alias for `system` (matching the OpenAI Responses API) and is treated as `system`"},"content":{"$ref":"#/components/schemas/ResponseRequestInputItemsDiscriminatorMappingMessageContent"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","role","content"],"description":"A message in the conversation."},{"type":"object","properties":{"type":{"type":"string","enum":["tool_result"],"default":"tool_result"},"tool_use_id":{"type":"string"},"content":{"$ref":"#/components/schemas/ToolResultInputContent"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","tool_use_id","content"],"description":"Result from a tool call, sent back to continue the conversation."}],"discriminator":{"propertyName":"type"},"title":"ResponseRequestInputItems"},"FunctionTool":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"default":"function"},"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"description":"Any type"}},"defer_loading":{"type":["boolean","null"],"description":"Load this tool on demand through tool search instead of sending it with every request."}},"required":["name","description","parameters"],"description":"A function tool that the model can call.","title":"FunctionTool"},"ProviderNativeTool":{"type":"object","properties":{"type":{"type":["string","null"],"description":"Provider tool type, for example `web_search_20250305`."}},"description":"A provider-native tool, passed through to the provider with all of its fields.","title":"ProviderNativeTool"},"ResponseRequestToolsItems":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool"},{"$ref":"#/components/schemas/ProviderNativeTool"}],"title":"ResponseRequestToolsItems"},"ResponseRequestToolChoice":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"description":"Any type"}}],"description":"Tool choice policy: 'auto', 'none', 'required', or {'type': 'function', 'function': {'name': '...'}}","title":"ResponseRequestToolChoice"},"ResponseFormatJson":{"type":"object","properties":{"type":{"type":"string","enum":["json_object"],"default":"json_object"}},"description":"JSON response format configuration.","title":"ResponseFormatJson"},"JsonSchemaSpec":{"type":"object","properties":{"name":{"type":"string","default":"response"},"description":{"type":["string","null"]},"schema":{"type":"object","additionalProperties":{"description":"Any type"}},"strict":{"type":["boolean","null"]}},"required":["schema"],"description":"The `json_schema` wrapper for structured output; omit `strict` to keep the provider's default, and unknown wrapper keys pass through to the provider.","title":"JsonSchemaSpec"},"ResponseFormatJsonSchema":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"],"default":"json_schema"},"json_schema":{"$ref":"#/components/schemas/JsonSchemaSpec"}},"required":["json_schema"],"description":"JSON Schema response format configuration (for structured output).","title":"ResponseFormatJsonSchema"},"ResponseRequestResponseFormat":{"oneOf":[{"$ref":"#/components/schemas/ResponseFormatJson"},{"$ref":"#/components/schemas/ResponseFormatJsonSchema"}],"description":"Response format (json_object or json_schema structured output)","title":"ResponseRequestResponseFormat"},"TagInput":{"type":"object","properties":{"key":{"type":"string","description":"Tag key"},"value":{"type":"string","description":"Tag value"}},"required":["key","value"],"description":"Tag key-value pair for use in requests.","title":"TagInput"},"ResponseRequestServiceTier":{"type":"string","enum":["standard","flex","priority","fast","ultrafast","default","auto","unspecified","standard_only"],"description":"Processing tier: `standard` (default), `flex`, `priority` (`fast` is an alias), or `ultrafast` (OpenAI only), where `default`, `auto`, `unspecified`, and `standard_only` also mean standard; a tier the route doesn't price returns 400 `unsupported_params`.","title":"ResponseRequestServiceTier"},"ResponseRequestModalitiesItems":{"type":"string","enum":["text","image"],"title":"ResponseRequestModalitiesItems"},"ThinkingConfigType":{"type":"string","enum":["enabled","disabled"],"default":"enabled","description":"Turn extended thinking on or off.","title":"ThinkingConfigType"},"ThinkingConfig":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ThinkingConfigType","default":"enabled","description":"Turn extended thinking on or off."},"budget_tokens":{"type":["integer","null"],"exclusiveMinimum":0,"description":"Maximum tokens the model may spend thinking."}},"description":"Extended thinking settings.","title":"ThinkingConfig"},"FusionConfigPreset":{"type":"string","enum":["quality","budget"],"default":"quality","description":"Preset name, accepted for compatibility and currently advisory.","title":"FusionConfigPreset"},"FusionConfig":{"type":"object","properties":{"analysis_models":{"type":"array","items":{"type":"string"},"description":"Two or more model IDs that answer the prompt in parallel."},"synthesis_model":{"type":["string","null"],"description":"Model that merges the parallel answers into the final response; defaults to the first `analysis_models` entry."},"synthesis_instructions":{"type":["string","null"],"description":"Replaces the default instruction given to the synthesis model."},"preset":{"$ref":"#/components/schemas/FusionConfigPreset","default":"quality","description":"Preset name, accepted for compatibility and currently advisory."},"include_candidates":{"type":"boolean","default":true,"description":"Include each parallel answer's text and usage in the response's `fusion` metadata."}},"required":["analysis_models"],"description":"Sends the prompt to every `analysis_models` entry in parallel, then has `synthesis_model` merge the answers into one response.","title":"FusionConfig"},"ResponseRequest":{"type":"object","properties":{"model":{"type":["string","null"],"description":"Model ID as `provider/model-name` or a bare name, an `@alias/<slug>` model alias, or `default_routing`; optional when a routing policy applies."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution. A non-UUID value returns 422 and an unknown customer returns 404 `customer_not_found`."},"routing_policy_id":{"type":["string","null"],"description":"Routing policy ID for this request: an org-level policy, or a project or customer policy when the request carries that scope."},"priority_order":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ResponseRequestPriorityOrderItems"},"description":"An inline PRIORITY list: the models to try for this request in order, first success wins. Each entry is a model id (`provider/model` or a bare name) or a `{model, priority, vendors}` object. Up to 10 entries. Bypasses every stored routing policy (org default, customer default, key binding) while the key's allowed models, vendor and region limits, ZDR and vendor access still apply per entry. Fails over on provider faults only (5xx, 429, timeouts, 402); on a stream, before the first byte. The list is materialized as a routing policy with an id derived from its content and scope, attributed in `routing.policy_id` and the `x-merge-routing-policy-id` header, and reusable later via `routing_policy_id`. `model` must be omitted or equal the first entry. Cannot be combined with `routing_policy_id`, a policy alias, or the top-level `vendor` / `vendors` pins. Also accepted on every SDK-compatible surface. See [Sending a priority list with the request](/merge-gateway/routing/using-policies#sending-a-priority-list-with-the-request)."},"input":{"type":"array","items":{"$ref":"#/components/schemas/ResponseRequestInputItems"},"description":"Conversation history"},"tools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ResponseRequestToolsItems"},"description":"Tools the model may call: function tools, or provider-native tools passed through by `type`."},"tool_choice":{"oneOf":[{"$ref":"#/components/schemas/ResponseRequestToolChoice"},{"type":"null"}],"description":"Tool choice policy: 'auto', 'none', 'required', or {'type': 'function', 'function': {'name': '...'}}"},"max_tokens":{"type":["integer","null"],"description":"Maximum tokens to generate"},"temperature":{"type":["number","null"],"format":"double","minimum":0,"maximum":2,"description":"Sampling temperature"},"top_p":{"type":["number","null"],"format":"double","minimum":0,"maximum":1,"description":"Nucleus sampling parameter"},"stop":{"type":["array","null"],"items":{"type":"string"},"description":"Stop sequences"},"response_format":{"oneOf":[{"$ref":"#/components/schemas/ResponseRequestResponseFormat"},{"type":"null"}],"description":"Response format (json_object or json_schema structured output)"},"stream":{"type":"boolean","default":false,"description":"Whether to stream the response"},"tags":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TagInput"},"description":"Tags to attach to this request for categorization (key-value pairs)"},"project_id":{"type":["string","null"],"description":"Optional project ID (UUID) to associate with this request"},"include_routing_metadata":{"type":"boolean","default":false,"description":"Include detailed routing metadata in response"},"include_guardrails_metadata":{"type":"boolean","default":false,"description":"Include prompt-injection protection and DLP results for this request in a top-level `guardrails` object. In prompt-injection alert mode this also runs the direct scan on the request path (bounded by the alert-mode budget) so the score is available in the body; requests without the flag are unaffected."},"vendor":{"type":["string","null"],"description":"Restrict routing to a specific vendor (hosting platform)"},"vendors":{"type":["array","null"],"items":{"type":"string"},"description":"Ordered list of acceptable vendors. First available wins."},"service_tier":{"oneOf":[{"$ref":"#/components/schemas/ResponseRequestServiceTier"},{"type":"null"}],"description":"Processing tier: `standard` (default), `flex`, `priority` (`fast` is an alias), or `ultrafast` (OpenAI only), where `default`, `auto`, `unspecified`, and `standard_only` also mean standard; a tier the route doesn't price returns 400 `unsupported_params`."},"service_tier_fallback":{"type":"boolean","default":false,"description":"If the provider throttles the requested tier (429/503), retry once at the standard tier, billed at standard rates. The response service_tier shows the tier that actually served."},"previous_response_id":{"type":["string","null"],"description":"ID of a stored response (`resp_...`) whose conversation is replayed before this request's `input`; an expired or unknown ID returns 404 `response_not_found`."},"store":{"type":["boolean","null"],"description":"Set `true` to store this turn so a later request can continue it with `previous_response_id`; stored turns expire an hour after their last use and are never kept under zero data retention."},"logprobs":{"type":["boolean","null"],"description":"Return log probabilities of the output tokens."},"top_logprobs":{"type":["integer","null"],"description":"Number of most likely tokens to return per position; requires `logprobs`."},"user":{"type":["string","null"],"description":"End-user identifier forwarded to the provider."},"safety_identifier":{"type":["string","null"],"description":"End-user identifier forwarded to providers that support it (OpenAI's newer name for `user`)."},"prompt_cache_retention":{"type":["string","null"],"description":"Prompt-cache retention hint forwarded to OpenAI."},"parallel_tool_calls":{"type":["boolean","null"],"description":"Whether the model may make several tool calls in one turn; omit to keep the provider default."},"modalities":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ResponseRequestModalitiesItems"},"description":"Output modalities to generate; include `image` for inline image generation on a route that supports image output, otherwise the request returns 400."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Top-level prompt-caching setting for providers that cache automatically."},"session_id":{"type":["string","null"],"description":"Caching session hint, up to 256 characters, also accepted as the `X-Session-Id` header, which wins when both are set."},"thinking":{"oneOf":[{"$ref":"#/components/schemas/ThinkingConfig"},{"type":"null"}],"description":"Extended thinking settings; the model can reason between tool calls."},"provider_options":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Provider-specific options, keyed by provider family."},"fusion":{"oneOf":[{"$ref":"#/components/schemas/FusionConfig"},{"type":"null"}],"description":"Multi-model fusion settings, used when `model` is `fusion`."}},"required":["input"],"description":"Request body for POST /v1/responses.","title":"ResponseRequest"},"OutputMessageFinishReason":{"type":"string","enum":["stop","max_tokens","tool_use","content_filter"],"title":"OutputMessageFinishReason"},"OutputMessageContentItems":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Discriminator value: text"},"text":{"type":"string"},"annotations":{"type":["array","null"],"items":{"type":"object","additionalProperties":{"description":"Any type"}},"description":"Citations attached to this text, such as `url_citation` entries from web search."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","text"],"description":"Text content block."},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"],"description":"Discriminator value: image_url"},"url":{"type":"string"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","url"],"description":"Image URL content block for vision models."},{"type":"object","properties":{"type":{"type":"string","enum":["image"],"default":"image"},"source_type":{"$ref":"#/components/schemas/ImageContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'image/png', 'image/jpeg'"},"data":{"type":"string","description":"Base64-encoded image data or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Image content block with explicit source type."},{"type":"object","properties":{"type":{"type":"string","enum":["document"],"default":"document"},"source_type":{"$ref":"#/components/schemas/DocumentContentSourceType","default":"base64"},"media_type":{"type":"string","description":"e.g. 'application/pdf'"},"data":{"type":"string","description":"Base64-encoded content or URL"},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type","media_type","data"],"description":"Document content block (PDF, etc.) for document-understanding models."},{"type":"object","properties":{"type":{"type":"string","enum":["tool_use"],"description":"Discriminator value: tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object","additionalProperties":{"description":"Any type"}}},"required":["type","id","name","input"],"description":"Tool use content block (in assistant output)."}],"discriminator":{"propertyName":"type"},"title":"OutputMessageContentItems"},"OutputMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message"],"default":"message"},"role":{"type":"string","enum":["assistant"],"default":"assistant"},"finish_reason":{"oneOf":[{"$ref":"#/components/schemas/OutputMessageFinishReason"},{"type":"null"}]},"content":{"type":"array","items":{"$ref":"#/components/schemas/OutputMessageContentItems"}}},"required":["id","content"],"description":"An output message from the assistant.","title":"OutputMessage"},"Usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"cost":{"type":["number","null"],"format":"double","description":"Cost of this call in USD, computed by Gateway. Null when the route that served the request has no pricing on file, so cost trackers record no spend rather than a false zero."}},"required":["input_tokens","output_tokens","total_tokens"],"description":"Token usage statistics.","title":"Usage"},"RoutingLatency":{"type":"object","properties":{"policy_lookup_ms":{"type":"number","format":"double","default":0},"routing_decision_ms":{"type":"number","format":"double","default":0},"llm_call_ms":{"type":"number","format":"double","default":0},"total_ms":{"type":"number","format":"double","default":0}},"description":"Latency breakdown for routing steps.","title":"RoutingLatency"},"RoutingMetadata":{"type":"object","properties":{"policy_id":{"type":["string","null"]},"policy_name":{"type":["string","null"]},"strategy":{"type":["string","null"]},"intelligent_routing_used":{"type":"boolean","default":false},"complexity_score":{"type":["number","null"],"format":"double","description":"ML-computed prompt complexity score (0-1)"},"adjusted_score":{"type":["number","null"],"format":"double","description":"Strategy-adjusted complexity score"},"selected_tier":{"type":["integer","null"]},"total_tiers":{"type":["integer","null"]},"routing_reason":{"type":["string","null"],"description":"Human-readable explanation of the routing decision"},"router_decision_id":{"type":["string","null"],"description":"ID of the router decision, set only when a router ran."},"model_requested":{"type":["string","null"]},"model_used":{"type":["string","null"],"description":"The actual model selected by routing"},"vendor_used":{"type":["string","null"],"description":"Vendor that served the request."},"credential_type":{"type":["string","null"],"description":"Whose provider credential served the request: `byok` or `managed`."},"fallback":{"type":"boolean","default":false,"description":"True when routing fell through to a lower-priority candidate; `model_used` and `vendor_used` show what served."},"reasoning_effort_requested":{"type":["string","null"],"description":"Reasoning effort the request asked for."},"reasoning_effort_applied":{"type":["string","null"],"description":"Reasoning effort sent to the provider."},"reasoning_effort_source":{"type":["string","null"],"description":"Where the applied reasoning effort came from."},"cost_usd":{"type":["number","null"],"format":"double","description":"Estimated provider spend for the request in USD, at the list price of the route that served it, whoever paid the provider. On a BYOK key this is what the tokens cost on your own provider account. Null when the route has no pricing on file."},"merge_fee_usd":{"type":["number","null"],"format":"double","description":"Merge's fee on this request in USD, at the markup rate that applies to your organization (the plan rate, or 0 when no markup applies). cost_usd + merge_fee_usd is the request's cost with markup on every key type. Excludes server-tool charges such as web search. Null when cost_usd is null."},"latency":{"oneOf":[{"$ref":"#/components/schemas/RoutingLatency"},{"type":"null"}]}},"description":"Metadata about how the request was routed.","title":"RoutingMetadata"},"PromptInjectionMetadataMode":{"type":"string","enum":["off","alert","block"],"description":"The effective prompt-injection mode at evaluation time.","title":"PromptInjectionMetadataMode"},"PITriggeringSegment":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":["string","null"]},"score":{"type":["number","null"],"format":"double"}},"required":["id"],"description":"The segment that produced the decisive score.","title":"PITriggeringSegment"},"PISegmentScore":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","description":"`system_message`, `user_message`, `assistant_message`, `tool_result`, `tool_definition`, ..."},"trusted":{"type":"boolean"},"score":{"type":["number","null"],"format":"double","description":"Maximum Tier 1 score for the segment; null when it was not scored."},"lexical_hit":{"type":"boolean","default":false,"description":"True when the pattern-based detector fired on this segment."}},"required":["id","kind","trusted"],"description":"Direct-injection score for one scanned input segment. Identified by id and kind; never carries the text.","title":"PISegmentScore"},"PiIndirectMetadataMode":{"type":"string","enum":["off","alert","block"],"title":"PiIndirectMetadataMode"},"PIIndirectMetadata":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/PiIndirectMetadataMode"},"action":{"type":["string","null"],"description":"`observe` or `block`."},"blocked_reason":{"type":["string","null"]},"would_block":{"type":"boolean","default":false,"description":"The block rule was satisfied; in alert mode this is what a block-mode org would have done."},"tainted":{"type":"boolean","default":false,"description":"Untrusted content (tool results, retrieved documents, web search) was present."},"taint_sources":{"type":"array","items":{"type":"string"},"description":"`client_tool_result`, `web_search`, `fusion_candidate`."},"tier2a_score":{"type":["number","null"],"format":"double","description":"Heuristic detector confidence."},"tier2b_score":{"type":["number","null"],"format":"double","description":"Embedding similarity to known attacks."},"fired_signals":{"type":"array","items":{"type":"string"}},"structural_violation":{"type":"boolean","default":false,"description":"A model-emitted tool call carried an exfiltration-shaped argument."},"flagged_tools":{"type":"array","items":{"type":"string"}}},"required":["mode"],"description":"Indirect-injection signals for the request.","title":"PIIndirectMetadata"},"PIOutputMetadata":{"type":"object","properties":{"credential_findings":{"type":"integer","default":0},"redacted":{"type":"boolean","default":false}},"description":"Output-side credential-leak scan of the response text (non-streaming only).","title":"PIOutputMetadata"},"PromptInjectionMetadata":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/PromptInjectionMetadataMode","description":"The effective prompt-injection mode at evaluation time."},"action":{"type":["string","null"],"description":"`observe` or `block`. Null when no direct scan ran."},"blocked_reason":{"type":["string","null"],"description":"Why the request was blocked, e.g. `pi_block_threshold`."},"skipped_reason":{"type":["string","null"],"description":"Why no Tier 1 score is present: `alert_timeout`, `block_timeout`, `saturated` (alert mode: every scan slot on the serving instance was busy, so the scan was skipped rather than queued), `no_segments`, `sidecar_error`, `sidecar_unavailable`, `deferred`."},"score":{"type":["number","null"],"format":"double","description":"Maximum direct-injection (Tier 1) score across scanned segments, in [0, 1]."},"block_threshold":{"type":["number","null"],"format":"double","description":"The effective `pi_block_threshold` the score is compared against."},"model_version":{"type":["string","null"],"description":"Classifier version that produced the decisive score."},"triggering_segment":{"oneOf":[{"$ref":"#/components/schemas/PITriggeringSegment"},{"type":"null"}],"description":"The segment behind the decisive score: the maximum in alert mode, the first over threshold in block mode."},"segments":{"type":"array","items":{"$ref":"#/components/schemas/PISegmentScore"},"description":"Every input segment the scanner saw, by id and kind, with its score when scored."},"allowlist_skipped_segment_ids":{"type":"array","items":{"type":"string"},"description":"Segments skipped because they matched an allowlist pattern."},"indirect":{"oneOf":[{"$ref":"#/components/schemas/PIIndirectMetadata"},{"type":"null"}],"description":"Indirect-injection (untrusted content) signals for the request."},"output":{"oneOf":[{"$ref":"#/components/schemas/PIOutputMetadata"},{"type":"null"}],"description":"Output-side credential scan. Non-streaming responses only."},"policy_scope":{"type":["string","null"],"description":"`org`, or `project` when a project override applied."},"latency_ms":{"type":["number","null"],"format":"double","description":"Time the direct scan took, in milliseconds."}},"required":["mode"],"description":"Prompt-injection protection outcome for the request.","title":"PromptInjectionMetadata"},"DlpMetadataStatus":{"type":"string","enum":["skipped","clean","flagged","redacted","blocked","error"],"title":"DlpMetadataStatus"},"DlpMetadataAction":{"type":"string","enum":["none","notify","redact","block"],"title":"DlpMetadataAction"},"DLPMetadata":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/DlpMetadataStatus"},"action":{"$ref":"#/components/schemas/DlpMetadataAction"},"skipped_reason":{"type":["string","null"],"description":"Set when status is `skipped` or `error`: `no_enabled_rules`, `no_text`, `disabled`, `sidecar_timeout`, `sidecar_http_error`, `sidecar_exception`."},"finding_count":{"type":"integer","default":0},"entity_counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Findings per entity type, keyed by entity name (for example US_SSN). Never the matched values."},"action_counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Findings per rule action (`LOG`, `REDACT`, `BLOCK`)."},"rule_ids":{"type":"array","items":{"type":"string"},"description":"Your DLP rule ids that matched."},"policy_scope":{"type":["string","null"],"description":"`org`, or `project` when a project override applied."},"latency_ms":{"type":["number","null"],"format":"double"}},"required":["status","action"],"description":"DLP enforcement outcome for the request.","title":"DLPMetadata"},"GuardrailsMetadata":{"type":"object","properties":{"prompt_injection":{"oneOf":[{"$ref":"#/components/schemas/PromptInjectionMetadata"},{"type":"null"}],"description":"Prompt-injection protection outcome. Null when the organization has no prompt-injection configuration."},"dlp":{"oneOf":[{"$ref":"#/components/schemas/DLPMetadata"},{"type":"null"}],"description":"DLP enforcement outcome. Null when DLP did not run for the request."}},"description":"Guardrail results attached when `include_guardrails_metadata` is set. Every field is a copy of a value already computed for the request log; no prompt text or matched value is ever included.","title":"GuardrailsMetadata"},"ResponseResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["response"],"default":"response"},"created_at":{"type":"string","format":"date-time"},"model":{"type":"string","description":"The model that generated the response, in 'provider/model-name' format"},"vendor":{"type":["string","null"],"description":"The execution vendor that served the request"},"provider_request_id":{"type":["string","null"],"description":"The upstream provider's request ID"},"output":{"type":"array","items":{"$ref":"#/components/schemas/OutputMessage"}},"usage":{"$ref":"#/components/schemas/Usage"},"routing":{"oneOf":[{"$ref":"#/components/schemas/RoutingMetadata"},{"type":"null"}],"description":"Routing metadata (only present when include_routing_metadata=true)"},"guardrails":{"oneOf":[{"$ref":"#/components/schemas/GuardrailsMetadata"},{"type":"null"}],"description":"Prompt-injection protection and DLP results (only present when include_guardrails_metadata=true). Also present on blocked 422 responses beside `error`."},"service_tier":{"type":["string","null"],"description":"The tier that actually served the request and was billed. Differs from the requested tier on a throttle fallback."}},"required":["id","created_at","model","output","usage"],"description":"Response body for POST /v1/responses.","title":"ResponseResponse"},"StoredResponse":{"type":"object","properties":{"id":{"type":"string","description":"Response ID."},"object":{"type":"string","enum":["response.stored"]},"created_at":{"description":"When the turn was stored."},"model":{"type":"string","description":"Model that produced the turn."},"vendor":{"type":"string","description":"Vendor that served the turn."},"previous_response_id":{"type":["string","null"],"description":"ID of the turn this one continued, if any."},"input":{"type":"array","items":{"description":"Any type"},"description":"Stored input items."},"output":{"type":"array","items":{"description":"Any type"},"description":"Stored output items."}},"description":"A stored conversation turn.","title":"StoredResponse"},"DeletedResponse":{"type":"object","properties":{"id":{"type":"string","description":"Response ID."},"object":{"type":"string","enum":["response.deleted"]},"deleted":{"type":"boolean","description":"Always true."}},"description":"Confirmation that a stored turn was deleted.","title":"DeletedResponse"},"EmbeddingRequestSchemaInput":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Text to embed","title":"EmbeddingRequestSchemaInput"},"EmbeddingRequestSchema":{"type":"object","properties":{"model":{"type":"string","description":"Model ID in format 'provider/model-name'"},"input":{"$ref":"#/components/schemas/EmbeddingRequestSchemaInput","description":"Text to embed"},"encoding_format":{"type":["string","null"],"description":"Encoding format for embeddings"},"dimensions":{"type":["integer","null"],"description":"Number of dimensions for the output embeddings. Supported by OpenAI text-embedding-3 and later models and by Google gemini embedding models."},"task_type":{"type":["string","null"],"description":"Google-only: the embedding task type (e.g. RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING). Ignored for non-Google models."},"user":{"type":["string","null"],"description":"End-user identifier"},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."}},"required":["model","input"],"description":"Request body for POST /v1/embeddings.","title":"EmbeddingRequestSchema"},"EmbeddingDataSchema":{"type":"object","properties":{"object":{"type":"string","enum":["embedding"],"default":"embedding"},"embedding":{"type":"array","items":{"type":"number","format":"double"}},"index":{"type":"integer"}},"required":["embedding","index"],"description":"Single embedding result.","title":"EmbeddingDataSchema"},"EmbeddingUsage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"cost":{"type":["number","null"],"format":"double","description":"Cost of this call in USD, computed by Gateway. Null when the embedding model has no pricing on file, so cost trackers record no spend rather than a false zero."}},"required":["prompt_tokens","total_tokens"],"description":"Token usage for embeddings.","title":"EmbeddingUsage"},"EmbeddingResponseSchema":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/EmbeddingDataSchema"}},"model":{"type":"string"},"usage":{"$ref":"#/components/schemas/EmbeddingUsage"},"vendor":{"type":"string","description":"Vendor that served the request."}},"required":["data","model","usage","vendor"],"description":"Response body for POST /v1/embeddings.","title":"EmbeddingResponseSchema"},"ImageGenerationRequestSchemaResponseFormat":{"type":"string","enum":["b64_json","url"],"description":"Legacy OpenAI field; most current models return `b64_json` only.","title":"ImageGenerationRequestSchemaResponseFormat"},"ImageGenerationRequestSchema":{"type":"object","properties":{"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"model":{"type":"string","description":"Image model, for example `openai/gpt-image-2`."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"prompt":{"type":"string","minLength":1,"description":"Text prompt for the image."},"n":{"type":["integer","null"],"minimum":1,"maximum":10,"description":"Number of images, 1 to 10."},"size":{"type":["string","null"],"description":"Image size, for example `1024x1024`."},"quality":{"type":["string","null"],"description":"Quality tier, model-specific."},"output_format":{"type":["string","null"],"description":"Output format such as `png`, `jpeg`, or `webp`, model-specific."},"response_format":{"oneOf":[{"$ref":"#/components/schemas/ImageGenerationRequestSchemaResponseFormat"},{"type":"null"}],"description":"Legacy OpenAI field; most current models return `b64_json` only."},"style":{"type":["string","null"],"description":"Style hint, model-specific."},"user":{"type":["string","null"],"description":"End-user identifier forwarded to the provider."},"provider_options":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Provider-specific options, allowlisted per vendor family."}},"required":["model","prompt"],"description":"Request body for `POST /v1/images/generations`, compatible with OpenAI; unknown top-level fields are forwarded to the provider.","title":"ImageGenerationRequestSchema"},"ImageGenerationDatum":{"type":"object","properties":{"b64_json":{"type":["string","null"],"description":"Base64-encoded image."},"url":{"type":["string","null"],"description":"Image URL, when the model returns one."},"revised_prompt":{"type":["string","null"],"description":"Prompt as rewritten by the model, when it returns one."}},"description":"One generated image.","title":"ImageGenerationDatum"},"ImageGenerationInputTokensDetails":{"type":"object","properties":{"image_tokens":{"type":"integer","default":0,"description":"Reference-image input tokens, billed at the route's image-input rate."},"text_tokens":{"type":"integer","default":0,"description":"Text input tokens."}},"description":"Input tokens split into text and reference-image tokens.","title":"ImageGenerationInputTokensDetails"},"ImageGenerationUsageSchema":{"type":"object","properties":{"input_tokens":{"type":"integer","default":0},"output_tokens":{"type":"integer","default":0},"total_tokens":{"type":"integer","default":0},"input_tokens_details":{"oneOf":[{"$ref":"#/components/schemas/ImageGenerationInputTokensDetails"},{"type":"null"}]}},"description":"Token usage reported by the provider.","title":"ImageGenerationUsageSchema"},"ImageGenerationResponseSchema":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp in seconds."},"data":{"type":"array","items":{"$ref":"#/components/schemas/ImageGenerationDatum"},"description":"Generated images."},"usage":{"oneOf":[{"$ref":"#/components/schemas/ImageGenerationUsageSchema"},{"type":"null"}],"description":"Token usage reported by the provider; absent for flat per-image models."},"images_generated":{"type":"integer","default":0,"description":"Number of images generated."},"cost":{"type":["number","null"],"format":"double","description":"Cost of the request in USD; null when the route is unpriced."}},"required":["created","data"],"description":"Generated images, compatible with OpenAI, plus `images_generated` and `cost`.","title":"ImageGenerationResponseSchema"},"TranscriptionResponseSchema":{"type":"object","properties":{"text":{"type":"string","description":"Transcribed text."},"vendor":{"type":"string","description":"Vendor that served the request."},"language":{"type":["string","null"],"description":"Detected language, when the model returns it."},"duration":{"type":["number","null"],"format":"double","description":"Audio duration in seconds, when the model returns it."}},"required":["text","vendor"],"description":"Transcription result, compatible with OpenAI.","title":"TranscriptionResponseSchema"},"SpeechRequestSchemaResponseFormat":{"type":"string","enum":["mp3","opus","aac","flac","wav","pcm"],"description":"Audio format; defaults to `mp3`.","title":"SpeechRequestSchemaResponseFormat"},"SpeechRequestSchema":{"type":"object","properties":{"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"model":{"type":"string","description":"Text-to-speech model, for example `openai/tts-1`."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"input":{"type":"string","minLength":1,"description":"Text to synthesize."},"voice":{"type":["string","null"],"description":"Voice ID, model-specific, for example `alloy`."},"response_format":{"oneOf":[{"$ref":"#/components/schemas/SpeechRequestSchemaResponseFormat"},{"type":"null"}],"description":"Audio format; defaults to `mp3`."},"speed":{"type":["number","null"],"format":"double","minimum":0.25,"maximum":4,"description":"Playback speed, 0.25 to 4."},"instructions":{"type":["string","null"],"description":"Voice direction, model-specific."}},"required":["model","input"],"description":"Request body for `POST /v1/audio/speech`, compatible with OpenAI; unknown top-level fields are forwarded to the provider.","title":"SpeechRequestSchema"},"V1VideosGetParametersOrder":{"type":"string","enum":["asc","desc"],"default":"desc","title":"V1VideosGetParametersOrder"},"VideoJobSchema":{"type":"object","properties":{"id":{"type":"string","description":"Video job ID."},"object":{"type":"string","enum":["video"],"default":"video"},"status":{"type":"string","description":"Job status, starting at `queued`; poll until it is `completed` or `failed`."},"model":{"type":"string","description":"Model running the job."},"seconds":{"type":["string","null"],"description":"Clip length in seconds."},"size":{"type":["string","null"],"description":"Output resolution."},"created_at":{"type":["integer","null"],"description":"Unix timestamp in seconds."},"progress":{"type":["integer","null"],"description":"Progress percentage, when the provider reports it."},"error":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Error details for a failed job."},"cost":{"type":["number","null"],"format":"double","description":"Cost of the job in USD, set once it completes; failed jobs are not billed."}},"required":["id","status","model"],"description":"An asynchronous video generation job.","title":"VideoJobSchema"},"VideoListSchema":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/VideoJobSchema"}},"first_id":{"type":["string","null"],"description":"ID of the first video on this page."},"last_id":{"type":["string","null"],"description":"ID of the last video on this page; pass it as `after` to get the next page."},"has_more":{"type":"boolean","default":false,"description":"Whether more videos follow this page."}},"required":["data"],"description":"A page of video jobs.","title":"VideoListSchema"},"VideoGenerationRequestSchemaSeconds":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"Clip length in seconds, within the model's limits.","title":"VideoGenerationRequestSchemaSeconds"},"VideoGenerationRequestSchema":{"type":"object","properties":{"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"model":{"type":"string","description":"Video model, for example `google/veo-3.1-generate-001`."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"prompt":{"type":"string","minLength":1,"description":"Text prompt for the video."},"seconds":{"oneOf":[{"$ref":"#/components/schemas/VideoGenerationRequestSchemaSeconds"},{"type":"null"}],"description":"Clip length in seconds, within the model's limits."},"size":{"type":["string","null"],"description":"Output resolution as `WIDTHxHEIGHT`, model-specific."},"user":{"type":["string","null"],"description":"End-user identifier forwarded to the provider."}},"required":["model","prompt"],"description":"Request body for `POST /v1/videos`, compatible with OpenAI Videos.","title":"VideoGenerationRequestSchema"},"VideoDeleted":{"type":"object","properties":{"id":{"type":"string","description":"Video job ID."},"object":{"type":"string","enum":["video.deleted"]},"deleted":{"type":"boolean","description":"Always true."}},"description":"Confirmation that a video job was deleted; usage and billing history are kept.","title":"VideoDeleted"},"BatchObjectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Batch ID."},"object":{"type":"string","enum":["batch"],"default":"batch"},"endpoint":{"type":"string","description":"Request shape of the batch lines."},"model":{"type":"string","description":"Model the batch runs on."},"status":{"type":"string","description":"One of `validating`, `in_progress`, `finalizing`, `cancelling`, `completed`, `failed`, `expired`, or `cancelled`."},"request_counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Line counts by outcome."},"created_at":{"type":"integer","description":"Unix timestamp in seconds."},"expires_at":{"type":"integer","description":"Unix timestamp in seconds after which an unfinished batch expires."},"completed_at":{"type":["integer","null"],"description":"Unix timestamp in seconds when the batch finished."},"usage":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Aggregate usage and cost, once known."},"metadata":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Metadata you sent at creation."}},"required":["id","endpoint","model","status","request_counts","created_at","expires_at"],"description":"A batch job.","title":"BatchObjectSchema"},"BatchListSchema":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/BatchObjectSchema"}},"first_id":{"type":["string","null"],"description":"ID of the first batch on this page."},"last_id":{"type":["string","null"],"description":"ID of the last batch on this page; pass it as `after` to get the next page."},"has_more":{"type":"boolean","default":false,"description":"Whether more batches follow this page."}},"required":["data"],"description":"A page of batches, newest first.","title":"BatchListSchema"},"BatchRequestLineSchema":{"type":"object","properties":{"custom_id":{"type":"string","description":"Your ID for this line, unique within the batch."},"body":{"type":"object","additionalProperties":{"description":"Any type"},"description":"Request body in the shape the batch's `endpoint` accepts."}},"required":["custom_id","body"],"description":"One batch line.","title":"BatchRequestLineSchema"},"BatchProviderSchema":{"type":"object","properties":{"only":{"type":["array","null"],"items":{"type":"string"},"description":"Vendors the batch may run on; narrows your organization's vendor restrictions and never widens them."}},"description":"Vendor restrictions for a batch; only `only` is supported and any other key returns 400.","title":"BatchProviderSchema"},"BatchCreateRequestSchema":{"type":"object","properties":{"endpoint":{"type":"string","description":"Request shape of every line: `/v1/chat/completions`, `/v1/embeddings`, `/v1/messages`, or `/v1/responses`."},"model":{"type":"string","description":"Model every line runs on."},"requests":{"type":"array","items":{"$ref":"#/components/schemas/BatchRequestLineSchema"},"description":"Batch lines, each with a unique `custom_id`."},"metadata":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Your metadata, echoed back unchanged."},"provider":{"oneOf":[{"$ref":"#/components/schemas/BatchProviderSchema"},{"type":"null"}],"description":"Vendor restrictions for the batch, for example `{\"only\": [\"anthropic\"]}`."}},"required":["endpoint","model","requests"],"description":"Request body for `POST /v1/batches`, with the requests inline.","title":"BatchCreateRequestSchema"},"BatchDeletedDeletionUpstream":{"type":"object","properties":{"provider":{"type":"string"},"status":{"type":"string"}},"title":"BatchDeletedDeletionUpstream"},"BatchDeletedDeletion":{"type":"object","properties":{"merge":{"type":"string"},"upstream":{"$ref":"#/components/schemas/BatchDeletedDeletionUpstream"}},"description":"What was deleted: `merge` is `deleted`, and `upstream` gives the provider and whether its copy was deleted.","title":"BatchDeletedDeletion"},"BatchDeleted":{"type":"object","properties":{"id":{"type":"string","description":"Batch ID."},"object":{"type":"string","enum":["batch.deleted"]},"deleted":{"type":"boolean","description":"Always true."},"deletion":{"$ref":"#/components/schemas/BatchDeletedDeletion","description":"What was deleted: `merge` is `deleted`, and `upstream` gives the provider and whether its copy was deleted."}},"description":"Confirmation that a batch was deleted; usage and billing history are kept.","title":"BatchDeleted"},"DecisionRequestSchemaState":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"description":"Any type"}},{"type":"array","items":{"description":"Any type"}}],"description":"Content to evaluate, as text or structured data.","title":"DecisionRequestSchemaState"},"DecisionQuestionSchemaType":{"type":"string","enum":["noul","choice","score"],"description":"Answer type: `noul` (yes or no), `choice`, or `score`.","title":"DecisionQuestionSchemaType"},"DecisionQuestionSchemaInstructions":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"description":"Any type"}},{"type":"array","items":{"description":"Any type"}}],"description":"What the question asks, as text or structured data. Must be non-empty.","title":"DecisionQuestionSchemaInstructions"},"DecisionQuestionSchemaCriteria":{"oneOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"array","items":{"type":"string"}}],"description":"Answer space: required for `choice` (option to description map) and `score` (at least two ordered levels), optional for `noul`.","title":"DecisionQuestionSchemaCriteria"},"DecisionQuestionSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/DecisionQuestionSchemaType","description":"Answer type: `noul` (yes or no), `choice`, or `score`."},"instructions":{"$ref":"#/components/schemas/DecisionQuestionSchemaInstructions","description":"What the question asks, as text or structured data. Must be non-empty."},"criteria":{"oneOf":[{"$ref":"#/components/schemas/DecisionQuestionSchemaCriteria"},{"type":"null"}],"description":"Answer space: required for `choice` (option to description map) and `score` (at least two ordered levels), optional for `noul`."}},"required":["type","instructions"],"description":"One typed question.","title":"DecisionQuestionSchema"},"DecisionRequestSchema":{"type":"object","properties":{"model":{"type":"string","description":"Decision model ID, for example `typesafe/jev-1.13`."},"state":{"$ref":"#/components/schemas/DecisionRequestSchemaState","description":"Content to evaluate, as text or structured data."},"questions":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DecisionQuestionSchema"},"description":"Questions to answer, keyed by names you choose."},"vendor":{"type":["string","null"],"description":"Pin the vendor that runs this request."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."}},"required":["model","state","questions"],"description":"Request body for `POST /v1/decisions`; unknown fields are rejected.","title":"DecisionRequestSchema"},"DecisionUsage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"cost":{"type":["number","null"],"format":"double","description":"Cost of the request in USD."}},"required":["input_tokens","output_tokens","total_tokens"],"description":"Token usage for a decision request.","title":"DecisionUsage"},"DecisionResponseSchema":{"type":"object","properties":{"object":{"type":"string","enum":["decision"],"default":"decision"},"model":{"type":"string","description":"Concrete model version that answered."},"vendor":{"type":"string","description":"Vendor that served the request."},"answers":{"type":"object","additionalProperties":{"description":"Any type"},"description":"One typed answer per question, keyed by your question names."},"usage":{"$ref":"#/components/schemas/DecisionUsage"}},"required":["model","vendor","answers","usage"],"description":"Typed answers from a decision model.","title":"DecisionResponseSchema"},"OpenAiChatMessageRole":{"type":"string","enum":["system","user","assistant","tool","developer"],"title":"OpenAiChatMessageRole"},"OpenAiChatMessageContent":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":{"description":"Any type"}}}],"title":"OpenAiChatMessageContent"},"OpenAIChatMessage":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/OpenAiChatMessageRole"},"content":{"oneOf":[{"$ref":"#/components/schemas/OpenAiChatMessageContent"},{"type":"null"}]},"name":{"type":["string","null"]},"tool_calls":{"type":["array","null"],"items":{"type":"object","additionalProperties":{"description":"Any type"}}},"tool_call_id":{"type":["string","null"]},"thinking":{"type":["string","null"],"description":"Reasoning text from a previous assistant turn, replayed to models that need it."},"thinking_signature":{"type":["string","null"],"description":"Signature for the replayed `thinking` text."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["role"],"description":"OpenAI chat message format.","title":"OpenAIChatMessage"},"OpenAiChatCompletionRequestStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"title":"OpenAiChatCompletionRequestStop"},"OpenAIFunctionDef":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","default":""},"parameters":{"type":"object","additionalProperties":{"description":"Any type"}}},"required":["name"],"description":"OpenAI function definition within a tool.","title":"OpenAIFunctionDef"},"OpenAITool":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"default":"function"},"function":{"$ref":"#/components/schemas/OpenAIFunctionDef"}},"required":["function"],"description":"OpenAI tool definition.","title":"OpenAITool"},"OpenAiChatCompletionRequestToolChoice":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":{"description":"Any type"}}],"title":"OpenAiChatCompletionRequestToolChoice"},"OpenAIResponseFormat":{"type":"object","properties":{"type":{"type":"string","default":"text","description":"One of 'text', 'json_object', or 'json_schema'."},"json_schema":{"oneOf":[{"$ref":"#/components/schemas/JsonSchemaSpec"},{"type":"null"}],"description":"Required when type is 'json_schema'."}},"description":"OpenAI response format.","title":"OpenAIResponseFormat"},"OpenAiChatCompletionRequestServiceTier":{"type":"string","enum":["standard","flex","priority"],"description":"Processing tier. 'flex' = discounted best-effort (slower, may be throttled); 'priority' = premium low-latency (not currently priced on any route, so it fails closed). Omit or 'standard' for normal processing. Allowed only on routes that price the requested tier, otherwise the request fails closed with 400.","title":"OpenAiChatCompletionRequestServiceTier"},"OpenAiChatCompletionRequestPriorityOrderItems":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/PriorityOrderEntry"}],"title":"OpenAiChatCompletionRequestPriorityOrderItems"},"OpenAIChatCompletionRequest":{"type":"object","properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/OpenAIChatMessage"}},"temperature":{"type":["number","null"],"format":"double"},"top_p":{"type":["number","null"],"format":"double"},"n":{"type":["integer","null"]},"stream":{"type":"boolean","default":false},"stop":{"oneOf":[{"$ref":"#/components/schemas/OpenAiChatCompletionRequestStop"},{"type":"null"}]},"max_tokens":{"type":["integer","null"]},"max_completion_tokens":{"type":["integer","null"]},"presence_penalty":{"type":["number","null"],"format":"double"},"frequency_penalty":{"type":["number","null"],"format":"double"},"logit_bias":{"type":["object","null"],"additionalProperties":{"type":"number","format":"double"}},"user":{"type":["string","null"]},"tools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/OpenAITool"}},"tool_choice":{"oneOf":[{"$ref":"#/components/schemas/OpenAiChatCompletionRequestToolChoice"},{"type":"null"}]},"response_format":{"oneOf":[{"$ref":"#/components/schemas/OpenAIResponseFormat"},{"type":"null"}]},"seed":{"type":["integer","null"]},"stream_options":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"service_tier":{"oneOf":[{"$ref":"#/components/schemas/OpenAiChatCompletionRequestServiceTier"},{"type":"null"}],"description":"Processing tier. 'flex' = discounted best-effort (slower, may be throttled); 'priority' = premium low-latency (not currently priced on any route, so it fails closed). Omit or 'standard' for normal processing. Allowed only on routes that price the requested tier, otherwise the request fails closed with 400."},"service_tier_fallback":{"type":"boolean","default":false,"description":"If the provider throttles the requested tier (429/503), retry once at the standard tier, billed at standard rates. The response service_tier shows the tier that actually served."},"logprobs":{"type":["boolean","null"],"description":"Return log probabilities of the output tokens."},"top_logprobs":{"type":["integer","null"],"description":"Number of most likely tokens to return per position; requires `logprobs`."},"thinking":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Extended thinking settings for models that support it."},"tags":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TagInput"},"description":"Key-value tags to attach to this request."},"project_id":{"type":["string","null"],"description":"Project ID (UUID) to attribute this request to."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"routing_policy_id":{"type":["string","null"],"description":"Routing policy ID for this request: an org-level policy, or a project or customer policy when the request carries that scope."},"priority_order":{"type":["array","null"],"items":{"$ref":"#/components/schemas/OpenAiChatCompletionRequestPriorityOrderItems"},"description":"Ordered list of models to try, first success wins, with the same rules as `priority_order` on `POST /v1/responses`."},"vendor":{"type":["string","null"],"description":"Restrict routing to one vendor (hosting platform)."},"vendors":{"type":["array","null"],"items":{"type":"string"},"description":"Ordered list of acceptable vendors; the first available one wins."},"provider_options":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Provider-specific options, keyed by provider family."},"prompt_cache_key":{"type":["string","null"],"description":"Prompt-cache routing hint forwarded to providers that cache automatically."},"include_routing_metadata":{"type":"boolean","default":false,"description":"Return routing metadata for this request."},"include_guardrails_metadata":{"type":"boolean","default":false,"description":"Return prompt-injection and DLP results in a top-level `guardrails` object."}},"required":["model","messages"],"description":"OpenAI chat completion request body.","title":"OpenAIChatCompletionRequest"},"AnthropicMessageParamRole":{"type":"string","enum":["user","assistant"],"title":"AnthropicMessageParamRole"},"AnthropicContentBlockContent":{"oneOf":[{"type":"string"},{"type":"array","items":{"description":"Any type"}}],"title":"AnthropicContentBlockContent"},"AnthropicContentBlock":{"type":"object","properties":{"type":{"type":"string","description":"Block type, such as `text`, `image`, `tool_use`, or `tool_result`"},"text":{"type":["string","null"]},"id":{"type":["string","null"]},"name":{"type":["string","null"]},"input":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"tool_use_id":{"type":["string","null"]},"content":{"oneOf":[{"$ref":"#/components/schemas/AnthropicContentBlockContent"},{"type":"null"}]},"source":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"is_error":{"type":["boolean","null"],"description":"Marks a `tool_result` block as an error."},"thinking":{"type":["string","null"],"description":"Reasoning text of a `thinking` block."},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Marks a prompt-caching breakpoint at this block for providers that support it."}},"required":["type"],"title":"AnthropicContentBlock"},"AnthropicMessageParamContent1":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicContentBlock"},"title":"AnthropicMessageParamContent1"},"AnthropicMessageParamContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/AnthropicMessageParamContent1"}],"title":"AnthropicMessageParamContent"},"AnthropicMessageParam":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/AnthropicMessageParamRole"},"content":{"$ref":"#/components/schemas/AnthropicMessageParamContent"}},"required":["role","content"],"title":"AnthropicMessageParam"},"AnthropicMessageRequestSystem1":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicContentBlock"},"title":"AnthropicMessageRequestSystem1"},"AnthropicMessageRequestSystem":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/AnthropicMessageRequestSystem1"}],"title":"AnthropicMessageRequestSystem"},"AnthropicToolDef":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"input_schema":{"type":"object","additionalProperties":{"description":"Any type"}},"type":{"type":["string","null"],"description":"Tool type for Anthropic server tools; omit for a custom tool."},"defer_loading":{"type":["boolean","null"],"description":"Load this tool on demand through tool search instead of sending it with every request."}},"required":["name"],"title":"AnthropicToolDef"},"AnthropicThinkingConfig":{"type":"object","properties":{"type":{"type":"string","default":"enabled","description":"Thinking mode, for example `enabled` or `adaptive`."},"budget_tokens":{"type":"integer","default":10000,"description":"Maximum tokens the model may spend thinking."},"display":{"type":["string","null"]},"block_binding":{"type":["object","null"],"additionalProperties":{"description":"Any type"}}},"description":"Anthropic extended thinking settings, accepting both the `enabled` with `budget_tokens` form and `adaptive`.","title":"AnthropicThinkingConfig"},"AnthropicOutputConfig":{"type":"object","properties":{"effort":{"type":["string","null"],"description":"Reasoning effort."}},"description":"Anthropic `output_config` block; only `effort` is applied.","title":"AnthropicOutputConfig"},"AnthropicMessageRequestPriorityOrderItems":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/PriorityOrderEntry"}],"title":"AnthropicMessageRequestPriorityOrderItems"},"AnthropicMessageRequest":{"type":"object","properties":{"model":{"type":"string"},"max_tokens":{"type":"integer"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicMessageParam"}},"system":{"oneOf":[{"$ref":"#/components/schemas/AnthropicMessageRequestSystem"},{"type":"null"}]},"stream":{"type":"boolean","default":false},"temperature":{"type":["number","null"],"format":"double"},"top_p":{"type":["number","null"],"format":"double"},"top_k":{"type":["integer","null"]},"stop_sequences":{"type":["array","null"],"items":{"type":"string"}},"tools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AnthropicToolDef"}},"tool_choice":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"metadata":{"type":["object","null"],"additionalProperties":{"description":"Any type"}},"service_tier":{"type":["string","null"]},"cache_control":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Top-level prompt-caching setting."},"thinking":{"oneOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}],"description":"Extended thinking settings for models that support it."},"output_config":{"oneOf":[{"$ref":"#/components/schemas/AnthropicOutputConfig"},{"type":"null"}],"description":"Anthropic output settings; only `effort` is applied."},"customer":{"type":["string","null"],"description":"Customer ID (UUID) to scope this request to, applying that customer's routing policy, provider keys, budget, and usage attribution."},"routing_policy_id":{"type":["string","null"],"description":"Routing policy ID for this request: an org-level policy, or a project or customer policy when the request carries that scope."},"priority_order":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AnthropicMessageRequestPriorityOrderItems"},"description":"Ordered list of models to try, first success wins, with the same rules as `priority_order` on `POST /v1/responses`."},"vendor":{"type":["string","null"],"description":"Restrict routing to one vendor (hosting platform)."},"vendors":{"type":["array","null"],"items":{"type":"string"},"description":"Ordered list of acceptable vendors; the first available one wins."},"provider_options":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Provider-specific options, keyed by provider family."},"include_routing_metadata":{"type":"boolean","default":false,"description":"Return routing metadata for this request."},"include_guardrails_metadata":{"type":"boolean","default":false,"description":"Return prompt-injection and DLP results in a top-level `guardrails` object."},"service_tier_fallback":{"type":"boolean","default":false,"description":"Retry once at the standard tier, billed at standard rates, if the requested tier is throttled (429 or 503)."}},"required":["model","max_tokens","messages"],"title":"AnthropicMessageRequest"},"AnthropicMessageResponseStopReason":{"type":"string","enum":["end_turn","max_tokens","stop_sequence","tool_use"],"title":"AnthropicMessageResponseStopReason"},"AnthropicUsage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"cache_creation_input_tokens":{"type":["integer","null"]},"cache_read_input_tokens":{"type":["integer","null"]}},"required":["input_tokens","output_tokens"],"title":"AnthropicUsage"},"AnthropicMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["message"]},"role":{"type":"string","enum":["assistant"]},"model":{"type":"string"},"content":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicContentBlock"}},"stop_reason":{"oneOf":[{"$ref":"#/components/schemas/AnthropicMessageResponseStopReason"},{"type":"null"}]},"stop_sequence":{"type":["string","null"]},"usage":{"$ref":"#/components/schemas/AnthropicUsage"}},"required":["id","type","role","model","content","usage"],"title":"AnthropicMessageResponse"},"AnthropicCountTokensRequestSystem1":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicContentBlock"},"title":"AnthropicCountTokensRequestSystem1"},"AnthropicCountTokensRequestSystem":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/AnthropicCountTokensRequestSystem1"}],"title":"AnthropicCountTokensRequestSystem"},"AnthropicCountTokensRequest":{"type":"object","properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/AnthropicMessageParam"}},"system":{"oneOf":[{"$ref":"#/components/schemas/AnthropicCountTokensRequestSystem"},{"type":"null"}]},"tools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AnthropicToolDef"}},"tool_choice":{"type":["object","null"],"additionalProperties":{"description":"Any type"},"description":"Tool choice, counted as part of the prompt."},"thinking":{"oneOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}],"description":"Extended thinking settings for models that support it."}},"required":["model","messages"],"title":"AnthropicCountTokensRequest"},"AnthropicCountTokensResponse":{"type":"object","properties":{"input_tokens":{"type":"integer"}},"required":["input_tokens"],"title":"AnthropicCountTokensResponse"},"V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"}},"title":"V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems"},"V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItems":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"strategy":{"type":"string"},"description":{"type":["string","null"]},"is_intelligent":{"type":"boolean"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems"}},"is_active":{"type":"boolean"}},"title":"V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItems"},"Routing_listPolicies_Response_200":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/V1RoutingPoliciesGetResponsesContentApplicationJsonSchemaDataItems"}}},"title":"Routing_listPolicies_Response_200"},"V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItemsMlRouting":{"type":"object","properties":{"score_exponent":{"type":"number","format":"double"},"behavior":{"type":"string"}},"title":"V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItemsMlRouting"},"V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItems":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"is_intelligent":{"type":"boolean"},"description":{"type":"string"},"ml_routing":{"oneOf":[{"$ref":"#/components/schemas/V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItemsMlRouting"},{"type":"null"}]}},"title":"V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItems"},"Routing_listStrategies_Response_200":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/V1RoutingStrategiesGetResponsesContentApplicationJsonSchemaDataItems"}}},"title":"Routing_listStrategies_Response_200"},"TagSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique tag identifier"},"object":{"type":"string","enum":["tag"],"default":"tag"},"tag_key":{"type":"string","description":"Tag key"},"tag_value":{"type":"string","description":"Tag value"},"org_id":{"type":["string","null"],"description":"Organization ID, null for global tags"},"is_global":{"type":"boolean","default":false,"description":"Whether this is a global tag"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","tag_key","tag_value"],"description":"A tag available through the gateway.","title":"TagSchema"},"TagsListResponse":{"type":"object","properties":{"object":{"type":"string","enum":["list"],"default":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TagSchema"}},"has_more":{"type":"boolean","default":false},"next_cursor":{"type":["string","null"]}},"required":["data"],"description":"Response for GET /v1/tags.","title":"TagsListResponse"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Your production key sent as a bearer token."}}}}