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
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
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
--jsonto any command for scripts. The package is halfpennymac on npm;npm install -g halfpennymacgives you a plainhalfpennycommand. - 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
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.
| Scope | Allows |
|---|---|
read | List your machines, their status, actions and the catalogue. |
connect | Fetch credentials: the macOS password, Tailscale invite and SSH relay key. |
manage | Restart, rotate the password and update macOS. |
support | Open and reply to support tickets. |
order | Order 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).
| Call | What it does |
|---|---|
GET /me | Who the token acts as Any scope. The user, and the token name and scopes. |
GET /machines | List 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}/status | Live checks: online, invite accepted, connected before, restart phase |
POST /machines/{id}/credentials | Credentials (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}/actions | Recent 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-update | Install 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 /catalog | Tiers, prices and stock (scope: read or order) |
GET /orders | List 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 /orders | Order 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}/cancel | Cancel 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 /tickets | List 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 /tickets | Open 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}/messages | Reply 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
}
}| Status | Meaning |
|---|---|
queued | Built to order: online within 48 hours. Nothing is charged until the Mac is reserved. |
configuring | Paid and being set up, usually online within the hour. |
payment_required | The card needs a person, for example to approve the payment with the bank. Open payment_url. |
payment_failed | The first payment was not completed in time. Nothing was charged and no Mac is held. |
delivered | Handed over. The order id is the machine id. |
cancelled | Cancelled before handover. Nothing was charged. |
ended | Handed 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.
| Code | Status | Meaning |
|---|---|---|
unauthenticated | 401 | No token, or a token that is unknown, revoked or expired. |
forbidden | 403 | The 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_scope | 403 | The token lacks the scope this call needs (read, connect, manage, support or order). |
not_found | 404 | No such machine, action, ticket or order, or it belongs to someone else. |
invalid_input | 400 | The request body or query could not be used; details.fields says what is wrong. |
conflict | 409 | Not 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. |
locked | 423 | An action of this kind is already running on the machine; wait for it. |
awaiting_payment | 402 | The machine is reserved but its first payment has not completed; finish it on the dashboard. |
payment_method_required | 402 | Ordering needs a card on file and there is none. A person adds one on the dashboard; the API never takes card details. |
subscription_ended | 410 | The subscription was cancelled and has lapsed. |
rate_limited | 429 | Too many requests for this token; Retry-After says how long to wait. |
service_error | 500 | Something failed on our side; safe to retry. |
Limits and conduct
- 120 requests a minute per token;
X-RateLimit-RemainingandRetry-Aftertell 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-Keyheader 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.