audio.speech

Speech

Speech

post/v1/audio/speech

Request body

modelstring nullable
metadataMetadataDict

Custom type for metadata with embedded validation.

streamboolean
prompt_cache_keystring nullable
voice_idstring nullable

The preset or custom voice to use for generating the speech.

inputstring required

Text to generate a speech from

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

Response

Speech audio data.

audio_datastring required

Base64 encoded audio data

Changes

Changed in 1 of the 3 revisions of this API.11

  • 933c4ebdcd7211See the full diff
    • the ref_audio/anyOf[subschema #2]/ request property contentMediaType changed from application/octet-stream to

      request-property-content-media-type-changed

    • added the new optional request property prompt_cache_key

      new-optional-request-property

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