connected status message, then send
base64-encoded audio chunks.
Connect
The endpoint is:account_id plus
token query parameters. Never place a permanent API key in a URL or browser
bundle.
The SDKs create short-lived streaming tokens but do not manage the WebSocket or
audio capture. Use the WebSocket library appropriate for your application.
SDK
These server-side examples use the Sully SDK for token creation and a WebSocket library for the connection.Query parameters
Example URL before URL encoding:
Wait for readiness
Do not send audio immediately after the WebSocket opens. Wait for:Send audio
Each WebSocket message is JSON with a base64-encoded audio chunk:encoding and sample_rate declared at connection time.
For linear16, send signed 16-bit little-endian PCM. Small, consistently paced
chunks—about 50–200 ms of audio—work well for live capture.
Malformed messages are ignored so that a later valid audio frame can continue the
session.
Receive transcripts
Partial and final results share one shape:is_final as the canonical finality field. isFinal is included for
compatibility. Timing values may be null, and word objects can contain additional
normalized metadata. Render partial text as provisional and replace it
when a final segment arrives.
Errors and reconnects
The server can send an error message before closing:
A session can last up to two hours. A network or service interruption ends the
current session; reconnecting creates a new session.
Usage behavior
Billable streaming time starts when the server sendsconnected, not when the
WebSocket transport opens. Idle time after readiness counts. Time spent starting
transcription and draining final results after audio closes does not count.