Create speech
POST
https://api.openai.com/v1/audio/speechCreates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Request
Header Params
Authorization
string
required
Example:
Bearer $OPENAI_API_KEY
Content-Type
string
required
Example:
application/json
Body Params application/json
model
string
required
One of the available TTS models: tts-1
or tts-1-hd
input
string
required
The text to generate audio for. The maximum length is 4096 characters.
voice
string
required
The voice to use when generating the audio. Supported voices are alloy
, echo
, fable
, onyx
, nova
, and shimmer
. Previews of the voices are available in the Text to speech guide.
Example
{
"model": "tts-1",
"input": "The quick brown fox jumped over the lazy dog.",
"voice": "alloy"
}
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
The audio file content.
Data Schema
object {0}
Example
Not configured
Last modified: 15 days ago