The TTS Text upload generate API allows you to upload text and wait to get the audio file as a response.
This endpoint only supports text less than or equal to 4096 characters
This endpoint requires an Integrator Account

Rate Limits

30 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/generate

Authentication

All requests require a Bearer token in the Authorization header:
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/generate' \
--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 request can timeout with an http status code 503 in 120 seconds, the text-id in the 503 response can be used to get the file’s status with the Get TTS Status endpoint
{
    "data": {
        "audio_duration_in_seconds": 3,
        "audio_path": "http://myaudio.wav",
        "processing_status": "TTS_TEXT_AUDIO_GENERATED"
    },
    "message": "text status found",
    "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 100 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"
}