POST
/
audio
/
speech
Generate speech
curl --request POST \
  --url https://api.openai.com/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "input": "<string>",
  "instructions": "<string>",
  "voice": "ash",
  "response_format": "mp3",
  "speed": 1
}'
This response does not have an example.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
required

One of the available TTS models: tts-1, tts-1-hd or gpt-4o-mini-tts.

input
string
required

The text to generate audio for. The maximum length is 4096 characters.

Maximum length: 4096
voice
required

The voice to use when generating the audio. Supported voices are alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, and verse. Previews of the voices are available in the Text to speech guide.

Example:

"ash"

instructions
string

Control the voice of your generated audio with additional instructions. Does not work with tts-1 or tts-1-hd.

Maximum length: 4096
response_format
enum<string>
default:mp3

The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm.

Available options:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
default:1

The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.

Required range: 0.25 <= x <= 4

Response

200 - application/octet-stream

OK

The response is of type file.