HTTP-native micropayments for APIs. Return a 402, get paid in USDC, deliver data. No subscriptions, no API keys to manage — just pay-per-request built into HTTP.
Three HTTP round-trips. No out-of-band negotiation, no payment SDKs, no webhooks to configure.
Client sends a standard HTTP request to a monetized endpoint.
Server responds with payment requirements in standard HTTP headers.
Client signs payment, retries with proof. Server settles and delivers.
Everything you need to monetize APIs with HTTP-native payments, from middleware to AI agent integration.
Protect any Laravel route with a single middleware declaration. Configurable pricing per endpoint with automatic 402 response generation and settlement verification before data delivery.
Autonomous AI agents can pay for API access using the MCP tool integration. Budget limits and approval thresholds keep spending under control without human intervention.
Granular spending controls with daily caps, per-transaction limits, and per-agent budgets. Configurable approval thresholds trigger manual review above set amounts.
Settle payments on Base (primary, low fees), Ethereum, or Avalanche using USDC. Each endpoint can be independently configured with its preferred network.
Leverage the x402.org facilitator for trustless payment verification and settlement, or run your own self-hosted facilitator for full control over the payment pipeline.
Full CRUD for monetized endpoints, payment history, and spending reports. Choose REST or GraphQL for managing your x402-protected resources programmatically.
From API monetization to autonomous AI agents, x402 handles payment at the protocol level so you can focus on delivering value.
Charge per-request for premium data, analytics, or AI inference endpoints. No subscription management, no billing integration — clients pay at the HTTP layer and get instant access.
Let Claude, GPT, and other AI agents pay for API access autonomously. MCP tool integration with budget controls ensures agents operate within defined spending limits.
Real-time market data, research reports, and compliance feeds with instant USDC settlement on Base. Consumers pay only for the data they actually consume.
Protect any Laravel route with x402 middleware in one line. Handle 402 responses client-side with a few lines of JavaScript.
// routes/api.php
// Simple: protect a route for $0.10
Route::get('/premium/market-data', [MarketDataController::class, 'index'])
->middleware('x402:100000'); // micro-USDC
// Full config: price, network, asset
Route::get('/premium/analytics', [AnalyticsController::class, 'show'])
->middleware('x402:500000,eip155:8453,USDC');
// Group multiple endpoints
Route::middleware(['x402:250000'])->group(function () {
Route::get('/data/trades', [TradeController::class, 'index']);
Route::get('/data/orderbook', [OrderBookController::class, 'show']);
});
const res = await fetch('/v2/premium/data');
if (res.status === 402) {
// Read payment requirements from headers
const amount = res.headers.get('X-Payment-Amount');
const network = res.headers.get('X-Payment-Network');
const receiver = res.headers.get('X-Payment-Receiver');
// Sign and send USDC payment
const txHash = await sendUSDC(receiver, amount, network);
// Retry with payment proof
const data = await fetch('/v2/premium/data', {
headers: { 'X-Payment-Proof': txHash }
});
}
Set X402_FACILITATOR_URL and X402_RECEIVER_ADDRESS in your .env
Attach x402:price middleware to any route you want to monetize
Clients receive 402 responses with payment info and pay in USDC automatically
Settle payments on the network that best fits your use case. Base offers the lowest fees for high-frequency micropayments.
| Network | Chain ID | Asset | Status |
|---|---|---|---|
| Base | eip155:8453 | USDC | Primary |
| Ethereum | eip155:1 | USDC | Supported |
| Avalanche | eip155:43114 | USDC | Supported |
Networks are configurable per-endpoint via middleware parameters or the management API.
Add x402 payment gates to your endpoints and get paid per request. No subscriptions, no billing integrations — just HTTP.
Building a mobile wallet? See Mobile Payments →