Skip to main content
POST

Authorizations

string
required
All APIs require Bearer Token authenticationGet API Key:Visit API Key Management Page to get your API KeyAdd to request header:

Body

string
default:"gpt-4o-mini-tts"
required
TTS model nameAvailable models:
  • gpt-4o-mini-tts - GPT-4o Mini TTS model
Example: "gpt-4o-mini-tts"
string
required
The text to convert to speechMaximum length: 4096 charactersExample: "The quick brown fox jumps over the lazy dog."
string
required
Voice selectionAvailable voices:
  • alloy - Neutral, balanced voice
  • echo - Male, calm voice
  • fable - British, narrative voice
  • onyx - Male, deep voice
  • nova - Female, energetic voice
  • shimmer - Female, gentle voice
Example: "alloy"
string
default:"wav"
required
Audio output formatSupported formats:
  • wav - WAV format, uncompressed (default)
  • opus - Opus format, for internet streaming
  • aac - AAC format
  • flac - FLAC format, lossless compression
  • pcm - PCM format, raw audio data
Example: "wav"
number
default:"1.0"
Speech playback speedRange: 0.25 to 4.0
  • 0.25 - Slowest speed (1/4x)
  • 1.0 - Normal speed (default)
  • 4.0 - Fastest speed (4x)
Example: 1.0

Response

Returns binary audio data stream on success, which can be saved as an audio file or played directly. Returns JSON formatted error information on error, including error code, message, and type.