Generates audio from input text (text-to-speech). Returns the audio file as binary data.

post/v1/audio/speech

Request

  • Base URL
    https://api.llmgateway.io
  • Auth
    HTTP bearer

Request body

modelstring required

ID of the speech generation (text-to-speech) model to use.

inputstring required

The text to synthesize into speech.

voicestring

The prebuilt voice to use. Defaults to the model's default voice when omitted.

response_format'wav' | 'pcm' | 'mp3' | 'opus' | 'aac' | 'flac'

The audio format of the returned audio. OpenAI models support mp3 (default), opus, aac, flac, wav and pcm. Gemini models emit PCM, so only wav (default) and pcm are supported.

speednumber

Playback speed hint. Forwarded to OpenAI models; not applied by Gemini speech models.

instructionsstring

Optional style/delivery instructions prepended to the input as a natural-language directive (e.g. 'Say cheerfully').

Example request

{
  "model": "gemini-2.5-flash-preview-tts",
  "input": "Hello, welcome to LLM Gateway!",
  "voice": "Kore",
  "response_format": "wav",
  "speed": 1,
  "instructions": "Say in a warm, friendly tone"
}

Response

Generated audio.

Changes

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status