> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fish.audio/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Version

> Publish a new immutable version of a pronunciation dictionary

Each version holds the complete, ordered rule list; send every rule you want in the new version, not only the changes. Published versions never change, so TTS requests pinned to an older version keep using its rules.

Set `expected_latest_version_id` to the dictionary's current `latest_version_id`, or `null` for the first version. If another version was published in the meantime, the request returns 409. Fetch the new latest version, merge its rules with your changes, and publish again with its ID; resending your original list would drop the other publisher's changes.

For the rule fields, rule types and limits, see [Write Pronunciation Rules](https://docs.fish.audio/developer-guide/core-features/fine-grained-control/pronunciation-dictionaries.md#write-pronunciation-rules).


## OpenAPI

````yaml post /v1/pronunciation-dictionaries/{dictionary_id}/versions
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/pronunciation-dictionaries/{dictionary_id}/versions:
    post:
      tags:
        - Pronunciation Dictionaries
      summary: Publish a version
      description: >-
        Publish an immutable snapshot of rules. Send the version you believe is
        current as `expected_latest_version_id`; a stale value returns 409. Keys
        are unique within a version (duplicates return 422). Alias rules never
        shorten billing.
      parameters:
        - in: path
          name: dictionary_id
          description: ''
          required: true
          schema:
            title: Dictionary Id
            type: string
          deprecated: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PronunciationDictionaryVersionCreatePayload'
      responses:
        '201':
          description: Document created, URL follows
          headers: {}
          content:
            application/json:
              schema:
                description: A version with its full ordered rule list.
                properties:
                  id:
                    description: Stable version identifier.
                    examples:
                      - 1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b
                    title: Id
                    type: string
                  dictionary_id:
                    description: Dictionary this version belongs to.
                    examples:
                      - 9b2f5c0d4e6a4f4c8a1d3e5f7a9b0c2d
                    title: Dictionary Id
                    type: string
                  description:
                    description: Version note entered when publishing.
                    examples:
                      - Add the new product names
                    title: Description
                    type: string
                  version_number:
                    anyOf:
                      - type: integer
                      - type: 'null'
                    default: null
                    description: >-
                      Monotonic version number within the dictionary. Null only
                      for versions published before version numbers existed.
                    examples:
                      - 3
                    title: Version Number
                  added_count:
                    default: 0
                    description: Rules added relative to the previous version.
                    examples:
                      - 2
                    title: Added Count
                    type: integer
                  removed_count:
                    default: 0
                    description: Rules removed relative to the previous version.
                    examples:
                      - 0
                    title: Removed Count
                    type: integer
                  changed_count:
                    default: 0
                    description: Rules whose key, value, type or case sensitivity changed.
                    examples:
                      - 1
                    title: Changed Count
                    type: integer
                  item_count:
                    default: 0
                    description: Total number of rules in this version.
                    examples:
                      - 12
                    title: Item Count
                    type: integer
                  created_at:
                    description: Publish time (UTC).
                    examples:
                      - '2026-11-05T04:02:44Z'
                    format: date-time
                    title: Created At
                    type: string
                  items:
                    description: Rules in application order.
                    items:
                      $ref: '#/components/schemas/PronunciationDictionaryV1Item'
                    title: Items
                    type: array
                required:
                  - id
                  - dictionary_id
                  - description
                  - created_at
                  - items
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '403':
          description: Request forbidden -- authorization will not help
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '409':
          description: Request conflict
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                  reason:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    title: Reason
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
components:
  schemas:
    PronunciationDictionaryVersionCreatePayload:
      properties:
        expected_latest_version_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Optimistic-concurrency guard: the latest version ID the caller
            believes is current, or null for the first publish. A mismatch
            returns 409.
          examples:
            - 1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b
          title: Expected Latest Version Id
        description:
          default: ''
          description: Optional version note (up to 1024 characters).
          examples:
            - Add the new product names
          maxLength: 1024
          title: Description
          type: string
        items:
          description: >-
            Complete ordered rule list for the new version (up to 5000 rules).
            Keys must be unique within the version; order is the engine's
            application order.
          items:
            $ref: '#/components/schemas/PronunciationDictionaryItemPayload'
          maxItems: 5000
          title: Items
          type: array
      title: PronunciationDictionaryVersionCreatePayload
      type: object
    PronunciationDictionaryV1Item:
      description: One key/value rule in a published version.
      properties:
        key:
          description: >-
            Substring to match in the request text. 1-256 characters. Alias
            rules may not start or end with whitespace and may not contain
            control characters, `<`, `>`, `(`, `)`, `[` or `]`.
          examples:
            - Fish Audio
          title: Key
          type: string
        value:
          description: >-
            Replacement text. 1-1024 characters. For phoneme rules it is the
            phonetic form (without the `<|phoneme_start|>` / `<|phoneme_end|>`
            markers); for alias rules it is plain text. Neither type may contain
            `<|` or `|>`.
          examples:
            - fɪʃ ˈɔːdi.oʊ
          title: Value
          type: string
        type:
          default: phoneme
          description: >-
            How the key is replaced: `phoneme` (default) speaks the value as a
            phonetic form; `alias` substitutes the literal text, which is then
            read like the rest of the request.
          enum:
            - phoneme
            - alias
          examples:
            - phoneme
          title: Type
          type: string
        case_sensitive:
          default: false
          description: >-
            When true, matching is case-sensitive; when false, ASCII case
            folding is applied.
          examples:
            - false
          title: Case Sensitive
          type: boolean
      required:
        - key
        - value
      title: PronunciationDictionaryV1Item
      type: object
    PronunciationDictionaryItemPayload:
      properties:
        key:
          description: >-
            Substring to match in the request text (1-256 characters). Alias
            rules may not start or end with whitespace and may not contain
            control characters, `<`, `>`, `(`, `)`, `[` or `]`.
          examples:
            - Fish Audio
          maxLength: 256
          minLength: 1
          title: Key
          type: string
        value:
          description: >-
            Replacement text (1-1024 characters). For phoneme rules this is the
            phonetic form without the `<|phoneme_start|>` / `<|phoneme_end|>`
            markers; for alias rules it is plain text. Neither may contain `<|`
            or `|>`.
          examples:
            - fɪʃ ˈɔːdi.oʊ
          maxLength: 1024
          minLength: 1
          title: Value
          type: string
        type:
          default: phoneme
          description: >-
            Replacement mode: `phoneme` (default, and also the meaning of an
            omitted or null value) speaks the value as a phonetic form; `alias`
            substitutes the literal text. Other values return 422.
          enum:
            - phoneme
            - alias
          examples:
            - phoneme
          title: Type
          type: string
        case_sensitive:
          default: false
          description: >-
            When true, matching is case-sensitive; when false, ASCII case
            folding is applied.
          examples:
            - false
          title: Case Sensitive
          type: boolean
      required:
        - key
        - value
      title: PronunciationDictionaryItemPayload
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.