Skip to content

Now open source · Learn more

DocsLocal API Server

Local API Server

Turn on the HyperWhisper HTTP server to control transcription from MCP clients, Shortcuts, Raycast, or a shell script.

HyperWhisper includes an optional HTTP server. The server listens on 127.0.0.1 only, and the network cannot reach it. When the server starts, it writes a discovery file with the port and a bearer token. MCP wrappers, benchmark scripts, and Shortcuts read this file. You do not copy the credentials anywhere.

The server is off by default. You turn it on one time in Settings. It stays on across restarts.

Turn on the server

  1. Open API Server settings

    Open Settings → API Server.

  2. Turn on the server

    Set the toggle to on. The status line then shows the bound address and the last four characters of your bearer token.

When the server runs, the panel shows three tabs on every platform: Connection, MCP setup, and cURL.

Connection tab

The Connection tab shows the current values that you need to make requests to the server.

FieldWhat it shows
PortThe port that the server listens on. The Copy button copies the port to the clipboard.
Bearer tokenHidden by default. Click Reveal to show the full value. Click Copy to copy the token. Click the regenerate button to make a new token (see the next section).
Port fileThe full path of the discovery file. The Show button opens the file in Finder (macOS) or Explorer (Windows). On Linux, the Show button opens the folder of the file in your file manager.

If an error occurs after the server starts (for example, the port is already in use), an orange warning appears below these fields.

Bearer token

Every request except GET /health must include the bearer token:

Authorization: Bearer <token>

HyperWhisper makes the token the first time the server starts. macOS keeps the token in the Keychain. Windows keeps the token in a DPAPI-protected file at %LOCALAPPDATA%\HyperWhisper\local-api-token.bin. Linux keeps the token in an owner-only file at $XDG_DATA_HOME/hyperwhisper/local-api-token. The token stays the same across restarts. You do not update your scripts each time.

To make a new token, click the regenerate button. This button is a circular arrows icon on macOS, a rotate button on Windows, and a refresh icon with the tooltip Regenerate on Linux. The previous token stops immediately. Update each MCP client and each script that cached the old token. These clients and scripts can read the new value from the discovery file.

Host and Origin check

The server also examines the Host, Origin, and Sec-Fetch-Site headers on each request. The server returns 403 for a request that is not a true loopback call. This check protects you against DNS-rebinding attacks from a browser tab. macOS, Windows, and Linux all make this check, and all three make it on every route, including the unauthenticated GET /health.

A request is a true loopback call when all three of these are true:

  • Host is 127.0.0.1:<port> or localhost:<port>, with the port that the server is bound to. A missing Host header is a rejection.
  • Origin is absent, empty, or http://127.0.0.1:<port> or http://localhost:<port>. Any other value is a rejection.
  • Sec-Fetch-Site is absent, same-origin, or none. A browser sends cross-site for a rebound request, and that is a rejection.

A command-line client sends the correct Host and no Origin, so it needs no change. Do not set your own Host header, and do not send an Origin header for a different site.

MCP setup tab

The MCP setup tab shows the configuration to paste into your MCP client. The bridge reads the discovery file when it starts. Thus no port and no token appear in the client configuration.

{
  "mcpServers": {
    "hyperwhisper": {
      "command": "npx",
      "args": ["-y", "@hyperwhisper/mcp"]
    }
  }
}

The Copy button copies the full block. For step-by-step instructions for Cursor, Claude Desktop, and Claude Code, read the MCP setup guide.

cURL tab

The cURL tab shows shell commands that contain your current port and token.

When the server runs, the snippet contains your current values:

PORT=<your port>
TOKEN=<your token>
curl -s http://127.0.0.1:$PORT/health | jq .
curl -s -H "Authorization: Bearer $TOKEN" "http://127.0.0.1:$PORT/models" | jq .

If the server does not run, the snippet reads the values from the discovery file:

PORT=$(jq -r .port ~/Library/Application\ Support/HyperWhisper/local-api.json)
TOKEN=$(jq -r .token ~/Library/Application\ Support/HyperWhisper/local-api.json)
curl -s http://127.0.0.1:$PORT/health | jq .
curl -s -H "Authorization: Bearer $TOKEN" "http://127.0.0.1:$PORT/models" | jq .

Discovery file

When the server starts, it writes a JSON file. MCP wrappers and scripts read the port and the token from this file. You do not put these values in your code.

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

HyperWhisper creates the file with chmod 600. Only your user account can read the file.

The file has this structure:

{
  "port": 39201,
  "pid": 12345,
  "started_at": "2026-06-02T13:57:46Z",
  "api_version": 1,
  "app_version": "2.36.0",
  "token": "9YH8r0Z1u3Xl..."
}

The server deletes the file when it stops correctly. If you force-quit HyperWhisper, the file can stay on disk until the next start. The next start writes new values over the old file.

Port

The server has no fixed port. At the first start, it asks the operating system for a free port. It then keeps that port and uses the same port at each later start. Thus a script that holds the port in its code continues to operate across restarts.

