Skip to navigation

WebSockets

Murf TTS API supports WebSocket streaming, enabling low-latency, bidirectional communication over a persistent connection. It’s designed for building responsive voice experiences like interactive voice agents, live conversations, and other real-time applications.

New: Pass model = falcon-2 to use our Falcon 2 model in text-to-speech streaming endpoints, designed for ultra-low latency (~100 ms). WebSocket streaming supports Falcon only.

With a single WebSocket connection, you can stream text input and receive synthesized audio continuously, without the overhead of repeated HTTP requests. This makes it ideal for use cases where your application sends or receives text in chunks and needs real-time audio to deliver a smooth, conversational experience.

Simple WebSocket Connection

Endpoint

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

global geo-routes your connection to the nearest datacenter. Use it unless you have a data-residency requirement, in which case pin to a regional host such as wss://in.api.murf.ai/v1/speech/stream-input — see Available Regions for the full list.

api.murf.ai is a legacy alias that always resolves to us-east and does not geo-route. Note also that /v1/speech/stream-input is the WebSocket path; /v1/speech/stream is the HTTP streaming endpoint.

Quickstart

This guide walks you through setting up and making your first WebSocket streaming request.

1

Getting Started

Generate an API key here. Store the key in a secure location, as you’ll need it to authenticate your requests. You can optionally save the key as an environment variable in your terminal.

# Export an environment variable on macOS or Linux systems
export MURF_API_KEY="your_api_key_here"
2

Install required packages

This guide uses the websockets and pyaudio Python packages. The websockets package is essential for the core functionality.

Note: pyaudio is used in this quickstart guide to demonstrate playing the audio received from the WebSocket. However, it is not required to use Murf WebSockets if you have a different method for handling or playing the audio stream.

pyaudio depends on PortAudio, you may need to install it first.

PyAudio depends on PortAudio, a cross-platform audio I/O library. You may need to install PortAudio separately if it’s not already on your system.

brew install portaudio

Once you have installed PortAudio, you can install the required Python packages using the following command:

Install Python packages
pip install websockets pyaudio
3

Streaming Text and Playing Synthesized Audio

import asyncio
import websockets
import json
import base64
import pyaudio
# import os
API_KEY = "YOUR_API_KEY" # Or use os.getenv("MURF_API_KEY") if you have set the API key as an environment variable
WS_URL = "wss://global.api.murf.ai/v1/speech/stream-input"
CONTEXT_ID = "quickstart-1"
PARAGRAPH = "With a single WebSocket connection, you can stream text input and receive synthesized audio continuously, without the overhead of repeated HTTP requests. This makes it ideal for use cases where your application sends or receives text in chunks and needs real-time audio to deliver a smooth, conversational experience"
# Audio format settings (must match your API output)
SAMPLE_RATE = 24000
CHANNELS = 1
FORMAT = pyaudio.paInt16
async def tts_stream():
async with websockets.connect(
f"{WS_URL}?api-key={API_KEY}&model=falcon-2&sample_rate=24000&channel_type=MONO&format=WAV"
) as ws:
# Send voice config first, before any text
voice_config_msg = {
"voice_config": {
"voiceId": "Gordon",
"locale":"en-US",
"style": "Conversation",
"rate": 0,
"pitch": 0
},
"context_id": CONTEXT_ID
}
print(f'Sending payload : {voice_config_msg}')
await ws.send(json.dumps(voice_config_msg))
# Use the same context ID on the text frame
text_msg = {
"text": PARAGRAPH,
"end": True, # This closes the context and frees its concurrency slot
"context_id": CONTEXT_ID
}
print(f'Sending payload : {text_msg}')
await ws.send(json.dumps(text_msg))
# Setup audio stream
pa = pyaudio.PyAudio()
stream = pa.open(format=FORMAT, channels=CHANNELS, rate=SAMPLE_RATE, output=True)
first_chunk = True
try:
while True:
response = await ws.recv()
data = json.loads(response)
print(f'Received data: {data}')
if "audio" in data:
audio_bytes = base64.b64decode(data["audio"])
# Only the first chunk of a context carries the WAV header
if first_chunk and len(audio_bytes) > 44:
audio_bytes = audio_bytes[44:]
first_chunk = False
stream.write(audio_bytes)
if data.get("error"):
print(f'Error {data["error_code"]}: {data["error"]}')
if data.get("fatal"):
break
if data.get("warning"):
print(f'Warning {data["warning_code"]}: {data["warning"]}')
if data.get("final"):
break
finally:
stream.stop_stream()
stream.close()
pa.terminate()
if __name__ == "__main__":
asyncio.run(tts_stream())

