x402 is an open, neutral standard for internet-native payment over HTTP. A client requests a resource, receives 402 Payment Required, submits payment, and gains access. Created by Coinbase and contributed to the Linux Foundation, it removes the need for accounts, signups, and API keys in machine commerce.
Key Features
- Native HTTP Flow: Payment requirements travel through standard request and response semantics.
- No Protocol Fees: Users pay only nominal network costs.
- Chain Flexibility: Supports EVM networks and Solana, with extensibility to fiat.
- Payment Schemes: Includes exact, upto, and batch-settlement modes.
- Framework Middleware: Available for Express, FastAPI, Flask, Hono, and Next.js.
- Multiple Transports: Works across HTTP, MCP, and A2A.
Use Cases
Who Should Use This Tool?
- API Providers monetizing individual requests.
- Agent Developers purchasing data, compute, content, or tools.
- Infrastructure Teams seeking a vendor-neutral payment interface.
Problems It Solves
- Account setup: Payment can replace signup and API-key provisioning.
- Micropayment friction: Stablecoin settlement supports small resource purchases.
- Vendor lock-in: An open foundation governs the standard.
Pricing
| Plan | Price | Features |
|---|---|---|
| Protocol | Free | Open standard, middleware, and payment schemes. |
| Settlement | Network fees only | Costs depend on the selected payment rail. |
Advantages & Unique Selling Points
Compared to Competitors:
- Protocol, not platform: Implementers choose wallets, chains, and facilitators.
- HTTP-native interaction: Payment fits existing web infrastructure.
- Broad backing: The foundation includes major payment, cloud, commerce, and blockchain organizations.
What Makes It Stand Out:
- No mandatory accounts or API keys.
- Blockchain-agnostic and extensible design.
- Middleware for popular JavaScript and Python frameworks.
User Reviews
"Using an HTTP status code as the negotiation point makes paid APIs easy for agents to understand." Illustrative backend-developer perspective, editorially composed
"Vendor neutrality matters because our service should not dictate the buyer's wallet stack." Illustrative infrastructure-lead perspective, editorially composed
Getting Started
Quick Start Guide
- Choose middleware: Select the package for your server framework.
- Describe payment: Configure amount, asset, network, and recipient.
- Return 402: Protect the paid route with the payment requirement.
- Verify settlement: Grant access after valid payment evidence.
Integration
Integrates with:
- Express, FastAPI, Flask, Hono, and Next.js
- EVM chains and Solana
- HTTP, MCP, and A2A transports
Frequently Asked Questions
Does x402 charge protocol fees?
No. Only nominal costs from the selected settlement network apply.
Does it require user accounts?
No. The standard is designed to work without signups or API keys.
Is x402 limited to one blockchain?
No. It supports multiple blockchain families and can extend to fiat.
Alternatives
- Stripe Agent Toolkit: Stripe tools and machine-payment capabilities.
- Gate Pay: Multi-chain x402 payment infrastructure.
- Delegare: Mandate-controlled x402 and MPP settlement.
Tips & Best Practices
- Return precise requirements: Clearly specify asset, amount, network, and recipient.
- Make verification idempotent: Safely handle retried requests and payment evidence.
- Use batch settlement thoughtfully: Group payments only when latency permits.
Conclusion
x402 turns payment into a standard part of the web request lifecycle. Its open governance, zero protocol fees, broad framework support, and chain flexibility make it a foundational option for APIs serving autonomous agents.
Comments
No comments yet. Be the first to comment!
Related Tools
Cloudflare Wallets
blog.cloudflare.com/wallets
Programmable account and virtual wallets for the agentic Internet, combining stablecoin micropayments, delegated identity, and policy-based spending controls.
caipay
caipay.com
Open-source x402 agent payment infrastructure with independent wallets, gas-free Base transactions, programmable controls, and multichain settlement.
Crossmint
www.crossmint.com/solutions/agentic-payments
Agentic payment infrastructure combining fiat and stablecoin wallets, virtual cards, global onramps, purchasing APIs, and programmable guardrails.
Related Insights
After I Connected Obsidian to OpenClaw, It Started Helping Me Make Decisions
Once Obsidian stopped being just a place to store notes and started working with OpenClaw, it began helping me organize context, connect information, and improve real decisions.
Stop Cramming AI Assistants into Chat Boxes: Clawdbot Picked the Wrong Battlefield
Clawdbot is convenient, but putting it inside Slack or Discord was the wrong design choice from day one. Chat tools are not for operating tasks, and AI isn't for chatting.
The Twilight of Low-Code Platforms: Why Claude Agent SDK Will Make Dify History
A deep dive from first principles of large language models on why Claude Agent SDK will replace Dify. Exploring why describing processes in natural language is more aligned with human primitive behavior patterns, and why this is the inevitable choice in the AI era.