Pronunciation Dictionary
A pronunciation dictionary is a JSON file of "word": "how to say it" pairs. Upload it once, get a dict_id, and pass that ID in any text-to-speech request. Matching words are replaced before synthesis. There is no phoneme markup and no retraining.
It works with both bulbul:v3 and bulbul:v4-flash, on REST, HTTP streaming and WebSocket.
Test without a dictionary first. Add only the words that are actually misread: acronyms that should be spelled out, brand names, and terms borrowed from another language.
When to use one
Input such as NAIC policy number check karein aur B2B portal pe login karein can be misread: NAIC may be pronounced as a word and B2B read literally. A dictionary fixes exactly those tokens and leaves the rest of the sentence alone.
Dictionary format
The top-level key pronunciations maps language codes to word-to-replacement pairs:
Matching is per language. A request with language_code="ta-IN" ignores the hi-IN and en-IN blocks of the same dictionary.
Quick start
Set your key once:
Save the example above (or your own) as dict.json.
1. Upload
The returned ID always matches ^p_[0-9a-f]{8}$.
2. Use it in a TTS request
For bulbul:v3, change model to bulbul:v3 and use a v3 speaker such as shubh. Speaker names from one model are rejected by the other.
Managing dictionaries
All endpoints live under https://api.sarvam.ai/text-to-speech/pronunciation-dictionary and use the api-subscription-key header.
List
Get
Update
Delete
Upload a new JSON file with the same dict_id. The ID does not change, so existing integrations keep working.
Update replaces whole language blocks. Every language that appears in the uploaded file is overwritten with exactly the entries in that file. Languages that are not in the file are left as they are. To add one word to hi-IN, upload the full hi-IN block (existing words plus the new one).
Deleting an unknown ID returns 200 with "success": false, so check the success field rather than the status code.
Limits and errors
Using a dictionary on every transport
dict_id is accepted on REST, HTTP streaming and WebSocket. On WebSocket, set it in the config message.
HTTP stream
WebSocket
Patterns
Financial services (IVR, voice bots)
Healthcare
Brand and product names, one word with different forms per language
Same acronym across languages
Tips
- Keep one dictionary per request. To combine sets, merge them into one file (up to 100 entries per language).
- Update instead of recreating. The
dict_idstays the same, so deployed code keeps working. - Audition with your production speaker. Different voices can read the same replacement slightly differently.
Full request and response schemas are in the API reference. Questions? Ask on Discord.