WebSockets
The channel for streaming audio and receiving transcription results.
Connect to wss://in.api.murf.ai/v1/transcription/stream-input and
authenticate with your API key (query or header). See bindings below.
Speech to Text (Beta) is available in the India region only. Connect to wss://in.api.murf.ai/v1/transcription/stream-input.
Handshake
Headers
Your Murf API key (hyphenated header name).
Query parameters
Your Murf API key. Required unless you send the api-key header.
Language of the audio. One of en_IN (English, India), as (Assamese), bn (Bengali), gu (Gujarati), hi (Hindi), kn (Kannada), ml (Malayalam), mr (Marathi), or (Odia), pa (Punjabi), ta (Tamil), te (Telugu); auto (default) to detect from every supported language; or a comma-separated list such as hi,en_IN to detect from a smaller set. Each value also accepts the India region, for example hi_IN or en-IN.
Comma-separated words or phrases to boost during recognition. URL-encode spaces (for example voice%20clone).
How strongly to boost keywords. Higher values increase their influence.
Set to true to format numbers and similar terms in Hindi and English (India) transcripts. Has no effect for other languages.
Coming soon. commit_mode=auto will end a turn when the caller stops speaking. Accepted today but ignored. A turn ends only when you send Finalize or CloseStream.
Coming soon. bvc=true will remove background voices before transcription. Accepted today but ignored.
Send
Optional. Send once, as the first text message, before any binary audio. If omitted, the server expects 16-bit PCM, 16 kHz, mono.
Binary WebSocket frames, encoded as declared in AudioConfig (or raw 16-bit PCM, 16 kHz, mono if no AudioConfig was sent). For Opus, send one Opus packet per frame, without an Ogg or WebM container.
Flush pending speech immediately and send a final message with rawEvent.event set to EndOfTurn and rawEvent.trigger set to manual. The connection stays open; audio sent afterwards starts the next turn. rawEvent.turn_index goes up by one, rawEvent.sequence_id keeps counting, and audio_window_start / audio_window_end stay relative to the start of the session.
Flush pending speech, send a final message if a turn is still open, then close the WebSocket with code 1000.
Receive
Sent while the caller is speaking. Each partial contains the whole turn up to that point, so replace the text you are showing instead of appending to it. Word timestamps are not included.
Sent after Finalize or CloseStream. Use transcript as the caller’s utterance, and read rawEvent.words for word timestamps. If there was no pending speech, transcript is empty.
Sent immediately before the server closes the WebSocket. The close code identifies the cause: 4001 invalid or missing API key; 4002 invalid audio config, undecodable audio, invalid JSON, or invalid query parameter; 4003 insufficient credits at connect; 4004 concurrency limit reached; 4005 credits exhausted mid-session; 4006 API key revoked mid-session; 4008 no audio or KeepAlive (initial_timeout or idle_timeout); 4010 billing service unreachable at connect; 4011 speech detection unavailable at connect.