Endpoint
model query parameter is optional.
If
session.update.session.model is omitted, the server uses the model query parameter. If both are omitted, the server uses lilac.Session lifecycle
1
Open the WebSocket
Connect to
wss://realtime.camb.ai/v1/realtime. Send your API key in the x-api-key request header when your WebSocket client supports custom headers.2
Send `session.update` first
The first WebSocket message must be a JSON
session.update event. The server waits up to 10 seconds for this initial event.3
Wait for session activation
After authorization and activation, the server sends
session.created, followed by session.updated.4
Stream microphone audio
Send base64-encoded audio chunks with
input_audio_buffer.append. The server forwards decoded audio bytes into the realtime pipeline.5
Read realtime output
The server emits completed input transcripts, translated text deltas, final translated text, translated audio chunks, and audio completion events.
Authentication
Prefer thex-api-key WebSocket request header.
session.update event.
If the request header and
auth object are both present, the request header credential is used.Limits
Session configuration
Send the active session settings insession.update.session.
Client events
session.update
Initializes the realtime session. This must be the first client event.
session.update is recognized but not supported. The server responds with an error event.
input_audio_buffer.append
Appends audio bytes to the realtime input stream.
audio and forwards the decoded bytes into the realtime pipeline. Each decoded payload can be up to 256 KiB.
Unsupported client events
These events are recognized so clients can receive a structured error instead of silent failure.input_audio_buffer.clear
input_audio_buffer.clear
input_audio_buffer.commit
input_audio_buffer.commit
response.cancel
response.cancel
Server events
Session events
session.created includes the durable realtime session ID.
session.updated confirms the active session configuration.
Transcript and response events
Errors and billing stops
The server sendserror for recognized but unsupported client events.
error event whose error.message is the billing close reason, then ends the realtime loop. Active sessions are charged in billing windows and finalized on close, failure, or billing stop.