Pronunciation Dictionaries

import pronunciation dictionary

Changed on

Creates a pronunciation dictionary from a Cartesia pronunciation dictionary file: an array of { text, pronunciation, case_sensitive? } rows, with an optional Anam sounds_like fallback. A pronunciation containing << or >> is imported as an IPA entry; anything else is a sounds-like entry.

The file is validated as a whole: it must hold 1 to 500 rows and at most 1 MiB of UTF-8 JSON. When json is an array, the limit applies to the array serialized without whitespace. If any row is invalid, nothing is saved and the response lists every error by one-based row and file field name.

post/v1/pronunciation-dictionaries/import

Request

  • Base URL
    https://api.anam.ai
  • URL
    https://api.anam.ai/v1/pronunciation-dictionaries/import
  • Auth
    HTTP bearer

Request body

namestring required

Display name for the new dictionary

Example request

{
  "name": "Brand names"
}

Response

Successfully imported pronunciation dictionary

idstring uuid

Pronunciation dictionary ID. Pass it as voiceGenerationOptions.pronunciationDictionaryId when creating a session token.

namestring

Display name

revisioninteger

Starts at 1 and increases with every save. Send it as expectedRevision to reject a write if someone else saved first.

createdAtstring date-time

When the dictionary was created

updatedAtstring date-time

When the dictionary was last saved

Example response

{
  "id": "4f600129-13cf-4bfa-909a-2f4c31467f43",
  "name": "Brand names",
  "revision": 1,
  "entries": [
    {
      "text": "Anam",
      "kind": "sounds_like",
      "pronunciation": "annum",
      "soundsLike": "annum"
    }
  ]
}

Changes