Create speech
Changed onSynthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm) by default, or a JSON response with a 24-hour signed download URL when output_delivery is set to "url".
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Request body
Text-to-speech request input
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.
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.
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.
TTS model identifier
stream (default) streams the audio bytes directly in the response body. url stores the generated audio in OpenRouter storage and returns a JSON response with a signed download url, expires_at, and media_type. 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. Falls back to streaming raw audio bytes when a URL cannot be issued because zero-data-retention applies (account settings, guardrails, provider.zdr, or a ZDR endpoint) or the request has no workspace.
Provider configuration: provider routing preferences (order, only, ignore, allow_fallbacks), data policy routing preferences (zdr, data_collection) and provider-specific passthrough options
Audio output format
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.
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.
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.
A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
Voice identifier (provider-specific). Required by most providers; only Seed Audio, HeyGen, Fish Audio, AssemblyAI, Speechify accept requests without it.
Example request
{
"input": "Hello world",
"model": "mistralai/voxtral-mini-tts-2603",
"response_format": "pcm",
"speed": 1,
"voice": "en_paul_neutral"
}Response
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.
Changes
- info
added the new optional request property
provider/options/celeris - info
added the new
Celerisenum value to the request propertyprovider/ignore/items/anyOf[#/components/schemas/ProviderName] - info
added the new
Celerisenum value to the request propertyprovider/only/items/anyOf[#/components/schemas/ProviderName]
1 more change in this revision
- info