Cubs

Reference

The control plane API

Billing and machine state, over HTTP. Every example below is a response the built server returned.

Endpoints

GET/api/billing/summary

Balance, hourly rate, recent entries, and your machines.

Auth Session cookie

Response

{
  "ok": true,
  "data": {
    "balanceMicro": 45000000,
    "balanceLabel": "$45.00",
    "hourlyLabel": "$0.0329",
    "exhausted": false,
    "recent": [
      { "date": "2026-12-02", "event": "Top-up", "amount": "+$20.00" }
    ],
    "machines": [
      { "id": "m_seed", "name": "cubs-quiet-harbor", "status": "running", "vcpus": 4 }
    ]
  }
}
POST/api/machines/{id}/pause

Stop the processes. Files are kept and the rate drops to the paused rate.

Auth Session cookie

Response

{
  "ok": true,
  "data": {
    "machine": { "id": "m_seed", "status": "paused" },
    "chargedMicro": 0,
    "message": "Paused. Processes stopped, every file kept."
  }
}
POST/api/machines/{id}/resume

Start the machine. Refused with 402 when there is no credit.

Auth Session cookie

Response

{
  "ok": true,
  "data": {
    "machine": { "id": "m_seed", "status": "running" },
    "message": "Running. Billing is per second from your credit."
  }
}
POST/api/billing/topup

Add credit. Never starts a paused machine. With a payment provider configured it answers 201 and a `checkoutUrl` instead of crediting, and the credit arrives when the provider confirms the payment.

Auth Session cookie

Request body

{ "amountUsd": 20, "idempotencyKey": "your-own-key" }

Response

// provider configured, no money has moved yet
{
  "ok": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_…",
    "sessionId": "cs_…",
    "message": "Redirecting to Stripe. Credit is added when the payment is confirmed, not before."
  }
}

// no provider — a demo deployment, and the response says so
{
  "ok": true,
  "data": {
    "credited": true,
    "amountMicro": 20000000,
    "balanceMicro": 65000000,
    "machineResumed": false,
    "note": "Credit added."
  }
}

Status codes

200
Done. The body carries ok: true and data.
400
The body was refused before any rule ran: not JSON, a negative amount, a missing idempotency key.
401
No session, or one that does not verify: bad signature, expired, or signed with another secret.
402
Resume refused because the balance is zero. The machine stays paused and its files stay.
404
No such machine, or it belongs to another account. The two are indistinguishable on purpose.
409
The machine is in a state that cannot make that transition, pausing a paused machine, resuming a deleted one.
413
The body is larger than 64 KB.

How the money works

What is not built yet

Stated plainly, because an API reference that implies more than exists is the most expensive kind of wrong. This list is short, and it is the whole of it.

What is built, so this list is not read as a description of the product: sign-in by email link works, a top-up takes a card through a payment provider and credits only what the provider confirms, and a machine is created on real hardware through a provider.

A new home for your agents

A machine that stays on, with your coding agents on it. $25 of credit to start, no card.

Get the download link

Enter your email and we will send the download link when the signed build ships. Open it on a Mac with Apple Silicon.

One message when the build is signed. No newsletter.