Skip to main content
Custom dictionaries are per-project pronunciation and replacement lists. Each entry maps a written word to the text or IPA the TTS pipeline should pronounce instead. Use them for brand names, product names, acronyms, and domain vocabulary that should sound consistent across requests. Changes are available to synthesis after the dictionary mutation finishes. Generation must send the dictionary’s project_id; omission loads no project dictionary. The current Java generation and streaming builders do not expose that field, so use the raw generation API or raw WebSocket protocol for dictionary-backed synthesis. For the full HTTP contract, field limits, master-key project_id rules, and error codes, see the Dictionaries API reference.

Create a Dictionary

Manage Dictionaries

Every dictionaries() and entries() method has a master-key overload that takes a trailing Long projectId. Use it only when acting on a specific project with a master key; with a normal API key, call the shorter overload.

Add and Manage Entries

Use replacement for normal spelling-based fixes. Use ipa when you need an exact phonetic pronunciation; IPA takes precedence over replacement.

Atomic Bulk Sync

replaceAll upserts every entry in one transaction and deletes entries currently in the dictionary whose word is not in the payload. Use it to sync from a CMS, PIM, or internal glossary.
replaceAll is intentionally destructive for omitted words. Only call it with the complete desired contents of that dictionary.

Generation Limitation

.dictionaryIds(...) alone is not enough: the API requires project_id for both the default active dictionaries and an explicit selection. Because the Java generation builders cannot send project_id, use the raw generation API for dictionary-backed synthesis.
Next: Types — data models, audio utilities, and a complete example.