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

# Partial-field update



## OpenAPI

````yaml /api-reference/local-api/openapi.yaml patch /modes/{id}
openapi: 3.0.3
info:
  title: HyperWhisper Local API
  description: >
    HTTP API exposed by HyperWhisper.app on `127.0.0.1` when the user enables

    Settings → API Server. Off by default. Used by MCP wrappers, benchmarking

    scripts, and power-user automation.


    **Port + token discovery.** The server writes

    `~/Library/Application Support/HyperWhisper/local-api.json`

    (chmod 600) on every start. Clients read that file to find the port

    and bearer token — neither value is hard-coded.


    **Response envelope.** Successful calls return `{"ok": true, ...}` with

    HTTP 200. Expected business failures (model not installed, missing API

    key, file not found, transcription engine errored, etc.) also return HTTP

    200 with `{"ok": false, "error": {"code": "...", "message": "...", "hint":
    "..."}}`.

    HTTP 4xx is reserved for protocol failures: malformed JSON (400), missing

    or invalid bearer token (401), or a rejected Host/Origin header (403 — a

    DNS-rebinding guard applied to every route, including the unauthenticated

    /health, on every platform). On macOS, a request head over 8 KiB a line

    or 64 KiB in total gets a bare 431 and the connection closes.
  version: 1.0.0
servers:
  - url: http://127.0.0.1:{port}
    description: >-
      Local-only loopback. The port is dynamic — read it from the discovery
      file.
    variables:
      port:
        default: '39201'
        description: >-
          Persisted port from `~/Library/Application
          Support/HyperWhisper/local-api.json`.
security:
  - bearerAuth: []
paths:
  /modes/{id}:
    patch:
      summary: Partial-field update
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModePatch'
      responses:
        '200':
          description: Updated mode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModeResponse'
