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

# Replace entries

> Replaces the dictionary's entries. Each entry maps a grapheme to exactly one of alias (whole-word text substitution, expanded at the gateway) or phoneme (passed to the model). Max 1,000 entries.



## OpenAPI

````yaml /api-reference/openapi.json put /pronunciation-dicts/{id}/entries
openapi: 3.1.0
info:
  title: Hopper API
  version: 1.0.0
  description: >-
    Inference for voice agents: LLM, text to speech, and speech to text at
    api.withhopper.com. OpenAI-compatible routes are served under /v1; native
    routes are served at the root. All errors use the OpenAI envelope.
servers:
  - url: https://api.withhopper.com
security:
  - bearerAuth: []
tags:
  - name: LLM
    description: OpenAI-compatible chat completions and model listing.
  - name: Text to Speech
    description: >-
      Speech synthesis: native /tts routes and the OpenAI-compatible
      /v1/audio/speech.
  - name: Speech to Text
    description: Batch transcription. Streaming runs over WS /stt/websocket.
  - name: Voices
    description: Voice library, cloning, profiles, and localization.
  - name: Pronunciation
    description: Pronunciation dictionaries applied at synthesis time.
  - name: Jobs
    description: Status of async voice jobs.
  - name: Health
    description: Unauthenticated liveness check.
paths:
  /pronunciation-dicts/{id}/entries:
    put:
      tags:
        - Pronunciation
      summary: Replace entries
      description: >-
        Replaces the dictionary's entries. Each entry maps a grapheme to exactly
        one of alias (whole-word text substitution, expanded at the gateway) or
        phoneme (passed to the model). Max 1,000 entries.
      parameters:
        - $ref: '#/components/parameters/DictId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - entries
              properties:
                entries:
                  type: array
                  maxItems: 1000
                  items:
                    $ref: '#/components/schemas/PronunciationEntry'
      responses:
        '200':
          description: The stored entries.
          content:
            application/json:
              schema:
                type: object
                properties:
                  dict_id:
                    type: string
                  entries:
                    type: array
                    items:
                      $ref: '#/components/schemas/PronunciationEntry'
        '400':
          description: >-
            Invalid entries: missing grapheme, both or neither of alias/phoneme,
            over 1,000 entries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '404':
          $ref: '#/components/responses/DictNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    DictId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Pronunciation dictionary id.
  schemas:
    PronunciationEntry:
      type: object
      required:
        - grapheme
      description: Exactly one of alias or phoneme per entry.
      properties:
        grapheme:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            The written form to match; whole-word, case-insensitive unless
            case_sensitive.
        alias:
          type: string
          maxLength: 256
          description: Replacement text, expanded at the gateway before synthesis.
        phoneme:
          type: string
          maxLength: 256
          description: Phonetic spelling, passed to the model.
        case_sensitive:
          type: boolean
          default: false
    Error:
      type: object
      description: OpenAI error envelope, used by every error response.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
            param:
              type:
                - string
                - 'null'
  responses:
    Unauthorized:
      description: >-
        Missing, malformed, or revoked API key. Codes: invalid_api_key,
        api_key_disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                Incorrect API key provided. Check your key at
                https://withhopper.com/dashboard.
              type: invalid_request_error
              code: invalid_api_key
              param: null
    PaymentRequired:
      description: Credit balance is zero.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: You have run out of credits. Contact us to add more.
              type: insufficient_quota
              code: insufficient_quota
              param: null
    DictNotFound:
      description: >-
        The dictionary does not exist or belongs to another org. Code:
        dict_not_found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Over 600 requests per minute on this key. Retry after the number of
        seconds in Retry-After.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                Rate limit reached: 600 requests per minute per key. Retry after
                21s.
              type: rate_limit_error
              code: rate_limit_exceeded
              param: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in the Authorization header: Bearer sk_hopper_... Keys are
        minted in the dashboard at withhopper.com/console/keys and shown once at
        creation. WebSocket connections also accept ?api_key=.

````