If the kept port is not free at a later start, for example because a different program took it, the server does not fail. It asks the operating system for a new free port and writes the new port into the discovery file. To make a script that always finds the server, read the port from the discovery file.

On macOS, when you set the Local API switch to off, the status shows Stopping… until the old server releases its port, then Server disabled. If you set the switch to on again before the port is released, HyperWhisper waits up to 2 seconds for it. After that, it asks the operating system for a new free port.

Request timeout

A /transcribe or a /post-process call is slow. A large local model, or a slow cloud model, needs 30 to 90 seconds, and sometimes more. On macOS, the server allows 10 minutes for one request. On Windows and on Linux, the server sets no limit on the time of one request.

Set the timeout of your own HTTP client higher than its default value. Many clients apply a short default timeout. Such a client reports a failure while the transcription is still in progress.

On macOS, /transcribe calls on a local Whisper model run one at a time, in the order they arrive. A later call waits for the earlier calls, so set your timeout to include that wait. A dictation in the app has priority over a running call. That call then returns ok: false with the code TRANSCRIPTION_FAILED and the message "Cancelled by a newer transcription request." Send the request again.

Available endpoints

MethodPathAuthPurpose
GET/healthNoneServer identity and status.
GET/modelsRequiredModel catalog.
GET/modesRequiredList saved Modes.
POST/modesRequiredCreate a Mode.
GET/modes/{id}RequiredFetch one Mode.
PATCH/modes/{id}RequiredPartial-field update.
DELETE/modes/{id}RequiredDelete a Mode.
POST/transcribeRequiredTranscribe an audio file. If you give a file path instead of audio_base64, the path must be inside your recordings folder. The server rejects all other paths.
POST/post-processRequiredRewrite text with a preset prompt or a custom prompt.
GET/recordings/searchRequiredSubstring search across past transcripts.
GET/recordings/{id}RequiredSingle transcript row.
GET/recordingsRequiredWindows and Linux only — an alias for /recordings/search. It uses the same handler and the same parameters. macOS does not serve it.
POST/recording/toggleRequiredLinux only — start the microphone, or stop it and transcribe.
POST/recording/cancelRequiredLinux only — stop the microphone and keep no transcript.

The OpenAPI reference gives the full request and response schemas.

The recording routes on Linux

The Linux build serves two routes that drive the live microphone. The macOS build does not serve them. Windows answers them with ok: false and the code ENGINE_UNAVAILABLE: recording control is not available through the Local API on Windows. Neither route takes a body, and both answer with the state of the recorder:

{ "ok": true, "recording": { "is_recording": true, "state": "recording" } }

state is one of idle, recording, stopping, transcribing, retrying, completed, cancelled, or failed.

POST /recording/toggle starts the recorder when the recorder is idle. It stops the recorder and transcribes when the recorder is recording, and it waits for that transcription. The route accepts no mode_id, so it uses the current Mode. A toggle during the stopping or the transcribing state is refused with an HTTP 400 and the code INVALID_REQUEST, because a transcription is already in progress.

POST /recording/cancel stops the recorder at any point and keeps no transcript.

What /transcribe does to the text

/transcribe does not run AI post-processing. /post-process is the endpoint for that. This is true even when the Mode you name has AI post-processing on.

The deterministic text steps are different. They are your own settings, and they contain no AI. On all three platforms, the text field gives you the transcript after these three steps:

  • Vocabulary replacements.
  • Dictated break commands. "New line" and "new paragraph" become a line break in the text.
  • Remove filler words, when that setting is on. This step applies to English only. "Er" and "um" are real words in other languages, so the step leaves every other language alone.

When mode_id and engine disagree

You can send mode_id and engine in the same /transcribe request. The Mode is the baseline, and the engine replaces the provider for this one call. The two can name different cloud vendors, and then the question is which model runs.

The Mode's saved model does not move to the other vendor. Each platform drops it and uses the engine's own default model. A model id is not portable between vendors: nova-3-general is a Deepgram model, and an OpenAI request that carries it is rejected — or, worse, is accepted because the same text is also a model of that vendor, and you are billed for a model you did not ask for.

Three rules follow:

  • An explicit model wins. Send "model" to pin one. For a BYOK provider the value goes to the vendor as you sent it, and no other rule applies.
  • A model that really belongs to the engine you named is kept. This includes an old name for a current model. An AssemblyAI Mode saved with universal, re-run with "engine": "assemblyai", still runs universal. It is not silently changed to a different model at a different rate.
  • HyperWhisper Cloud is different. It selects the model from the Mode's accuracy tier, not from a model id. "engine": "cloud" keeps the Mode's model only when that model is one of the tier's models, and uses the tier's default model in every other case. This applies to an explicit model too.

Read the response model field to see which rule applied. It names the model that ran. It is empty only for an engine that takes no model parameter, which the OpenAPI reference describes in full.

