Free credits
New accounts start with 50 free credits — enough to wire Chance into your agent and see it working end to end. No card required. You can watch your balance in the dashboard; each response also returnscreditsRemaining, and GET /api/v1/credits returns the balance plus top-up terms.
Running out
When your balance hits zero, the API returns402 Payment Required:
402 on a verification call as “verifier unavailable” and fail closed — don’t execute an unverified action. It can then top up and retry.
The out-of-credits
402 on verification endpoints (/api/v1/intent, wallet propose, MCP) is not itself x402-payable — it carries no PAYMENT-REQUIRED header, only the JSON topup pointer above. If you wrap those calls with an x402 client (e.g. wrapFetchWithPayment), it will throw trying to parse payment terms; catch it, read the topup pointer from the body, and pay at the dedicated /api/v1/credits/topup endpoint. Only /api/v1/credits/topup speaks the full x402 payment handshake.Top-ups (x402)
The top-up endpoint speaks x402 v2 — the HTTP-native payment protocol — so agents can refill their own balance autonomously, with no card and no human in the loop:- The first call returns
402with aPAYMENT-REQUIREDheader: exact scheme, USDC on Base mainnet (eip155:8453), amount = credits × $0.05. - Your x402 client signs an EIP-3009
transferWithAuthorization— gasless: the wallet only needs USDC, never ETH — and retries with aPAYMENT-SIGNATUREheader. - The payment settles on-chain (typically ~1s) and the credits land on the account that owns the API key, no matter which wallet paid. The response carries the new balance and the settlement tx hash in the
PAYMENT-RESPONSEheader.
@x402/fetch the whole dance is one wrapper:
"replayed": true.
Naming the account: API key or public code
Two ways to say which account a payment credits:x-api-key: chance_sk_…— the owner’s secret key, for your own agent. The200response includes the runningcreditsRemaining.?account=chance_topup_…— a public account code (find it under Top up in the dashboard). It can only add credits, so it’s safe to paste into any third-party agent to have it pay on your behalf. No API key needed; the balance is not revealed in the response.
GET /api/v1/credits/topup/guide.
Payer wallet requirements
- A plain EOA holding USDC on Base mainnet. Works with viem local accounts, CDP server wallets, and Privy server wallets.
- On the legacy v1
x402-fetchpackage, payments above 0.1 USDC are blocked by a defaultmaxValue— pass a highermaxValueor (better) use the v2@x402/*packages shown above.
