Realtime TTS-2 is live. Built for realtime conversation that feels human. Read the Realtime TTS-2 announcement

Pronunciation dictionaries

Update a pronunciation dictionary

Update a dictionary's display name or atomically replace all of its pronunciation entries.

PATCH/pronunciations/v1/workspaces/{workspaceId}/pronunciationDictionaries/{pronunciationDictionaryId}

Updating pronunciations replaces the complete entry list. Entries omitted from the request are deleted, and an empty list clears the dictionary.

The request must include the current etag. If another writer has changed the dictionary, the stale etag returns HTTP 409 Conflict instead of overwriting the newer state. Get the dictionary again, reconcile the changes, and retry with the new value.

The primary example supplies both mutable fields and sets updateMask=displayName,pronunciations. The pronunciations value must contain the complete desired dictionary; entries omitted from it are deleted.

Update selected fields

Always send an explicit updateMask query parameter in REST requests. Its comma-separated field names use the same lowerCamelCase spelling as the JSON request body. For example, rename a dictionary without changing its entries:

bash
curl --request PATCH \
  "https://api.inworld.ai/pronunciations/v1/workspaces/${INWORLD_WORKSPACE_ID}/pronunciationDictionaries/${PRONUNCIATION_DICTIONARY_ID}?updateMask=displayName" \
  --header "Authorization: Basic ${INWORLD_API_KEY}" \
  --header "Content-Type: application/json" \
  --data "{\"displayName\":\"Product names v2\",\"etag\":\"${PRONUNCIATION_DICTIONARY_ETAG}\"}"

Supported fields are displayName and pronunciations. Use updateMask=displayName,pronunciations or updateMask=* only when you intend to update both fields and supply both values. Keep etag in the request body; it is a concurrency token, not an update-mask field.

Authorizations

Authorizationstringrequired

Your authentication credentials. For Basic authentication, send Basic $INWORLD_API_KEY. Use a Standard API key for the target workspace. Voices Read access permits list and get; Voices Write access permits all five methods.

Path Parameters

workspaceIdstringrequired

ID of the workspace that owns the dictionary. It must match a workspace accessible to the API key.

pronunciationDictionaryIdstringrequired

Service-assigned UUID from the dictionary's resource name.

Query Parameters

updateMaskstring

Comma-separated fields to update, using lowerCamelCase JSON names. Supported fields are displayName and pronunciations. For REST requests, send an explicit mask. Use displayName,pronunciations or * to update both mutable fields. Keep etag in the request body, not in the mask.

Body

application/json

displayNamestring

Non-blank human-readable dictionary name, containing at most 64 Unicode code points.

pronunciationsobject[]default: []

Complete dictionary contents. A dictionary can contain up to 1,000 entries and must remain within the 512 KiB encoded dictionary limit. Entries must be unique after language-aware lexical canonicalization.

Show child attributes

displayHeadwordstringrequired

Caller-facing spelling. It must be non-blank and tokenize to exactly one replaceable lexical token.

languageCodestringrequired

Concrete language supported for pronunciation entries, in its exact canonical BCP-47 spelling: for example, en-US, not en-us, EN_US, or en. Blank values and auto are not accepted. The general TTS language list is not a pronunciation catalog. See Author pronunciation entries.

phoneSymbolsstring[]required

Ordered array of complete phone tokens supported for the selected language, not a slash-delimited or whitespace-separated IPA string. Each token can contain at most 16 Unicode code points. Preserve compound-phone token boundaries; do not split by Unicode character. Supported aliases may be canonicalized in the response. See phone-token guidance and examples.

etagstringrequired

Current dictionary etag. A stale value fails the update rather than overwriting a concurrent change.

Response

200 - application/json

namestringrequired

Service-assigned resource name in the form workspaces/{workspace}/pronunciationDictionaries/{uuid}.

displayNamestringrequired

Non-blank human-readable dictionary name, containing at most 64 Unicode code points.

pronunciationsobject[]requireddefault: []

Complete dictionary contents. A dictionary can contain up to 1,000 entries and must remain within the 512 KiB encoded dictionary limit. Entries must be unique after language-aware lexical canonicalization.

Show child attributes

displayHeadwordstringrequired

Caller-facing spelling. It must be non-blank and tokenize to exactly one replaceable lexical token.

languageCodestringrequired

Concrete language supported for pronunciation entries, in its exact canonical BCP-47 spelling: for example, en-US, not en-us, EN_US, or en. Blank values and auto are not accepted. The general TTS language list is not a pronunciation catalog. See Author pronunciation entries.

phoneSymbolsstring[]required

Ordered array of complete phone tokens supported for the selected language, not a slash-delimited or whitespace-separated IPA string. Each token can contain at most 16 Unicode code points. Preserve compound-phone token boundaries; do not split by Unicode character. Supported aliases may be canonicalized in the response. See phone-token guidance and examples.

etagstringrequired

Optimistic-concurrency token. Include the current value when updating or deleting the dictionary.

createTimestringrequired

Time at which the dictionary was created.

updateTimestringrequired

Time at which the dictionary's metadata or contents last changed.