Skip to main content
GET
cURL
Use this API to stream audio to the speech service over a WebSocket connection for ambient and Form filling sessions. For more information on how to handle the handshake, wire format, message order, and error handling, refer to the Ambient audio streaming guide.

Prerequisites

Complete these steps before opening the WebSocket.
Opening /ws/stream before the session and context are ready often leads to handshake failures or a broken stream.
  • Authenticate and obtain sdp_suki_token
  • Create an ambient session with POST /api/v1/ambient/session/create. A successful create returns 201 Created; keep the ambient_session_id you used or received.
  • Seed session context with POST /api/v1/ambient/session/{ambient_session_id}/context. Send the JSON body your integration requires (see that endpoint for the full schema).
  • Authenticate and open the WebSocket on wss://sdp.suki-stage.com/ws/stream. To stream audio, you must first establish an authenticated WebSocket connection. The authentication method you use depends on your client types: browser or non-browser.

Browser clients

When connecting from a browser, include the Sec-WebSocket-Protocol header as part of the WebSocket handshake. Set the header value as a single comma-separated string. The order must be:
  • Subprotocol name
  • Ambient session ID - Your ambient session ID
  • Token - Your sdp_suki_token
Avoid adding spaces between values unless your client library requires it.
For example:
The server negotiates this subprotocol to establish the connection.

Non-browser clients

For non-browser clients such as mobile apps, backend services, or testing tools, pass authentication details as separate HTTP headers in the WebSocket upgrade request. Do not use the Sec-WebSocket-Protocol header. Include the following headers:
  • 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 - The ID for the current .
If you push non-JSON payloads where the server expects JSON, you can see parse errors (for example invalid character or null byte errors).

Code examples

Authorizations

sdp_suki_token
string
header
required

Suki access token for the authenticated provider. Obtain this by calling Login or Register with a valid partner_token. Pass the suki_token value from the JSON response as the sdp_suki_token header on REST requests and non-browser WebSocket upgrades. Browser WebSocket clients pass the token in Sec-WebSocket-Protocol instead. Tokens expire after one hour; call Login again to refresh.

Headers

Sec-WebSocket-Protocol
string

Required FOR BROWSER CLIENTS ONLY. Sent during WebSocket handshake. Format: 'SukiAmbientAuth,<ambient_session_id>,<sdp_suki_token>' (comma-separated, no spaces required between parts).

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 - Stable identifier for the active provider. Omit for standard partners whose partner_token identifies the user. Required for Bearer partners and Single Auth Token authentication where multiple providers share one partner_token. Use the same provider_id you sent on Login or Register.

Example:

"provider-123"

Response

Switching Protocols - Indicates successful WebSocket handshake.

The response is of type string.

Last modified on June 30, 2026