Loading...
Loading...
One middleware. One line. USDC hits your wallet in 2 seconds.
No API keys. No dashboards. No KYC.
You write code. The protocol handles the rest.
Three lines between you and crypto payments. Not three files. Three lines.
import { withX402 } from "x402-next"
const handler = async (req) => {
return Response.json({ data: "your API response" })
}
export const GET = withX402(handler, "YOUR_WALLET", {
price: "$1",
network: "base"
})Four pillars. Four code examples. Zero fluff.
Wrap any handler. That's it. x402-next handles the 402 response, receipt verification, and content delivery.
import { withX402 } from 'x402-next'
const handler = async (req) => {
return Response.json({ data: 'unlocked' })
}
export const GET = withX402(handler, 'YOUR_WALLET', {
price: '$1',
network: 'base',
})Next.js, Express, Fastify, Cloudflare Workers, Deno Deploy, vanilla Node.js. We have templates for all of them.
// Express
app.get('/api/data',
requirePayment('$0.50'),
handler
)
// Fastify
fastify.get('/api/data',
{ preHandler: payGate },
handler
)
// Cloudflare Worker
export default {
async fetch(req) { /* x402 */ }
}Instant settlement. ~2 second confirmations. Near-zero gas fees. Real USDC, not wrapped tokens or IOUs.
// Payment settles to your wallet
// No intermediary. No escrow.
{
network: 'base', // L2 — fast
currency: 'USDC', // Stable
settlement: 'instant', // ~2s
gas: '$0.001', // Negligible
}No signup. No dashboard. No monthly fees. No percentage cut. The protocol is open. You keep 100% of revenue.
// Traditional payment processor:
// Revenue: $1,000
// Platform fee: -$29 (2.9%)
// Per-txn fee: -$30 ($0.30 x 100)
// You keep: $941
// x402 on Base:
// Revenue: $1,000
// Gas cost: ~$0.10 (100 txns)
// You keep: $999.90Six steps. Two seconds. One protocol.
$49 one-time. Everything included. No upsells.
Launch pricing ends in
15 templates • 4 guides • Commercial license • Lifetime access
Your competitors are still filling out Stripe applications.
You could be accepting USDC before they get approved.
Weekly developer insights on crypto payments and Web3 monetization.
Trusted by developers worldwide
Also useful for AI builders
From AI Business Factory