Streaming

WebSocket protocol

Authentication, client messages, server events, and audio requirements for realtime transcription.

Connect to:

wss://api.orbitalsai.com/api/v1/streaming/transcribe?token=<API_KEY>

Send PCM16 little-endian, mono audio at 16 kHz as binary frames. Send control messages as JSON text frames.

Client messages

Configure the session after receiving ready:

{
  "type": "config",
  "language": "hausa",
  "sample_rate": 16000,
  "return_timestamps": true,
  "translate": false
}

To enable translation, set translate to true and provide target_language. Optional fields include translation_domain and translation_window_ms.

When the audio source ends, send {"type":"flush"} and wait for flushed before closing.

Server events

EventMeaning
readyThe connection is authenticated and ready.
speech_start / speech_endVoice activity state changed.
partialReplaceable transcript draft.
finalStable transcript segment; may include word timestamps when requested.
translationTranslation for one or more finalized segment IDs.
translation_failedTranslation failed; the source final remains valid.
flushedBuffered audio has been finalized.
errorThe session cannot process a request or continue.

See Realtime transcription, Realtime translation, and the Python realtime SDK.

On this page