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

Stream speech over HTTP

POST https://api.vakyam.ai/v1/tts/stream
Streams audio bytes for the full input text as they are generated. The request body is identical to POST /v1/tts/generate. Authentication, rate limits, credits, voice/language, and model_id are validated before streaming starts.
voice_name is deprecated — use the voice parameter instead (a preset voice name or a vc_ custom voice ID). See POST /v1/tts/generate for details.

Authorization

header Authorizationstringrequired
Bearer token: Bearer vak_live_<key>.

Body

Same as POST /v1/tts/generate. pcm is recommended for streaming to avoid container overhead.
Request body
{ "text": "வணக்கம்.", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "pcm", "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. Send either voice or the deprecated voice_name, not both.
body voice_namestringdeprecated
Deprecated — use voice instead. Temporarily accepted for preset voices only.
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. pcm is recommended for streaming to avoid container overhead.
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

The response body is a raw application/octet-stream of audio bytes. Usage and rate-limit metadata are returned as headers:
Response headers
Content-Type: application/octet-stream X-Characters-Used: 12 X-Audio-Duration-Seconds: 1.8
X-Characters-Usedinteger
Characters consumed for this request.
X-Audio-Duration-Secondsnumber
Duration of the streamed audio in seconds.
Request example
curl -N https://api.vakyam.ai/v1/tts/stream \ -H "Authorization: Bearer $VAKYAM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "வணக்கம்.", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "pcm" }' --output speech.pcm
Response example
Content-Type: application/octet-stream X-Characters-Used: 12 X-Audio-Duration-Seconds: 1.8 X-RateLimit-Limit: 15 X-RateLimit-Remaining: 14