{
"context_id": "<string>",
"voice_id": "<string>",
"text": "<string>",
"language": "<string>",
"model": "<string>",
"audio_format": "<string>",
"temperature": 123,
"top_p": 123,
"flush": true
}{
"context_id": "<string>",
"text": "<string>",
"flush": true,
"close_context": true,
"close_socket": true
}{
"context_id": "<string>",
"close_context": true
}{
"close_socket": true
}{
"audio": "<string>",
"context_id": "<string>"
}{
"is_last": true,
"context_id": "<string>"
}{
"context_closed": true,
"context_id": "<string>"
}{
"error": "<string>",
"context_id": "<string>"
}Multiple concurrent TTS streams over a single WebSocket connection. Each context has its own voice and settings. For multiple generations, use this instead of /stream.
Authentication: Authorization: Bearer YOUR_API_KEY
{
"context_id": "<string>",
"voice_id": "<string>",
"text": "<string>",
"language": "<string>",
"model": "<string>",
"audio_format": "<string>",
"temperature": 123,
"top_p": 123,
"flush": true
}{
"context_id": "<string>",
"text": "<string>",
"flush": true,
"close_context": true,
"close_socket": true
}{
"context_id": "<string>",
"close_context": true
}{
"close_socket": true
}{
"audio": "<string>",
"context_id": "<string>"
}{
"is_last": true,
"context_id": "<string>"
}{
"context_closed": true,
"context_id": "<string>"
}{
"error": "<string>",
"context_id": "<string>"
}API key (vk_*). Include in Authorization header: 'Bearer YOUR_API_KEY'. Required for all WebSocket connections. See the Authentication guide for details.
First message to a context_id to set up that context
Subsequent messages to an existing context (text-only, no params). Can include close_context or close_socket to control context/connection lifecycle.
Close a specific context. Can be sent as a standalone message or included in any message. Server responds with context_closed message to confirm the context is closed.
Close entire WebSocket connection and all contexts. Can be sent as a standalone message or included in any message. Server closes the connection after processing.
Base64-encoded audio chunk with context_id (streamed immediately)
Sent after all audio chunks for a flush operation (separate message). Indicates inference is complete for this flush. The context remains active and can receive more text/flushes. Each flush generates its own is_last message.
Sent when a context is explicitly closed via close_context. This is a separate message from is_last to distinguish context closure from flush completion.
Error message from server with context_id