Multimodal
Text-to-speech
Same shape as OpenAI's audio.speech —
POST /v1/audio/speech. Returns raw audio
bytes in one response (no streaming playback yet), billed per input character.
resp = client.audio.speech.create(
model="tts-1",
voice="alloy",
input="Your order has shipped.",
response_format="mp3",
)
resp.stream_to_file("out.mp3")
Which models and voices
tts-1OpenAIe.g. alloy (default)tts-1-hdOpenAIOpenAI voice idsgpt-4o-mini-ttsOpenAIOpenAI voice idsspeech-02-hdMiniMaxMiniMax voice ids — required, no defaultspeech-02-turboMiniMaxMiniMax voice ids — required, no defaulteleven_multilingual_v2ElevenLabsElevenLabs voice ids — required, no defaulteleven_v3ElevenLabsElevenLabs voice ids — required, no default
voice only defaults to
"alloy" for OpenAI models — MiniMax and
ElevenLabs use their own voice-id vocabulary and a request against those models must set
voice explicitly.
response_format accepts
mp3 (default),
opus,
aac,
flac,
wav, and
pcm.
Not yet supported
No real-time/streamed audio output — the full file is generated and returned in one response. For transcription (audio → text) see Speech-to-text.