Streaming API

Main channel for bi-directional audio and transcription data

HandshakeTry it

WSS
wss://streaming.assemblyai.com/v3/ws

Headers

AuthorizationstringOptional

Use your API key for authentication, or alternatively generate a temporary token and pass it via the token query parameter.

Query parameters

sample_ratestringRequired
Sample rate of the audio stream
encodingenumOptionalDefaults to pcm_s16le
Encoding of the audio stream
Allowed values:
tokenstringOptional
API token for authentication
format_turnsenumOptionalDefaults to false
Whether to return formatted final transcripts
Allowed values:
end_of_turn_confidence_thresholdstringOptionalDefaults to 0.7

The confidence threshold (0.0 to 1.0) to use when determining if the end of a turn has been reached

min_end_of_turn_silence_when_confidentstringOptionalformat: "ms"Defaults to 160
The minimum amount of silence in milliseconds required to detect end of turn when confident
max_turn_silencestringOptionalformat: "ms"Defaults to 2400
The maximum amount of silence in milliseconds allowed in a turn before end of turn is triggered

Send

sendAudioanyRequired
Send audio data chunks for transcription. The payload must be of type bytes and contain audio data between 50ms and 1000ms in length.
OR
sendUpdateConfigurationobjectRequired
Update streaming configuration parameters during an active session.
OR
sendForceEndpointobjectRequired
Manually force an endpoint in the transcription.
OR
sendSessionTerminationobjectRequired
Gracefully terminate the streaming session.

Receive

receiveSessionBeginsobjectRequired
Receive confirmation that the streaming session has successfully started.
OR
receiveTurnobjectRequired

Receive a formatted turn-based transcription result.

OR
receiveTerminationobjectRequired
Receive confirmation that the session has been terminated by the server.