pronunciation selector applies to HTTP TTS requests. One dictionary is active per request or WebSocket turn.
Prerequisites
- An SLNG API key. See Create your API key.
- The regional gateway you send TTS requests to, such as
https://eu-west.api.slng.ai. The Pronunciation dictionaries API lists the regions that serve dictionaries.
Create and use a dictionary in the same region and organization. A dictionary you create in one region is not visible from another.
1
Create your dictionary
Send the rewrite rules to Each rule pairs a
POST /v1/pronunciation/dictionaries. A successful call returns 201 Created.match term with the replace text sent to the model. A dictionary holds up to 256 rules. Pronunciation fails closed: if a request names a dictionary that cannot be resolved, the TTS request is rejected rather than synthesized without it.2
Open a TTS WebSocket with the dictionary selected
Connect to a TTS endpoint in the same region and pass the dictionary name in the Send the API key in the handshake header:Then send the
init config. This example uses Deepgram Aura 2:init message with a pronunciation selector:3
Send text and collect audio
After the server sends Collect binary audio frames until
ready, send a text message:audio_end. The model speaks “SLNG” as “slang” instead of reading the letters on its own.4
Reuse the selection across turns
The selection stays active for the session. Send later text messages without repeating
pronunciation. To switch dictionaries, include a new selector on the first text message of a later turn.Hear the difference
Both clips synthesize the same line. The dictionary rewritesSLNG, QubePay, and ACH so the model speaks them as intended instead of guessing.
API reference
Pronunciation dictionaries API
Create, list, read, and delete dictionaries, with the full rewrite contract and error codes.