Skip to main content
GET
cURL
Use this API to stream visit audio over the Partner WebSocket (GET /ws/stream) for Form filling sessions.

Stream Ambient Audio Overview

Ambient Streaming Wire Format

Complete the Ambient Session after Streaming

Pass the ambient_session_id returned by Create Form filling session in the WebSocket handshake.Do not reuse an ambient_session_id from Create ambient session. Both APIs return a field named ambient_session_id, but each ID belongs to a different product session and is not interchangeable.

Prerequisites

Complete these steps before you open the WebSocket.
Opening /ws/stream before the session and context are ready can cause handshake failures or a broken stream.
  • Authenticate and obtain sdp_suki_token.
  • Create a Form filling session with POST /api/v1/form-filling/session/create. Save the ambient_session_id from the 201 Created response.
  • Seed session context (recommended) with POST /api/v1/form-filling/session/{ambient_session_id}/context. Include form_template_id values when you send context.
  • Open the WebSocket at wss://sdp.suki-stage.com/ws/stream (staging) or wss://sdp.suki.ai/ws/stream (production). Use your Form filling ambient_session_id in the handshake.

Browser clients

Send Sec-WebSocket-Protocol during the handshake as one comma-separated string, in this order:
  • Subprotocol name.
  • sdp_suki_token.
  • Form filling session ID (ambient_session_id).
Do not add spaces between values unless your client library requires them.
Example:
The server negotiates this subprotocol to establish the connection.

Non-browser clients

For mobile apps, backend services, or testing tools, pass headers on the WebSocket upgrade request. Do not use Sec-WebSocket-Protocol.
  • sdp_suki_token - Session token from login.
  • sdp_provider_id - Provider identifier. Optional for standard partners; required for Single Auth Token authentication.
  • ambient_session_id - Form filling session ID from Create Form filling session.
Sending non-JSON payloads where the server expects JSON can cause parse errors (for example invalid character or null byte errors).

Full code examples

For end-to-end Form filling streaming examples, start with these tutorials:

Authorizations

sdp_suki_token
string
header
required

Suki access token (suki_token) from Login or Register. Expires after one hour.

Headers

Sec-WebSocket-Protocol
string

Required FOR BROWSER CLIENTS ONLY. Sent during WebSocket handshake. Browsers must use the same subprotocol the grpc-wsproxy maps to Authorization: 'SukiAmbientAuth,<sdp_suki_token>,<ambient_session_id>' (comma-separated; token second, ambient session id third). Other subprotocol names are not mapped and typically yield 401.

ambient_session_id
string
required

Required for non-browser clients only. Session UUID from Create Ambient Session or Create Form filling Session.

sdp_provider_id
string

Optional for standard partners.

Required for:

  • Bearer authentication. Use the same provider_id returned by the Login or Register API.
  • Single Auth Token authentication. Include the same provider_id on every request as sdp_provider_id.
Example:

"provider-123"

Response

Switching Protocols - Indicates successful WebSocket handshake.

The response is of type string.

Last modified on August 10, 2026