Skip to main content

Prerequisites

  • A wallet on any of 11 supported EVM chains (Ethereum, Base, Arbitrum, Optimism, etc.)
  • USDC deposited via Circle Gateway
  • x402-fetch (Node) or x402-requests (Python) installed

TypeScript example

That’s it. The first call returns 402; wrapFetchWithPayment automatically signs, retries, and returns the data.

Python example

Cost math

How much will it actually cost?
At sustained high volume, a subscription plan usually becomes cheaper than per-call nanopayment. Mix both: subscription for steady workloads, Nanopayment for spikes.

Troubleshooting

Top up via Circle Gateway. The error response includes the exact amount needed.
Nanopayment supports 11 EVM chains. Check your wallet client is on Base, Ethereum, Arbitrum, Optimism, Polygon, or another supported chain.
Make sure your wallet client uses the same account that holds the USDC. EIP-3009 requires the signer == token holder.