> ## 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.

# Compare Versions

> Compare the rules of two versions of a pronunciation dictionary

`version_id` is the version you are looking at and `base_version_id` is the version it is compared with.


## OpenAPI

````yaml get /v1/pronunciation-dictionaries/{dictionary_id}/versions/{version_id}/compare
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/{version_id}/compare:
    get:
      tags:
        - Pronunciation Dictionaries
      summary: Compare two versions
      description: >-
        Return a row-level diff between the target version and
        `base_version_id`: added, removed, changed, moved and unchanged rules.
      parameters:
        - in: path
          name: dictionary_id
          description: ''
          required: true
          schema:
            title: Dictionary Id
            type: string
          deprecated: false
        - in: path
          name: version_id
          description: ''
          required: true
          schema:
            title: Version Id
            type: string
          deprecated: false
        - in: query
          name: base_version_id
          description: Version to compare the target version against.
          required: true
          schema:
            examples:
              - 9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e
            title: Base Version Id
            type: string
          deprecated: false
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                description: Row-level diff between two versions of one dictionary.
                properties:
                  version_id:
                    description: Target (viewed) version.
                    examples:
                      - 1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b
                    title: Version Id
                    type: string
                  base_version_id:
                    description: Base version the target is compared against.
                    examples:
                      - 1c3e5a7b9d0f4a2c8e6b4d1f3a5c7e9b
                    title: Base Version Id
                    type: string
                  added:
                    description: Number of added rows.
                    examples:
                      - 1
                    title: Added
                    type: integer
                  removed:
                    description: Number of removed rows.
                    examples:
                      - 0
                    title: Removed
                    type: integer
                  changed:
                    description: Number of changed rows.
                    examples:
                      - 2
                    title: Changed
                    type: integer
                  rows:
                    description: >-
                      Per-rule diff rows in target order, with removed rows
                      last.
                    items:
                      $ref: '#/components/schemas/PronunciationDictionaryV1CompareRow'
                    title: Rows
                    type: array
                required:
                  - version_id
                  - base_version_id
                  - added
                  - removed
                  - changed
                  - rows
                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
        '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:
    PronunciationDictionaryV1CompareRow:
      description: One rule row in a version comparison.
      properties:
        key:
          description: Key in the target version.
          examples:
            - Fish
          title: Key
          type: string
        value:
          description: Value in the target version.
          examples:
            - fɪʃ
          title: Value
          type: string
        type:
          default: phoneme
          description: Replacement type in the target version.
          enum:
            - phoneme
            - alias
          examples:
            - phoneme
          title: Type
          type: string
        case_sensitive:
          description: Case sensitivity in the target version.
          examples:
            - false
          title: Case Sensitive
          type: boolean
        order:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: >-
            Position in the target version; null for a removed row (the rule
            only exists in the base version).
          examples:
            - 0
          title: Order
        status:
          description: >-
            Change relative to the base version: `added` only in target,
            `removed` only in base, `changed` with different content, `moved`
            with identical content but a different position, `unchanged`.
          enum:
            - added
            - removed
            - changed
            - moved
            - unchanged
          examples:
            - changed
          title: Status
          type: string
        base_key:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Key in the base version; only for changed, moved or removed rows.
          examples:
            - Fish
          title: Base Key
        base_value:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Value in the base version; only for changed, moved or removed rows.
          examples:
            - fɪʃ
          title: Base Value
        base_type:
          anyOf:
            - enum:
                - phoneme
                - alias
              type: string
            - type: 'null'
          default: null
          description: >-
            Replacement type in the base version; only for changed, moved or
            removed rows.
          examples:
            - phoneme
          title: Base Type
        base_case_sensitive:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          description: >-
            Case sensitivity in the base version; only for changed, moved or
            removed rows.
          examples:
            - false
          title: Base Case Sensitive
        base_order:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: >-
            Position in the base version; only for changed, moved or removed
            rows.
          examples:
            - 0
          title: Base Order
      required:
        - key
        - value
        - case_sensitive
        - status
      title: PronunciationDictionaryV1CompareRow
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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