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
Resource Request
An AI agent sends a standard HTTP request to a protected endpoint. No payment credentials are provided initially.
402 Challenge
The server returns a 402 Payment Required status with a JSON PaymentRequirements object specifying the terms of trade.
Cryptographic Authorization
The agent constructs a payment payload using EIP-712 typed structured data, creating a cryptographic intent to pay.
Request Replay
The agent resends the request with an X-PAYMENT header containing the Base64-encoded signed payload.
Facilitation & Settlement
A Facilitator verifies the signature, checks balance, and submits the transaction to the blockchain.
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.
| Facilitator | Networks | Architecture | Key Features |
|---|---|---|---|
| Coinbase CDP | Base, Base Sepolia | Hosted | Fee-free USDC settlement, KYT/OFAC checks |
| PayAI | Solana, Base, Polygon | Multi-chain | Speed, multi-chain compatibility, echo refunds |
| Meridian | Base, EVM Chains | Decentralized | Non-custodial settlement, $MRDN token governance |
| Corbits | Polygon, Solana | Plugin-based | Faremeter framework, composable payment schemes |
| OpenX402 | Omnichain | Permissionless | Gasless, no login required, maximum decentralization |
| x402.rs | Multi-chain | Self-Hosted | Rust-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
| Repository | Function | Language |
|---|---|---|
| coinbase/x402 | Official Protocol Spec & Reference | TypeScript |
| paracetamol951/P-Link-MCP | Payment Link MCP Server | TypeScript |
| homebrewroboticsclub/Raid-app-x402 | Robotics Orchestration | JavaScript |
| casaislabs/AutonomiX | Agent Identity & Reputation | TypeScript |
| tipdotmd/tip-md-x402-mcp-server | Developer Tipping Agent | TypeScript |
| google-agentic-commerce/a2a-x402 | Google Agent Payment Extension | Python |
| merit-systems/x402scan | Ecosystem Explorer | TypeScript |
| xpaysh/awesome-x402 | Resource Directory | Markdown |
| t54-labs/x402-secure | Risk & Security Proxy | Python |
Explore x402 Agents
Discover the agents building on the x402 protocol and join the agentic economy.
Browse Agent Directory