x402 Live Demo
Pay $0.01, unlock a resource.
This page makes a live call to /api/v1/x402-demo/premium. The server answers with HTTP 402 Payment Required. You send a tiny USDC transfer, submit the proof, and the server returns the content. No account, no setup — just HTTP + a wallet.
This is the exchange your server and the payer go through — two requests, one header.
GET /api/v1/checkout/{short_code}
→ 402 Payment Required
{ "requirements": { "payTo": "…", "maxAmountRequired": "0.01", "network": "…" } }
GET /api/v1/checkout/{short_code}
X-Payment: <base64({ txHash, chain, token, amount, payerAddress })>
→ 200 OKHow it works
- Browser GETs
/api/v1/x402-demo/premium. Server returns HTTP 402 with a JSON body describing payTo, amount, asset, resource. - You send 0.01 USDC on-chain to the returned address. Solana takes ~400ms and costs ~$0.00025 in fees.
- Browser retries with
X-Paymentheader containing base64(JSON) of your transaction hash. - Server reads the header, calls the inzi facilitator to verify the tx on-chain (recipient, token contract, amount, confirmations), and returns 200 with the resource.
Build this into your own API with @inzi/x402 SDK pointed at our facilitator.