Internet-Native Micropayments for the Agentic Economy
x402 is an open payments protocol that activates the HTTP 402 "Payment Required" status code to enable instant, blockchain-based payments for web resources and APIs. Developed by Coinbase and backed by Cloudflare since July 2025, x402 is transforming how digital content and services are monetized online.
Built on permissionless blockchain infrastructure, x402 eliminates traditional payment inefficiencies by leveraging stablecoins like USDC and Layer-2 networks like Base for low-cost, instant, and automated transactions.
How x402 Works
Discovery
A client (AI agent or browser) attempts to access a protected resource. The server responds with 402 Payment Required and machine-readable payment instructions including amount, currency, recipient address, and blockchain network.
Payment Execution
The client sends the required payment (typically USDC) to the specified blockchain address on networks like Base, Ethereum, or Polygon. The transaction is confirmed on-chain within seconds.
Proof Submission
The client retries the request with cryptographic proof of payment (the transaction hash) via query parameter or HTTP header. The server verifies the transaction on the blockchain.
Access Granted
Upon successful verification, the server returns 200 OK with the requested content or service. Access is granted for a specified duration (e.g., 24 hours) with payments cached to prevent redundant verification.
Why x402 Matters for AI Agents
Autonomous Commerce
AI agents can discover payment requirements, execute blockchain transactions, and complete purchases without human intervention. No API keys, accounts, or pre-existing relationships required.
Global & Permissionless
Available worldwide without costly currency conversions or access to traditional financial rails. Any agent, anywhere, can transact instantly using cryptocurrency.
Micropayment Economics
Transaction fees on Base are often under $0.01, making payments as small as fractions of a cent economically viable. True pay-per-use pricing becomes practical.
Instant Settlement
Payments settle in seconds on Layer-2 networks like Base. No chargebacks, no payment processors, no delays. Content providers receive funds immediately.
Real-World Use Cases
Premium Content & News
Publishers can gate articles behind micropayments. AI agents and readers pay per article rather than committing to full subscriptions, creating flexible monetization for quality journalism.
API Access & Data Feeds
Services charge per API call instead of monthly subscriptions. An AI agent needing real-time stock data or weather information pays only for the specific requests it makes, with instant payment verification.
Cloud Computing Resources
AI agents can autonomously purchase compute time, storage, or GPU cycles on demand. Pay-per-second pricing becomes practical with micropayment infrastructure.
E-Commerce & Tool Discovery
An AI shopping assistant can browse multiple merchants, compare prices, and complete purchases across platforms without requiring pre-configured accounts or payment methods at each vendor.
Research & Academic Papers
Researchers and AI systems can pay per paper access instead of expensive journal subscriptions, democratizing access to scientific knowledge.
The Growing x402 Ecosystem
In July 2025, Cloudflare formally backed x402, integrating support across its infrastructure and joining Coinbase in advancing it as an open, collaborative internet standard. The x402 Foundation was established to encourage protocol adoption and standardization.
By October 2025, the x402 category on CoinGecko reached nearly $800 million in market capitalization, reflecting surging interest in autonomous agent commerce. Industry analysts predict that autonomous agent commerce could exceed$50 billion annually by 2027, with most transactions settling in USDC on Layer-2 networks.
Technical Specifications
HTTP Status Code
402 Payment Required
Currency Standard
USDC (USD Coin) Stablecoin
Primary Network
Base (Layer-2, ~2 second blocks)
Typical Confirmation Time
~6 seconds (3 blocks on Base)
Transaction Fees
Often under $0.01 on Base
Response Format
JSON (agents) or HTML (browsers)
Try x402 Now
Experience the x402 protocol in action with our live demo. We have protected premium news content with a $1 USDC payment requirement on the Base network.
Option 1: See Payment Required Response
Visit the protected page without payment to see the x402 payment instructions and requirements:
View Protected Content (No Payment)Option 2: Test with Demo Transaction
Use our test transaction hash to bypass payment and see the premium content (no real USDC required):
Access Premium Content (Test Mode)This demo transaction works on all networks and environments for testing purposes.
x402 on AgentPMT
AgentPMT has implemented a fully functional x402 payment gateway that protects premium content with blockchain-verified USDC payments on the Base network. Our implementation includes:
- Middleware-based payment verification that intercepts requests to protected routes
- Real-time blockchain verification using Base network RPC endpoints
- Payment caching in MongoDB to prevent redundant verification and enable 24-hour access windows
- Hybrid response system serving JSON to AI agents and styled HTML to browsers
- Support for multiple proof methods via query parameters or HTTP headers
- Test transaction support for development and demonstration
This infrastructure enables AI agents to discover our premium content, understand payment requirements, execute USDC transfers, and gain access autonomously.