{"type":"article","schemaVersion":"1","slug":"arc-c18-sdk-caps","title":"A Paying Client That Cannot Overspend: Mandatory Caps for x402 Buyer Agents","description":"An x402 buyer SDK that refuses to construct without PaymentCaps: per-call cap, session budget, strict accepts[] validation (never guess decimals), anti-loop guard, payer-binding headers, and an agentbadge pay CLI with --print-only.","status":"LIVE","topics":["arc","ai-agents","usdc","x402","sdk","caps"],"concepts":["arc","ai-agents","usdc","x402","sdk","caps"],"rules":[],"capabilities":[],"actions":[{"type":"read","label":"Read article (Markdown)","url":"https://agentbadge.xyz/blog/arc-c18-sdk-caps.md"},{"type":"view-demo","label":"Run Agent Readiness scan","url":"https://agentbadge.xyz/scan?src=article:arc-c18-sdk-caps"}],"qa":[{"question":"Why are spending caps mandatory instead of optional?","answer":"Because a cap you can forget is a cap you will forget. The paying client requires {maxPaymentUsd, sessionBudgetUsd} at construction, for example {maxPaymentUsd: \"0.50\", sessionBudgetUsd: \"5\"}. Omit them and construction fails with TypeError: PaymentCaps required — refusing to create an uncapped pay…"},{"question":"What does strict accepts validation reject?","answer":"Everything that is not on the contract, and it names what it rejected. Each entry of the accepts[] array in a 402 body must pass five checks: x402Version is 2; scheme is one of exact, eip3009-client-broadcast, or gateway-batch; network is in your allowlist; asset equals the USDC address for that ch…"},{"question":"How does the session budget stop a runaway loop?","answer":"The client keeps a cumulative SpendTracker for the session, and the reserve happens before signing. A 402 response goes through validateAccepts → tracker.tryReserve(amount) → only then does the signer see a typed-data payload. A price above the per-call cap throws CapExceededError carrying {cap, re…"},{"question":"What does the agent actually sign — and when does money move?","answer":"Signing is scheme-specific, and signing is not spending. For exact, the signer produces an EIP-3009 transferWithAuthorization typed-data signature; the facilitator settles it later, so a signature alone moves no funds. For eip3009-client-broadcast (Arc self-settle), the client broadcasts the USDC t…"},{"question":"How do you run it — and verify before signing?","answer":"From code:"},{"question":"Can a client verify the server's contract before paying?","answer":"Yes, because the 402 body the client validates is part of the machine-readable API contract. The server's committed openapi.yaml artifact carries the x402 components (X402PaymentRequired, X402PaymentRequirement, X402HonestRefusal) with x402Version: 2, the scheme enum, extra.decimals: 6, and charged…"}],"claims":[{"id":"claim-1","text":"@agentbadge/circle-payments ships a buyer-side x402 client that cannot be created without PaymentCaps {maxPaymentUsd, sessionBudgetUsd} — no uncapped mode. Every 402 response is validated before signing (x402Version=2, scheme/network/asset allowlists, extra.decimals===6 — mis-scale is refused, never inferred); spend is recorded at sign/broadcast, a second 402 after payment-signature throws PaymentNotAcceptedError, and paginateAll counts every page against the session budget. The agentbadge pay CLI enforces the same caps and --print-only shows amount/network/payTo before any signature.","status":"UNVERIFIED","evidence":[]}],"canonical":"https://agentbadge.xyz/blog/arc-c18-sdk-caps","dates":{"published":"2026-10-10","modified":"2026-10-15"},"markdownUrl":"https://agentbadge.xyz/blog/arc-c18-sdk-caps.md","jsonUrl":"https://agentbadge.xyz/blog/arc-c18-sdk-caps.json","shortAnswer":"@agentbadge/circle-payments ships a buyer-side x402 client that cannot be created without PaymentCaps {maxPaymentUsd, sessionBudgetUsd} — no uncapped mode. Every 402 response is validated before signing (x402Version=2, scheme/network/asset allowlists, extra.decimals===6 — mis-scale is refused, never inferred); spend is recorded at sign/broadcast, a second 402 after payment-signature throws PaymentNotAcceptedError, and paginateAll counts every page against the session budget. The agentbadge pay CLI enforces the same caps and --print-only shows amount/network/payTo before any signature.","relatedResources":[{"type":"guide","label":"Agent guide","url":"https://agentbadge.xyz/agent-guide/articles/arc-c18-sdk-caps"}]}