Protocol
All control messages are JSON over WebSocket. Audio is binary PCM.
Client → Server
Section titled “Client → Server”Start session
Section titled “Start session”{ "type": "start", "sample_rate": 16000, "save_audio": true, "format": "wav", "target_language": "es"}| Field | Type | Description |
|---|---|---|
sample_rate |
number | Informational; audio is always 16000 Hz |
save_audio |
bool | Save the recording when the session is cleaned |
format |
wav | ogg |
Recording format |
target_language |
BCP-47 string | Output language hint/translation target |
target_language is validated twice: against the global language union and against the loaded model’s supported languages. Unsupported values are dropped before they reach the model. Canary translates into the target, Whisper/Whisperfile/Cohere/SenseVoice use it as a hint, and Parakeet/GigaAM/Moonshine ignore it.
Audio chunks
Section titled “Audio chunks”Binary PCM 16-bit mono @ 16 kHz — only speech frames passed through VAD.
Stop / Clean / Discard
Section titled “Stop / Clean / Discard”{"type": "stop"}{"type": "clean"}{"type": "discard"}stopends the session and replies with{"type":"status","message":"stopped"}cleansaves the buffer torecords/(ifsave_audiois enabled), clears it, and repliescleaneddiscardclears the buffer without saving and repliesdiscarded
Model manager
Section titled “Model manager”The client can list, download, load and delete models at runtime. All commands share the same WebSocket and require a model field (except list_models). See Supported Models for the flags and languages behind each name.
{"type": "list_models"}{"type": "download_model", "model": "Canary1BV2"}{"type": "load_model", "model": "Canary1BV2"}{"type": "reload_model", "model": "Canary1BV2"}{"type": "delete_model", "model": "MoonshineTiny"}Rules enforced by the server:
- Model names are matched exactly, then case-insensitively
- Only one model operation runs at a time; a download cannot overlap a load or delete
load_modelfails if the model is not installeddelete_modelfails for the active modelreload_modelis an alias forload_model- Loading a model sends
model_infoand persists the choice tosinsajo-config.json
Server → Client
Section titled “Server → Client”Transcription
Section titled “Transcription”{"type": "transcription", "text": "..."}Also accepted by the client: partial, final.
Status / Error
Section titled “Status / Error”{"type": "status", "message": "ready"}{"type": "error", "message": "..."}Model info
Section titled “Model info”Sent on connect and after a successful model load:
{"type": "model_info", "model": "Canary1BV2", "languages": ["bg", "hr", "cs", "..."]}The client shows the active model and enables only the advertised languages in Settings.
Model list
Section titled “Model list”Response to list_models, and sent again after every model action:
{ "type": "model_list", "active": "ParakeetTDT", "models": [ { "name": "ParakeetTDT", "display": "Parakeet TDT 0.6b v3", "dir": "parakeet-tdt-0.6b-v3-onnx", "installed": true, "active": true, "files": 8 } ]}| Field | Description |
|---|---|
active |
Name of the loaded model |
models[].name |
Value to pass back in manager commands |
models[].display |
Human-readable label |
models[].dir |
Subdirectory under the model directory |
models[].installed |
All required files are present |
models[].active |
This is the currently loaded model |
models[].files |
Number of files the definition requires |
Model action
Section titled “Model action”Reports the lifecycle of a manager command:
{"type": "model_action", "action": "load", "model": "Canary1BV2", "state": "started", "message": null}action:download|load|deletestate:started|completed|failedmessage: optional detail (for example"Model is already installed")
A failed action also sets the client’s error banner. completed/failed is followed by a fresh model_list.
Model download progress
Section titled “Model download progress”Streamed while a download_model action runs:
{ "type": "model_download_progress", "model": "Canary1BV2", "file": "encoder-model.int8.onnx", "file_downloaded": 1048576, "file_total": 314572800, "file_complete": false, "downloaded": 2097152, "total": 943718400, "percent": 33, "files_done": 1, "files_total": 7}| Field | Description |
|---|---|
file |
File currently being downloaded |
file_downloaded / file_total |
Bytes for the current file (0 total when unknown) |
file_complete |
Last snapshot for this file before the next starts |
downloaded / total |
Aggregate bytes for the whole model |
percent |
Overall completion; each file is weighted equally |
files_done / files_total |
Files finished / files to fetch |
percent weights every file equally, so it can differ from downloaded / total when files have different sizes. file_complete prevents a finished file from being counted twice and keeps the client bar from jumping backwards. Older servers may only send a per-file percent; the client falls back to it when files_total is 0.
Example flows
Section titled “Example flows”Transcription session
Section titled “Transcription session”Client Server | -- {"type":"start", ...} -------------> | | <-- {"type":"status","message":"ready"} | | -- [binary PCM chunk] ----------------> | | <-- {"type":"transcription","text":"hola"} | | -- [binary PCM chunk] ----------------> | | <-- {"type":"transcription","text":"hola mundo"} | | -- {"type":"clean"} ------------------> | | <-- {"type":"status","message":"cleaned"} |Model download
Section titled “Model download”Client Server | -- {"type":"download_model","model":"Canary1BV2"} --> | | <-- {"type":"model_action","state":"started", ...} | | <-- {"type":"model_download_progress", ...} | | <-- {"type":"model_download_progress", ...} | | <-- {"type":"model_action","state":"completed", ...} | | <-- {"type":"model_list", ...} | | -- {"type":"load_model","model":"Canary1BV2"} -------> | | <-- {"type":"model_info","model":"Canary1BV2", ...} | | <-- {"type":"model_action","state":"completed", ...} |