Streaming API
Main channel for bi-directional audio and transcription data
HandshakeTry it
WSS
wss://streaming.assemblyai.com/v3/ws
Headers
Authorization
Use your API key for authentication, or alternatively generate a temporary token and pass it via the token
query parameter.
Query parameters
sample_rate
Sample rate of the audio stream
encoding
Encoding of the audio stream
Allowed values:
token
API token for authentication
format_turns
Whether to return formatted final transcripts
Allowed values:
end_of_turn_confidence_threshold
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_confident
The minimum amount of silence in milliseconds required to detect end of turn when confident
max_turn_silence
The maximum amount of silence in milliseconds allowed in a turn before end of turn is triggered
Send
sendAudio
Send audio data chunks for transcription. The payload must be of type bytes and contain audio data between 50ms and 1000ms in length.
OR
sendUpdateConfiguration
Update streaming configuration parameters during an active session.
OR
sendForceEndpoint
Manually force an endpoint in the transcription.
OR
sendSessionTermination
Gracefully terminate the streaming session.
Receive
receiveSessionBegins
Receive confirmation that the streaming session has successfully started.
OR
receiveTurn
Receive a formatted turn-based transcription result.
OR
receiveTermination
Receive confirmation that the session has been terminated by the server.