Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: ""
id: ""
management:
docChecksum: 93dc429cea259bac51d2deba56b57427
docChecksum: ee22093311cc0f37ed22037cfb77fcf3
docVersion: 1.0.0
speakeasyVersion: 1.808.1
generationVersion: 2.960.8
releaseVersion: 1.5.178
configChecksum: 3832af9ac11724251b9ec645a5d768de
releaseVersion: 1.5.179
configChecksum: 1b7d457d4b504d3af05b2ade3c4b4e4b
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
Expand Down Expand Up @@ -12705,6 +12705,7 @@ trackedFiles:
docs/models/streameventsresponseoutputitemdone.mdx:
id: f78b880ee8be
pristine_git_object: e7adea7b505b7dfb6b6ca580fc1762d74bb21e72
docs/models/streamformat.mdx: {}
docs/models/streamlogprob.md:
id: 98efa527982e
last_write_checksum: sha1:3e845d902c0aa78dc24bbc84ae88f26d00ac7e19
Expand Down Expand Up @@ -24219,4 +24220,4 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
releaseNotes: "## Typescript SDK Changes:\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.responseFormat` **Changed**\n"
releaseNotes: "## Typescript SDK Changes:\n* `openrouter.tts.createSpeech()`: \n * `request.speechRequest.streamFormat` **Added**\n* `openrouter.tts.listModels()`: `response.data[].endpoints[].outputModalities[].supportedParameters.streamFormat` **Added**\n* `openrouter.tts.getModel()`: `response.endpoints[].outputModalities[].supportedParameters.streamFormat` **Added**\n"
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
typescript:
version: 1.5.178
version: 1.5.179
acceptHeaderEnum: false
additionalDependencies:
dependencies:
Expand Down
23 changes: 20 additions & 3 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37066,7 +37066,7 @@ components:
example: 'mistralai/voxtral-mini-tts-2603'
type: 'string'
output_delivery:
description: '`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`.'
description: '`stream` (default) streams the audio bytes directly in the response body (returns inline base64 JSON when `timestamp_granularities` is nonempty and `stream_format` is `"audio"`, or `text/event-stream` events when `stream_format` is `"sse"`). `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`.'
enum:
- 'stream'
- 'url'
Expand Down Expand Up @@ -37157,8 +37157,16 @@ components:
example: 1
format: 'double'
type: 'number'
stream_format:
description: 'Wire framing for inline responses. `audio` (default) returns raw audio bytes (or a buffered JSON envelope when `timestamp_granularities` is nonempty). `sse` streams `text/event-stream` events (`speech.audio.delta`, `speech.timestamps.delta` when `timestamp_granularities` is nonempty, `speech.audio.done`, and `error` on mid-stream failure) with the effective audio media type in `X-Audio-Media-Type`. Cannot be combined with `output_delivery: "url"`. Only routed to endpoints that advertise `sse` in `supported_parameters.stream_format` (and every requested granularity when `timestamp_granularities` is nonempty). Generated SDKs still type the 200 response as binary audio for compatibility; when using `stream_format: "sse"`, call the HTTP endpoint directly and parse `text/event-stream`.'
enum:
- 'audio'
- 'sse'
example: 'audio'
type: 'string'
x-speakeasy-unknown-values: allow
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`. 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.'
description: 'Timings to return with the audio. With the default `stream_format: "audio"`, the response is buffered 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`. Buffered timed responses are sent once the whole audio is generated and are capped at 10 MiB of decoded audio (the provider timed response, including its alignment data, is capped too); longer outputs return an error, so use a shorter input, a smaller audio format, or `stream_format: "sse"`. With `stream_format: "sse"`, the response is `text/event-stream` (`speech.audio.delta`, `speech.timestamps.delta`, `speech.audio.done`, and `error` on mid-stream failure) with the effective audio media type in `X-Audio-Media-Type` and no 10 MiB cap. 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 for the requested `stream_format`. Generated SDKs still type the 200 response as binary audio for compatibility; call the HTTP endpoint directly and parse JSON (for `stream_format: "audio"`) or `text/event-stream` (for `stream_format: "sse"`). An empty array is treated as no timings.'
example:
- 'word'
items:
Expand Down Expand Up @@ -37221,6 +37229,11 @@ components:
max: 4
min: 0.25
type: 'range'
stream_format:
type: 'enum'
values:
- 'audio'
- 'sse'
timestamp_granularities:
type: 'enum'
values:
Expand All @@ -37238,6 +37251,10 @@ components:
$ref: '#/components/schemas/SpeechEnumParameter'
speed:
$ref: '#/components/schemas/SpeechRangeParameter'
stream_format:
allOf:
- $ref: '#/components/schemas/SpeechEnumParameter'
- description: 'The `stream_format` values the endpoint supports (`audio`, `sse`).'
timestamp_granularities:
allOf:
- $ref: '#/components/schemas/SpeechEnumParameter'
Expand Down Expand Up @@ -44239,7 +44256,7 @@ paths:
example: '<binary audio data>'
format: 'binary'
type: 'string'
description: 'Raw audio bytes stream (`audio/*`) by default. 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, always 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>"}` (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":"<mime>","usage"?:{"input_characters"?:number}}`, and `{"type":"error","error":{"message":"<string>"}}` 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`.'
'400':
content:
application/json:
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.808.1
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:b7a1d4a19b2b9ef84a7b299486f1c011d67d74bee59ec7547c8c81b98629aff4
sourceBlobDigest: sha256:a74a543b711cbfb66a3c769a31b57bbb23b3332baf16e43fe250a42073fd59a1
sourceRevisionDigest: sha256:6305b1e258dadea08c306870d09be1979085a71760e3530a97d4f1bfa55a101d
sourceBlobDigest: sha256:4d2b5ecedb5c99dd9a244f73a9eeaf9c66a570b6567f30f1847a772f28bafff5
tags:
- latest
- 1.0.0
targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:b7a1d4a19b2b9ef84a7b299486f1c011d67d74bee59ec7547c8c81b98629aff4
sourceBlobDigest: sha256:a74a543b711cbfb66a3c769a31b57bbb23b3332baf16e43fe250a42073fd59a1
sourceRevisionDigest: sha256:6305b1e258dadea08c306870d09be1979085a71760e3530a97d4f1bfa55a101d
sourceBlobDigest: sha256:4d2b5ecedb5c99dd9a244f73a9eeaf9c66a570b6567f30f1847a772f28bafff5
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:776e617aeb06d731f4e6a55a4df3ab44da6735b275ef238fadb98c3abb1669f8
codeSamplesRevisionDigest: sha256:e2af5a57a798f82aa0a975d32be7653157771d6f7729d4dc58fc2a9fd0b2c0c0
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.808.1
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6156,4 +6156,14 @@ Based on:
### Generated
- [typescript v1.5.178] .
### Releases
- [NPM v1.5.178] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.178 - .
- [NPM v1.5.178] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.178 - .

## 2026-12-04 19:21:02
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.808.1 (2.960.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v1.5.179] .
### Releases
- [NPM v1.5.179] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.179 - .
2 changes: 1 addition & 1 deletion docs/models/outputdelivery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "OutputDelivery"
---

`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` (default) streams the audio bytes directly in the response body (returns inline base64 JSON when `timestamp_granularities` is nonempty and `stream_format` is `"audio"`, or `text/event-stream` events when `stream_format` is `"sse"`). `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`.

## Example Usage

Expand Down
Loading