diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 24741e75..28bfb23c 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -1,6 +1,12 @@ components: parameters: {} responses: + SpeechSeparatedTracks: + content: + application/json: + schema: + $ref: '#/components/schemas/SpeechSeparatedTracksResponse' + description: 'Speech request with `separate_tracks`: one entry per separated track, each with base64 audio or a signed download URL.' SpeechTimedAudio: content: application/json: @@ -33930,9 +33936,15 @@ components: max: format: 'double' type: 'number' + max_pixels: + description: '`input_references` only: largest accepted pixel count (width x height) of each reference image. Absent when none is declared.' + type: 'integer' min: format: 'double' type: 'number' + min_edge: + description: '`input_references` only: smallest accepted shorter side of each reference image, in pixels. Absent when none is declared.' + type: 'integer' type: enum: - 'range' @@ -36213,6 +36225,80 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' + SpeechAudioTrack: + description: 'One separated track with its audio as base64.' + example: + audio: 'SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYw' + description: 'all speech' + media_type: 'audio/mpeg' + type: 'speaker' + properties: + audio: + description: 'Base64-encoded audio in the format named by `media_type`.' + example: 'SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYw' + type: 'string' + description: + description: 'The provider''s short description of the track.' + example: 'all speech' + type: 'string' + media_type: + description: 'MIME type of the generated audio (for example `audio/mpeg` for mp3 or `audio/pcm;rate=24000;channels=1` for pcm).' + example: 'audio/mpeg' + type: 'string' + type: + description: 'What the track holds: `speaker` (speech), `sfx` (sound effects), `bgm` (background music), or `composite` (several categories merged because the prompt asked for it).' + enum: + - 'speaker' + - 'sfx' + - 'bgm' + - 'composite' + example: 'speaker' + type: 'string' + required: + - 'type' + - 'media_type' + - 'audio' + type: 'object' + SpeechAudioTrackUrl: + description: 'One separated track as a signed download URL.' + example: + description: 'background music' + expires_at: 1748458800 + media_type: 'audio/mpeg' + type: 'bgm' + url: 'https://openrouter.ai/api/v1/audio/speech/media/abcdefghijklmnopqrstuvwxyz0123456789abcdefg' + properties: + description: + description: 'The provider''s short description of the track.' + example: 'all speech' + type: 'string' + expires_at: + description: 'Unix timestamp (seconds) when the signed download URL expires.' + example: 1748458800 + type: 'integer' + media_type: + description: 'MIME type of the generated audio (for example `audio/mpeg` for mp3 or `audio/pcm;rate=24000;channels=1` for pcm).' + example: 'audio/mpeg' + type: 'string' + type: + description: 'What the track holds: `speaker` (speech), `sfx` (sound effects), `bgm` (background music), or `composite` (several categories merged because the prompt asked for it).' + enum: + - 'speaker' + - 'sfx' + - 'bgm' + - 'composite' + example: 'speaker' + type: 'string' + url: + description: 'Signed download URL for the generated audio, valid until `expires_at` (up to 24 hours).' + example: 'https://openrouter.ai/api/v1/audio/speech/media/abcdefghijklmnopqrstuvwxyz0123456789abcdefg' + type: 'string' + required: + - 'type' + - 'media_type' + - 'url' + - 'expires_at' + type: 'object' SpeechEnumParameter: example: type: 'enum' @@ -36242,7 +36328,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; `video` is a reference video the generated audio is made for.' + description: 'An input the model accepts. `audio` and `image` are `input_references` for voice cloning and voice design, and `audio` is also the clip `separate_tracks` splits; `video` is a reference video the generated audio is made for.' example: type: 'text' oneOf: @@ -36263,7 +36349,7 @@ components: type: 'object' - properties: supported_inputs: - description: '`references` is how many audio clips a request may send. With more than one, some providers require the text to address every clip with an `@AudioN` placeholder.' + description: '`references` is how many audio clips a request may send. With more than one, some providers require the text to address every clip with an `@AudioN` placeholder. An endpoint may accept a clip only for voice cloning, only for `separate_tracks`, or both: check `supported_parameters` for `separate_tracks` and `voice` before cloning a voice.' properties: references: $ref: '#/components/schemas/SpeechReferenceCount' @@ -36830,6 +36916,10 @@ components: - 'wav' example: 'pcm' type: 'string' + separate_tracks: + description: 'Split one existing audio clip into separate tracks (speech, sound effects, background music) instead of generating speech. Requires exactly one `input_audio` part in `input_references` and no other parts, `voice` or `timestamp_granularities`, and `speed` omitted or `1`; `input` describes how to split the clip (for example "all speech in one track, background music in one track, all sound effects in one track"). The response is always JSON (`SpeechSeparatedTracksResponse`): `{tracks: [{type, description, audio, media_type}]}` with base64 audio, or `url` and `expires_at` per track when `output_delivery` is `url`. The audio defaults to `mp3` unless `response_format` is set. The whole output is buffered and capped at 10 MiB of decoded audio across all tracks inline, or 32 MiB with `url` delivery. With `output_delivery: "url"`, tracks fall back to inline base64 `audio` (no `url`) under the 10 MiB inline cap when a signed URL cannot be issued (zero-data-retention, missing workspace, or storage failure), so the 32 MiB cap only applies when storage is available. Only routed to endpoints that price track separation (`supported_parameters.separate_tracks` on the speech models list). Generated SDKs type the 200 response as binary audio; call the HTTP endpoint directly and parse the JSON.' + example: true + type: 'boolean' session_id: description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' example: 'session-1234' @@ -36873,6 +36963,25 @@ components: - 'model' - 'input' type: 'object' + SpeechSeparatedTracksResponse: + description: 'JSON response for a request with `separate_tracks`: one entry per separated track.' + example: + tracks: + - audio: 'SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYw' + description: 'all speech' + media_type: 'audio/mpeg' + type: 'speaker' + properties: + tracks: + description: 'The separated tracks in provider order (up to six). Each carries base64 `audio`, or `url` and `expires_at` when `output_delivery` is `url` and a signed URL could be issued.' + items: + anyOf: + - $ref: '#/components/schemas/SpeechAudioTrack' + - $ref: '#/components/schemas/SpeechAudioTrackUrl' + type: 'array' + required: + - 'tracks' + type: 'object' SpeechSignedUrlResponse: description: 'JSON response containing a signed download URL for generated speech audio.' example: @@ -36930,6 +37039,10 @@ components: $ref: '#/components/schemas/SpeechUnknownParameter' response_format: $ref: '#/components/schemas/SpeechEnumParameter' + separate_tracks: + allOf: + - $ref: '#/components/schemas/SpeechUnknownParameter' + - description: 'Present when the endpoint accepts `separate_tracks` (split one audio clip into speech, sound effect and music tracks). Absent: track separation is not supported.' speed: $ref: '#/components/schemas/SpeechRangeParameter' stream_format: @@ -43855,7 +43968,7 @@ paths: example: '' format: 'binary' type: 'string' - description: 'Raw audio bytes stream (`audio/*`) by default. When `stream_format` is `"sse"`, returns `text/event-stream` with `X-Audio-Media-Type` set to the effective audio media type (exposed via `Access-Control-Expose-Headers`) and default SSE `data:` frames (no named `event:` field) carrying one JSON object per event discriminated by `type`: `{"type":"speech.audio.delta","audio":""}` (base64-encoded audio chunk; decode each delta separately before concatenating bytes), `{"type":"speech.timestamps.delta","words"?:[{"text","start","end"}],"characters"?:[{"text","start","end"}]}` (when `timestamp_granularities` is nonempty; times in float seconds from start of output), `{"type":"speech.audio.done","media_type":"","usage"?:{"input_characters"?:number}}`, and `{"type":"error","error":{"message":""}}` on mid-stream failure. When `output_delivery` is `"url"`, returns `application/json` with `{ url, expires_at, media_type }` (a 24-hour signed download URL) unless zero-data-retention or missing workspace causes fallback to raw audio streaming. When `timestamp_granularities` is nonempty and `stream_format` is `"audio"` (default), returns `application/json`: `{ audio, media_type }` with base64 audio (`SpeechTimedAudioResponse`), or `{ url, expires_at, media_type }` with URL delivery (`SpeechTimedUrlResponse`), each with the requested `words` and/or `characters` timings. A timed `url` request that cannot get a signed URL (zero-data-retention, missing workspace, or storage failure) returns the inline `{ audio, media_type }` envelope with no `url`.' + description: 'Raw audio bytes stream (`audio/*`) by default. When `stream_format` is `"sse"`, returns `text/event-stream` with `X-Audio-Media-Type` set to the effective audio media type (exposed via `Access-Control-Expose-Headers`) and default SSE `data:` frames (no named `event:` field) carrying one JSON object per event discriminated by `type`: `{"type":"speech.audio.delta","audio":""}` (base64-encoded audio chunk; decode each delta separately before concatenating bytes), `{"type":"speech.timestamps.delta","words"?:[{"text","start","end"}],"characters"?:[{"text","start","end"}]}` (when `timestamp_granularities` is nonempty; times in float seconds from start of output), `{"type":"speech.audio.done","media_type":"","usage"?:{"input_characters"?:number}}`, and `{"type":"error","error":{"message":""}}` on mid-stream failure. When `output_delivery` is `"url"`, returns `application/json` with `{ url, expires_at, media_type }` (a 24-hour signed download URL) unless zero-data-retention or missing workspace causes fallback to raw audio streaming. When `timestamp_granularities` is nonempty and `stream_format` is `"audio"` (default), returns `application/json`: `{ audio, media_type }` with base64 audio (`SpeechTimedAudioResponse`), or `{ url, expires_at, media_type }` with URL delivery (`SpeechTimedUrlResponse`), each with the requested `words` and/or `characters` timings. A timed `url` request that cannot get a signed URL (zero-data-retention, missing workspace, or storage failure) returns the inline `{ audio, media_type }` envelope with no `url`. When `separate_tracks` is true, always returns `application/json` `{ tracks }` (`SpeechSeparatedTracksResponse`), one entry per separated track with base64 `audio`, or `url` and `expires_at` with URL delivery. A separated-tracks `url` request that cannot get signed URLs (zero-data-retention, missing workspace, or storage failure) returns inline base64 `audio` per track under the inline size cap.' '400': content: application/json: