pronunciation selector applies to HTTP TTS requests. One dictionary is active per request or WebSocket turn.
Prerequisites
- An SLNG API key.
- The hostname of a production cluster with dictionary support enabled.
Create and consume a dictionary on the same cluster, organization, and environment. A dictionary created on one cluster 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 on the same cluster 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.API reference
Pronunciation dictionaries API
Create, list, read, and delete dictionaries, with the full rewrite contract and error codes.