For decades, the web has had an unused HTTP status code: 402 – Payment Required. It was reserved for a future in which servers could charge per request. That future never arrived, not because the idea was flawed, but because the infrastructure wasn’t ready.
Today, that infrastructure exists.
Stablecoins settle instantly, blockchains are programmable, and agents, both human-driven and autonomous need payments that can occur at machine speed.
x402 is the protocol that finally operationalizes HTTP 402 in a modern context.
What x402 Enables
x402 introduces a minimal extension to HTTP that allows any service API, model, dataset, or content endpoint to require payment within the request-response loop. No sessions, no accounts, no OAuth flows.
A server can respond with HTTP 402 along with:
- Token type
- Amount
- Receiving address
- Chain/network
The client then submits a signed authorization using EIP-3009 (transferWithAuthorization), enabling third-party execution of the transfer. A facilitator verifies and settles the transaction on-chain, allowing the server to return the requested resource.
This sequence takes sub-second for the client.
Why Developers Should Care
1. Micropayments Become Realistic
Facilitator costs are simply gas. For low-cost L2s, sub-cent pricing becomes economically viable.
2. Works With Existing Web Infrastructure
x402 is HTTP-native.
Any backend that can return a custom status code can support it. Framework-specific SDKs aren’t required.
3. Stateless Payments
No user accounts, no cookies, no stored balances.
Each request carries the authorization needed for settlement.
4. Machine-Readable Payments for Agents
Agents can consume, pay for, and chain services without human supervision:
- Pay-per-inference
- Pay-per-crawl
- Pay-per-compute-cycle
- Pay-per-task orchestration between agents
This pattern is impossible with traditional payment rails.
Trust Models: Where x402 Intersects With Web3
x402 enables payment, but it does not solve trust e.g., whether the model or service responding is authentic, private, or verifiable.
This is where ERC-8004 and ROFL come in.
ERC-8004
A neutral on-chain registry system for:
- Agent identity
- Reputation trails
- Validation methods
It lets agents discover each other and negotiate trust assumptions.
ROFL
A confidential compute layer enabling:
- Verifiable execution in TEEs.
- Attestation of service code and models.
- Enclave-generated keys and isolated signing.
- End-to-end encrypted request processing.
- Autonomous agents with tamper-proof state.
Together, x402 handles payment, ERC-8004 handles coordination, and ROFL handles trust.
This trio forms an interoperable stack for building autonomous services that transact, compute, and collaborate without intermediaries.
Example Implementations
Developers have already begun deploying x402-enabled confidential services, including:
- Document summarization APIs where users pay cents per inference.
- Multi-LLM verification oracles, with each inference paid through x402.
- GPU compute tasks triggered programmatically by agents.
In all cases, the payment, execution, and verification layers compose cleanly.
Closing Thoughts
x402 brings the web much closer to a true pay-per-use model one that’s compatible with autonomous agents, micro-services, and global machine-driven commerce. When paired with verifiable computation (ROFL) and standardized agent discovery (ERC-8004), it forms the foundation for an emerging agentic economy.
If you’re building APIs, autonomous systems, or compute-heavy services, this is a protocol worth watching.



