Text to Speech
The Text to Speech (TTS) Generation API provides a simple yet powerful interface for converting text into natural-sounding speech.
Endpoint
POST /audio/v1/text-to-speechBody
prompt(string, required): The text input to be converted into speech.voiceId(string, required): The ID of the voice to be used for speech synthesis. The following voice IDs are accepted:52f254abbd463029dd655422femalee1fb08ee7177e52425b96a49male3695e87db7f5059a13c3ec9emaleb054b7a4a1dbabba96a691ddfemale127de703d939930eb0a85420female68e53488394f7e26aa66a57fmaleb38d58df9133fc82798fa8b5male55b829b051ad61983f8e3579femaledfc9b361cb98b238cf816ab3malee09406111fbb6c20e4cc5ebcfemalede84f730320dea1fc5e139b4male21c1658c7c9290b069a30b75female65b53fb9492bb30ef542b16dmale4681e2025560678d8a344cbemale620f8886ee8a435c1aa66010male8015b0357f6da0e72043cf6ffemale753b5470f2294f7eedb9a5afmale73108b4aaaf6e8bf118cae48female700eebf16fe75784f3c45f9amalee387eee06b3892c72c69d5a2male
Example
Request
POST /audio/v1/text-to-speech
Content-Type: application/json
x-access-key: YOUR_ACCESS_KEY
{
"prompt": "<Input text>",
"voiceId": "<one of the voices IDs>"
}Response
Success
HTTP/1.1 200 OK
Content-Type: audio/mpeg
[Binary audio data]Error
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"success": false,
"message": "<An error message containg the details>"
}