Skip to main content
Use POST /v1/audio/speech when you want audio output instead of generated text. This endpoint returns streamed audio bytes, not a JSON text response.

Required fields

Request Example

Important Difference From Text APIs

This endpoint does not return generated text JSON. It returns streamed audio bytes with a media type such as audio/mpeg, audio/opus, or audio/wav.

Response Formats

Supported output formats include:
  • mp3
  • opus
  • aac
  • flac
  • wav
  • pcm

Common mistakes

  • expecting a normal JSON response instead of binary audio
  • forgetting to write the response to a file or audio buffer
  • choosing a response format your playback pipeline does not handle

Reference