Choosing a voice

Choose a voice from the Falcon 2 Supported Voices section.

What matters is that the voice exists in the Falcon catalog. An unknown voice returns an INVALID_VOICE error with "fatal": true, and the message points you to GET /v1/speech/voices?model=FALCON.

Using voice settings with Context IDs

A context_id does not alter the values in voice_config; it determines which independent context owns those settings. If you include a context_id on a text frame, send a voice_config frame with the same context_id first.

A configuration sent without context_id belongs only to the default context, so named contexts do not inherit it. Text sent to an unconfigured named context uses the default voice and produces a NO_VOICE_CONFIG warning. The context keeps its configured settings for its lifetime, even if you later change the default context’s configuration.

For a single default stream, you can omit context_id from both frames. See Context ID for multi-turn and interruption examples.

Audio format and the WAV header

With format=WAV, the first audio chunk of a context starts with a 44-byte WAV header whose RIFF-size and data-size fields are 0xFFFFFFFF — the “length unknown, read to end of stream” sentinel — because the total length isn’t known mid-stream. Only the first chunk has it.

  • Playing progressively: feed the bytes straight to a streaming decoder. It honours the sentinel.
  • Saving to a file: strip the first 44 bytes, concatenate the rest, then write your own header with the real length. Otherwise players show a bogus duration and can’t seek.
  • Avoiding it entirely: request format=PCM for headerless little-endian 16-bit samples.

Field naming

Request fields accept both snake_case and camelCase (context_id/contextId, min_buffer_size/minBufferSize, max_buffer_delay_in_ms/maxBufferDelayInMs, predictive_chunking/predictiveChunking, add_word_timestamps/addWordTimestamps). Responses are always snake_case.

Note that voice_config itself uses camelCase inside (voiceId, volumeOffset, and other voice settings), which is why both spellings are accepted at the top level.

predictive_chunking, min_buffer_size, max_buffer_delay_in_ms and add_word_timestamps are top-level siblings of text, not members of voice_config. Nesting them inside voice_config fails silently. See Advanced Settings.

Machine-readable schema

Every frame, field and query parameter is defined in the WebSockets API reference, generated from our AsyncAPI document. Use it when generating a client.

Falcon 2 Supported Voices

