Protocol

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:

1
Request
Client sends HTTP request to a paid API endpoint
GET /api/data
2
402 Response
Server responds with HTTP 402 and pricing info
HTTP 402 + X-PAYMENT
3
Payment
Client signs USDC payment proof and resends
GET /api/data + X-PAYMENT
4
Verify & Settle
Facilitator verifies and settles on-chain
HTTP 200 + data

Key Features

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.

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

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

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

Supported Networks

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

Solana

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

Base

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

SKALE Base

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

Avalanche

Fast finality with gasless payments via 0xGasless integration.

Ethereum

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

Polygon

Affordable EVM-compatible payments with wide wallet support.

See Networks & Facilitators for the full compatibility matrix.

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.