Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

Synthesize speech

POST https://api.vakyam.ai/v1/tts/generate
Synthesizes the full input text and returns base64-encoded audio in a JSON envelope. The entire audio is generated before the response is returned. For lower latency, see HTTP streaming or the WebSocket endpoint.
voice_name is deprecated and will be removed after a migration window. Use the new voice parameter instead — it accepts a preset voice name (e.g. Archana) or a custom voice ID beginning with vc_. voice_name remains temporarily accepted for preset voices only and cannot be combined with voice.

Authorization

header Authorizationstringrequired
Bearer token: Bearer vak_live_<key>.

Body

Request body
{ "text": "வணக்கம், நான் வாக்யம் AI பேசுகிறேன்.", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "mp3", "sample_rate": 24000, "speed": 1.0 }
body textstringrequired
Text to synthesize. Maximum 3000 Unicode characters.
body model_idstringrequired
Model identifier. Must be raaga-v1.
body voicestringrequired
Voice selector. A preset voice name (e.g. Archana) or a custom voice ID beginning with vc_. A preset voice must form a valid pair with language — see Voices. Send either voice or the deprecated voice_name, not both.
body voice_namestringdeprecated
Deprecated — use voice instead. Temporarily accepted for preset voices only (it cannot select vc_ custom voices) and will be removed after the migration window.
body languagestringrequired
BCP 47 language code: en-IN, hi-IN, ta-IN, te-IN, kn-IN, mr-IN, gu-IN, or bn-IN.
body output_formatstringdefault: mp3
Audio format: mp3, wav, pcm, or mulaw.
body sample_rateintegerdefault: 24000
Output sample rate in Hz. One of 8000, 16000, 24000, or 48000.
body speednumberdefault: 1.0
Playback speed multiplier, 0.5–2.0.

Response

Response
{ "audio": "SUQzBAAAAAAA...", "format": "mp3", "duration_seconds": 2.4, "characters_used": 36 }
audiostring
Base64-encoded audio data. Decode it to get the raw audio bytes.
formatstring
Output format of the returned audio.
duration_secondsnumber
Duration of the synthesized audio in seconds.
characters_usedinteger
Unicode characters consumed from your credit balance.
Request example
curl https://api.vakyam.ai/v1/tts/generate \ -H "Authorization: Bearer $VAKYAM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "வணக்கம், நான் வாக்யம் AI பேசுகிறேன்.", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "mp3" }'
Response example
{ "audio": "SUQzBAAAAAAA...", "format": "mp3", "duration_seconds": 2.4, "characters_used": 36 }