From b294ae2ca43a85e80e3f99c49de73ac054746085 Mon Sep 17 00:00:00 2001 From: OpenRouter SDK Bot Date: Thu, 3 Dec 2026 21:22:59 +0000 Subject: [PATCH] chore: update OpenAPI spec [sdk-bot] --- .speakeasy/in.openapi.yaml | 253 ++++++++++++++++++++++++++++++++++--- 1 file changed, 232 insertions(+), 21 deletions(-) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index dc31dc1d..53903381 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -5345,6 +5345,21 @@ components: required: - 'url' type: 'object' + BatchImageGenerationMissingImage: + description: 'An image the provider returned that OpenRouter could not store. It is not billed.' + properties: + index: + description: 'Position of the image among the images returned for this request, from 0' + example: 1 + type: 'integer' + message: + description: 'Why the image is missing' + example: 'The provider returned this image without readable image data.' + type: 'string' + required: + - 'index' + - 'message' + type: 'object' BatchImageGenerationResponse: description: 'Image generation result of a batch request: image links and when they expire' properties: @@ -5364,6 +5379,11 @@ components: description: 'Generation ID of this request. Look up its cost and details with `GET /api/v1/generation?id=`.' example: 'gen-batch-1748372400-3f1c9b2e7a5d4c8e0b61' type: 'string' + missing_images: + description: 'Images the provider returned without usable image data. Present only when some images of the request are missing; `data` lists the rest.' + items: + $ref: '#/components/schemas/BatchImageGenerationMissingImage' + type: 'array' usage: $ref: '#/components/schemas/ImageGenerationUsage' required: @@ -6499,6 +6519,23 @@ components: items: $ref: '#/components/schemas/ORAnthropicContentBlock' type: 'array' + context_management: + properties: + applied_edits: + items: + additionalProperties: {} + properties: + type: + type: 'string' + required: + - 'type' + type: 'object' + type: 'array' + required: + - 'applied_edits' + type: + - 'object' + - 'null' id: type: 'string' input_transformations: @@ -6509,10 +6546,20 @@ components: - 'null' model: type: 'string' + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' + provider: + type: 'string' role: enum: - 'assistant' type: 'string' + safeguard_results: + items: + $ref: '#/components/schemas/AnthropicSafeguardResult' + type: + - 'array' + - 'null' stop_details: $ref: '#/components/schemas/AnthropicRefusalStopDetails' stop_reason: @@ -6526,26 +6573,81 @@ components: - 'message' type: 'string' usage: - allOf: - - $ref: '#/components/schemas/AnthropicUsage' - - properties: - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: 'array' - speed: - $ref: '#/components/schemas/AnthropicSpeed' + properties: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' + cache_creation_input_tokens: + type: + - 'integer' + - 'null' + cache_read_input_tokens: + type: + - 'integer' + - 'null' + cost: + format: 'double' + type: + - 'number' + - 'null' + cost_details: + $ref: '#/components/schemas/CostDetails' + deferred_tools_details: + properties: + completion_tokens: + description: 'Completion tokens summed over every upstream call' + type: 'integer' + prompt_tokens: + description: 'Prompt tokens summed over every upstream call' + type: 'integer' + total_tokens: + description: 'Sum of the above two fields' + type: 'integer' + turns: + description: 'Upstream model calls the run made' + exclusiveMinimum: true + minimum: 0 + type: 'integer' + required: + - 'turns' + - 'prompt_tokens' + - 'completion_tokens' + - 'total_tokens' type: 'object' - example: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 100 - output_tokens: 50 - output_tokens_details: null - server_tool_use: null - service_tier: 'standard' + inference_geo: + type: + - 'string' + - 'null' + input_tokens: + type: 'integer' + is_byok: + type: 'boolean' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: 'array' + output_tokens: + type: 'integer' + output_tokens_details: + $ref: '#/components/schemas/AnthropicOutputTokensDetails' + server_tool_use: + $ref: '#/components/schemas/ORAnthropicServerToolUsage' + service_tier: + type: + - 'string' + - 'null' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + required: + - 'input_tokens' + - 'output_tokens' + - 'output_tokens_details' + - 'cache_creation_input_tokens' + - 'cache_read_input_tokens' + - 'cache_creation' + - 'inference_geo' + - 'server_tool_use' + - 'service_tier' + type: 'object' required: - 'id' - 'type' @@ -21062,6 +21164,63 @@ components: required: - 'model' type: 'object' + MessagesMcpToolResultBlock: + description: 'MCP tool result block paired with a prior `mcp_tool_use` block for replay.' + example: + content: 'Sunny, 21C' + is_error: false + tool_use_id: 'mcptoolu_01abc' + type: 'mcp_tool_result' + properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + anyOf: + - type: 'string' + - items: + $ref: '#/components/schemas/AnthropicTextBlockParam' + type: 'array' + is_error: + type: 'boolean' + tool_use_id: + type: 'string' + type: + enum: + - 'mcp_tool_result' + type: 'string' + required: + - 'type' + - 'tool_use_id' + type: 'object' + MessagesMcpToolUseBlock: + description: 'MCP tool call emitted by an upstream Anthropic assistant turn for replay.' + example: + id: 'mcptoolu_01abc' + input: + city: 'Paris' + name: 'get_forecast' + server_name: 'weather' + type: 'mcp_tool_use' + properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + id: + type: 'string' + input: {} + name: + type: 'string' + server_name: + type: 'string' + type: + enum: + - 'mcp_tool_use' + type: 'string' + required: + - 'type' + - 'id' + - 'name' + - 'server_name' + type: 'object' MessagesMessageParam: description: 'Anthropic message with OpenRouter extensions' example: @@ -21237,6 +21396,8 @@ components: - $ref: '#/components/schemas/MessagesBashToolResultBlock' - $ref: '#/components/schemas/ORAnthropicToolSearchResultParam' - $ref: '#/components/schemas/MessagesToolSearchToolResultBlock' + - $ref: '#/components/schemas/MessagesMcpToolUseBlock' + - $ref: '#/components/schemas/MessagesMcpToolResultBlock' type: 'array' output_config: $ref: '#/components/schemas/AnthropicMessageOutputConfig' @@ -36075,7 +36236,7 @@ components: description: 'Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models, by Fish Audio models other than S1, and by Speechify dialogue models.' example: 'Hello world' SpeechInputModality: - description: 'An input the model accepts. `audio` and `image` are `input_references` for voice cloning and voice design.' + description: 'An input the model accepts. `audio` and `image` are `input_references` for voice cloning and voice design; `video` is a reference video the generated audio is made for.' example: type: 'text' oneOf: @@ -36133,6 +36294,23 @@ components: - 'type' - 'supported_inputs' type: 'object' + - properties: + supported_inputs: + description: '`references` is how many `video_url` parts a request may send. A video reference is the only part of its request and bills at the endpoint''s video rate.' + properties: + references: + $ref: '#/components/schemas/SpeechReferenceCount' + required: + - 'references' + type: 'object' + type: + enum: + - 'video' + type: 'string' + required: + - 'type' + - 'supported_inputs' + type: 'object' SpeechInputReference: description: 'Reference content part for stateless voice cloning or voice design' discriminator: @@ -36140,6 +36318,7 @@ components: image_url: '#/components/schemas/SpeechInputReferenceImage' input_audio: '#/components/schemas/SpeechInputReferenceAudio' text: '#/components/schemas/SpeechInputReferenceText' + video_url: '#/components/schemas/SpeechInputReferenceVideo' propertyName: 'type' example: input_audio: @@ -36149,6 +36328,7 @@ components: - $ref: '#/components/schemas/SpeechInputReferenceAudio' - $ref: '#/components/schemas/SpeechInputReferenceText' - $ref: '#/components/schemas/SpeechInputReferenceImage' + - $ref: '#/components/schemas/SpeechInputReferenceVideo' SpeechInputReferenceAudio: description: 'Reference audio input for stateless voice cloning. Up to three parts per request; the Nth audio part is addressable from `input` as `@AudioN` on providers that support multiple references.' example: @@ -36238,6 +36418,37 @@ components: - 'type' - 'text' type: 'object' + SpeechInputReferenceVideo: + description: 'Reference video the generated audio is made for (sound and voice matched to the footage, same length as the clip). Must be the only part in `input_references`. Only routed to endpoints that support video references, which bill at their video rate.' + example: + type: 'video_url' + video_url: + url: 'https://example.com/clip.mp4' + properties: + type: + enum: + - 'video_url' + type: 'string' + video_url: + $ref: '#/components/schemas/SpeechInputReferenceVideoInput' + required: + - 'type' + - 'video_url' + type: 'object' + SpeechInputReferenceVideoInput: + description: 'Reference video input object' + example: + url: 'https://example.com/clip.mp4' + properties: + url: + description: 'Public http(s) URL of the reference video. The provider downloads it; OpenRouter does not fetch it, and data URIs are rejected.' + example: 'https://example.com/clip.mp4' + maxLength: 2048 + minLength: 1 + type: 'string' + required: + - 'url' + type: 'object' SpeechModelEndpoint: description: 'One endpoint serving a speech model, with the inputs and parameters it accepts.' example: @@ -36516,7 +36727,7 @@ components: input: $ref: '#/components/schemas/SpeechInput' input_references: - description: 'Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. An empty array is treated as no reference.' + description: 'Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. Video mode: exactly one `video_url` part with a public http(s) URL and no other parts; only routed to endpoints that support video references. An empty array is treated as no reference.' example: - input_audio: data: 'data:audio/wav;base64,UklGRuQXDABXQVZF...'