WSS wss://api.vakyam.ai/v1/tts/websocketAuthorization
header on connect, send a config message, then one text message per
sentence. See the realtime guide for the full
message reference.header AuthorizationstringrequiredBearer vak_live_<key>. An invalid key closes
the connection with code 4001.type field. Send config first,
then one text per sentence. Send cancel to interrupt the current utterance,
ping to keep the socket alive, and disconnect to close cleanly.123456789{ "type": "config", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "pcm", "sample_rate": 24000, "speed": 1.0 }
body typestringrequiredconfig.body model_idstringrequiredraaga-v1.body voicestringrequiredArchana) 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_namestringdeprecatedvoice instead. Temporarily accepted for preset
voices only.body languagestringrequireden-IN, hi-IN, ta-IN, te-IN, kn-IN,
mr-IN, gu-IN, or bn-IN.body output_formatstringdefault: pcmpcm, mp3, wav, or mulaw. Defaults to pcm over
WebSocket to avoid container overhead.body sample_rateintegerdefault: 240008000, 16000, 24000, or 48000.body speednumberdefault: 1.00.5–2.0.configured and end_of_utterance, the server streams the audio as raw
binary WebSocket frames (not JSON). Reassemble them in arrival order. All
other server messages are JSON objects with a type field.1234{ "type": "connected", "user_id": "f1e2d3c4-..." }
typestringconnected.user_idstringping — resets the timer, so send a
periodic ping to keep a session open between utterances. The Python and
JavaScript SDKs send a keepalive ping for you by default.| Code | Reason |
| 1000 | Normal closure |
| 1011 | Session lost (concurrency or worker capacity revoked mid-session) — reconnect |
| 4001 | Authentication failed |
| 4002 | Internal server error |
1234wss://api.vakyam.ai/v1/tts/websocket Header Authorization: Bearer vak_live_<key> Status 101 Switching Protocols
12345678{ "type": "config", "model_id": "raaga-v1", "voice": "Archana", "language": "ta-IN", "output_format": "pcm", "speed": 1.0 }
1234{ "type": "connected", "user_id": "f1e2d3c4-..." }