Messages
{
"type": "init",
"model_id": "sonic-3",
"voice": "f786b574-daa5-4673-aa0c-cbe3e8534c02",
"encoding": "linear16",
"sample_rate": 24000
}{
"type": "text",
"text": "Hello, this is Cartesia Sonic 3."
}{
"type": "flush"
}{
"type": "cancel"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "audio_chunk",
"context_id": "9baf38d7-799e-40f2-88d1-daeacbdb3910",
"status_code": 206,
"done": false,
"data": "AAF+/dD7n/wj/rD/owGoBEQHBgjTBcoDjAITAk0BtwF0BFUI5wmlB7cEAgO3ArIBUwB0AJwDDQbQBacCEgDA/vD96vxr/H3+hwAqASr/Z/3C/BEAEQAUAA==",
"step_time": 67.49622,
"flush_id": 0
}{
"type": "audio_end",
"context_id": "9baf38d7-799e-40f2-88d1-daeacbdb3910",
"status_code": 200,
"done": true
}{
"type": "error",
"message": "Provider returned an unexpected error",
"status_code": 500,
"error_code": "provider_error",
"done": true,
"request_id": "req-9b1c2f",
"doc_url": "https://docs.cartesia.ai/errors/provider_error",
"context_id": "demo-context-123"
}Cartesia
Cartesia Sonic 3
Stream low-latency speech synthesis from Cartesia Sonic 3 over WebSocket with a multilingual catalog of voices and context-aware controls.
WSS
/
v1
/
tts
/
cartesia
/
sonic:3
Messages
{
"type": "init",
"model_id": "sonic-3",
"voice": "f786b574-daa5-4673-aa0c-cbe3e8534c02",
"encoding": "linear16",
"sample_rate": 24000
}{
"type": "text",
"text": "Hello, this is Cartesia Sonic 3."
}{
"type": "flush"
}{
"type": "cancel"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "audio_chunk",
"context_id": "9baf38d7-799e-40f2-88d1-daeacbdb3910",
"status_code": 206,
"done": false,
"data": "AAF+/dD7n/wj/rD/owGoBEQHBgjTBcoDjAITAk0BtwF0BFUI5wmlB7cEAgO3ArIBUwB0AJwDDQbQBacCEgDA/vD96vxr/H3+hwAqASr/Z/3C/BEAEQAUAA==",
"step_time": 67.49622,
"flush_id": 0
}{
"type": "audio_end",
"context_id": "9baf38d7-799e-40f2-88d1-daeacbdb3910",
"status_code": 200,
"done": true
}{
"type": "error",
"message": "Provider returned an unexpected error",
"status_code": 500,
"error_code": "provider_error",
"done": true,
"request_id": "req-9b1c2f",
"doc_url": "https://docs.cartesia.ai/errors/provider_error",
"context_id": "demo-context-123"
}bearer
type:http
API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
method
type:string
GET
Init Request (Cartesia Sonic 3)
type:object
Initialize a Cartesia Sonic 3 TTS session with provider-specific configuration.
Text Message (Cartesia Sonic 3)
type:object
Send text to synthesize on Cartesia Sonic 3 with optional generation controls.
Flush Message
type:object
Standalone segment boundary on the active Cartesia Sonic 3 context.
Cancel Message
type:object
Cancel an in-progress Cartesia Sonic 3 synthesis context.
Close Message
type:object
Close the session and stop any further audio.
Keepalive Message
type:object
Keep the WebSocket connection alive during silence.
Audio Chunk (Cartesia Sonic 3)
type:object
Streaming audio chunk from Cartesia Sonic 3.
Audio End
type:object
Signals the end of audio generation.
Error Response
type:object
Indicates an error occurred during synthesis.