x402 Protocol Overview
x402 is an open internet-native payment protocol that enables instant micropayments for APIs, AI agents, and machine-to-machine commerce. Built on HTTP status code 402 Payment Required.
RelAI is the leading x402 marketplace and facilitator platform — supporting Solana, Base, Avalanche, SKALE, Ethereum, and Polygon.
What is x402?
x402 is an open payment protocol that turns the long-dormant HTTP 402 status code into a fully functional payment rail for the internet. Originally reserved by the HTTP specification for "future use," status code 402 was designed to signal that payment is required before a resource can be accessed.
The x402 protocol, pioneered by Coinbase, standardizes this flow: when a server returns HTTP 402, it includes payment requirements in the response headers. The client can then sign a cryptographic payment proof (using USDC stablecoins) and retry the request. A payment facilitator verifies and settles the transaction on-chain, and the server delivers the resource.
This creates a seamless, programmatic payment experience — no accounts, no API keys, no subscriptions. Just direct, per-request payments between any two parties on the internet.
How x402 Works
Four steps from request to payment settlement:
GET /api/dataHTTP 402 + X-PAYMENTGET /api/data + X-PAYMENTHTTP 200 + dataKey Features
Charge as little as $0.001 per API call. No minimum fees, no percentage cuts from payment processors.
Payments settle on-chain in seconds. No 30-day net terms, no chargebacks, no payment disputes.
AI agents can autonomously discover, negotiate, and pay for API access without human intervention.
x402 is fully open-source and permissionless. Anyone can implement it — no vendor lock-in.
Works across Solana, Base, Avalanche, SKALE, Ethereum, and Polygon. One protocol, many networks.
Facilitators cannot move funds outside of agreed payment terms. Cryptographic proofs ensure security.
Use Cases
AI Agent Payments
AI agents can autonomously pay for API access, data feeds, and compute resources. Combined with MCP (Model Context Protocol), agents discover and pay for services in real time.
API Monetization
Developers can monetize any API endpoint with per-request micropayments. Upload your OpenAPI spec, set pricing, and start earning — no subscription management needed.
Content Paywalls
Gate any URL behind an x402 paywall. Articles, datasets, research papers, premium content — users pay per access with no accounts or sign-ups required.
Metered API Access
Use a single API key to consume any x402-protected API without managing wallets or signing transactions. RelAI handles all payment logistics.
x402 vs Traditional API Payments
| Feature | Traditional APIs | x402 Protocol |
|---|---|---|
| Account required | Yes | No |
| Minimum payment | $5–50/month | $0.001 |
| Settlement time | 30–90 days | < 2 seconds |
| Chargebacks | Yes | Impossible |
| AI agent support | Limited | Native |
| Global access | Restricted by region | Permissionless |
| Billing infrastructure | Required | Built into HTTP |
| Pay-per-use | Complex setup | Default model |
Supported Networks
One protocol, multiple blockchains — choose the network that fits your use case.
High-speed settlement with minimal fees. The most popular network for x402 payments.
Coinbase L2 with low gas costs. Native home of x402 protocol development.
Zero gas fees with the Credits model. Ideal for high-frequency micropayments.
Fast finality with gasless payments via 0xGasless integration.
The original smart contract platform. Best for higher-value API payments.
Affordable EVM-compatible payments with wide wallet support.
See Networks & Facilitators for the full compatibility matrix.
x402 on RelAI
RelAI is the most comprehensive x402 platform — marketplace, facilitator, SDK, and tools in one place.
Frequently Asked Questions
What does x402 stand for?
x402 refers to HTTP status code 402 (Payment Required). The "x" prefix denotes the protocol extension that standardizes how payments flow over HTTP.
Who created x402?
The x402 protocol was created by Coinbase as an open-source standard. It is maintained as a community-driven project with contributions from RelAI, Solana Foundation, Cloudflare, and others.
What currency does x402 use?
x402 primarily uses USDC (USD Coin) stablecoins for payments, ensuring price stability while leveraging blockchain settlement.
Can AI agents use x402?
Yes — x402 is designed for autonomous machine-to-machine payments. AI agents can discover paid APIs, understand pricing from HTTP 402 responses, sign payments, and access resources without human intervention.
How fast are x402 payments?
Payment verification takes 200–400ms. Solana settles in ~400ms, while EVM chains like Base settle in a few seconds.
What is a facilitator?
A facilitator verifies payment signatures and settles transactions on-chain. RelAI supports PayAI, RelAI, AutoIncentive, Dexter, 0xGasless, and Stripe PayTo.
Is x402 only for APIs?
No. While API monetization is the primary use case, x402 can paywall any HTTP resource — web pages, file downloads, streaming data, or any URL-addressable content.
How do I get started?
Register your API in the RelAI dashboard, set pricing, and RelAI handles x402 middleware, facilitator integration, and payment settlement. For consumers, use Metered API Access with a simple API key.