HTTP 402 Payment Required — Now Live

Monetize any API endpoint in one line of code.

One command. One SDK. One HTTP status code.

No subscriptions. No commitments. Pay exactly what you use, per request. The first API platform to implement the long-dormant HTTP 402 status code.

xpay-terminal — bash
$ npx xpay init my-api
✓ XPay initialized in my-api/
$ npx xpay protect /api/data --price 0.01
✓ Endpoint /api/data protected — HTTP 402 active
$ curl https://api.get402.net/health
→ {"status":"ok","version":"0.1.0"}
$ curl https://api.get402.net/api/data
→ {"error":"payment_required","payment":{"amount":"0.01","currency":"USDC"}}
1% fee
USDC on Base
20 free tx/month

See get402 in action

Explore the dashboard, SDK, and payment protocol that make pay-per-request APIs effortless.

Dashboard Analytics

Real-time metrics at a glance. Monitor users, transactions, revenue, and system health from a single dashboard with live updates.

Users

12,847

+128 today

Transactions

284.3K

$42.5K volume

Revenue (USDC)

$18,942

+12% this month

System

Healthy

API · PG · Redis

1 / 4

Everything you need to monetize your API

No more Stripe subscriptions or custom billing logic. XPay handles it all with a single HTTP status code.

Pay-per-call

Only pay for what you use. Each API request settles instantly in USDC. No monthly fees, no minimums.

USDC on Base

Settled in USDC on the Base network. Fast, cheap, and reliable — with full transparency on-chain.

SDK Included

Drop-in JavaScript/TypeScript SDK that auto-handles HTTP 402 responses. One line of code to get started.

Dashboard

Real-time analytics, transaction history, API key management, and wallet top-ups from a single dashboard.

No commitment

No subscriptions. No lock-in. Fund your wallet and use it at your own pace. Unused balance never expires.

Auto-retry on 402

When funds run low, the SDK auto-prompts payment and retries. Seamless experience for your users.

Developer experience

One SDK. Two lines of middleware. Zero friction.

terminal
1
2
3
4
5
npm install xpay-sdk
# or with pnpm / yarn
pnpm add xpay-sdk
yarn add xpay-sdk

Built for AI agents

Any agent — OpenClaw, Hermes, Claude Code — can pay for API access autonomously via HTTP 402. No subscriptions, no human in the loop.

OpenClaw

Add the payment tool to your gateway config. Agents auto-pay for API access.

Hermes

Load the skill with /skill get402-agent-payment. Preload in config.yaml.

Claude Code

Protect endpoints with x402 middleware. Claude pays and retries automatically.

Any LLM Agent

Curl + wallet = done. SDK for Express, Fastify, Next.js. Open source on GitHub.

How it works

Three simple steps to start charging per request with USDC.

1. Get your API key

Sign up and get your API key instantly. No credit card required for the Free plan — just a wallet to receive USDC.

2. Make requests

Use the XPay SDK or standard HTTP clients. Your API key auto-handles payment. If you run out of balance, the SDK prompts top-up and retries.

3. Auto-pay via 402

Each request settles in USDC on Base. HTTP 402 responses are handled transparently — your users never see them. Pay as you go, per call.

Simple, transparent pricing

Only 1% transaction fee. No hidden costs. No surprises.

Free

$0/month

Get started with basic API access.

  • 20 transactions per month
  • API key access
  • Basic dashboard
  • Community support
Get Started
Popular

Starter

$9/month

For small projects and indie developers.

  • 1,000 transactions per month
  • SDK access (JS/TS)
  • Analytics dashboard
  • Email support
  • 1% transaction fee
Get Started

Pro

$49/month

For growing teams and businesses.

  • 10,000 transactions per month
  • Stripe top-up integration
  • Webhook support
  • SLA guarantee
  • Priority support
  • 1% transaction fee
Get Started

Enterprise

Custom

For large-scale deployments.

  • Unlimited transactions
  • On-prem deployment
  • SSO / SAML
  • Audit logs
  • Dedicated support
  • Custom SLA
Contact Us

Frequently asked questions

Everything you need to know about XPay and HTTP 402.

HTTP 402 is the 'Payment Required' status code — long dormant in the HTTP spec. XPay brings it to life. Add our middleware to any endpoint, and XPay automatically returns HTTP 402 when payment is needed. Your users' SDK handles the rest transparently.

XPay takes 1% per transaction. No monthly minimum, no setup fees, no hidden costs. You keep 99% of every API call revenue. For microtransactions (under $0.01), XPay is 10x cheaper than Stripe or any traditional payment processor.

Yes. Add 2 lines of middleware to your existing API. Works with any framework — Express, Fastify, Next.js, FastAPI, Rails, Django, and more via our universal SDK. No need to rewrite your API or change your architecture.

XPay settles all transactions in USDC on the Base Network. Base is Coinbase's Ethereum L2 — it's cheap ($0.02/tx average), fast (~1 second finality), and battle-tested. Your users don't need to know or care about the blockchain; our SDK abstracts everything.

Yes! Every developer gets 20 free transactions per month. No credit card required. Sign up, get your API key, and start building immediately. Only upgrade when you need more volume.

Your users fund their XPay wallet once (via credit card, USDC transfer, or any supported on-ramp). After that, every API call auto-debits their balance. No friction, no repeated checkout forms, no subscription commitments. Fund once, use forever.

When a user's balance runs low, XPay returns HTTP 402. The SDK auto-detects this and prompts the user to top up. Once funded, the SDK retries the request seamlessly. Your users never see a broken experience — just a smooth 'top up and continue' flow.

Different tools for different jobs. Stripe is excellent for subscriptions and one-time payments. XPay is purpose-built for pay-per-call API billing. For microtransactions (cents or fractions of cents), XPay is 10x cheaper. Use Stripe for monthly plans, XPay for per-request billing. Better together.