Request Body
The TTS model to use. Options include
tts-1 and tts-1-hd.The text to generate audio for. Maximum length is 4096 characters.
The voice to use. Supported voices:
alloy, echo, fable, onyx, nova, shimmer.The audio format. Supported formats:
mp3, opus, aac, flac, wav, pcm.The speed of the generated audio. Range: 0.25 to 4.0.
Response
Returns the audio file content in the requested format. The response has the appropriateContent-Type header based on the format.
Examples
Basic Text-to-Speech
High-Definition Audio
Adjusting Speed
Voice Descriptions
| Voice | Description |
|---|---|
alloy | Neutral, balanced voice |
echo | Warm, conversational voice |
fable | Expressive, narrative voice |
onyx | Deep, authoritative voice |
nova | Friendly, energetic voice |
shimmer | Clear, refined voice |
Audio Format Comparison
| Format | Quality | File Size | Use Case |
|---|---|---|---|
mp3 | Good | Small | General use, web streaming |
opus | Excellent | Small | Real-time streaming |
aac | Good | Small | Mobile apps |
flac | Lossless | Large | Archival, high quality |
wav | Lossless | Large | Professional editing |
pcm | Raw | Large | Audio processing |
