Skip to main content
This guide explains how to stream live audio to GET /ws/stream after creating an ambient session. The WebSocket is responsible only for streaming audio and receiving control messages. Use the ambient REST APIs to:
  • End the session after streaming
  • Poll session status and retrieve transcripts, notes, and structured data
For related guides:

Click Each Button to Learn More

How Ambient streaming works

Suki for Partners ambient streaming works as follows:
  1. Create an Ambient session and Seed session context.
  2. Open a WebSocket connection to GET /ws/stream.
  3. Send one START_TIME message for the stream segment.
  4. Send one JSON message per audio chunk.
  5. Optionally send EVENT messages, such as PAUSE, RESUME, or KEEP_ALIVE, when control is needed.
  6. Send the ambient end marker as the final AUDIO message.
  7. Close the socket, then use End ambient session to end the session and retrieve results.
Ambient streaming uses JSON text frames. Do not send raw binary audio frames to this endpoint.

Send JSON text frames

Every message you send on /ws/stream must be a UTF-8 JSON text frame.
  • Each WebSocket frame must contain exactly one JSON object.
  • Each client send should contain one logical message.
  • Audio bytes go inside a JSON string field, not in a binary WebSocket frame.
Do not:
  • Send binary WebSocket frames.
  • Send multiple JSON objects in one frame.
  • Stream raw audio through HTTP, for example with Content-Type: application/json.
If the server receives non-JSON payloads, it returns parsing errors, such as invalid character or null byte errors.

Audio streaming recommendations

Sample Rate of 16 kHz

Suki streams audio at 16 kHz, which captures the full range of clinical speech.

Mono Channel

Send a single mono channel of audio, not stereo or multi-channel.

LINEAR16 Encoding

Encode as LINEAR16 (PCM signed 16-bit little-endian). Remove WAV headers or decode to raw PCM before you send.

Audio Chunk Size of 100 ms

Suki supports 100 ms chunks to balance recognition quality, latency, and efficiency. At 16 kHz mono 16-bit, that is about 3200 bytes of raw PCM per chunk.

Stream at Real-Time Speed

Pace audio chunks to match their actual duration and stream at or near real time, rather than sending buffered audio as fast as possible.
For encoding steps and the message order, see WebSocket streaming wire format. For capture guidance before you open the socket, see Audio capture best practices.

References

Wire Format

Ambient message types (START_TIME, AUDIO, EVENT, RU9G), required order, example flow, and audio format and chunking.

Audio Capture Best Practices

Capture format, environment, gain, and network readiness before you stream.

Complete the Session

Close the socket, end the session with REST, fetch results, and use the streaming error reference.

Ambient Client Code Example

End-to-end Python, TypeScript, and Go example: login, create session, seed context, stream, and handle errors.

Audio Streaming API

Endpoint reference, handshake details, and API code samples for GET /ws/stream.

Available tutorials

Ambient

Build an Ambient Streaming Client

Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.

20 minIntermediate

Next steps

Open the ambient tab in WebSocket streaming wire format Follow Complete the session after streaming Copy the Ambient WebSocket client code example
Last modified on July 24, 2026