Voice IDSupported LocalesVoice Styles
Aliciaen-US (English - US & Canada)Conversation
Alinaen-US (English - US & Canada)Conversation
Amaraen-US (English - US & Canada)Conversation
Arianaen-US (English - US & Canada)Conversation
Caleben-US (English - US & Canada)Conversation
Daisyen-US (English - US & Canada)Conversation
Danielen-US (English - US & Canada)Conversation
Edmunden-US (English - US & Canada)Conversation
Ezekielen-US (English - US & Canada)Conversation
Gordonen-US (English - US & Canada)Conversation
Granten-US (English - US & Canada)Conversation
Jonathanen-US (English - US & Canada), tr-TR (Turkish - Turkey)Conversation
Josieen-US (English - US & Canada)Conversation
Judithen-US (English - US & Canada)Conversation
Lunaen-US (English - US & Canada)Conversation
Madisonen-US (English - US & Canada)Conversation
Matthewen-US (English - US & Canada)Conversation
Michelleen-US (English - US & Canada)Conversation
Milesen-US (English - US & Canada)AIAgent, Customer Support Agent
Mollyen-US (English - US & Canada)Conversation
Natalieen-US (English - US & Canada)Conversation
Wayneen-US (English - US & Canada)Conversation
Willen-US (English - US & Canada)Conversation
Zionen-US (English - US & Canada)Conversation
Bertieen-US (English - US & Canada), en-UK (English - UK), tr-TR (Turkish - Turkey)Conversation
Blazejen-US (English - US & Canada), pl-PL (Polish - Poland)Conversation
Carlosen-US (English - US & Canada), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), es-MX (Spanish - Mexico), fr-FR (French - France), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), th-TH (Thai - Thailand), tl-PH (Tagalog - Philippines)Conversation
Carmenen-US (English - US & Canada), es-ES (Spanish - Spain)Conversation
Elviraen-US (English - US & Canada)Conversation
Heidien-US (English - US & Canada), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-UK (English - UK), es-MX (Spanish - Mexico), nl-BE (Dutch - Belgium), sv-SE (Swedish - Sweden), tl-PH (Tagalog - Philippines), tr-TR (Turkish - Turkey)Conversation
Isadoraen-US (English - US & Canada), pt-BR (Portuguese - Brazil)Conversation
Joshuaen-US (English - US & Canada), en-UK (English - UK), es-MX (Spanish - Mexico), fr-FR (French - France)Conversation
Laraen-US (English - US & Canada), de-DE (German - Germany), es-MX (Spanish - Mexico)Conversation
Merelen-US (English - US & Canada), nl-NL (Dutch - Netherlands)Conversation
Nimishaen-US (English - US & Canada), en-IN (English - India), ml-IN (Malayalam - India)Conversation
Voice IDSupported LocalesVoice Styles
Benedicten-UK (English - UK)Conversation
Bertieen-UK (English - UK), en-US (English - US & Canada), tr-TR (Turkish - Turkey)Conversation
Freddieen-UK (English - UK)Conversation
Hazelen-UK (English - UK)Conversation
Heidien-UK (English - UK), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-US (English - US & Canada), es-MX (Spanish - Mexico), nl-BE (Dutch - Belgium), sv-SE (Swedish - Sweden), tl-PH (Tagalog - Philippines), tr-TR (Turkish - Turkey)Conversation
Hugoen-UK (English - UK)Conversation
Joshuaen-UK (English - UK), en-US (English - US & Canada), es-MX (Spanish - Mexico), fr-FR (French - France)Conversation
Julieten-UK (English - UK)Conversation
Lydiaen-UK (English - UK)Conversation
Masonen-UK (English - UK)Conversation
Pearlen-UK (English - UK)Conversation
Rubyen-UK (English - UK)Conversation
Sharonen-UK (English - UK)Conversation
Theoen-UK (English - UK)Narration
Voice IDSupported LocalesVoice Styles
Aaraven-IN (English - India), hi-IN (Hindi - India)Conversation
Abhinaven-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India), mr-IN (Marathi - India), tr-TR (Turkish - Turkey)Conversation
Anishaen-IN (English - India), as-IN (Assamese - India), bn-IN (Bangla - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), pa-IN (Punjabi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Anushaen-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), te-IN (Telugu - India)Conversation
Nikhilen-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India)Conversation
Poojaen-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), id-ID (Indonesian - Indonesia), kn-IN (Kannada - India), ms-MY (Malay - Malaysia), ta-IN (Tamil - India), te-IN (Telugu - India), vi-VN (Vietnamese - Vietnam)Conversation
Priyaen-IN (English - India), hi-IN (Hindi - India)Conversation
Samaren-IN (English - India), ar-XA (Arabic - XA), as-IN (Assamese - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India), mr-IN (Marathi - India), or-IN (Odia - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Hardiken-IN (English - India), gu-IN (Gujarati - India), te-IN (Telugu - India)Conversation
Nimishaen-IN (English - India), en-US (English - US & Canada), ml-IN (Malayalam - India)Conversation
Prathameshen-IN (English - India), gu-IN (Gujarati - India), mr-IN (Marathi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Voice IDSupported LocalesVoice Styles
Harperen-AU (English - Australia)Conversation
Ivyen-AU (English - Australia)Conversation
Jimmen-AU (English - Australia)Conversation
Leytonen-AU (English - Australia)Conversation
Sophiaen-AU (English - Australia)Narration
Voice IDSupported LocalesVoice Styles
Adéliefr-FR (French - France)Conversation
Axelfr-FR (French - France), es-MX (Spanish - Mexico)Conversation
Guillaumefr-FR (French - France)Conversation
Justinefr-FR (French - France)Conversation
Carlosfr-FR (French - France), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-US (English - US & Canada), es-MX (Spanish - Mexico), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), th-TH (Thai - Thailand), tl-PH (Tagalog - Philippines)Conversation
Diyafr-FR (French - France), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), gu-IN (Gujarati - India), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ml-IN (Malayalam - India), mr-IN (Marathi - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Joshuafr-FR (French - France), en-UK (English - UK), en-US (English - US & Canada), es-MX (Spanish - Mexico)Conversation
Voice IDSupported LocalesVoice Styles
Alexisfr-CA (French - Canada)Conversation
Clémentfr-CA (French - Canada)Conversation
Voice IDSupported LocalesVoice Styles
Björnde-DE (German - Germany), vi-VN (Vietnamese - Vietnam)Conversation
Josephinede-DE (German - Germany)Conversation
Larade-DE (German - Germany), en-US (English - US & Canada), es-MX (Spanish - Mexico)Conversation
Matthiasde-DE (German - Germany)Conversation
Ralfde-DE (German - Germany)Conversation
Carlosde-DE (German - Germany), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), en-US (English - US & Canada), es-MX (Spanish - Mexico), fr-FR (French - France), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), th-TH (Thai - Thailand), tl-PH (Tagalog - Philippines)Conversation
Diyade-DE (German - Germany), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), fr-FR (French - France), gu-IN (Gujarati - India), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ml-IN (Malayalam - India), mr-IN (Marathi - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Heidide-DE (German - Germany), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), en-UK (English - UK), en-US (English - US & Canada), es-MX (Spanish - Mexico), nl-BE (Dutch - Belgium), sv-SE (Swedish - Sweden), tl-PH (Tagalog - Philippines), tr-TR (Turkish - Turkey)Conversation
Javierde-DE (German - Germany), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania)Conversation
Voice IDSupported LocalesVoice Styles
Carloses-MX (Spanish - Mexico), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-US (English - US & Canada), fr-FR (French - France), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), th-TH (Thai - Thailand), tl-PH (Tagalog - Philippines)Conversation
Luisaes-MX (Spanish - Mexico)Conversation
Valeriaes-MX (Spanish - Mexico)Conversation
Axeles-MX (Spanish - Mexico), fr-FR (French - France)Conversation
Heidies-MX (Spanish - Mexico), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-UK (English - UK), en-US (English - US & Canada), nl-BE (Dutch - Belgium), sv-SE (Swedish - Sweden), tl-PH (Tagalog - Philippines), tr-TR (Turkish - Turkey)Conversation
Javieres-MX (Spanish - Mexico), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), es-ES (Spanish - Spain), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania)Conversation
Joshuaes-MX (Spanish - Mexico), en-UK (English - UK), en-US (English - US & Canada), fr-FR (French - France)Conversation
Laraes-MX (Spanish - Mexico), de-DE (German - Germany), en-US (English - US & Canada)Conversation
Voice IDSupported LocalesVoice Styles
Carmenes-ES (Spanish - Spain), en-US (English - US & Canada)Conversation
Javieres-ES (Spanish - Spain), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), es-MX (Spanish - Mexico), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania)Conversation
Voice IDSupported LocalesVoice Styles
Angeloit-IT (Italian - Italy)Conversation
Gretait-IT (Italian - Italy)Conversation
Vincenzoit-IT (Italian - Italy)Conversation
Carlosit-IT (Italian - Italy), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), en-US (English - US & Canada), es-MX (Spanish - Mexico), fr-FR (French - France), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), th-TH (Thai - Thailand), tl-PH (Tagalog - Philippines)Conversation
Diyait-IT (Italian - Italy), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), fr-FR (French - France), gu-IN (Gujarati - India), id-ID (Indonesian - Indonesia), ml-IN (Malayalam - India), mr-IN (Marathi - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Javierit-IT (Italian - Italy), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), es-ES (Spanish - Spain), es-MX (Spanish - Mexico), id-ID (Indonesian - Indonesia), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania)Conversation
Voice IDSupported LocalesVoice Styles
Beníciopt-BR (Portuguese - Brazil)Conversation
Eloapt-BR (Portuguese - Brazil)Conversation
Gustavopt-BR (Portuguese - Brazil)Conversation
Heitorpt-BR (Portuguese - Brazil)Conversation
Isadorapt-BR (Portuguese - Brazil), en-US (English - US & Canada)Conversation
Silviopt-BR (Portuguese - Brazil)Conversation
Yagopt-BR (Portuguese - Brazil)Conversation
Voice IDSupported LocalesVoice Styles
Jiaozh-CN (Mandarin - China), vi-VN (Vietnamese - Vietnam)Conversation
Taozh-CN (Mandarin - China)Conversation
Weizh-CN (Mandarin - China)Conversation
Yuxanzh-CN (Mandarin - China)Conversation
Voice IDSupported LocalesVoice Styles
Dirknl-NL (Dutch - Netherlands)Conversation
Famkenl-NL (Dutch - Netherlands)Conversation
Merelnl-NL (Dutch - Netherlands), en-US (English - US & Canada)Conversation
Voice IDSupported LocalesVoice Styles
Amanhi-IN (Hindi - India)Conversation
Ayushihi-IN (Hindi - India), gu-IN (Gujarati - India), hi-LATN (Hinglish - India), te-IN (Telugu - India)Conversation
Karanhi-IN (Hindi - India)Conversation
Khyatihi-IN (Hindi - India)Conversation
Namritahi-IN (Hindi - India), kn-IN (Kannada - India), tr-TR (Turkish - Turkey)Conversation
Shwetahi-IN (Hindi - India)Conversation
Sunainahi-IN (Hindi - India)Conversation
Aaravhi-IN (Hindi - India), en-IN (English - India)Conversation
Abhikhi-IN (Hindi - India)Conversation
Abhinavhi-IN (Hindi - India), en-IN (English - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India), mr-IN (Marathi - India), tr-TR (Turkish - Turkey)Conversation
Abiramihi-IN (Hindi - India), te-IN (Telugu - India)Conversation
Aliahi-IN (Hindi - India), te-IN (Telugu - India)Conversation
Anishahi-IN (Hindi - India), as-IN (Assamese - India), bn-IN (Bangla - India), en-IN (English - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), pa-IN (Punjabi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Anushahi-IN (Hindi - India), en-IN (English - India), hi-LATN (Hinglish - India), te-IN (Telugu - India)Conversation
Arnabhi-IN (Hindi - India)Conversation
Arohihi-IN (Hindi - India)Conversation
Eashwarhi-IN (Hindi - India)Conversation
Ishahi-IN (Hindi - India)Conversation
Ishanihi-IN (Hindi - India)Conversation
Karthikeyanhi-IN (Hindi - India), gu-IN (Gujarati - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India), ta-IN (Tamil - India)Conversation
Madhavanhi-IN (Hindi - India), ml-IN (Malayalam - India)Conversation
Nikhilhi-IN (Hindi - India), en-IN (English - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India)Conversation
Poojahi-IN (Hindi - India), en-IN (English - India), hi-LATN (Hinglish - India), id-ID (Indonesian - Indonesia), kn-IN (Kannada - India), ms-MY (Malay - Malaysia), ta-IN (Tamil - India), te-IN (Telugu - India), vi-VN (Vietnamese - Vietnam)Conversation
Priyahi-IN (Hindi - India), en-IN (English - India)Conversation
Samarhi-IN (Hindi - India), ar-XA (Arabic - XA), as-IN (Assamese - India), en-IN (English - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India), mr-IN (Marathi - India), or-IN (Odia - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Sarveshhi-IN (Hindi - India), kn-IN (Kannada - India)Conversation
Vaibhavhi-IN (Hindi - India), mr-IN (Marathi - India)Conversation
Voice IDSupported LocalesVoice Styles
Gyeongko-KR (Korean - South Korea)Conversation
Hwanko-KR (Korean - South Korea)Conversation
Jangmiko-KR (Korean - South Korea)Conversation
Jong-suko-KR (Korean - South Korea)Conversation
Minseoko-KR (Korean - South Korea), ja-JP (Japanese - Japan)Conversation
Seokko-KR (Korean - South Korea)Conversation
Voice IDSupported LocalesVoice Styles
Karthikeyanta-IN (Tamil - India), gu-IN (Gujarati - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India)Conversation
Anishata-IN (Tamil - India), as-IN (Assamese - India), bn-IN (Bangla - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), pa-IN (Punjabi - India), te-IN (Telugu - India)Conversation
Poojata-IN (Tamil - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), id-ID (Indonesian - Indonesia), kn-IN (Kannada - India), ms-MY (Malay - Malaysia), te-IN (Telugu - India), vi-VN (Vietnamese - Vietnam)Conversation
Prathameshta-IN (Tamil - India), en-IN (English - India), gu-IN (Gujarati - India), mr-IN (Marathi - India), te-IN (Telugu - India)Conversation
Samarta-IN (Tamil - India), ar-XA (Arabic - XA), as-IN (Assamese - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India), mr-IN (Marathi - India), or-IN (Odia - India), te-IN (Telugu - India)Conversation
Voice IDSupported LocalesVoice Styles
Blazejpl-PL (Polish - Poland), en-US (English - US & Canada)Conversation
Jacekpl-PL (Polish - Poland)Conversation
Kasiapl-PL (Polish - Poland)Conversation
Voice IDSupported LocalesVoice Styles
Debaratibn-IN (Bangla - India)Conversation
Subhankarbn-IN (Bangla - India), mr-IN (Marathi - India)Conversation
Anishabn-IN (Bangla - India), as-IN (Assamese - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), pa-IN (Punjabi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Voice IDSupported LocalesVoice Styles
Denkija-JP (Japanese - Japan)Conversation
Kenjija-JP (Japanese - Japan)Conversation
Kimija-JP (Japanese - Japan)Conversation
Minseoja-JP (Japanese - Japan), ko-KR (Korean - South Korea)Conversation
Voice IDSupported LocalesVoice Styles
Diyagu-IN (Gujarati - India), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), fr-FR (French - France), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ml-IN (Malayalam - India), mr-IN (Marathi - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Hardikgu-IN (Gujarati - India), en-IN (English - India), te-IN (Telugu - India)Conversation
Ayushigu-IN (Gujarati - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), te-IN (Telugu - India)Conversation
Karthikeyangu-IN (Gujarati - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India), ta-IN (Tamil - India)Conversation
Prathameshgu-IN (Gujarati - India), en-IN (English - India), mr-IN (Marathi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Voice IDSupported LocalesVoice Styles
Harshithakn-IN (Kannada - India)Conversation
Harmankn-IN (Kannada - India), pa-IN (Punjabi - India)Conversation
Namritakn-IN (Kannada - India), hi-IN (Hindi - India), tr-TR (Turkish - Turkey)Conversation
Nikhilkn-IN (Kannada - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India)Conversation
Poojakn-IN (Kannada - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), id-ID (Indonesian - Indonesia), ms-MY (Malay - Malaysia), ta-IN (Tamil - India), te-IN (Telugu - India), vi-VN (Vietnamese - Vietnam)Conversation
Samarkn-IN (Kannada - India), ar-XA (Arabic - XA), as-IN (Assamese - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Sarveshkn-IN (Kannada - India), hi-IN (Hindi - India)Conversation
Voice IDSupported LocalesVoice Styles
Madhavanml-IN (Malayalam - India), hi-IN (Hindi - India)Conversation
Nimishaml-IN (Malayalam - India), en-IN (English - India), en-US (English - US & Canada)Conversation
Abhinavml-IN (Malayalam - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), tr-TR (Turkish - Turkey)Conversation
Diyaml-IN (Malayalam - India), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), fr-FR (French - France), gu-IN (Gujarati - India), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), mr-IN (Marathi - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Karthikeyanml-IN (Malayalam - India), gu-IN (Gujarati - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), ta-IN (Tamil - India)Conversation
Voice IDSupported LocalesVoice Styles
Prajaktamr-IN (Marathi - India), te-IN (Telugu - India)Conversation
Prathameshmr-IN (Marathi - India), en-IN (English - India), gu-IN (Gujarati - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Vaibhavmr-IN (Marathi - India), hi-IN (Hindi - India)Conversation
Abhinavmr-IN (Marathi - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), ml-IN (Malayalam - India), tr-TR (Turkish - Turkey)Conversation
Anishamr-IN (Marathi - India), as-IN (Assamese - India), bn-IN (Bangla - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), or-IN (Odia - India), pa-IN (Punjabi - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Diyamr-IN (Marathi - India), ar-XA (Arabic - XA), bg-BG (Bulgarian - Bulgaria), cs-CZ (Czech - Czech Republic), de-DE (German - Germany), fr-FR (French - France), gu-IN (Gujarati - India), id-ID (Indonesian - Indonesia), it-IT (Italian - Italy), ml-IN (Malayalam - India), ms-MY (Malay - Malaysia), nl-BE (Dutch - Belgium), ro-RO (Romanian - Romania), sv-SE (Swedish - Sweden), tr-TR (Turkish - Turkey), vi-VN (Vietnamese - Vietnam)Conversation
Harpreetmr-IN (Marathi - India), pa-IN (Punjabi - India)Conversation
Samarmr-IN (Marathi - India), ar-XA (Arabic - XA), as-IN (Assamese - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India), or-IN (Odia - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Subhankarmr-IN (Marathi - India), bn-IN (Bangla - India)Conversation
Voice IDSupported LocalesVoice Styles
Harmanpa-IN (Punjabi - India), kn-IN (Kannada - India)Conversation
Harpreetpa-IN (Punjabi - India), mr-IN (Marathi - India)Conversation
Anishapa-IN (Punjabi - India), as-IN (Assamese - India), bn-IN (Bangla - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), ta-IN (Tamil - India), te-IN (Telugu - India)Conversation
Voice IDSupported LocalesVoice Styles
Abiramite-IN (Telugu - India), hi-IN (Hindi - India)Conversation
Aliate-IN (Telugu - India), hi-IN (Hindi - India)Conversation
Anishate-IN (Telugu - India), as-IN (Assamese - India), bn-IN (Bangla - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), mr-IN (Marathi - India), or-IN (Odia - India), pa-IN (Punjabi - India), ta-IN (Tamil - India)Conversation
Anushate-IN (Telugu - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India)Conversation
Ayushite-IN (Telugu - India), gu-IN (Gujarati - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India)Conversation
Hardikte-IN (Telugu - India), en-IN (English - India), gu-IN (Gujarati - India)Conversation
Poojate-IN (Telugu - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), id-ID (Indonesian - Indonesia), kn-IN (Kannada - India), ms-MY (Malay - Malaysia), ta-IN (Tamil - India), vi-VN (Vietnamese - Vietnam)Conversation
Prajaktate-IN (Telugu - India), mr-IN (Marathi - India)Conversation
Prathameshte-IN (Telugu - India), en-IN (English - India), gu-IN (Gujarati - India), mr-IN (Marathi - India), ta-IN (Tamil - India)Conversation
Samarte-IN (Telugu - India), ar-XA (Arabic - XA), as-IN (Assamese - India), en-IN (English - India), hi-IN (Hindi - India), hi-LATN (Hinglish - India), kn-IN (Kannada - India), mr-IN (Marathi - India), or-IN (Odia - India), ta-IN (Tamil - India)Conversation

Available Regions

Use the region closest to your users for the lowest latency.

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

The Global Router picks the nearest region automatically. The concurrency limit is 5 for the US-East region and 2 for all other regions. To get higher concurrency, use the US-East endpoint directly or contact us to increase limits for regional endpoints.

Best Practices

Following are some best practices for using the WebSocket streaming API:

  • Send voice_config before any text. When using a named context, put the same context_id on both frames. Text that arrives in an unconfigured context is synthesized with the default voice and returns a NO_VOICE_CONFIG warning.
  • Branch on error_code and warning_code, never on the human-readable message. See Errors & Warnings.
  • Once connected, the session remains active as long as it is in use and will automatically close after 3 minutes of inactivity.
  • You can maintain up to 10X your streaming concurrency limit in WebSocket connections, as per your plan’s rate limits.
  • For the lowest latency, prefer Falcon 2 voices by setting model = falcon-2.
  • If you use LiveKit or Pipecat, turn off the framework’s sentence tokenizer or text aggregation and stream LLM tokens straight to the WebSocket. Falcon does its own sentence splitting.
  • For how to write text for Falcon, including numbers, codes, scripts and an LLM system prompt template, see Best Practices.

Next Steps

FAQs

WebSocket allows you to stream input text and receive audio over the same persistent connection, making it truly bidirectional. In contrast, HTTP streaming is one-way, you send the full text once and receive audio while it is being generated. WebSocket is better for real-time, interactive use cases where text arrives in parts.

The audio is streamed as a sequence of base64-encoded strings, with each message containing a chunk of the overall audio. With format=WAV, only the first chunk of a context carries a 44-byte header, and its length fields are placeholders. Request format=PCM to receive headerless little-endian 16-bit samples instead.

The WebSocket connection will automatically close after 3 minutes of inactivity.

You can control style, speed and pitch, and set how any word is pronounced by writing it in IPA in your text ("/mɜːrf/") or with pronunciation_dictionary in voice_config. You can also tune latency with predictive chunking and receive word-level timestamps. See Advanced Settings.

Add model = falcon-2 to your WebSocket connection query (or request parameters). Falcon 2 is optimized for ultra-low latency (~100 ms) and is ideal for interactive agents, live support, gaming, tutoring, and other real-time experiences where fast turn-taking matters. WebSocket streaming supports Falcon only.

The HTTP upgrade completes and the connection is then closed with WebSocket code 1008 (policy violation). It is not an HTTP 401, so handle the close code. See Errors & Warnings.