Text to speech

Turn text into spoken audio.

POSThttps://your-instance.com/v1/audio/speech

Returns raw audio bytes rather than JSON. Write the body straight to a file, or stream it to the client.

  • modelstringrequired

    Speech model to use.

  • inputstringrequired

    The text to speak.

  • voicestringrequired

    Which voice to use. Available voices vary by model.

  • response_formatstringdefault: "mp3"

    Audio container: mp3, opus, aac, flac, wav or pcm.

  • speednumberdefault: 1.0

    Playback rate between 0.25 and 4.0.

curl https://your-instance.com/v1/audio/speech \
  -H "Authorization: Bearer $CLAWROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox.",
    "voice": "alloy"
  }' \
  --output speech.mp3