TTS

Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).

post/audio/speech

Request

  • Base URL: https://openrouter.ai/api/v1
  • URL: https://openrouter.ai/api/v1/audio/speech
  • Auth: HTTP bearer

Request body

instructionsstring

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.

modelstring required

TTS model identifier

response_format'mp3' | 'pcm'

Audio output format

session_idstring

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.

speednumber double

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.

userstring

A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.

voicestring

Voice identifier (provider-specific).

Example request

{
  "input": "Hello world",
  "model": "mistralai/voxtral-mini-tts-2603",
  "response_format": "pcm",
  "speed": 1,
  "voice": "en_paul_neutral"
}

Response

Audio bytes stream

Changes

    • info

      added the new optional request property

    • info

      request property list-of-types was widened by adding types array to media type application/json

    • info

      added the new optional request property /

    • info

      added the new optional request property /