Audio

Create speech

Generates audio from the input text.

Returns the audio file content, or a stream of audio events.

post/audio/speech

Request body

inputstring required

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

instructionsstring

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

response_format'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'

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

speednumber

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

stream_format'sse' | 'audio'

The format to stream the audio in. Supported formats are sse and audio. sse is not supported for tts-1 or tts-1-hd.

Example request

{
  "voice": {
    "id": "voice_1234"
  }
}

Response

OK

Changes

Changed in 11 of the 163 revisions of this API.1528

    • ○

      added the media type audio/aac for the response with the status

      response-media-type-added

    • ○

      added the media type audio/flac for the response with the status

      response-media-type-added

    • ○

      added the media type audio/mpeg for the response with the status

      response-media-type-added

    • ○

      added the media type audio/opus for the response with the status

      response-media-type-added

    • ○

      added the media type audio/pcm for the response with the status

      response-media-type-added

    • ○

      added the media type audio/wav for the response with the status

      response-media-type-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

  • 43d3ab82871511See the full diff
    • ▲

      removed from the request property anyOf list

      request-property-any-of-removed

    • ○

      added subschema #1 to the request property anyOf list

      request-property-any-of-added

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the optional property / to the response with the status

      response-optional-property-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

    • ○

      added the non-success response with the status

      response-non-success-status-added

  • 74cbcf73838f14See the full diff
    • ▲

      removed subschema #1 subschema #2 from the request property anyOf list

      request-property-any-of-removed

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added subschema #2 to the request property anyOf list

      request-property-any-of-added

    • ○

      added the new gpt-4o-mini-tts-2025-12-15 enum value to the request property /

      request-property-enum-value-added

    • ○

      added the media type text/event-stream for the response with the status

      response-media-type-added

    This revision also has 40 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 41844462b873103See the full diff
    • ▲

      removed the enum value alloy of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value ash of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value coral of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value echo of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value fable of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value nova of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value onyx of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value sage of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value shimmer of the request property

      request-property-enum-value-removed

    • ▲

      the request property type changed from string to no type

      request-property-type-changed

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added subschema #1 subschema #2 to the request property anyOf list

      request-property-any-of-added

    • ○

      added the new gpt-4o-mini-tts enum value to the request property /

      request-property-enum-value-added

    • ○

      added the new ash enum value to the request property

      request-property-enum-value-added

    • ○

      added the new coral enum value to the request property

      request-property-enum-value-added

    • ○

      added the new sage enum value to the request property

      request-property-enum-value-added

    • ▲

      removed the enum value ash of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value coral of the request property

      request-property-enum-value-removed

    • ▲

      removed the enum value sage of the request property

      request-property-enum-value-removed