Method Signature
Parameters
The text to generate audio for. The maximum length is 4096 characters.
One of the available TTS models:
tts-1- Standard quality text-to-speechtts-1-hd- High definition text-to-speechgpt-4o-mini-tts- Advanced TTS with instruction supportgpt-4o-mini-tts-2025-12-15- Latest advanced TTS model
The voice to use when generating the audio. Supported built-in voices are:
alloyashballadcoralechofableonyxnovasageshimmerversemarincedar
id, for example {"id": "voice_1234"}.Control the voice of your generated audio with additional instructions. Does not work with
tts-1 or tts-1-hd.The format to audio in. Supported formats are:
mp3(default)opusaacflacwavpcm
The speed of the generated audio. Select a value from
0.25 to 4.0. 1.0 is the default.The format to stream the audio in. Supported formats are
sse and audio. sse is not supported for tts-1 or tts-1-hd.Response
Returns aBinaryAPIResponse object containing the audio file data. The response can be saved to a file or streamed directly.