Skip to main content
Generates audio from text input using text-to-speech models.

Request Body

model
string
required
The TTS model to use. Options include tts-1 and tts-1-hd.
input
string
required
The text to generate audio for. Maximum length is 4096 characters.
voice
string
required
The voice to use. Supported voices: alloy, echo, fable, onyx, nova, shimmer.
response_format
string
default:"mp3"
The audio format. Supported formats: mp3, opus, aac, flac, wav, pcm.
speed
number
default:"1.0"
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 appropriate Content-Type header based on the format.

Examples

Basic Text-to-Speech

High-Definition Audio

Adjusting Speed

Voice Descriptions

Audio Format Comparison

Use tts-1 for lower latency and tts-1-hd for higher quality audio generation.