HalfpennyMac
For developers and agents

The Halfpenny Mac API, command line and MCP server.

Everything the dashboard does for a machine, from a script or an AI agent: list your Macs, see whether they are online, fetch credentials, restart, rotate the password, update macOS, order another Mac on your saved card, and open a support ticket when it needs a person. JSON over HTTPS, a personal access token, and an OpenAPI document to generate a client from.

Quick start

  1. 1

    Create a token

    Go to Account → API & CLI on the dashboard. Name the token after the tool that will use it and pick its scopes. The token is shown once, so copy it straight away.

  2. 2

    Command line

    npx halfpennymac login                      # paste the token
    npx halfpennymac machines                   # your Macs
    npx halfpennymac status mini-01-123         # online? invite accepted? connected?
    npx halfpennymac ssh mini-01-123            # open a shell on it
    npx halfpennymac restart mini-01-123 --wait # restart and wait for it to come back
    npx halfpennymac tickets open --subject "…" --body "…"   # ask a person (support scope)
    npx halfpennymac order pro --wait           # another Mac on your saved card (order scope)

    Add --json to any command for scripts. The package is halfpennymac on npm; npm install -g halfpennymac gives you a plain halfpenny command.

  3. 3

    Claude Code, Cursor, Claude Desktop (MCP)

    claude mcp add halfpenny -e HALFPENNY_TOKEN=hpm_… -- npx -y halfpennymac mcp

    Or add it to any MCP config (every tool is in the MCP server docs):

    {
      "mcpServers": {
        "halfpenny": {
          "command": "npx",
          "args": ["-y", "halfpennymac", "mcp"],
          "env": { "HALFPENNY_TOKEN": "hpm_…" }
        }
      }
    }

    Then ask your agent: “is my build Mac online?”, “restart mini-01-123 and tell me when it is back”, “what would a Max cost me?”, “open a support ticket about the backups”, “order me another Pro and tell me when it is online”.

  4. 4

    Plain HTTPS

    curl -H "Authorization: Bearer hpm_…" https://halfpennymac.com/api/v1/machines

    Base URL https://halfpennymac.com/api/v1, JSON in and out. Generate a client from openapi.json.

Tokens and scopes

A token acts as you. Macs shared with you as a team member appear with role member: you can read and connect, not restart. Tokens can expire, and you can revoke any token from the dashboard at once.

The support scope stands alone: it reaches only the ticket calls, and no other scope does. An agent with a support-only token can ask us for help without being able to see or touch a Mac.

The order scope stands alone as well, and comes with a limit you set when you make the token: how many Macs it may order, one by default. It reaches the order calls and the catalogue, nothing else. Orders go on the card already on your account. The API never takes card details, so with no card on file an order is refused and a person adds one on the dashboard.

ScopeAllows
readList your machines, their status, actions and the catalogue.
connectFetch credentials: the macOS password, Tailscale invite and SSH relay key.
manageRestart, rotate the password and update macOS.
supportOpen and reply to support tickets.
orderOrder a Mac on your saved card, up to the limit you set on this token, and read the catalogue.

Endpoints

Base URL https://halfpennymac.com/api/v1. A machine is addressed by its id or by its name (mini-01-123).

