Open Payment Standard

x402 Protocol Explained

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.

Protocol Flow

How x402 Works

Four steps from request to payment settlement

1

Request

Client sends HTTP request to a paid API endpoint

GET /api/data
2

402 Response

Server responds with HTTP 402 Payment Required and pricing info

HTTP 402 + X-PAYMENT header
3

Payment

Client signs a USDC payment proof and resends the request

GET /api/data + X-PAYMENT
4

Verify & Settle

Facilitator verifies and settles the payment on-chain

HTTP 200 + data
Why x402

Why x402 is the Future of Payments

Built for the agentic economy and the open internet

Micropayments

Charge as little as $0.001 per API call. No minimum fees, no percentage cuts from payment processors.

Instant Settlement

Payments settle on-chain in seconds. No 30-day net terms, no chargebacks, no payment disputes.

AI Agent Native

AI agents can autonomously discover, negotiate, and pay for API access without human intervention.

Open Standard

x402 is fully open-source and permissionless. Anyone can implement it - no vendor lock-in, no gatekeepers.

Multi-Chain

Works across Solana, Base, Avalanche, SKALE, Ethereum, and Polygon. One protocol, many networks.

Trust Minimized

Facilitators cannot move funds outside of agreed payment terms. Cryptographic proofs ensure security.

Use Cases

x402 Protocol Use Cases

From AI agents to human developers - x402 powers the new payment layer

AI Agent Payments

AI agents can autonomously pay for API access, data feeds, and compute resources. x402 enables machine-to-machine commerce without pre-negotiated contracts or API keys. Combined with MCP (Model Context Protocol), agents can 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, no billing infrastructure - x402 handles payments at the HTTP layer.

Content Paywalls

Gate any URL or digital resource behind an x402 paywall. Articles, datasets, research papers, premium content - users pay per access with no accounts or sign-ups required. Perfect for one-time access to premium resources.

Metered API Access

Use a single API key to consume any x402-protected API without managing wallets or signing transactions. RelAI Metered Access handles all payment logistics - fund your account and call any x402 API with a standard HTTP request.

Comparison

x402 vs Traditional API Payments

How x402 compares to subscription-based and credit-based API billing

FeatureTraditional APIsx402 Protocol
Account requiredYesNo
Minimum payment$5-50/month$0.001
Settlement time30-90 days< 2 seconds
ChargebacksYesImpossible
AI agent supportLimitedNative
Global accessRestricted by regionPermissionless
Billing infrastructureRequiredBuilt into HTTP
Pay-per-useComplex setupDefault model
Networks

x402 Supported Networks on RelAI

One protocol, multiple blockchains - choose the network that fits your use case

Solana

Solana

High-speed settlement with minimal fees. The most popular network for x402 payments.

Base

Base

Coinbase L2 with low gas costs. Native home of x402 protocol development.

SKALE

SKALE Base

Zero gas fees with the Credits model. Ideal for high-frequency micropayments.

Avalanche

Avalanche

Fast finality with gasless payments via 0xGasless integration.

Ethereum

Ethereum

The original smart contract platform. Best for higher-value API payments.

Polygon

Polygon

Affordable EVM-compatible payments with wide wallet support.

Platform

x402 on RelAI - the Complete Platform

RelAI is the most comprehensive x402 platform - marketplace, facilitator, SDK, and tools in one place

x402 API Marketplace

Browse, discover, and consume x402 APIs from a growing marketplace of providers. Every API is pay-per-call with transparent pricing.

Multiple Facilitators

Choose from PayAI, RelAI, AutoIncentive, Dexter, 0xGasless, or Stripe PayTo. Each facilitator offers different networks and features.

RelAI x402 SDK

npm package @relai-fi/x402 for TypeScript/JavaScript. Handles payment signing, EIP-3009 authorization, and multi-chain support out of the box.

Metered API Access

Consume any x402 API with just an API key. No wallet management or transaction signing. RelAI handles all payment logistics automatically.

MCP + WebSocket Support

Native Model Context Protocol integration for AI agents. WebSocket relay for real-time bidirectional x402 payment flows.

Payment Links & Campaigns

Create shareable x402 paywall links for any URL. Organize links into campaigns with shared settings and analytics.

FAQ

x402 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 using this status code.

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 multiple organizations including RelAI, Solana Foundation, Cloudflare, and others.

What currency does x402 use?

x402 primarily uses USDC (USD Coin) stablecoins for payments. This ensures price stability while leveraging blockchain settlement. USDC is supported across all x402-compatible networks.

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?

x402 payment verification typically takes 200-400ms. Settlement finality depends on the blockchain - Solana settles in ~400ms, while EVM chains like Base settle in a few seconds.

What is a facilitator in x402?

A facilitator is a service that verifies payment signatures and settles transactions on-chain. RelAI supports multiple facilitators including PayAI, RelAI, AutoIncentive, Dexter, 0xGasless, and Stripe PayTo - each optimized for different networks.

Is x402 only for APIs?

No. While API monetization is the primary use case, x402 can paywall any HTTP resource - web pages, file downloads, webhook deliveries, streaming data, or any URL-addressable content.

How do I get started with x402?

The easiest way is through RelAI. Register your API in the dashboard, set pricing, and RelAI handles the x402 middleware, facilitator integration, and payment settlement. For consumers, browse the marketplace or use Metered API Access with a simple API key.

Get Started

Ready to Build with x402?

Join the growing ecosystem of developers and AI agents using x402 for instant payments on the open internet.