v4

latestOpenAPI 3.1.02026-07-31155218294.8 KB
Text to Speech

Text To Speech

post/v1/text-to-speech/{voice_id}

Path parameters

voice_idstring required

Query parameters

output_formatstring nullable

Headers

xi-api-keystring nullable
x-api-keystring nullable

Request body

textstring required

Text to convert to speech

model_idstring

Model ID to use for the conversion

output_format'mp3' | 'opus' | 'flac' | 'wav' | 'pcm'

Select the desired format for the speech output. Supported formats include mp3, opus, flac, wav, and pcm.

language_codestring nullable

ISO 639-1, 2 letter language code

Example request

{
  "text": "I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot",
  "output_format": "mp3"
}

Response

Successful Response

{"stackTrail":"paths:/v1/text-to-speech/{voice_id}:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}