From 17d45066988e2481180ceeb0227097a7a155219a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 4 Dec 2026 00:58:02 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.808.1 --- .speakeasy/gen.lock | 7 ++--- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 10 +++---- .speakeasy/workflow.lock | 10 +++---- RELEASES.md | 12 +++++++- .../speechinputmodalitysupportedinputs3.mdx | 2 +- docs/models/speechinputmodalityvideo.mdx | 8 ++--- docs/models/speechinputreferencevideo.mdx | 2 +- docs/models/speechrequest.mdx | 30 +++++++++---------- docs/models/speechrequestresponseformat.mdx | 2 +- jsr.json | 2 +- package.json | 8 ++--- src/lib/config.ts | 4 +-- src/models/speechinputmodality.ts | 4 +-- src/models/speechinputreferencevideo.ts | 2 +- src/models/speechrequest.ts | 10 +++---- 16 files changed, 62 insertions(+), 53 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index cad0ff0c2..4305bba6a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: "" id: "" management: - docChecksum: e26c66479d55a5a19e09be187f7d9204 + docChecksum: 07fbb79d51250e334f820b313eb992cb docVersion: 1.0.0 speakeasyVersion: 1.808.1 generationVersion: 2.960.8 - releaseVersion: 1.5.173 - configChecksum: 15231fa597f3732aab1703bacac3f13c + releaseVersion: 1.5.174 + configChecksum: afe6af6ec10a534ea1b8b05215e5633a repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -24218,4 +24218,3 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Typescript SDK Changes:\n* `openrouter.batch.createBatches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.getBatches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.cancel()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.batch.getResults()`: `response.data[].response.body` **Changed** (Breaking ⚠️)\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.inputReferences[].union(video_url)` **Added**\n* `openrouter.tts.listModels()`: `response.data[].endpoints[].inputModalities[].union(video)` **Added**\n* `openrouter.tts.getModel()`: `response.endpoints[].inputModalities[].union(video)` **Added**\n* `openrouter.presets.createPresetsMessages()`: \n * `request.messagesRequest.messages[].content.union(Array<>)[]` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 20c766492..2b5f1812e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -38,7 +38,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.173 + version: 1.5.174 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 0dd5d5a0a..064be408b 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -36609,7 +36609,7 @@ components: 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.' + description: '`references` is how many `video_url` parts a request may send. A video may come with `input_audio` clips, never with an image, but only on an endpoint that accepts both itself: the model lists each modality from any endpoint, so check the endpoint''s own `audio` modality for its clip limit; and the request bills at the endpoint''s video rate.' properties: references: $ref: '#/components/schemas/SpeechReferenceCount' @@ -36732,7 +36732,7 @@ components: - '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.' + description: 'Reference video the generated audio is made for (sound and voice matched to the footage, same length as the clip). At most one per request; it may come with one to three `input_audio` parts (voices for the footage, with `input` giving the words they speak) but never with an `image_url` part. Only routed to endpoints that support video references, which bill at their video rate.' example: type: 'video_url' video_url: @@ -37040,7 +37040,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. 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.' + 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, optionally with one to three `input_audio` parts (and their `text` transcripts) grouped as in audio mode, and no `image_url` part; Seed Audio 1.5 ignores those transcripts, so the words the voices speak go in `input`; only routed to endpoints that support video references (and voice cloning when clips are sent, plus multiple references for two or three clips). An empty array is treated as no reference.' example: - input_audio: data: 'data:audio/wav;base64,UklGRuQXDABXQVZF...' @@ -37133,7 +37133,7 @@ components: type: 'object' response_format: default: 'pcm' - description: 'Audio output format' + description: 'Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty.' enum: - 'mp3' - 'pcm' @@ -37152,7 +37152,7 @@ components: format: 'double' type: 'number' timestamp_granularities: - description: 'Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings.' + description: 'Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. The audio defaults to `mp3` unless `response_format` is set. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings.' example: - 'word' items: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c4606df1c..d83291b05 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.808.1 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:51d6baca9f630b996fae26738ca95f2b9f08963b42560dfb6652c654b30f946d - sourceBlobDigest: sha256:f5e064e616f561b6afcbd54b62a3377b810732e2752028eab2097a2598082ae1 + sourceRevisionDigest: sha256:479ff757f75fd3f10c14301133831a9ceceff32d48f5262245f6454234231f98 + sourceBlobDigest: sha256:15a13f926d6ee036c1ff95838832674f2199a20a9b0f9e1a75a678433829d3a7 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:51d6baca9f630b996fae26738ca95f2b9f08963b42560dfb6652c654b30f946d - sourceBlobDigest: sha256:f5e064e616f561b6afcbd54b62a3377b810732e2752028eab2097a2598082ae1 + sourceRevisionDigest: sha256:479ff757f75fd3f10c14301133831a9ceceff32d48f5262245f6454234231f98 + sourceBlobDigest: sha256:15a13f926d6ee036c1ff95838832674f2199a20a9b0f9e1a75a678433829d3a7 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:39592ed9563e621c58a72193bc735eee03614ce5ffbce1f3558e71e90ff47847 + codeSamplesRevisionDigest: sha256:3b1bf96919d29904beb4f9b7f4c5222848076aecdba371b7c8809e103f70e383 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.808.1 diff --git a/RELEASES.md b/RELEASES.md index 70f0abc4e..021c954d7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -6106,4 +6106,14 @@ Based on: ### Generated - [typescript v1.5.173] . ### Releases -- [NPM v1.5.173] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.173 - . \ No newline at end of file +- [NPM v1.5.173] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.173 - . + +## 2026-12-04 00:55:29 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.174] . +### Releases +- [NPM v1.5.174] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.174 - . \ No newline at end of file diff --git a/docs/models/speechinputmodalitysupportedinputs3.mdx b/docs/models/speechinputmodalitysupportedinputs3.mdx index f7c3b8641..5e4cc1bab 100644 --- a/docs/models/speechinputmodalitysupportedinputs3.mdx +++ b/docs/models/speechinputmodalitysupportedinputs3.mdx @@ -2,7 +2,7 @@ title: "SpeechInputModalitySupportedInputs3" --- -`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. +`references` is how many `video_url` parts a request may send. A video may come with `input_audio` clips, never with an image, but only on an endpoint that accepts both itself: the model lists each modality from any endpoint, so check the endpoint's own `audio` modality for its clip limit; and the request bills at the endpoint's video rate. ## Example Usage diff --git a/docs/models/speechinputmodalityvideo.mdx b/docs/models/speechinputmodalityvideo.mdx index 3b7b8897a..39e738dad 100644 --- a/docs/models/speechinputmodalityvideo.mdx +++ b/docs/models/speechinputmodalityvideo.mdx @@ -20,7 +20,7 @@ let value: SpeechInputModalityVideo = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `supportedInputs` | [models.SpeechInputModalitySupportedInputs3](../models/speechinputmodalitysupportedinputs3.mdx) | ✔️ | `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. | -| `type` | *"video"* | ✔️ | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `supportedInputs` | [models.SpeechInputModalitySupportedInputs3](../models/speechinputmodalitysupportedinputs3.mdx) | ✔️ | `references` is how many `video_url` parts a request may send. A video may come with `input_audio` clips, never with an image, but only on an endpoint that accepts both itself: the model lists each modality from any endpoint, so check the endpoint's own `audio` modality for its clip limit; and the request bills at the endpoint's video rate. | +| `type` | *"video"* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/speechinputreferencevideo.mdx b/docs/models/speechinputreferencevideo.mdx index 28d8cbb91..fc9d423dc 100644 --- a/docs/models/speechinputreferencevideo.mdx +++ b/docs/models/speechinputreferencevideo.mdx @@ -2,7 +2,7 @@ title: "SpeechInputReferenceVideo" --- -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. +Reference video the generated audio is made for (sound and voice matched to the footage, same length as the clip). At most one per request; it may come with one to three `input_audio` parts (voices for the footage, with `input` giving the words they speak) but never with an `image_url` part. Only routed to endpoints that support video references, which bill at their video rate. ## Example Usage diff --git a/docs/models/speechrequest.mdx b/docs/models/speechrequest.mdx index 7537a0ce4..b3c92ba1c 100644 --- a/docs/models/speechrequest.mdx +++ b/docs/models/speechrequest.mdx @@ -17,18 +17,18 @@ let value: SpeechRequest = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *models.SpeechInput* | ✔️ | 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. | Hello world | -| `inputReferences` | *models.SpeechInputReference*[] | ➖ | 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. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] | -| `instructions` | *string* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers. | Speak in a warm and friendly tone. | -| `model` | *string* | ✔️ | TTS model identifier | mistralai/voxtral-mini-tts-2603 | -| `outputDelivery` | [models.OutputDelivery](../models/outputdelivery.mdx) | ➖ | `stream` (default) streams the audio bytes directly in the response body (or returns inline base64 JSON when `timestamp_granularities` is nonempty). `url` stores the generated audio in OpenRouter storage and returns a JSON response with a signed download `url`, `expires_at`, and `media_type` (plus `words` and/or `characters` when `timestamp_granularities` is nonempty). The URL is a bearer link: anyone holding it can download the audio until it expires, up to 24 hours after the audio was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. When a URL cannot be issued (zero-data-retention via account settings, guardrails, `provider.zdr`, or a ZDR endpoint; no workspace; or storage failure), untimed requests fall back to streaming raw audio bytes (except on a storage failure for responses larger than 10 MiB, which returns an error), and timed requests fall back to inline base64 JSON (`{audio, media_type, words?, characters?}`) with no `url`. | stream | -| `provider` | [models.SpeechRequestProvider](../models/speechrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | | -| `responseFormat` | [models.SpeechRequestResponseFormat](../models/speechrequestresponseformat.mdx) | ➖ | Audio output format | pcm | -| `sessionId` | *string* | ➖ | 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. | session-1234 | -| `speed` | *number* | ➖ | Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control. | 1 | -| `timestampGranularities` | [models.TimestampGranularity](../models/timestampgranularity.mdx)[] | ➖ | Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings. | [
"word"
] | -| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `user` | *string* | ➖ | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | -| `voice` | *string* | ➖ | Voice identifier (provider-specific). Required by most providers; only Seed Audio, HeyGen, Fish Audio, AssemblyAI, Speechify accept requests without it. | en_paul_neutral | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | *models.SpeechInput* | ✔️ | 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. | Hello world | +| `inputReferences` | *models.SpeechInputReference*[] | ➖ | 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, optionally with one to three `input_audio` parts (and their `text` transcripts) grouped as in audio mode, and no `image_url` part; Seed Audio 1.5 ignores those transcripts, so the words the voices speak go in `input`; only routed to endpoints that support video references (and voice cloning when clips are sent, plus multiple references for two or three clips). An empty array is treated as no reference. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] | +| `instructions` | *string* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers. | Speak in a warm and friendly tone. | +| `model` | *string* | ✔️ | TTS model identifier | mistralai/voxtral-mini-tts-2603 | +| `outputDelivery` | [models.OutputDelivery](../models/outputdelivery.mdx) | ➖ | `stream` (default) streams the audio bytes directly in the response body (or returns inline base64 JSON when `timestamp_granularities` is nonempty). `url` stores the generated audio in OpenRouter storage and returns a JSON response with a signed download `url`, `expires_at`, and `media_type` (plus `words` and/or `characters` when `timestamp_granularities` is nonempty). The URL is a bearer link: anyone holding it can download the audio until it expires, up to 24 hours after the audio was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. When a URL cannot be issued (zero-data-retention via account settings, guardrails, `provider.zdr`, or a ZDR endpoint; no workspace; or storage failure), untimed requests fall back to streaming raw audio bytes (except on a storage failure for responses larger than 10 MiB, which returns an error), and timed requests fall back to inline base64 JSON (`{audio, media_type, words?, characters?}`) with no `url`. | stream | +| `provider` | [models.SpeechRequestProvider](../models/speechrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | | +| `responseFormat` | [models.SpeechRequestResponseFormat](../models/speechrequestresponseformat.mdx) | ➖ | Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty. | pcm | +| `sessionId` | *string* | ➖ | 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. | session-1234 | +| `speed` | *number* | ➖ | Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control. | 1 | +| `timestampGranularities` | [models.TimestampGranularity](../models/timestampgranularity.mdx)[] | ➖ | Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. The audio defaults to `mp3` unless `response_format` is set. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings. | [
"word"
] | +| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `user` | *string* | ➖ | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 | +| `voice` | *string* | ➖ | Voice identifier (provider-specific). Required by most providers; only Seed Audio, HeyGen, Fish Audio, AssemblyAI, Speechify accept requests without it. | en_paul_neutral | \ No newline at end of file diff --git a/docs/models/speechrequestresponseformat.mdx b/docs/models/speechrequestresponseformat.mdx index a9614f011..ab0cc3d30 100644 --- a/docs/models/speechrequestresponseformat.mdx +++ b/docs/models/speechrequestresponseformat.mdx @@ -2,7 +2,7 @@ title: "SpeechRequestResponseFormat" --- -Audio output format +Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty. ## Example Usage diff --git a/jsr.json b/jsr.json index f99f29689..999dc7468 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.173", + "version": "1.5.174", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 551657d0d..970a476e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.173", + "version": "1.5.174", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.", "keywords": [ @@ -74,14 +74,14 @@ "build": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", "compile": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc && node scripts/unbarrel-imports.js", - "postinstall": "node scripts/check-types.js || true", "prepare": "npm run build", "test": "vitest --run --project unit", "test:e2e": "vitest --run --project e2e", "test:transit": "exit 0", - "test:watch": "vitest --watch --project unit", "typecheck": "tsc --noEmit", - "typecheck:transit": "exit 0" + "typecheck:transit": "exit 0", + "postinstall": "node scripts/check-types.js || true", + "test:watch": "vitest --watch --project unit" }, "peerDependencies": { diff --git a/src/lib/config.ts b/src/lib/config.ts index 4b7fc374b..ef01314c2 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -74,7 +74,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "1.5.173", + sdkVersion: "1.5.174", genVersion: "2.960.8", - userAgent: "speakeasy-sdk/typescript 1.5.173 2.960.8 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.174 2.960.8 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/speechinputmodality.ts b/src/models/speechinputmodality.ts index 1919be9ad..4cb56202f 100644 --- a/src/models/speechinputmodality.ts +++ b/src/models/speechinputmodality.ts @@ -17,7 +17,7 @@ import { } from "./speechreferencecount.js"; /** - * `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. + * `references` is how many `video_url` parts a request may send. A video may come with `input_audio` clips, never with an image, but only on an endpoint that accepts both itself: the model lists each modality from any endpoint, so check the endpoint's own `audio` modality for its clip limit; and the request bills at the endpoint's video rate. */ export type SpeechInputModalitySupportedInputs3 = { references: SpeechReferenceCount; @@ -25,7 +25,7 @@ export type SpeechInputModalitySupportedInputs3 = { export type SpeechInputModalityVideo = { /** - * `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. + * `references` is how many `video_url` parts a request may send. A video may come with `input_audio` clips, never with an image, but only on an endpoint that accepts both itself: the model lists each modality from any endpoint, so check the endpoint's own `audio` modality for its clip limit; and the request bills at the endpoint's video rate. */ supportedInputs: SpeechInputModalitySupportedInputs3; type: "video"; diff --git a/src/models/speechinputreferencevideo.ts b/src/models/speechinputreferencevideo.ts index 780c3a67f..d78c015ee 100644 --- a/src/models/speechinputreferencevideo.ts +++ b/src/models/speechinputreferencevideo.ts @@ -11,7 +11,7 @@ import { } from "./speechinputreferencevideoinput.js"; /** - * 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. + * Reference video the generated audio is made for (sound and voice matched to the footage, same length as the clip). At most one per request; it may come with one to three `input_audio` parts (voices for the footage, with `input` giving the words they speak) but never with an `image_url` part. Only routed to endpoints that support video references, which bill at their video rate. */ export type SpeechInputReferenceVideo = { type: "video_url"; diff --git a/src/models/speechrequest.ts b/src/models/speechrequest.ts index 7533e8850..9200ef3d8 100644 --- a/src/models/speechrequest.ts +++ b/src/models/speechrequest.ts @@ -114,7 +114,7 @@ export type SpeechRequestProvider = { }; /** - * Audio output format + * Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty. */ export const SpeechRequestResponseFormat = { Mp3: "mp3", @@ -122,7 +122,7 @@ export const SpeechRequestResponseFormat = { Wav: "wav", } as const; /** - * Audio output format + * Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty. */ export type SpeechRequestResponseFormat = OpenEnum< typeof SpeechRequestResponseFormat @@ -143,7 +143,7 @@ export type SpeechRequest = { */ input: SpeechInput; /** - * 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. + * 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, optionally with one to three `input_audio` parts (and their `text` transcripts) grouped as in audio mode, and no `image_url` part; Seed Audio 1.5 ignores those transcripts, so the words the voices speak go in `input`; only routed to endpoints that support video references (and voice cloning when clips are sent, plus multiple references for two or three clips). An empty array is treated as no reference. */ inputReferences?: Array | undefined; /** @@ -163,7 +163,7 @@ export type SpeechRequest = { */ provider?: SpeechRequestProvider | undefined; /** - * Audio output format + * Audio output format. Defaults to `pcm`, or to `mp3` when `timestamp_granularities` is nonempty. */ responseFormat?: SpeechRequestResponseFormat | undefined; /** @@ -175,7 +175,7 @@ export type SpeechRequest = { */ speed?: number | undefined; /** - * Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings. + * Timings to return with the audio. When nonempty, the response is JSON instead of raw audio bytes: `{audio, media_type, words?, characters?}` with base64 audio, or `{url, expires_at, media_type, words?, characters?}` when `output_delivery` is `url`. If a signed URL cannot be issued (ZDR, no workspace, or storage failure), timed `url` requests fall back to the inline `{audio, media_type, ...}` envelope with no `url`. The audio defaults to `mp3` unless `response_format` is set. Each timing entry is `{text, start, end}` in seconds. Only routed to endpoints that support every requested granularity (`supported_parameters.timestamp_granularities` on the speech models list). A timed response is sent once the whole audio is generated, not streamed, and is capped at 10 MiB of decoded audio for both inline and `url` delivery (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input or a smaller audio format. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse the JSON response when using `timestamp_granularities`. An empty array is treated as no timings. */ timestampGranularities?: Array | undefined; /**