What is x402
x402 is Coinbase’s open spec for paywalling HTTP endpoints. The flow is:- Client calls a protected endpoint without payment.
- Server returns
HTTP 402 Payment Requiredwith apayment_requirementsJSON body listing accepted networks, assets, amounts, and a receiving address. - Client pays on-chain and includes the resulting
tx_idin anX-Paymentheader. - Server verifies the payment via a facilitator (AlgoVoi) and serves the resource.
When to use x402
Per-request API monetisation
Charge $0.001 per LLM call, $0.05 per image generation, $0.10 per data lookup.
Agent-to-agent commerce
AI agents discovering and paying for other agents’ capabilities autonomously.
Pay-per-view content
Articles, video, or downloads, all gated by a single chain transaction.
Microservice metering
Internal services charging each other for compute or storage with cryptographic proof.
Quickstart
1. Define a protected resource
In the dashboard go to Resources → New and define what you want to monetise:resource_id: a string you’ll use in the URL path, for examplepremium-dataprice_microalgos: amount in chain microunits (USDC has 6 decimals on most chains, so $1.00 is 1,000,000)payment_network: the chain you want to settle onasset_id: the stablecoin contract, ASA, or SPL mint, or0for native
2. Gate your endpoint
Point your server’s protected endpoint at the AlgoVoi gateway:3. Pay and retry with X-Payment
The client pays on-chain, then retries with the tx_id:
Multi-chain mode
A single resource can accept payment on multiple chains. The 402 response advertises every chain you’ve configured a payout for, and the client picks one:Solana Pay reference binding
Solana doesn’t support memos in the same way as Algorand, VOI, or Hedera, so x402 over Solana uses the Solana Payreference pubkey mechanism. AlgoVoi generates a fresh ed25519 reference pubkey per checkout, includes it in the Solana Pay URL, and verifies the settling transaction by looking up getSignaturesForAddress(reference).
You don’t have to think about this. It’s automatic when network = solana:*.
Verifying webhooks
When a payment confirms, AlgoVoi fires apayment.confirmed event to your configured generic webhook. See Outbound webhooks for the payload schema and HMAC verification.
Chain support matrix
| Chain | Native | Stablecoin | CAIP-2 |
|---|---|---|---|
| Algorand mainnet | ALGO | USDC ASA | algorand:mainnet |
| VOI mainnet | VOI | aUSDC ARC-200 | voi:mainnet |
| Hedera mainnet | HBAR | USDC HTS | hedera:mainnet |
| Stellar mainnet | XLM | USDC issuer | stellar:mainnet |
| Base mainnet | ETH | USDC ERC-20 | eip155:8453 |
| Solana mainnet | SOL | USDC SPL | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
| Tempo mainnet | ETH | USDCe TIP-20 | tempo:mainnet |
See also
- MPP for paywalling MCP tools
- AP2 for Google’s mandate-based agent commerce
- A2A for x402 over the Agent-to-Agent transport
- Solana Actions for Blink and dial.to integration