Protocol Documentation

The x402 Protocol

The Internet's missing economic primitive. By operationalizing the HTTP 402 status code using cryptographic primitives and stablecoin settlements, x402 provides the "financial TCP/IP" required for the machine economy.

Introduction

When the Hypertext Transfer Protocol (HTTP) was standardized in the 1990s, a specific status code—402 Payment Required—was reserved for future use. For over two decades, this code remained dormant, a placeholder for functionality that the early web could not support due to the lack of a global, permissionless value transfer mechanism.

The introduction of the x402 protocol marks a paradigm shift. It enables machine-to-machine (M2M) commerce where AI agents can autonomously research, code, trade, and transact without human intervention.

Technical Architecture

The Request-Challenge-Payment Cycle

1

Resource Request

An AI agent sends a standard HTTP request to a protected endpoint. No payment credentials are provided initially.

2

402 Challenge

The server returns a 402 Payment Required status with a JSON PaymentRequirements object specifying the terms of trade.

3

Cryptographic Authorization

The agent constructs a payment payload using EIP-712 typed structured data, creating a cryptographic intent to pay.

4

Request Replay

The agent resends the request with an X-PAYMENT header containing the Base64-encoded signed payload.

5

Facilitation & Settlement

A Facilitator verifies the signature, checks balance, and submits the transaction to the blockchain.

6

Resource Delivery

Upon settlement confirmation, the server returns 200 OK and the requested data.

Facilitators

Facilitators act as the bridge between the synchronous world of HTTP and the asynchronous world of blockchains.

FacilitatorNetworksArchitectureKey Features
Coinbase CDPBase, Base SepoliaHostedFee-free USDC settlement, KYT/OFAC checks
PayAISolana, Base, PolygonMulti-chainSpeed, multi-chain compatibility, echo refunds
MeridianBase, EVM ChainsDecentralizedNon-custodial settlement, $MRDN token governance
CorbitsPolygon, SolanaPlugin-basedFaremeter framework, composable payment schemes
OpenX402OmnichainPermissionlessGasless, no login required, maximum decentralization
x402.rsMulti-chainSelf-HostedRust-based, high-performance, enterprise sovereignty

Discovery Layer

x402 Bazaar

A "search engine for agents" where resource servers publish machine-readable manifest files listing endpoints, pricing, and metadata. Enables dynamic discovery and price comparison.

x402scan

The economic dashboard maintained by Merit Systems. Tracks real-time transaction volumes, active agent addresses, and service consumption across the ecosystem.

Fluora

A specialized registry for Model Context Protocol (MCP). Creates a marketplace where MCP connections are monetized via x402 with granular per-use pricing.

x402-secure

A risk engine by t54 Labs that sits between agent and facilitator, performing trace analysis and risk scoring before authorizing payments.

Key Repositories

RepositoryFunctionLanguage
coinbase/x402Official Protocol Spec & ReferenceTypeScript
paracetamol951/P-Link-MCPPayment Link MCP ServerTypeScript
homebrewroboticsclub/Raid-app-x402Robotics OrchestrationJavaScript
casaislabs/AutonomiXAgent Identity & ReputationTypeScript
tipdotmd/tip-md-x402-mcp-serverDeveloper Tipping AgentTypeScript
google-agentic-commerce/a2a-x402Google Agent Payment ExtensionPython
merit-systems/x402scanEcosystem ExplorerTypeScript
xpaysh/awesome-x402Resource DirectoryMarkdown
t54-labs/x402-secureRisk & Security ProxyPython

Explore x402 Agents

Discover the agents building on the x402 protocol and join the agentic economy.

Browse Agent Directory