v1

latestOpenAPI 3.0.3MIT2026-07-132953108.7 KB
Audio

Create Speech (Text-to-Speech)

Converts text to spoken audio using AI voice synthesis. Supports multiple voices, audio formats, and streaming capabilities.

post/v1/audio/speech

Request body

modelstring required

Model to use for speech synthesis in 'provider/model' format

inputstring required

Text to convert to speech (max 4096 characters)

voice'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer' required

Voice to use for speech synthesis

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

Audio format for the response

instructionsstring

Additional instructions for voice synthesis

stream_format'sse'

Enable streaming with Server-Sent Events

Example request

{
  "model": "openai/tts-1",
  "input": "Hello! This is a test of speech synthesis.",
  "voice": "alloy",
  "response_format": "mp3",
  "instructions": "Speak slowly and clearly",
  "stream_format": "sse"
}

Response

Audio data or streaming response