Streaming Speech-to-Text

HandshakeTry it

GET
wss://api.assemblyai.com/v2/realtime/ws

Headers

AuthorizationstringOptional

Authenticate using your AssemblyAI API key

Query parameters

sample_rateintegerRequired

The sample rate of the streamed audio

word_booststringOptional

Add up to 2500 characters of custom vocabulary. The parameter value must be a JSON encoded array of strings. The JSON must be URL encoded like other query string parameters.

encodingenumOptionalDefaults to pcm_s16le

The encoding of the audio data

Allowed values:
tokenstringOptionalformat: "password"

Authenticate using a generated temporary token

disable_partial_transcriptsbooleanOptionalDefaults to false

Set to true to not receive partial transcripts. Defaults to false.

enable_extra_session_informationbooleanOptionalDefaults to false

Set to true to receive the SessionInformation message before the session ends. Defaults to false.

Send

Audio DatastringRequiredformat: "binary"
OR
Terminate SessionobjectRequired
OR
Force End UtteranceobjectRequired
OR
Configure End Utterance Silence ThresholdobjectRequired

Receive

Session BeginsobjectRequired
OR
Partial TranscriptobjectRequired
OR
Final TranscriptobjectRequired
OR
Session InformationobjectRequired
OR
Session TerminatedobjectRequired
OR
Realtime ErrorobjectRequired