For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PricingJoin CommunityGet API Key
DocumentationAPI ReferenceChangelog
DocumentationAPI ReferenceChangelog
  • API Reference
      • POSTStream Speech
      • WSSWebSockets
  • Additional Resources
    • Try on Postman
LogoLogo
PricingJoin CommunityGet API Key
API ReferenceText to Speech - Streaming

Stream Speech

POST
/v1/speech/stream
POST
/v1/speech/stream
1from murf import Murf, MurfRegion
2client = Murf(
3 api_key="YOUR_API_KEY",
4 region=MurfRegion.GLOBAL
5)
6audio_stream = client.text_to_speech.stream(
7 text="Hi, How are you doing today?",
8 voice_id="Matthew",
9 model="FALCON",
10 locale="en-US",
11 sample_rate=24000
12)
1{}
Synthesize speech with ultra-low latency over a streaming connection. Choose the `Base URL` from the URL dropdown (Global URL or a pinned Region) **Note**: Global URL auto-routes to the nearest region. | Region | URL | Default Concurrency | | ------------------------- | ---------------------------------------------- | -------------------- | | Global (Routes to the nearest server) | `https://global.api.murf.ai/v1/speech/stream` | Region specific concurrency | | US-East | `https://us-east.api.murf.ai/v1/speech/stream` | 15 | | US-West | `https://us-west.api.murf.ai/v1/speech/stream` | 2 | | India | `https://in.api.murf.ai/v1/speech/stream` | 2 | | Canada | `https://ca.api.murf.ai/v1/speech/stream` | 2 | | South Korea | `https://kr.api.murf.ai/v1/speech/stream` | 2 | | UAE | `https://me.api.murf.ai/v1/speech/stream` | 2 | | Japan | `https://jp.api.murf.ai/v1/speech/stream` | 2 | | Australia | `https://au.api.murf.ai/v1/speech/stream` | 2 | | EU (Central) | `https://eu-central.api.murf.ai/v1/speech/stream` | 2 | | UK | `https://uk.api.murf.ai/v1/speech/stream` | 2 | | South America (São Paulo) | `https://sa-east.api.murf.ai/v1/speech/stream` | 2 |
Was this page helpful?

WebSockets

Next
Built with

Synthesize speech with ultra-low latency over a streaming connection. Choose the Base URL from the URL dropdown (Global URL or a pinned Region)

Note: Global URL auto-routes to the nearest region.

RegionURLDefault Concurrency
Global (Routes to the nearest server)https://global.api.murf.ai/v1/speech/streamRegion specific concurrency
US-Easthttps://us-east.api.murf.ai/v1/speech/stream15
US-Westhttps://us-west.api.murf.ai/v1/speech/stream2
Indiahttps://in.api.murf.ai/v1/speech/stream2
Canadahttps://ca.api.murf.ai/v1/speech/stream2
South Koreahttps://kr.api.murf.ai/v1/speech/stream2
UAEhttps://me.api.murf.ai/v1/speech/stream2
Japanhttps://jp.api.murf.ai/v1/speech/stream2
Australiahttps://au.api.murf.ai/v1/speech/stream2
EU (Central)https://eu-central.api.murf.ai/v1/speech/stream2
UKhttps://uk.api.murf.ai/v1/speech/stream2
South America (São Paulo)https://sa-east.api.murf.ai/v1/speech/stream2

Headers

api-keystringOptional

Request

This endpoint expects an object.
textstringRequired

The text that is to be synthesised. e.g. ‘Hello there [pause 1s] friend’

voiceIdstringRequired

Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor’s name (e.g. natalie).

modelstringOptional

The model to use for audio output. Defaults to FALCON for all the regions except US-East. Valid values: FALCON, GEN2

channelTypestringOptionalDefaults to MONO

Valid values: STEREO, MONO

formatstringOptionalDefaults to WAV

Format of the generated audio file.Valid values: MP3, FLAC, WAV, ALAW, ULAW, OGG, PCM

localestringOptional

Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Valid values: “en-US”, “en-UK”, “es-ES”, etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.

pitchintegerOptional-50-50
Pitch of the voiceover
pronunciationDictionarymap from strings to objectsOptional

An object used to define custom pronunciations.

Example 1: {“live”:{“type”: “IPA”, “pronunciation”: “laɪv”}}.

Example 2: {“2022”:{“type”: “SAY_AS”, “pronunciation”: “twenty twenty two”}}

rateintegerOptional-50-50
Speed of the voiceover
sampleRatedoubleOptionalDefaults to 24000
Valid values are 8000, 16000, 24000, 44100, 48000. Defaults to 24000 for Falcon model and 44100 for Gen2 model.
stylestringOptional
The voice style to be used for voiceover generation.
variationintegerOptional0-5Defaults to 1
Higher values will add more variation in terms of Pause, Pitch, and Speed to the voice. Only available for Gen2 model.
multiNativeLocalestringOptionalDeprecated

This field is superseded by locale field. Please migrate to locale field to ensure compatibility with future API versions.

Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Valid values: “en-US”, “en-UK”, “es-ES”, etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.

Response

Ok

Errors

400
Bad Request Error
402
Payment Required Error
403
Forbidden Error
500
Internal Server Error
503
Service Unavailable Error