Your agent pays for what it uses. Under a budget, not a blank check.
An API answers with a 402 and a price. The agent checks the mandate its owner signed once, settles the call in USDC from its wallet slot, and gets the data back. The receipt is sealed to the mandate that allowed it. This rail is live in production on Base mainnet.
Find a service, pay it, seal the receipt.
The agent hits a market-data API it discovered on its own, gets a 402 with a price, verifies the mandate its owner signed, pays in USDC on Base, and gets the JSON back. A second call over the cap is refused before it reaches the chain.
- Discovered the service on its own, no account and no card
- Verified the signed mandate before paying: limit, scope, expiry
- A $2 call against a $1 cap was refused before the chain
- Receipt hash-chained to the mandate that authorized it
The conversation is the easy part.
Machine-to-machine payments today mean prepaid balances, shared keys, and invoices you reconcile later. An agent either has a blank check or no way to pay at all.
Provision an API key and prepay a balance for every service
The agent pays per call in USDC, no account to set up
Give the agent a blank check and hope it behaves
Every payment is checked against a mandate: limit, scope, expiry
Reconcile machine spend from provider invoices weeks later
Each payment is a sealed receipt, hash-chained to its mandate
Trust that an over-budget call just will not happen
A payment over the cap is refused before it touches the chain
Machine spend with a budget.
The agent settles x402-priced calls in USDC from its wallet slot, always inside the mandate its owner signed. USDC on Base is one slot of the multi-rail wallet, and Pix is the center. This is the first CodeSpar rail proven fully in production.
Agent hits the resource
Service quotes a price
codespar_payMandate cap, scope, expiry
MandateUSDC on Base, gasless
Receipt to the mandate
The agent calls a resource, receives a 402 with a price, and codespar_pay verifies the mandate (cap, scope, expiry) before settling in USDC on Base. The x402 leg is gasless via the facilitator relayer. The receipt is hash-sealed to the mandate so every machine payment reconstructs end to end.
A few lines. The whole loop.
const session = await codespar.sessions.create(); // the agent hits an x402-priced resource and gets a 402 + quote const res = await session.execute("codespar_pay", { rail: "x402", resource: "https://x402.example/crypto-news", maxUsdc: 1, // per-tx cap from the signed mandate }); // paid in USDC on Base, inside the cap, sealed to the mandate await session.verificationStatus(res.toolCallId);
codespar_paySettles an x402-priced call in USDC from the wallet slot, inside the mandate cap.
Wallet (USDC slot)Holds USDC on Base as one slot of the multi-rail wallet; Pix is the center.
Audit ledgerHash-seals every machine payment to the mandate that authorized it.
Ship it this afternoon.
Open the sandbox, point a session at your providers, and run the whole loop against real rails in minutes — not the quarter it takes to build it by hand.