CallWhat it does
GET /meWho the token acts as
Any scope. The user, and the token name and scopes.
GET /machinesList your machines
Newest first. Includes machines shared with you as a team member. Cancelled requests are left out unless include=cancelled.
GET /machines/{id}One machine
GET /machines/{id}/statusLive checks: online, invite accepted, connected before, restart phase
POST /machines/{id}/credentialsCredentials (scope: connect)
The macOS username and password, the Tailscale host and invite, and the SSH relay key when one exists. Logged like a dashboard reveal. Treat the response as a secret.
GET /machines/{id}/actionsRecent actions on a machine
POST /machines/{id}/actions/{command}Restart, or rotate the macOS password (scope: manage)
Owners only. restart has a 10-minute cooldown and is refused while FileVault is on (the Mac could not come back unattended). rotate_password issues a new password; fetch it from /credentials once the action succeeds.
POST /machines/{id}/macos-updateInstall pending macOS updates (scope: manage)
Minor updates install (with a restart where needed); a major upgrade is reported in major_available but never installed by this call.
GET /actions/{id}One action
GET /catalogTiers, prices and stock (scope: read or order)
GET /ordersList orders placed over the API (scope: order)
Newest first, with allowance: how many Macs this token may order, how many it has, and whether a card is on file. Orders placed on the dashboard are not listed here; once delivered, every Mac is under GET /machines.
POST /ordersOrder a Mac on the card on file (scope: order)
Orders one machine, billed monthly to the card already on the account. Tiers the catalogue marks orderable can be ordered: in stock (claimed, charged and online within the hour) or built to order (queued, online within 48 hours, charged when the Mac is reserved). The answer is the order as it stands when the call returns; poll GET /orders/{id} until status is delivered, then use the same id with GET /machines/{id}. Refused with 402 when there is no card on file, 403 when the token has used its order limit, and 409 for a special order (deposit and minimum term), which is placed on the dashboard. The Mac Studios are quoted, not ordered.
GET /orders/{id}One order: where it stands (scope: order)
Poll this after POST /orders; once a minute is plenty. detail says in a sentence what is happening and what, if anything, to do.
POST /orders/{id}/cancelCancel an order before handover (scope: order)
Works while nothing has been charged (cancellable is true: queued, payment_required or payment_failed). An open first payment is cancelled with it. Safe to repeat: an order already cancelled comes back unchanged. A cancelled order no longer counts against the token's limit. Once a Mac is paid for or handed over this is refused with 409: ending a rental is done on the dashboard.
GET /ticketsList your support tickets (scope: support)
Newest activity first. status is open (with us), waiting_user (we replied, your move) or resolved. unread_reply is true when we have replied since the ticket was last read.
POST /ticketsOpen a support ticket (scope: support)
Opens a ticket as you, exactly as the dashboard does: it lands in the same inbox, the team is notified, and replies come back on the ticket and by email. Reply with POST /tickets/{id}/messages rather than opening another ticket about the same thing. At most 10 new tickets an hour per account. Send an Idempotency-Key so a retry cannot open it twice.
GET /tickets/{id}One ticket with its messages (scope: support)
Messages oldest first, each with author_role (user or admin). Attachments are listed by name and size only. Reading a ticket marks it seen, as opening it on the dashboard does.
POST /tickets/{id}/messagesReply on a ticket (scope: support)
Posts your reply and notifies the team. A waiting_user ticket goes back to open. A resolved ticket is refused with 409: open a new ticket to follow up. Send an Idempotency-Key so a retry cannot post it twice.

Shapes

Lists come under a resource key with a meta object; a single resource under its name. Actions are asynchronous: a restart returns an action you poll at GET /actions/{id} until its status issuccess or error, and for a restart the phase walks queued → restarting → online.

{
  "machine": {
    "id": "0a1b2c3d-…", "name": "mini-01-123", "status": "active", "role": "owner",
    "tier": "budget", "tier_label": "Budget", "spec": "M1, 8 GB RAM, 245 GB",
    "online": true, "last_seen_at": "2026-10-21T14:02:11Z",
    "macos": { "version": "27.0", "update_available": false, "updating": false },
    "backups": { "ok": true, "last_success_at": "2026-10-21T03:14:09Z" },
    "access": { "tailscale_host": "mini-01-123.tail….ts.net", "username": "halfpenny-…",
                "ssh_relay": { "host": "relay.halfpennymac.com", "port": 22, "user": "…" } },
    "billing": { "cadence": "monthly", "amount": 39, "currency": "gbp", "status": "active", "next_bill_at": "…" }
  }
}

Ordering

GET /catalog marks each tier orderable or not. POST /orders with a tier and an Idempotency-Key header places the order and answers with it as it stands. An order is followed, not instant: poll GET /orders/{id} until status is delivered, then use the same id with GET /machines/{id} and POST /machines/{id}/credentials.

