Docs
audio
Text To Speech

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 female
    • e1fb08ee7177e52425b96a49 male
    • 3695e87db7f5059a13c3ec9e male
    • b054b7a4a1dbabba96a691dd female
    • 127de703d939930eb0a85420 female
    • 68e53488394f7e26aa66a57f male
    • b38d58df9133fc82798fa8b5 male
    • 55b829b051ad61983f8e3579 female
    • dfc9b361cb98b238cf816ab3 male
    • e09406111fbb6c20e4cc5ebc female
    • de84f730320dea1fc5e139b4 male
    • 21c1658c7c9290b069a30b75 female
    • 65b53fb9492bb30ef542b16d male
    • 4681e2025560678d8a344cbe male
    • 620f8886ee8a435c1aa66010 male
    • 8015b0357f6da0e72043cf6f female
    • 753b5470f2294f7eedb9a5af male
    • 73108b4aaaf6e8bf118cae48 female
    • 700eebf16fe75784f3c45f9a male
    • e387eee06b3892c72c69d5a2 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>"
}