Skip to navigation

WebSockets

The channel for sending TTS requests and receiving audio responses. Use this WebSocket endpoint to stream text and receive audio in real time.

Synthesize speech with ultra-low latency over a websocket connection. This endpoint serves the Falcon model only.

Choose the Base URL from a table below (Global URL or a Region URL)

Note: Global URL auto-routes to the nearest region. Use it unless you have a data-residency requirement. api.murf.ai is a legacy alias that always resolves to us-east and does not geo-route.

RegionURLDefault Concurrency
Global (Routes to the nearest server)wss://global.api.murf.ai/v1/speech/stream-inputRegion specific concurrency
US-Eastwss://us-east.api.murf.ai/v1/speech/stream-input5
US-Westwss://us-west.api.murf.ai/v1/speech/stream-input2
Indiawss://in.api.murf.ai/v1/speech/stream-input2
Canadawss://ca.api.murf.ai/v1/speech/stream-input2
South Koreawss://kr.api.murf.ai/v1/speech/stream-input2
UAEwss://me.api.murf.ai/v1/speech/stream-input2
Japanwss://jp.api.murf.ai/v1/speech/stream-input2
Australiawss://au.api.murf.ai/v1/speech/stream-input2
EU (Central)wss://eu-central.api.murf.ai/v1/speech/stream-input2
UKwss://uk.api.murf.ai/v1/speech/stream-input2
South America (São Paulo)wss://sa-east.api.murf.ai/v1/speech/stream-input2

Handshake

WSS
wss://global.api.murf.ai/v1/speech/stream-input

Headers

api_keystringOptional
Your Murf API key.

Query parameters

api_keystringOptional

Your Murf API key. Also accepted as api-key, or as an api-key header. A rejected key completes the HTTP upgrade and then closes the connection with code 1008 (policy violation) — it is not an HTTP 401.

modelenumOptionalDefaults to falcon-2

Only falcon-2 is served over WebSocket (aliases falcon2, falcon are accepted, case-insensitive). Gen2 is not available on this endpoint.

Allowed values:
sample_rateintegerOptionalDefaults to 24000
Valid values are 8000, 24000, 44100, 48000.
channel_typestringOptionalDefaults to MONO
The channel type for audio output. Valid values are MONO and STEREO.
formatstringOptionalDefaults to WAV

Audio format of the output. Valid values are WAV, MP3, FLAC, ALAW, ULAW, PCM. Use PCM to receive headerless little-endian 16-bit samples, avoiding the placeholder WAV header on the first chunk.

Send

setVoiceConfigurationOrInitializeContextobjectRequired
OR
sendTextobjectRequired
OR
setAdvancedSettingsobjectRequired
OR
clearContextobjectRequired

Receive

audioOutputobjectRequired
OR
timestampOutputobjectRequired
OR
finalOutputobjectRequired
OR
warningOutputobjectRequired
OR
errorOutputobjectRequired