components:
  schemas:
    ModePatch:
      description: >-
        Partial Mode. Any field omitted is left untouched on the server. All
        fields are optional. `id`, `isSystemProvided`, `createdDate` and
        `modifiedDate` are read-only: the server ignores them here, and sets
        `modifiedDate` itself on each patch. On macOS, an explicit JSON null
        clears `customInstructions`, `userSystemPrompt`, `languageModel`,
        `cloudTranscriptionModel`, `cloudTranscriptionDomain`, `cloudProvider`,
        `postProcessingProvider`, `englishSpelling`, `cloudAccuracyTier`,
        `geminiCustomPrompt`, or `cloudPostProcessingModel`. Windows treats null
        like omission for nullable PATCH fields. A key that is not listed here
        is IGNORED, on every platform. The value bounds are the same as on
        `Mode`; only the required-key rule is create-only.
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Must not be empty after normalization and must be unique. Two names
            are the same name when they are equal after trimming Unicode
            whitespace and lowercasing. Windows and Linux trim boundary
            whitespace first; macOS also normalizes Unicode, trims invisible
            boundary characters, and rejects names with no visible base
            character. Lengths are counted in Unicode scalar values.
        preset:
          type: string
          minLength: 1
          maxLength: 64
          description: hyper | message | mail | note | meeting | code | custom
        language:
          type: string
          minLength: 1
          maxLength: 32
        model:
          type: string
        punctuation:
          type: boolean
        capitalization:
          type: boolean
        profanityFilter:
          type: boolean
        customInstructions:
          type: string
          nullable: true
        userSystemPrompt:
          type: string
          nullable: true
          maxLength: 8000
        isDefault:
          type: boolean
          nullable: true
        sortOrder:
          type: integer
          nullable: true
          minimum: -32768
          maximum: 32767
          description: Every platform accepts values from -32768 through 32767.
        languageModel:
          type: string
          nullable: true
        cloudTranscriptionModel:
          type: string
          nullable: true
        cloudProvider:
          type: string
          nullable: true
          description: >-
            The cloud vendor this Mode dictates on. A value you WRITE is
            normalized before it is stored, on every platform: it is lowercased,
            and the two LEGACY names `googlespeech` and `microsoftazurespeech`
            (either casing) are folded onto `hyperwhisper` plus the matching
            `cloudAccuracyTier` (`geminiTranscribe`, `azureMaiTranscribe`) —
            those providers are HyperWhisper Cloud accuracy tiers now, not
            standalone vendors. So a Mode read back may not carry the string you
            sent. On CREATE the folded tier wins over a `cloudAccuracyTier` in
            the same body; on PATCH a `cloudAccuracyTier` in the same request
            wins — so PATCHING BACK A WHOLE DOCUMENT YOU FETCHED WITH `GET`
            folds the provider but PINS the tier the Mode already had, which may
            not be the tier the name implies. Send only the keys you are
            changing. A Mode that ALREADY holds a legacy name is not rewritten
            by this endpoint and is reported as stored. Windows, macOS and Linux
            fold such a row once at app startup.
        postProcessingMode:
          type: integer
          minimum: 0
          maximum: 2
          description: >-
            0 = off, 1 = cloud, 2 = local. Every platform rejects all other
            values.
        postProcessingProvider:
          type: string
          nullable: true
        englishSpelling:
          type: string
          nullable: true
          description: american | british | australian | canadian
        useStreamingTranscription:
          type: boolean
          nullable: true
        cloudAccuracyTier:
          type: string
          nullable: true
        removeTrailingPeriod:
          type: boolean
          nullable: true
        enableScreenOCR:
          type: boolean
          nullable: true
        geminiCustomPrompt:
          type: string
          nullable: true
          maxLength: 2000
        cloudPostProcessingModel:
          type: string
          nullable: true
        cloudTranscriptionDomain:
          type: string
          nullable: true
        localEngine:
          type: string
          nullable: true
          description: Windows and Linux. macOS ignores this key.
        localParakeetModel:
          type: string
          nullable: true
          description: Windows and Linux. macOS ignores this key.
        localPostProcessingModel:
          type: string
          nullable: true
          description: Windows and Linux. macOS ignores this key.
        customVocabulary:
          type: array
          nullable: true
          maxItems: 1000
          items:
            type: string
            maxLength: 200
          description: Windows and Linux. macOS ignores this key.
        providerType:
          type: string
          nullable: true
          description: >-
            Windows and Linux. macOS ignores this key. Windows accepts `local`
            or `cloud` in any casing, stores it lowercase, and refuses any other
            value with INVALID_REQUEST. A mode written before that rule may
            still return another value; Windows runs it on-device. Linux stores
            any value other than `cloud` as `local` and does not refuse it.
    ModeResponse:
      type: object
      properties:
        ok:
          type: boolean
        mode:
          $ref: '#/components/schemas/Mode'
    Mode:
      description: >-
        A key that is not listed here is IGNORED, on every platform. That is
        what makes the "Windows and Linux" keys below safe to send from a
        cross-platform client. The seven `required` keys are required on `POST
        /modes` only; a body missing one is refused on every platform with HTTP
        200 and `INVALID_REQUEST`, naming the keys that are missing. A
        well-formed JSON object that is merely incomplete is a business failure,
        not a protocol failure — see the envelope rule in this document's
        introduction. A body that is not a JSON object, or that carries a value
        of the wrong type, is still the protocol failure that rule describes:
        HTTP 400.
      type: object
      required:
        - name
        - preset
        - language
        - model
        - punctuation
        - capitalization
        - profanityFilter
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Must not be empty after normalization and must be unique. Two names
            are the same name when they are equal after trimming Unicode
            whitespace and lowercasing. Windows and Linux trim boundary
            whitespace first; macOS also normalizes Unicode, trims invisible
            boundary characters, and rejects names with no visible base
            character. Lengths are counted in Unicode scalar values.
        preset:
          type: string
          minLength: 1
          maxLength: 64
          description: hyper | message | mail | note | meeting | code | custom
        language:
          type: string
          minLength: 1
          maxLength: 32
        model:
          type: string
        punctuation:
          type: boolean
        capitalization:
          type: boolean
        profanityFilter:
          type: boolean
        customInstructions:
          type: string
          nullable: true
        userSystemPrompt:
          type: string
          nullable: true
          maxLength: 8000
        isDefault:
          type: boolean
          nullable: true
        isSystemProvided:
          type: boolean
          nullable: true
        sortOrder:
          type: integer
          nullable: true
          minimum: -32768
          maximum: 32767
          description: >-
            Every platform accepts values from -32768 through 32767 and refuses
            anything outside that range with `INVALID_REQUEST`. On create, macOS
            ignores the value and assigns the next stored order.
        createdDate:
          type: string
          format: date-time
          nullable: true
        modifiedDate:
          type: string
          format: date-time
          nullable: true
        languageModel:
          type: string
          nullable: true
        cloudTranscriptionModel:
          type: string
          nullable: true
        cloudProvider:
          type: string
          nullable: true
          description: >-
            The cloud vendor this Mode dictates on. A value you WRITE is
            normalized before it is stored, on every platform: it is lowercased,
            and the two LEGACY names `googlespeech` and `microsoftazurespeech`
            (either casing) are folded onto `hyperwhisper` plus the matching
            `cloudAccuracyTier` (`geminiTranscribe`, `azureMaiTranscribe`) —
            those providers are HyperWhisper Cloud accuracy tiers now, not
            standalone vendors. So a Mode read back may not carry the string you
            sent. On CREATE the folded tier wins over a `cloudAccuracyTier` in
            the same body; on PATCH a `cloudAccuracyTier` in the same request
            wins — so PATCHING BACK A WHOLE DOCUMENT YOU FETCHED WITH `GET`
            folds the provider but PINS the tier the Mode already had, which may
            not be the tier the name implies. Send only the keys you are
            changing. A Mode that ALREADY holds a legacy name is not rewritten
            by this endpoint and is reported as stored. Windows, macOS and Linux
            fold such a row once at app startup.
        postProcessingMode:
          type: integer
          minimum: 0
          maximum: 2
          description: >-
            0 = off, 1 = cloud, 2 = local. Every platform rejects all other
            values.
        postProcessingProvider:
          type: string
          nullable: true
        englishSpelling:
          type: string
          nullable: true
          description: >-
            american | british | australian | canadian. On create, an omitted
            value is seeded from the system region (Canada → canadian, Australia
            → australian, UK/IE/IN/SG/ZA/NZ and other British-English regions →
            british, everything else and an unknown region → american).
        useStreamingTranscription:
          type: boolean
          nullable: true
        cloudAccuracyTier:
          type: string
          nullable: true
          description: >-
            On create, an omitted or empty value resolves to
            `elevenLabsScribeV2`.
        removeTrailingPeriod:
          type: boolean
          nullable: true
        enableScreenOCR:
          type: boolean
          nullable: true
        geminiCustomPrompt:
          type: string
          nullable: true
          maxLength: 2000
        cloudPostProcessingModel:
          type: string
          nullable: true
          description: >-
            On create, an omitted or empty value resolves to
            `anthropic:claude-haiku-5-5`.
        cloudTranscriptionDomain:
          type: string
          nullable: true
        localEngine:
          type: string
          nullable: true
          description: >-
            Windows and Linux. macOS ignores this key and never returns it.
            Defaults to `whisper` on create.
        localParakeetModel:
          type: string
          nullable: true
          description: Windows and Linux. macOS ignores this key and never returns it.
        localPostProcessingModel:
          type: string
          nullable: true
          description: Windows and Linux. macOS ignores this key and never returns it.
        customVocabulary:
          type: array
          nullable: true
          maxItems: 1000
          items:
            type: string
            maxLength: 200
          description: Windows and Linux. macOS ignores this key and never returns it.
        providerType:
          type: string
          nullable: true
          description: >-
            Windows and Linux. macOS ignores this key and never returns it.
            Windows accepts `local` or `cloud` in any casing, stores it
            lowercase, and refuses any other value with INVALID_REQUEST. A mode
            written before that rule may still return another value; Windows
            runs it on-device. Linux stores any value other than `cloud` as
            `local` and does not refuse it.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: base64-url
      description: >-
        Token from the discovery file. Required on every endpoint except
        /health.

````

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