Your complete guide to HTTP 402 and x402 protocol — documentation, tutorials, whitepapers, and developer resources.
Whether you're a developer looking to implement pay-per-use APIs, a content creator wanting to monetize your work, or an AI agent developer building autonomous payment capabilities, this resource hub has everything you need to get started with x402 and HTTP 402.
The x402 protocol transforms the long-dormant HTTP 402 status code into a powerful, practical payment mechanism. Below you'll find official documentation, code examples, integration guides, and community resources organized by topic and skill level.
New to x402? Start here to understand the fundamentals and get your first integration running in minutes.
Comprehensive introduction to the x402 protocol, including V2 features, wallet authentication, and multi-chain support.
Deep dive into the HTTP 402 status code, its history, comparison with other status codes, and why it's finally becoming useful.
Step-by-step guide for users: set up your wallet, acquire USDC, and make your first x402 payment.
Authoritative resources from the x402 protocol team and web standards organizations.
Protocol overview, ecosystem updates, live demos, and onboarding guides. The primary source for x402 news and announcements.
Complete technical specification covering protocol design, workflow details, security considerations, and implementation guidelines.
Open-source reference implementations, SDK code, example applications, and contribution guidelines.
Libraries and tools to help you integrate x402 into your applications quickly and securely.
| Language | Package | Description |
|---|---|---|
| Node.js | @x402/server |
Express/Fastify middleware for protecting endpoints with 402 payment gates |
| Python | x402-python |
Django/Flask decorators for adding payment requirements to views |
| Go | x402-go |
HTTP middleware for Go web frameworks |
| Rust | x402-rs |
Actix/Axum middleware with async payment verification |
| Platform | Package | Description |
|---|---|---|
| JavaScript/TypeScript | @x402/client |
Browser and Node.js client for handling 402 responses and wallet signing |
| React | @x402/react |
React hooks and components for payment flows |
| Python | x402-requests |
Requests library extension with automatic 402 handling |
Step-by-step tutorials for common integration scenarios.
Learn how to add pay-per-call pricing to your REST or GraphQL APIs. Covers rate limiting, pricing tiers, and usage analytics.
Implement micropayments for articles, videos, or downloads without subscriptions.
Enable autonomous agents to access paid resources and make payments without human intervention.
Accept payments on multiple blockchains: Ethereum, Base, Polygon, Arbitrum, and more.
Official web standards documentation for HTTP status codes and payment protocols.
Mozilla Developer Network's comprehensive reference for the 402 status code, including browser compatibility and usage notes.
The official IETF specification for HTTP, including the definition of 402 as a reserved status code.
Historical context, timeline of 402 development, and overview of implementation attempts over the years.
Quick reference for all HTTP status codes with explanations and related codes.
Understanding the payment layer that powers x402 transactions.
Official documentation for USDC, the dollar-backed stablecoin used in x402 payments. Learn about reserves, audits, and supported chains.
Technical documentation for integrating USDC, including API references, SDKs, and best practices.
x402 supports USDC on multiple networks for maximum flexibility:
Structured learning journeys based on your role and goals.
Connect with the x402 community and get help when you need it.
Ask questions, share implementations, and discuss protocol improvements with the community.
Technical Q&A for x402 implementation issues. Use the [x402] tag for visibility.
Follow @x402protocol for announcements, tips, and ecosystem news.
Have questions about this documentation? Reach out to whatisx402@gmail.com
Understanding how x402 compares to existing payment integration options.
| Feature | x402 | Stripe/PayPal | Crypto Manual |
|---|---|---|---|
| Micropayments (<$1) | ✅ Efficient | ❌ Fee prohibitive | ⚠️ Gas costs vary |
| No Account Required | ✅ Wallet only | ❌ Account needed | ✅ Wallet only |
| Machine-to-Machine | ✅ First-class | ❌ Not supported | ⚠️ Complex |
| HTTP Native | ✅ 402 status | ❌ Redirects | ❌ Custom flow |
| Global Access | ✅ Permissionless | ⚠️ Geo-restricted | ✅ Permissionless |
| Instant Settlement | ✅ Blockchain | ❌ Days delay | ✅ Blockchain |
Essential security considerations when implementing x402.
Track and optimize your x402 payment implementation.
Yes, x402 V2 is production-ready and being used by multiple applications. The protocol is backed by Coinbase and has undergone extensive testing.
Fees depend on the blockchain used. Base and Polygon offer sub-cent fees, while Ethereum mainnet may cost a few dollars per transaction.
Currently, x402 focuses on USDC for simplicity and regulatory compliance. Multi-currency support is on the roadmap.
Refunds are handled at the application layer. Since payments are on-chain, you would send a separate transaction to refund the user's wallet.
x402 is permissionless — no KYC required for users. However, as a merchant, you may have compliance obligations depending on your jurisdiction.