What is x402?
x402 is an open payment protocol that uses the HTTP402 Payment Required status code to enable instant stablecoin payments over HTTP. Instead of API keys or subscriptions, you pay per request with USDC.
The protocol was created by Coinbase and is designed for both human users and AI agents.
The payment flow
1
Request a protected resource
Your agent sends a normal HTTP request to a paywalled endpoint (like
GET /get-card?amount=50).2
Server returns 402
The server responds with
402 Payment Required and a JSON body describing
the price and how to pay.3
Client signs a payment
Your x402 client library reads the payment requirements, constructs an
EIP-3009
transferWithAuthorization payload, and signs it with your
wallet’s private key. No on-chain transaction is submitted — just a
signature.4
Client retries with payment header
The client replays the original request with an
X-PAYMENT header
containing the signed payment.5
Server verifies and serves
The server forwards the payment to a facilitator (Coinbase) for
verification. If valid, the server returns the requested resource and the
facilitator settles the USDC transfer on-chain.
The 402 response
When you hit a paywalled endpoint without paying, you get back a JSON body like this:Key concepts
Your wallet signs, the facilitator pays gas
Your agent never submits a blockchain transaction. It only signs an authorization (EIP-3009transferWithAuthorization). The facilitator — hosted by Coinbase — handles the on-chain settlement and pays gas fees.
Client libraries handle everything
If you use@x402/axios or @x402/fetch, the entire 402 → sign → retry flow happens automatically. Your code looks like a normal HTTP request:
Base mainnet + Solana mainnet (USDC)
Laso Finance accepts USDC payments on Base (Coinbase’s L2) and Solana mainnet. Both networks have low fees and fast finality, making them ideal for the per-card payment flows on/get-card, /order-gift-card, /get-push-to-card, and /order-intl-card.
The three actors
Supported networks
x402 is chain-agnostic. The current ecosystem supports:
Laso Finance accepts payments on Base mainnet (
eip155:8453) and Solana mainnet (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp).
Further reading
x402 Protocol
Official x402 protocol site and whitepaper.
x402 GitHub
Open-source protocol specification and client libraries.