Two engine names are old names

googlespeech and microsoftazurespeech are the old names of two providers that HyperWhisper Cloud now serves as accuracy tiers. Every platform accepts them, and every platform now folds them:

You sendThe request runs onThe response reports
"engine": "googlespeech"HyperWhisper Cloud, tier Gemini 3.5 Transcribe"engine": "hyperwhisper"
"engine": "microsoftazurespeech"HyperWhisper Cloud, tier MAI-Transcribe"engine": "hyperwhisper"

Both spend HyperWhisper Cloud credits. Send an explicit model to choose a model inside the tier — mai-transcribe-1.5 instead of mai-transcribe-2, for example. The response engine is hyperwhisper, and you can send that value back in the next request.

The same fold applies to a Mode you write. POST /modes or PATCH /modes/{id} with "cloudProvider": "googlespeech" stores "cloudProvider": "hyperwhisper" and the matching cloudAccuracyTier, so read the Mode back to see what it holds. On create, the tier that the name implies wins over a cloudAccuracyTier in the same body. On patch, a cloudAccuracyTier in the same request wins.

Mode write rules

POST /modes and PATCH /modes/{id} reject an empty mode name and a case-insensitive duplicate. Windows trims whitespace at the start and end of the name. macOS also normalizes Unicode and trims invisible-only characters from the boundaries. A macOS name must contain at least one visible base character.

Exactly one Mode is the default Mode, and its name is fixed. Two rules follow, and all three platforms apply them:

  • A PATCH that changes the name of the default Mode returns ok: false with INVALID_REQUEST. The name field is disabled in the app for the same reason. Rename a different Mode, or make a different Mode the default first.
  • "isDefault": true moves the flag. The Mode that held it stops being the default in the same request. "isDefault": false on the only default Mode returns ok: false with INVALID_REQUEST, because it would leave no default Mode.

DELETE /modes/{id} on the default Mode moves the flag to the first remaining Mode. A restored backup that carries two default Modes, or none, is repaired the same way when the app starts.

On macOS, postProcessingMode must be 0, 1, or 2 on create and patch. A PATCH sortOrder must be from -32768 to 32767. macOS ignores sortOrder on create and assigns the next stored order. An invalid value returns ok: false with INVALID_REQUEST and does not change the mode.

For a macOS PATCH, an omitted field stays unchanged. An explicit JSON null clears these string fields: customInstructions, userSystemPrompt, languageModel, cloudTranscriptionModel, cloudTranscriptionDomain, cloudProvider, postProcessingProvider, englishSpelling, cloudAccuracyTier, geminiCustomPrompt, and cloudPostProcessingModel. Windows treats null like an omitted value for these PATCH fields.

Local models on Linux

A local Mode on Linux names its engine in localEngine. The value is one of two: whisper or parakeet. Linux removes the whitespace around the value and makes it lower case, and it uses whisper when you send no value.

parakeet is the engine of every model that the sherpa-onnx daemon runs, and localParakeetModel selects which one. So parakeet is how you select Nemotron 3.5 or Qwen3 ASR as well. Neither model has a localEngine value of its own.

localEngineField that names the modelAccepted modelsDefault
whispermodelType, or modeltiny, tiny.en, base, base.en, small, small.en, medium, medium.en, large-v3-turbo, large-v2, large-v3base
parakeetlocalParakeetModel, or modelparakeet-v2, parakeet-v3, qwen3-asr-0.6b, nemotron-3.5-ml-560msparakeet-v3

A different localEngine, or a model that is not in the list of its engine, returns an HTTP 400 with the code INVALID_REQUEST. The model must also be one of the voice models that GET /models reports.

To write a cloud Mode instead, send "providerType": "cloud" and a cloudProvider. A "model": "cloud" sets the same thing. If you omit cloudProvider, Windows and Linux run the Mode on HyperWhisper Cloud, and GET /modes still reports it without the key. Linux refuses an empty cloudProvider string, or a cloudProvider that is not in its provider list. It returns an HTTP 400 with the code INVALID_REQUEST.

Windows accepts the same two field names, but it applies no list of accepted values to them. Only Linux refuses an unknown localEngine or an unknown local model.

On Windows, a PATCH that changes a cloud Mode to "providerType": "local" must also name the local model in model (or in localParakeetModel for the parakeet engine). Without it, Windows returns INVALID_REQUEST and does not pick a model for you. A local Mode stores its local model ID in model, and GET /modes reports cloudProvider: null for it.

The providers array includes key_present, reachable, and status. For HyperWhisper Cloud, key_present reports whether HyperWhisper has your Cloud account key. A Meta key reports status: "configured" and reachable: false. Meta has no safe empty request for key validation. A transcription validates the key for that request, but the health endpoint stays conservative. macOS and Windows use the same status.

Next steps

  • MCP setup guide — connect HyperWhisper to Cursor, Claude Desktop, or Claude Code as an agent tool.
  • API overview — authentication, response envelope, and error codes.