x402 Protocol
x402 is an open protocol that turns the long-dormant HTTP status code 402 Payment Required into a real, usable handshake for crypto micropayments. A client calls an endpoint, the server responds with 402 and a price, the client signs a stablecoin transfer authorisation, and the server settles it on-chain. Total round-trip: under a second.
This page is the protocol-level documentation. If you’re looking for the TypeScript client that sits on top of it, see Agent SDK.
The handshake
Section titled “The handshake”client server chain │ │ │ │── GET /premium-data ──────────►│ │ │ ◄── 402 Payment Required ─────│ { price: "0.10 USDC", │ │ + payment requirements │ network: "avalanche", │ │ │ recipient: "0x..." } │ │ │ │ │── sign EIP-3009 authorization ─┐ │ │ │ │ │── GET /premium-data ──────────►│ │ │ X-Payment: <signed payload> │ forward to facilitator │ │ │── POST /settle ─────────────►│ │ │ │ tx submitted │ │ ◄── tx hash ─────────────────│ gas paid by │ ◄── 200 OK ────────────────────│ X-Payment-Response: … │ facilitator │ + the actual response │ │The protocol is chain- and token-agnostic, but in practice today most x402 traffic is USDC on EVM chains using EIP-3009 transferWithAuthorization. That’s the canonical scheme 0xGasless implements.
Why it’s interesting
Section titled “Why it’s interesting”- No accounts, no API keys for payment. Anyone with a stablecoin balance can pay any x402 server. No subscription, no signup.
- No invoices, no chargebacks. Settled on-chain in seconds.
- Tiny amounts work. Sub-cent payments are economical because the facilitator pays gas, not the payer.
- Composable. Bots, agents, browsers, and humans all use the same flow.
This is the right shape for an agentic web: when an autonomous AI agent needs to call an API, it shouldn’t have to pre-arrange billing with the API provider. It just pays per call.
What 0xGasless provides
Section titled “What 0xGasless provides”| Piece | URL |
|---|---|
| Public facilitator | https://x402.0xgasless.com |
| Agent SDK (TypeScript) | @0xgasless/agent |
| Dashboard | dashboard.0xgasless.com |
You can use the facilitator without signing up for anything:
- Anyone can
POST /verifyto check a signature. - Anyone can
POST /settleto submit a payment on-chain. The facilitator pays the gas. - No API key required for the public endpoints.
You need an API key only if you want server-managed agent wallets (the Agent SDK feature). For direct x402 use with your own EOA, just hit the facilitator.
Quick start by role
Section titled “Quick start by role”| You are | Read |
|---|---|
| A merchant / API provider — you want to charge per call | Accept payments |
| A client — you want to pay an x402 endpoint | Pay endpoints |
| A self-hoster — you want to run your own facilitator | Self-hosting |
| Building an autonomous agent that pays | Agent SDK Quickstart |
Reference
Section titled “Reference”- Facilitator API — full REST contract for
/verify,/settle,/list,/health. - Supported chains — chain IDs, USDC addresses, relayer contracts.
- Self-hosting — run the open-source facilitator on your own infrastructure.