Chat Completions FormatChatGPT APIChatGPT Audio
Create Speech
Request Body
application/json
model*string
One of the available TTS models: tts-1 or tts-1-hd
input*string
The text to generate audio for. Maximum length is 4096 characters.
voice*string
The voice to use when generating audio. Supported voices: alloy, echo, fable, onyx, nova, and shimmer.
response_format?string
Defaults to mp3. Supported audio formats: mp3, opus, aac, and flac.
speed?number
Defaults to 1. The speed of the generated audio. Choose a value between 0.25 and 4.0. 1.0 is the default.
Response Body
application/json
curl -X POST "https://loading/v1/audio/speech" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog.", "voice": "alloy" }'{}How is this guide?
Last updated on