Text to speech (TTS)
OpenAI-compatible
Text to speech (TTS)
POST /v1/audio/speech — synthesize text into speech
POST
Text to speech (TTS)
Synthesize text into natural-sounding speech.
Request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | tts-1 / tts-1-hd / gpt-4o-mini-tts |
input | string | ✅ | The text to synthesize (up to 4096 characters) |
voice | string | ✅ | Voice: alloy / echo / fable / onyx / nova / shimmer / coral / verse, etc. |
response_format | string | mp3 (default) / opus / aac / flac / wav / pcm | |
speed | number | 0.25 - 4.0 (default 1.0) | |
instructions | string | gpt-4o-mini-tts only; describe tone / style |
Response
Returns a binary audio stream directly, withContent-Type matching the chosen response_format:
| response_format | Content-Type |
|---|---|
mp3 | audio/mpeg |
opus | audio/ogg |
aac | audio/aac |
flac | audio/flac |
wav | audio/wav |
pcm | audio/pcm |
Python example
gpt-4o-mini-tts advanced
The next-gen TTS supports controlling tone viainstructions: