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
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text to convert (1-5000 chars) |
| language | string | No | english, hindi, nepali |
| voiceGender | string | No | male or female |
| voiceName | string | No | Specific voice (see /voices) |
| model | string | No | TTS 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": "Welcome to our service!",
"language": "english",
"voiceName": "Kore"
}'
Request
Responses
- 200
- 400
- 401
- 500
- 503
Text successfully converted to speech
Invalid request parameters
Authentication failed
Server error occurred
TTS service not available