Overview
1
Step 1 — Generate a voice embedding
Upload a reference audio clip to get a
speaker_embedding. See Voice Clone Embeddings.2
Step 2 — Synthesize with your cloned voice — this page
Pass the
speaker_embedding from Step 1 to this endpoint to stream cloned voice audio in real-time with the lowest latency.speaker_embedding from Voice Clone Embeddings to use your cloned voice. For simpler use cases, see Voice Cloning REST or Voice Cloning Streaming.
Endpoint
Authentication
All Realtime connections require the following headers:Request Format
Send a JSON message with the following structure:Response
The server uses the same WebSocket message protocol as TTS Realtime. Send a JSON synthesis request; receive JSON-wrapped base64 audio chunks.Connection flow
- Connect to
wss://api.vachana.ai/api/v1/ttswithX-API-Key-ID. - Send a JSON message with
text,model,speaker_embedding, andaudio_config. - Receive
start, thenaudiochunks, thencomplete. - Decode each chunk’s
data.audiofrom base64 and append in order.
Server messages
start — synthesis began:
complete — all audio sent:
error — synthesis failed:
Include a complete
audio_config (sample_rate, num_channels, sample_width, encoding, container) matching VC REST examples.