- create a dictionary from rules
- upload a
.plsfile - update rules over time
- download any version as PLS
- apply a dictionary to direct TTS requests
- assign a dictionary to an agent through
tts_params
Dictionary content is versioned. When you pass
dictionary_id without dictionary_version, Voice.ai uses the latest version.Rule Format
Rules use a compact TTS-oriented shape:| Field | Type | Required | Description |
|---|---|---|---|
word | string | Yes | Word or phrase to match. |
replacement | string | Yes | Replacement pronunciation text. |
ipa | string | No | Optional phonetic pronunciation string. |
case_sensitive | boolean | No | Whether matching is case sensitive. Defaults to true. |
ipa is omitted, the rule is treated as a text replacement rule.
Create From Rules
Create a managed dictionary by posting an initial rule set: See the Create pronunciation dictionary from rules endpoint for the full request and response schema.Upload a PLS File
If you already have a pronunciation lexicon, upload it directly: See the Create pronunciation dictionary from PLS file endpoint for details.cURL
Update Rules
Managed dictionaries are versioned. These endpoints create a new version:- Replace pronunciation dictionary rules
Replaces the entire rule set with
POST /api/v1/tts/pronunciation-dictionaries/{dictionary_id}/set-rules. - Add pronunciation dictionary rules
Adds new rules with
POST /api/v1/tts/pronunciation-dictionaries/{dictionary_id}/add-rules. - Remove pronunciation dictionary rules
Removes rules by stable
rule_idswithPOST /api/v1/tts/pronunciation-dictionaries/{dictionary_id}/remove-rules.
- List pronunciation dictionaries
GET /api/v1/tts/pronunciation-dictionaries - Get pronunciation dictionary
GET /api/v1/tts/pronunciation-dictionaries/{dictionary_id}
- Rename pronunciation dictionary
PATCH /api/v1/tts/pronunciation-dictionaries/{dictionary_id}
- Delete pronunciation dictionary
DELETE /api/v1/tts/pronunciation-dictionaries/{dictionary_id}
- Download pronunciation dictionary version as PLS
GET /api/v1/tts/pronunciation-dictionaries/{dictionary_id}/{version}/download
Use With Direct TTS Requests
Passdictionary_id and, optionally, dictionary_version in your TTS request.
cURL
dictionary_version, Voice.ai uses the latest version.
Use With Voice Agents
Pronunciation dictionaries can also be attached to a saved agent throughconfig.tts_params:
dictionary_version only when you want to pin the agent to a specific saved version. Otherwise, omit it and the agent will use the latest version.