Use the same base host for REST and WebSocket in a given environment (for example staging
https://sdp.suki-stage.com and wss://sdp.suki-stage.com). Your partnership team confirms which host and credentials apply.This guide applies to: Direct HTTP and WebSocket integrations with Suki for Partner Ambient, Form filling, and Dictation APIs. Form filling uses the same ambient socket (
GET /ws/stream) with an ambient session ID.What this guide covers
Use this page to understand the end-to-end flow before you implement a client:- What Ambient (and Form filling) and Dictation share
- Where the two products differ (endpoint, messages, results)
- Network and connection rules that affect both
- Stage-by-stage Ambient and Dictation flows
What stays the same
Across Ambient, Form filling, and Dictation:- Authenticate with Partner APIs and obtain an
sdp_suki_token. - Create a session with REST.
- Open a WebSocket Secure (
wss://) connection on the same base host as REST. - Send one UTF-8 JSON text frame per message (exactly one JSON object per frame).
- Put audio bytes in a Base64 string field inside that JSON, not in a binary WebSocket frame.
- Close the socket, then use REST to end the session and retrieve final results as needed.
What differs
High-level architecture
Below is the high-level architecture for Ambient, Form filling, and Dictation flows. Where they differ is the:- Endpoint
- Outbound message contract
- How results come back
Network and connection management
Plan your integration around the following network requirements and connection behaviors.Network requirements
For reliable real-time streaming, Suki recommends these minimums:
Refer to Audio capture and streaming FAQs for the source list.
How do you keep the connection alive
While a stream is paused, send anEVENT message with event: KEEP_ALIVE at least once every five seconds. Ambient streaming allows a maximum pause of 30 minutes.
For related idle-timeout guidance (including the 25 second audio inactivity window), see the Ambient API quickstart and Audio capture and streaming FAQs.
Call duration and reconnection
Ambient- There is no upper limit on call duration while the stream is active.
- You can reopen
GET /ws/streamwith the sameambient_session_idonly while the ambient job is still in theCREATEDstate. If the job has moved to another status (for exampleRUNNING,COMPLETED, orCANCELLED), the handshake fails withFailedPrecondition. - Suki needs a minimum amount of audio to generate content. For calls shorter than 1 minute, Suki may not have enough data, returns empty content, and marks the session as
skipped.
- One Dictation session can support multiple speech sessions over time (for example push-to-talk).
- Open
/ws/transcribeonly when the session isREADYorIDLE. See Stream Dictation audio for the session-state rules.
How streaming works
Choose the tab for your product. Ambient (and Form filling on the same socket) and Dictation share the REST β WebSocket β REST pattern, but use different endpoints and message contracts.- Ambient
- Dictation
Use this path when you already have an ambient session (or a Form filling session on the same socket) and stream to GET /ws/stream.The WebSocket carries live audio and control messages only. After streaming, use ambient REST APIs to end the session, poll status, and retrieve transcripts, notes, and structured data.Open WebSocket
Authenticate with the documented handshake:Send
Send one Send
Send one JSON text frame per chunk. Audio bytes are Base64 PCM in the Optional
When control is needed, send End the stream with
End the stream segment with a final
- Create an ambient session and seed session context with REST.
- Open a WebSocket connection to
GET /ws/stream. - Send one
START_TIMEmessage for the stream segment. - Send one JSON message per audio chunk (Base64 PCM in
data). - Optionally send
EVENTmessages, such asPAUSE,RESUME, orKEEP_ALIVE, when control is needed. - Send the ambient end marker as the final
AUDIOmessage (data:RU9G). - Close the socket, then end the ambient session with REST and retrieve results.
Create the Ambient session and seed context
Create the session with REST, then seed session context before you stream. Do not open the WebSocket until the ambient session exists and context is seeded.Open WebSocket GET /ws/stream
Authenticate with the documented handshake:- Browser
Sec-WebSocket-Protocol:SukiAmbientAuth,<sdp_suki_token>,<ambient_session_id>(token before session ID) - Non-browser headers:
sdp_suki_tokenandambient_session_id
CREATED state. Other statuses return FailedPrecondition.Send START_TIME
Send one START_TIME message for the stream segment before audio chunks. This is required for Ambient in the documented contract.Send AUDIO chunks
Send one JSON text frame per chunk. Audio bytes are Base64 PCM in the data field.Do not:- Send binary WebSocket frames
- Send multiple JSON objects in one frame
- Stream raw audio over HTTP
Optional EVENT messages
When control is needed, send EVENT messages such as PAUSE, RESUME, KEEP_ALIVE, CANCEL, or ABORT. The gateway acts on PAUSE, RESUME, and CANCEL. While paused, send KEEP_ALIVE at least once every five seconds per the documented idle-timeout guidance. Refer to the Audio capture and streaming FAQs for the full event enum.End the stream with RU9G
End the stream segment with a final AUDIO message whose data is RU9G (Base64 of the bytes EOF).Close the socket, then finish with REST
Close the WebSocket, then end the ambient session with REST and retrieve results. Final transcripts and notes are not guaranteed on the WebSocket. Treat REST as the source of truth after streaming.For field-level message shapes, refer to the Ambient tab in WebSocket streaming wire format. For end-of-session steps, refer to Complete the session after streaming.Available tutorials
Ambient
Build an Ambient Streaming Client
Authenticate, create a session, stream PCM audio over WebSocket, and retrieve clinical note results.
Dictation
Build a Dictation Streaming Client
Create a transcription session, stream audio, read partial frames, and print the final transcript.
Form Filling
Build a Form Filling Session Client
Create a Form filling session, send template context, stream audio, and retrieve structured form data.
Next steps
Follow Ambient vs Dictation streaming to compare endpoints, auth, and message contracts. Read Audio capture best practices before you open the WebSocket. Follow Stream ambient audio when you already have an ambient session and need to push live audio on/ws/stream.
Follow Stream Dictation audio when you have a Dictation session and need real-time transcript frames on /ws/transcribe.
Open WebSocket streaming wire format for message types, send order, and chunking.