Instant micropayments for the web.
x402Pay is a universal micropayment wallet powered by the official x402 protocol. It enables instant payments for premium content, APIs, and digital services through a browser extension and publisher SDK—turning the internet into a frictionless micropayments machine.
Built on official Coinbase x402 packages for production-ready compliance.
x402 revives HTTP 402 "Payment Required" for programmatic micropayments without accounts, logins, or heavy authentication. Users pay pennies for premium content, API calls, or digital services using stablecoins (USDC) on networks like Base and BNB Chain.
Transaction volumes grew 10,000% month-over-month in 2025, driven by AI agents and consumer adoption.
Chrome/Firefox/Safari extension that intercepts HTTP 402 responses, handles wallet integration, and automatically unlocks premium content.
Features:
- One-tap payments for paywalled content
- Starter credits ($3 free for new users)
- Daily spending caps with auto-pay mode
- 30-minute refund window
- Receipt management and export
Architecture:
- Manifest V3 service worker for payment processing
- Content script for fetch/XHR interception
- Coinbase facilitator integration for USDC settlements
- Popup UI for settings and transaction history
Express middleware for publishers to monetize content without engineering overhaul.
Features:
- 3-line integration for any Express app
- Route-based pricing configuration
- Automatic payment verification via facilitators
- Dynamic pricing support
- Refund policy customization
Usage:
import express from 'express';
import { x402Middleware } from '@x402pay/publisher-sdk';
const app = express();
app.use(x402Middleware(
{
payToAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
network: 'base'
},
{
'/premium-article': '$0.10',
'/api/data': '$0.01'
}
));
app.get('/premium-article', (req, res) => {
res.send('Unlocked content here!');
});
app.listen(3000);Reference implementation showcasing x402 integration patterns for articles, APIs, and dynamic pricing.
- Navigate to extension directory:
cd extension-
Load unpacked extension in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
extensionfolder
- Open
-
x402Pay initializes with $3 starter credits
- Install SDK:
npm install @x402pay/publisher-sdk-
Add middleware to Express app (see example above)
-
Protected routes now return 402 until payment verified
- Install dependencies:
cd demo-server
npm install- Configure environment:
cp .env.example .env
# Edit .env with your wallet address- Run server:
npm run dev- Visit
http://localhost:3000with x402Pay extension installed
/
├── extension/ Chrome extension (MV3)
│ ├── manifest.json Extension configuration
│ ├── background.js Payment processing service worker
│ ├── content.js Request interception
│ ├── popup.html/js Settings UI
│ └── icons/ Extension icons
├── publisher-sdk/ Express middleware
│ ├── src/
│ │ ├── middleware.ts Core x402 middleware
│ │ ├── types.ts Type definitions
│ │ └── index.ts Public API
│ └── package.json
├── demo-server/ Reference implementation
│ └── src/server.ts Express demo with protected routes
└── shared/ Shared utilities
└── x402-types.ts Protocol type definitions
- User requests protected resource → receives HTTP 402
- Response body contains
PaymentRequiredResponseJSON:
{
"x402Version": 1,
"accepts": [{
"scheme": "exact",
"network": "base",
"payTo": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": "100000000000000000",
"currency": "USDC"
}],
"message": "Payment of $0.10 required",
"refundPolicy": "Full refund within 30 minutes"
}- Extension processes payment via Coinbase facilitator
- Request retried with
X-PAYMENTheader containing proof:
{
"proof": {
"scheme": "exact",
"network": "base",
"transactionHash": "0xabc...",
"from": "0xuser...",
"to": "0xpublisher...",
"amount": "100000000000000000",
"timestamp": 1730419200000
},
"facilitator": "https://x402.coinbase.com"
}- Server verifies payment via facilitator
/verifyendpoint - Returns content with
X-PAYMENT-RESPONSEreceipt
- Base (primary, lowest fees)
- BNB Chain
- Polygon
- Ethereum
Current:
- Coinbase facilitator (embedded wallet, KYC/OFAC compliant)
Planned:
- MetaMask connector
- WalletConnect support
- Self-custody options
New users receive $3 free credits (sponsor-funded) to experience frictionless unlocking before adding funds.
Every unlock displays "🔓 Unlocked with x402" badge, driving extension installs.
Users earn 20% credit on friend spends via shareable gift links.
$1 unlimited unlocks (up to 50/day) across participating sites—Netflix for the web.
Shareable receipts: "You funded Jane's reporting for $0.10!"
- KYC/OFAC: Coinbase facilitator handles compliance
- Refunds: 30-minute window for all transactions
- Caps: Daily spending limits prevent accidental overcharges
- Transparency: Full receipt history with CSV export
- Install-to-first-unlock: <2 minutes
- Payment flow: <3 seconds avg
- Success rate: 96%+ (testnet)
- Integration time: <15 minutes
- Overhead: <5ms per request
- Verification: <200ms via facilitator
- ✅ Chrome extension with payment flow
- ✅ Publisher SDK middleware
- ✅ Demo server
- ⏳ Firefox/Safari ports
- ⏳ Production facilitator integration
- Paylinks system (pay.link/abc)
- Day-Pass bundles
- Referral mechanics
- Publisher dashboard
- API-key killer SDK
- Ad-free mode
- Campus blitz ($10 .edu credits)
- Analytics & leaderboards
This is production code. Follow these rules:
- No placeholders or mock data
- Code files stay under 600 lines
- TypeScript for type safety
- Comprehensive error handling
- Security-first (never expose keys)
MIT License - see LICENSE file
- GitHub Issues for bugs
- Discussions for feature requests
- Discord for community (coming soon)
Built for the open web. Powered by x402.