Skip to main content

Convert Text to Speech

POST 

/tts

Converts text to natural-sounding speech and returns a Google Cloud Storage URL to the audio file.

Request Body

FieldTypeRequiredDescription
textstringYesText to convert (1-5000 chars)
languagestringNoenglish, hindi, nepali
voiceGenderstringNomale or female
voiceNamestringNoSpecific voice (see /voices)
modelstringNoTTS model to use

Response

Returns a JSON object containing the Google Cloud Storage URL to the generated WAV audio file along with metadata about the conversion.

Example Usage

curl -X POST "https://api.example.com/ai/api/v2/tts" \
-H "Authorization: your-user-uuid" \
-H "Content-Type: application/json" \
-d '{
"text": "यस मार्फत अवगत गराइन्छ कि हालसालै प्रकाशित परीक्षाको नतिजा प्राप्त भएको छ ।",
"language": "nepali",
"voiceName": "Nikhil"
}'

Request

Responses

Text successfully converted to speech