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

# Rewrite text with AI post-processing

> `post_processed` says whether an LLM actually ran. Every platform sends
the key on every `ok: true` body, and macOS decodes it as a
non-optional `Bool`, so always read it rather than assuming a 200 means
a rewrite happened.

WHAT COUNTS AS A GRACEFUL DEGRADATION STILL DIFFERS PER PLATFORM, and
this is a known gap rather than a documented guarantee. For a bad key,
a model or network error, or an offline provider: macOS answers
`ok: true` with the raw input and `post_processed: false`; Windows
answers an `ok: false` / `TRANSCRIPTION_FAILED` envelope; the
portable/Linux head answers an `ok: false` / `ENGINE_UNAVAILABLE`
envelope. A `post_processed: false` on a 200 therefore means a silent
skip (post-processing off for the resolved mode, or an empty system
prompt) on Windows and Linux, and either that or a provider failure on
macOS. Handle both the `ok: false` envelope and `post_processed: false`.

One case is the same on every platform: a HyperWhisper Cloud run with
no account key stored answers `ok: false` / `MISSING_API_KEY`, the same
refusal `/transcribe` gives for that mode.




## OpenAPI

````yaml /api-reference/local-api/openapi.yaml post /post-process
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:
  /post-process:
    post:
      summary: Rewrite text with AI post-processing
      description: |
        `post_processed` says whether an LLM actually ran. Every platform sends
        the key on every `ok: true` body, and macOS decodes it as a
        non-optional `Bool`, so always read it rather than assuming a 200 means
        a rewrite happened.

        WHAT COUNTS AS A GRACEFUL DEGRADATION STILL DIFFERS PER PLATFORM, and
        this is a known gap rather than a documented guarantee. For a bad key,
        a model or network error, or an offline provider: macOS answers
        `ok: true` with the raw input and `post_processed: false`; Windows
        answers an `ok: false` / `TRANSCRIPTION_FAILED` envelope; the
        portable/Linux head answers an `ok: false` / `ENGINE_UNAVAILABLE`
        envelope. A `post_processed: false` on a 200 therefore means a silent
        skip (post-processing off for the resolved mode, or an empty system
        prompt) on Windows and Linux, and either that or a provider failure on
        macOS. Handle both the `ok: false` envelope and `post_processed: false`.

        One case is the same on every platform: a HyperWhisper Cloud run with
        no account key stored answers `ok: false` / `MISSING_API_KEY`, the same
        refusal `/transcribe` gives for that mode.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostProcessRequest'
      responses:
        '200':
          description: Rewritten text or business error envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostProcessResponse'
components:
  schemas:
    PostProcessRequest:
      type: object
      required:
        - text
      properties:
        text:
          type: string
        mode_id:
          type: string
          format: uuid
        preset:
          type: string
          description: >-
            hyper | message | mail | note | meeting | code | custom. Mutually
            exclusive with prompt.
        prompt:
          type: string
          description: Free-form system prompt. Sets preset=custom.
        provider:
          type: string
        model:
          type: string
    PostProcessResponse:
      type: object
      properties:
        ok:
          type: boolean
        text:
          type: string
        provider:
          type: string
          description: >-
            The provider that ACTUALLY ran, not the one stored on the mode. All
            three heads return a provider id (`openai`, `anthropic`,
            `local_llm`, or the `custom:<uuid>` string you configured); when the
            mode's stored spelling names the same provider, that spelling is
            echoed back unchanged, so the value differs from what you sent only
            when post-processing genuinely routed elsewhere. HyperWhisper Cloud
            has two accepted spellings for the one provider — macOS resolves it
            as `hyperwhisper` and Windows and Linux as `hyperwhispercloud` — and
            either can come back, because the spelling on your mode is
            preserved. Windows returns `none` when post-processing was skipped;
            macOS then returns the provider the mode resolves to, which is not a
            claim about a run (read `post_processed`); Linux fails the request
            rather than returning a skipped body.
        model:
          type: string
          description: >-
            The model that ACTUALLY ran and produced this text, not the one
            stored on the mode. Post-processing substitutes silently at several
            layers, and the substituted id is what appears here: a retired or
            unknown model id is remapped to the provider default, a local run
            reports the GGUF that was loaded, a custom endpoint reports the
            model name that went on the wire, and a HyperWhisper Cloud run
            reports the engine's catalog model id rather than the unrelated
            model field stored on the mode. The value is always a model id from
            the same vocabulary you would send in a request — never a display
            label. ONE KNOWN GAP: the hosted HyperWhisper Cloud backend runs a
            fallback of its own (a 5xx retry on another provider, or a
            prompt-leakage reroute) and that substitution is NOT visible here —
            a rerouted hosted request still reports the engine you asked for,
            because the backend does not expose the model it served as an id.
            When NO model ran, this falls back to the model the mode's own
            engine would have used (the cloud engine for a HyperWhisper Cloud
            mode, not the mode's `model` field) and is not a claim about a run;
            it can be empty. `post_processed: false` on macOS and `provider:
            none` on Windows are what tell you that happened. An EMPTY value on
            a run that DID happen means the opposite of nothing: an LLM ran and
            no single model id names this text. That is a macOS and Windows case
            only, and the cause is a MIXED-MODEL run — dictated-paragraph
            segments post-processed by different models, so no one id names the
            combined text. (Those two heads can also report `""` for a stored
            custom endpoint whose model name is blank, but only when its URL
            needs repair as well: a blank model on its own is rejected before
            the call, and saving an endpoint rejects both, so only an endpoint
            carried in from an older build or a backup is in that state.) Linux
            never emits it — it post-processes the whole text in one call, and
            it rejects a blank-model custom endpoint before the call rather than
            running it — so an empty `model` there is always the nothing-ran
            fallback above. Read `post_processed` / `provider` to tell an empty
            run value from an empty fallback; never read empty as "nothing ran".
        preset:
          type: string
          description: >-
            The preset the mode was resolved to. Never remapped, so this always
            matches the mode.
        latency_ms:
          type: integer
        post_processed:
          type: boolean
          description: >-
            true when an LLM actually ran and produced post-processed text;
            false when a failure path returned the raw input unchanged. ok stays
            true for graceful degradation, so read this to know post-processing
            happened. Sent by every platform on every ok:true body; macOS
            decodes it as a non-optional Bool. Which failures degrade to ok:true
            and which answer an ok:false envelope instead still differs per
            platform — see the note on this endpoint.
  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.