{
"type": "init",
"voice": "aura-2-thalia-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "cancel"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "ready",
"session_id": "1e1a9598-077e-4d9d-aba6-78af6363f27c",
"slng_request_id": "1e1a9598-077e-4d9d-aba6-78af6363f27c",
"accepts_partial_text": true
}"0000FF00000000FF00000000010101010101010100000000FFFFFFFFFFFEFEFDFEFEFEFEFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFEFEFEFEFF0001000001020303030303030303030201010000FFFFFEFDFDFDFDFEFFFFFFFF0001020303020201000000FFFDFCFBFAFAFBFAF9F8F7F7F7F6F6F4F2F2F3F7FC000406090F14191A19181715110E0A05FEF9F6F3F0EEECEBEBECEEF2F6F9FC0005090D0F101010100E0C080401"{
"type": "cleared"
}{
"type": "audio_end"
}{
"type": "error",
"code": "provider_error",
"message": "Upstream service unavailable"
}Unified TTS
Stream synthesized audio from any WebSocket-capable TTS model over SLNG’s native protocol. Send init (the model comes from the route path; model in the body is advisory), text frames, and flush to end a turn. The gateway returns ready, raw binary audio frames in the init encoding and sample rate, a bare audio_end after each flushed turn, cleared after clear, and flat error frames. There is no JSON audio_chunk, no flushed event, and no data envelope on any message. Encodings and sample rates are model-specific: Deepgram Aura accepts linear16 (8000–48000 Hz), mulaw, and alaw (8000/16000 Hz) over WebSocket only; Fish Audio accepts linear16/pcm/wav (8000–44100 Hz), mp3 (32000/44100 Hz), and opus (48000 Hz).
{
"type": "init",
"voice": "aura-2-thalia-en",
"config": {
"sample_rate": 24000,
"encoding": "linear16"
}
}{
"type": "text",
"text": "Hello, how can I help you?"
}{
"type": "flush"
}{
"type": "clear"
}{
"type": "cancel"
}{
"type": "close"
}{
"type": "keepalive"
}{
"type": "ready",
"session_id": "1e1a9598-077e-4d9d-aba6-78af6363f27c",
"slng_request_id": "1e1a9598-077e-4d9d-aba6-78af6363f27c",
"accepts_partial_text": true
}"0000FF00000000FF00000000010101010101010100000000FFFFFFFFFFFEFEFDFEFEFEFEFDFDFEFEFEFEFEFEFEFEFEFFFFFFFFFEFEFEFEFF0001000001020303030303030303030201010000FFFFFEFDFDFDFDFEFFFFFFFF0001020303020201000000FFFDFCFBFAFAFBFAF9F8F7F7F7F6F6F4F2F2F3F7FC000406090F14191A19181715110E0A05FEF9F6F3F0EEECEBEBECEEF2F6F9FC0005090D0F101010100E0C080401"{
"type": "cleared"
}{
"type": "audio_end"
}{
"type": "error",
"code": "provider_error",
"message": "Upstream service unavailable"
}API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
GET
Initialize Unmute TTS session with voice and configuration.
Send text to synthesize.
End the current turn and synthesize buffered text.
Discard queued output for the current turn.
Cancel the current synthesis turn.
Close the session.
Keep an idle session open.
Unmute TTS session is ready.
Raw binary audio frame from Unmute TTS.
Queued output was discarded.
Bare turn boundary after the last audio frame.
Error occurred during Unmute TTS session.