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-speech
Body
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:52f254abbd463029dd655422
femalee1fb08ee7177e52425b96a49
male3695e87db7f5059a13c3ec9e
maleb054b7a4a1dbabba96a691dd
female127de703d939930eb0a85420
female68e53488394f7e26aa66a57f
maleb38d58df9133fc82798fa8b5
male55b829b051ad61983f8e3579
femaledfc9b361cb98b238cf816ab3
malee09406111fbb6c20e4cc5ebc
femalede84f730320dea1fc5e139b4
male21c1658c7c9290b069a30b75
female65b53fb9492bb30ef542b16d
male4681e2025560678d8a344cbe
male620f8886ee8a435c1aa66010
male8015b0357f6da0e72043cf6f
female753b5470f2294f7eedb9a5af
male73108b4aaaf6e8bf118cae48
female700eebf16fe75784f3c45f9a
malee387eee06b3892c72c69d5a2
male
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>"
}