model parameter.
Authentication
Include your API key in every request:- Text-to-speech
- Transcription
- Translation
Convert text to speech
POST /v1/audio/speech generates an audio file from a text string. The response body is raw audio binary — write it directly to a file.curl
--output flag tells curl to save the binary response to speech.mp3 instead of printing it to the terminal.Key parameters
| Parameter | Type | Description |
|---|---|---|
model | string | The TTS model to use, e.g. openai/tts-1 or openai/tts-1-hd. |
input | string | The text to synthesize. Maximum 4096 characters. |
voice | string | Voice style. Options include alloy, echo, fable, onyx, nova, shimmer. |
response_format | string | Audio format: mp3 (default), opus, aac, or flac. |
speed | number | Playback speed from 0.25 to 4.0. Default is 1.0. |
