The Text-to-Speech (TTS) API converts text into natural-sounding speech. Submit your text and receive high-quality audio output in various voices and languages.
This endpoint only supports text less than or equal to 1200 characters
60 requests per minute
Rate limit headers included in response
Retry-After: (delay-seconds) indicates time in seconds to retry

Endpoint

POST https://infer.voice.intron.io/tts/v1/enqueue

Authentication

Authorization: Bearer YOUR_API_KEY

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_KEYYes
Content-Typeapplication/jsonYes

Body Parameters

FieldTypeDescriptionRequiredOptionsDefault
textStringthe text to processyes
voice_accentStringAccent for the speech voiceyessee page of supported accents
voice_genderStringAccent for the speech voiceyesmale / female
voice_languageStringLanguage of the input textnosee page of supported languagesen
output_audio_formatStringSpecify the output audio formatnosee list of supported audio formats belowwav

Supported Output Audio Formats

FormatExtensions
WAV.wav
OPUS.opus

Supported Language And Accents

Supported Languages And Accents

Comprehensive list of languages and accents supported

Basic request and response sample

Requests

curl --location 'https://infer.voice.intron.io/tts/v1/enqueue' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer api-key' \
--data '{
    "text":"hello world",
    "voice_language":"en",
    "voice_accent":"swahili",
    "voice_gender":"female"
}'

Response

The text-id in the response should be used to get the file’s status with the Get TTS Status endpoint
{
    "data": {
        "text_id": "12a9767f-b865-4404-91d0-a65d4cdt78fs"
    },
    "message": "tts text queued for processing",
    "status": "Ok"
}

Error Responses

Error response if the max character limit is exceed, Please refer to the list of support language,accent lists Supported Voice language and accents
JSON
{
    "data": {},
    "message": "tts text character count greater than the max limit of 1200 characters",
    "status": "Error"
}
Error response if an unsupported language code was sent, Please refer to the list of support language,accent lists Supported Voice language and accents
JSON
{
    "data": {},
    "message": "invalid text voice language,{language} not supported",
    "status": "Error"
}
Error response if the voice_accent sent is not supported under the selected voice_language, Please refer to the list of support language,accent lists Supported Voice language and accents
JSON
{
    "data": {},
    "message": "invalid text voice accent,{accent} not supported for language {language}",
    "status": "Error"
}
Error response if the voice_gender sent is not supported under the selected voice_accent, Please refer to the list of support language,accent lists Supported Voice language and accents
JSON
{
    "data": {},
    "message": "invalid text voice gender,{gender} not supported for accent {accent}",
    "status": "Error"
}
Error response if the output_audio_format is not supported, Please refer to the list of supported output_audio_format above
JSON
{
    "data": {},
    "message": "invalid text voice gender,{gender} not supported for accent {accent}",
    "status": "Error"
}