Budgets & billing
Every cent metered.
Every run capped.
Funds are reserved before a run starts, metered to the GPU-second while it works, charged exactly once when it ends, and receipted on a ledger nobody can edit.
curl https://api.swarms.dev/api/v1/budgets \ -H "Authorization: Bearer $SWARMS_KEY" \ -d '{ "scope": "key:prod-research", "limitMinor": 5000, "currency": "USD" }' # $50.00, stored as 5000 — integer minor units, no floats.# Every run under this key reserves funds before it starts.An agent that can spend real money needs more than a dashboard. It needs a limit that physically stops it, a charge that lands exactly once, and a record nobody can edit afterward. Swarms treats money as an engineering problem — integer units, reserved funds, append-only books — not a reporting one.
Hard-stop ceilings
A limit the platform enforces, not suggests.
Budget alerts arrive after the money is gone. Swarms budgets are enforcement: scoped to an org, an API key, or a schedule, with funds reserved before the run begins. If the reservation fails, nothing starts.
While it runs, the meter is exact — $0.02 per GPU-second plus a 20% platform fee, counted against the ceiling in real time. At the line, the worker stops. The overage is zero because overage is impossible.
budgetUsd: 3.00 — a physical ceiling
The ledger
Double-entry, append-only, exactly once.
Every amount in the system is an integer in minor units — floating point is banned from monetary math. Every charge carries an idempotency key, so a retried request can never bill you twice: exactly-once is a property, not a promise.
It all lands on a double-entry ledger that only grows. Holds, charges, releases, and receipts are appended, never updated — which means the books reconcile by construction.
the ledger never lies — append-only
x402 & credits
Agents that can pay their own way.
The web is starting to price itself for machines. With x402, when a resource answers HTTP 402, your agent pays the quoted price from prepaid credits and proceeds — no human in the checkout flow, no card number in a prompt.
Credits auto-reload at the floor you set, and every draw feeds spend analytics. Cost anomaly detection flags the run that spends unlike its history before it becomes a line item you have to explain.
GET https://data.example.com/premium-dataset← 402 Payment Required x402: { "amountMinor": 12, "currency": "USD" } → retried with payment attached← 200 OK # 12¢ drawn from prepaid credits, receipted on# the ledger · credits auto-reload at your floorStop discovering “what the agents spent.” Start declaring “what the agents may spend” — reserved up front, metered to the second, receipted forever.
What that unlocks
No runaway loops
The retry storm at 3am hits its ceiling and stops. The worst case is a capped budget spent, never an uncapped bill discovered.
Books that reconcile themselves
Append-only double-entry means every balance is the sum of its history. Month-end close is a query, not an investigation.
Retries that never double-charge
Idempotency keys make charging exactly-once even when networks flake. Your agent can retry aggressively; your invoice cannot.
Anomalies before invoices
Spend analytics baseline every workload, and the run that costs 8x its history gets flagged today — not on next month’s statement.
Keep exploring
Give your agent a workforce.
Start free. Spawn your first swarm in minutes. Pay only for the GPU-seconds you use.