How it works
- You send a request to the API
- The API responds with HTTP 402 and payment details
- Your x402 client automatically pays the specified USDC amount
- The client retries the request with a payment proof header
- The API verifies payment on-chain and returns results
Supported chains
| Chain | Asset | Network |
|---|---|---|
| Base | USDC | Mainnet |
| Solana | USDC | Mainnet |
Wallet setup
You need a wallet with USDC on Base or Solana. Each request costs 0.26 plus ~$0.001 in gas.Base (EVM) — fastest path
Option A: Buy USDC directly on Base- Create a Coinbase account (or use Coinbase Wallet)
- Buy USDC and select Base network at checkout — no bridging needed
- Export your private key from MetaMask/Coinbase Wallet
- Pass it to your x402 client
- Have USDC on Ethereum mainnet
- Bridge to Base via bridge.base.org
Keep at least 0.001 in gas.
Solana
- Get a Solana wallet private key (base58 format)
- Buy USDC on Solana via Coinbase or Jupiter
- Pass the private key to your x402 client
Dynamic pricing
The price depends on how many results you request:limit | Price |
|---|---|
| 1-20 | $0.10 |
| 50 | $0.16 |
| 100 | $0.26 |
price = $0.10 + max(0, limit - 20) * $0.002
The price is included in the 402 response headers, so your client always knows the exact cost before paying.