{}{
"type": "<string>"
}{
"type": "<string>"
}{
"type": "<string>",
"session_id": "<string>",
"model_type": "<string>",
"sample_rate": 123,
"mode": "<string>",
"style": "<string>",
"audio_format": "<string>",
"max_duration_seconds": 123
}{
"type": "<string>",
"text": "<string>"
}{
"type": "<string>",
"text": "<string>",
"audio_seconds": 123
}{
"type": "<string>",
"seconds_remaining": 123
}{
"type": "<string>",
"code": 123,
"message": "<string>"
}ASR WebSocket
Streaming speech to text. After the connection opens, the server sends session.started. Send audio as binary frames in the declared audio_format, as you capture it. The server sends transcript.delta events with new text as it is recognized. Send input.done after the last frame: the server sends transcript.done with the complete transcript and closes with code 1000.
Send keepalive while you have no audio, so the session is not closed as idle. A session lasts at most max_duration_seconds (from session.started); session.expiring arrives about a minute before the limit.
Billing is 1.5 credits per second of audio sent, charged periodically during the session and settled when it closes. Each open session uses one speech-to-text concurrency slot until it closes.
Authenticate with the chariotai-api-key header, or with the api_key query parameter when your client cannot set handshake headers.
Terminal errors send an error event whose code matches the close code that follows: 1008 for an auth problem, an invalid parameter, a product not on your plan, or the idle timeout; 1011 for a server error or a language, mode, or style that cannot be served right now; 4402 for insufficient credits; 4413 when the session reaches its maximum duration; and 4429 for the concurrency limit. An error event without a code concerns one message, and the session continues.
{}{
"type": "<string>"
}{
"type": "<string>"
}{
"type": "<string>",
"session_id": "<string>",
"model_type": "<string>",
"sample_rate": 123,
"mode": "<string>",
"style": "<string>",
"audio_format": "<string>",
"max_duration_seconds": 123
}{
"type": "<string>",
"text": "<string>"
}{
"type": "<string>",
"text": "<string>",
"audio_seconds": 123
}{
"type": "<string>",
"seconds_remaining": 123
}{
"type": "<string>",
"code": 123,
"message": "<string>"
}GET
A binary WebSocket frame of raw audio in the declared audio_format. No file header, JSON, or base64. Any frame size works; about 100 ms per frame is a good default.
Keeps the session open while you have no audio to send. Resets the idle timer. No reply.
No more audio is coming. The server transcribes the rest, sends transcript.done, and closes with code 1000. Audio sent afterwards is not transcribed.
The session is ready for audio. Sent once, first, with the settings in effect.
New text, as it is recognized. Append it to the text so far; spaces are included. Use transcript.done for the final text.
The complete transcript, sent once after input.done. The connection then closes with code 1000.
The session reaches max_duration_seconds soon. Sent once, about a minute before the limit. At the limit the session closes with 4413.
An error. With a code, it is terminal and the connection closes with that code. Without a code, it concerns one message (invalid JSON or an unknown message type) and the session continues.