curl -X POST https://halfpennymac.com/api/v1/orders \
  -H "Authorization: Bearer hpm_…" -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c0f0e-2b7a-4d0e-9a55-0c3c1f2f9b11" \
  -d '{ "tier": "pro" }'

{
  "order": {
    "id": "9b2f4c1e-…", "status": "queued", "tier": "pro", "tier_label": "Pro",
    "detail": "Built to order: online within 48 hours of the order. The saved card is charged when the Mac is reserved, not before.",
    "price": { "currency": "gbp", "monthly": 89 },
    "lead_time": "built to order, online within 48 hours", "expected_by": "2026-11-11T10:30:00Z",
    "payment_url": null, "machine": null, "cancellable": true
  }
}
StatusMeaning
queuedBuilt to order: online within 48 hours. Nothing is charged until the Mac is reserved.
configuringPaid and being set up, usually online within the hour.
payment_requiredThe card needs a person, for example to approve the payment with the bank. Open payment_url.
payment_failedThe first payment was not completed in time. Nothing was charged and no Mac is held.
deliveredHanded over. The order id is the machine id.
cancelledCancelled before handover. Nothing was charged.
endedHanded over, and the rental has since ended.

POST /orders/{id}/cancel works while cancellable is true, which is until anything is charged. After that, ending a rental is done on the dashboard. Special orders with a deposit and the Mac Studios, which are quoted to your spec, are arranged on the dashboard too.

Errors

One shape for every failure: { "error": { "code", "message", "details"? } }. Quote the X-Request-Id header when you write to support, on the dashboard or with POST /tickets.

We keep a record of each call made with your tokens for 90 days: the time, the endpoint, the result, the IP address and the client name. It never includes what you sent or what we returned. It is how we can look up a call from its X-Request-Id.

CodeStatusMeaning
unauthenticated401No token, or a token that is unknown, revoked or expired.
forbidden403The token is valid but may not do this: act on this machine (team members, for example, cannot restart it), or order another Mac once its order limit is used.
insufficient_scope403The token lacks the scope this call needs (read, connect, manage, support or order).
not_found404No such machine, action, ticket or order, or it belongs to someone else.
invalid_input400The request body or query could not be used; details.fields says what is wrong.
conflict409Not in a state where this can happen (machine not delivered, FileVault on, cooldown; ticket already resolved; order already paid or handed over), or an Idempotency-Key that is still running or was used for a different request.
locked423An action of this kind is already running on the machine; wait for it.
awaiting_payment402The machine is reserved but its first payment has not completed; finish it on the dashboard.
payment_method_required402Ordering needs a card on file and there is none. A person adds one on the dashboard; the API never takes card details.
subscription_ended410The subscription was cancelled and has lapsed.
rate_limited429Too many requests for this token; Retry-After says how long to wait.
service_error500Something failed on our side; safe to retry.

Limits and conduct

  • 120 requests a minute per token; X-RateLimit-Remaining and Retry-After tell you where you stand.
  • Credential calls are logged on your account like a dashboard reveal. Treat the response as a secret.
  • Restarts have a ten-minute cooldown and are refused while FileVault is on, because the Mac could not come back unattended.
  • Tickets opened over the API reach the same inbox as the dashboard and are answered by people, so say what you tried. Ten new tickets an hour per account; reply on an existing ticket rather than opening another about the same thing.
  • Send an Idempotency-Key header of your own with a ticket write, and a retry after a timeout returns the first result instead of doing it twice. Keys are kept for 24 hours. The command line and the MCP server send one for you.
  • An order needs an Idempotency-Key, and that key stays tied to its order for good, so a retry can never order a second Mac.
  • Orders bill monthly to the card on file, up to the limit set on the token. A cancelled order gives its place back; a delivered one does not.

Questions or a missing endpoint? Open a ticket (or POST /tickets); the people who built this read them.