Best Practices
This guide contains the best practices for using Murf API. These practices will help you get the most out of the API and ensure that your applications are performant, reliable, and secure.
Murf Falcon TTS: Prompting Best Practices
Falcon produces its best output when you send text the way a person would write it for another person to read. In most cases no preprocessing is needed: Falcon handles text normalisation, pacing and natural pauses on its own.
This guide is for developers calling the Falcon 2.1 streaming or WebSocket API, and for teams running Falcon inside a voice agent platform such as LiveKit, Pipecat or Agora, where an LLM writes the text Falcon speaks. Each section lists what to send, what to avoid, and an example.
Four rules cover most cases:
- Send full, punctuated sentences in normal casing.
- Send text in its original script. Falcon switches between languages inside a sentence; do not transliterate.
- Keep numbers, dates and currency in their standard written form.
- In a voice agent, stream LLM tokens straight to Falcon and let Falcon decide where to split.
Core text rules
Why casing matters. An all-caps word signals an initialism, so it may be read letter by letter. Keep EMI, KYC and UPI in capitals; write every other word in normal case.
Why original script matters. Romanised Hindi, Tamil or Kannada has no fixed spelling, so the model has to guess. Falcon first converts romanised Indic text back to native script, which costs accuracy and adds 5–10 ms to time-to-first-audio. Native script avoids both. For code-mixed speech such as Hinglish, write each word in the script it belongs to: Devanagari for Hindi words, Latin for English words, brand names and product names.
Choosing a voice, language and tone. Falcon offers 150+ voices across 35 languages. Pick and preview a voice in the Falcon voice library for your target language. Falcon voices are multinative: one voice can switch between languages mid-sentence. Set locale (for example hi-IN or en-US) to the caller’s main language; if you leave it out, it follows the voice. Falcon 2.1 voices have one style, Conversation, so set tone through word choice: an apology written as an apology sounds like one.
Numbers, dates and symbols
Write numbers, money, dates and contact details the way they appear on an invoice or a form. Falcon converts them to speech; do not spell them out in words by default. Before launch, play each format your agent uses through your chosen voice once.
Write the month as a word. 04/05/2026 means 4 May in India and 5 April in the US. Writing “4 May 2026” removes the ambiguity for every voice and locale.
Numbers inside Indic script. Keep digits as 0–9 inside Devanagari, Tamil or other Indic text, as most apps and statements display them: आपकी EMI ₹4,250 है।
Codes, IDs and spelled-out strings
OTPs, loan account numbers, PNRs and policy numbers need to be read one character at a time. Falcon has no spell or SSML tags, so you control this with spacing and punctuation in the text. Pick the method by how fast the listener must write it down.
Guidelines:
- Keep the code inside a sentence; never send the code alone.
- Use one delimiter style per string. Mixing periods and commas between characters produces uneven pauses.
- Group long numbers the way a person reads them aloud: card numbers in 4s, Indian mobiles in 5s.
- For letters that sound alike on a call (M/N, B/D, F/S), add a word: “B for Bangalore”. Falcon speaks only what is written, so the text has to include it.
- Letters in a Latin-script code are read with the voice’s own accent. Preview codes with each voice you ship.
Names, brands and hard words
Falcon 2.1 pronounces most names well from their spelling. When one comes out wrong, fix it one of two ways:
- A fixed list of names (your brand, products, common places): send a
pronunciationDictionarywith every Stream Speech request, orpronunciation_dictionaryin WebSocketvoice_config, for example{"Murf": {"type": "IPA", "pronunciation": "mɜːrf"}}. Your text stays readable, and the LLM doesn’t need to know any IPA. - Names that change from call to call (a customer’s name, a medicine): write the IPA in the text, between slashes inside double quotes:
Welcome to "/mɜːrf/".This also works over WebSockets.
Test each custom pronunciation with every voice you ship. See Pronunciations.
Pauses, speed and fillers
Pauses. Falcon adds natural pauses from the text itself. Shape pauses with punctuation: a comma gives a short beat, a full stop a longer one, and a new sentence or line break resets the rhythm. To pause after an amount, end the sentence there: “Your balance is ₹4,250. Your next EMI is due on 5 October.”
Speed. Set rate for speed and pitch for tone on the request or in voice_config. Both take an integer from -50 to 50; the default is 0. In the LiveKit plugin, speed is called speed. Start at 0 and move in steps of 5, listening after each change. Use one setting for the whole call rather than changing speed mid-conversation.
Loudness. Set volumeOffset when the agent sounds too quiet or too loud on the channel callers actually use—often 10–25 on phone calls and 15–30 on mobile voice paths. Default is 0. See Volume offset.
Fillers. Falcon speaks only what is written and does not insert fillers on its own. For a more human agent:
- Write fillers in standard spelling (um, uh, hmm; in Hindi, अच्छा), set off by commas.
- Use them before a looked-up value or after a hard question, and not in every turn.
Example: Let me check that for you. Your outstanding amount is, uh, ₹4,250.
Streaming and chunking
Turn off chunking in your voice agent platform. Stream LLM tokens straight to Falcon’s WebSocket and disable the sentence tokenizer or text aggregation in your framework, such as LiveKit or Pipecat. Falcon chunks automatically: it waits for a sentence to end, marked by punctuation, before generating audio. Splitting text twice adds a wait at each layer, so leaving the split to Falcon lowers latency.
More streaming habits:
- Keep one WebSocket open per call and send every turn on it. Reusing the connection saves 30–80 ms of handshake per request.
- Use a
context_idper turn so pitch and pace carry across chunks, and sendend: truewhen the turn is done. - When the caller interrupts, send
clearwith thatcontext_idto stop audio that is still queued. - Use the global endpoint, or the region closest to where your agent runs, and measure time-to-first-audio from that server, not from a laptop.
See Streaming and WebSockets for endpoint setup and examples.
Voice agents: rules for the LLM system prompt
In a voice agent, an LLM writes every line Falcon speaks. Add the block below to your agent’s system prompt and adjust the examples to your use case.
LLM system prompt template
Before going live, run 10–20 test calls per language and listen for misread numbers, codes and names.
API Key Safety
API keys are used to authenticate requests to the Murf API. It is important to keep your API keys secure to prevent unauthorized access to your account and data. Here are some best practices for keeping your API keys safe:
Never deploy your key in client-side environments like browsers or mobile apps.
If API keys are stored on the client side, they may be exposed to malicious actors - who can use them to make unauthorized requests on your behalf. This will result in unexpected charges and potential data breaches. When writing Murf API logic in client-side code, you can use a server-side application that generates a token for the client to use. The requests from the client can then be authenticated using this token.
Store your API keys as environment variables
To keep your API keys secure, store them as environment variables in your application. This will prevent you from accidentally exposing your keys in your codebase.
Alternatively you can use a key management service to securely store and manage your API keys.
Monitor your API usage
Regularly monitor your API usage to detect any unusual activity from your usage dashboard. If you notice any unexpected spikes in usage, it may indicate that your API key has been compromised. In such cases, you should immediately revoke the key and generate a new one. Rotate your API keys regularly to minimize the risk of unauthorized access.