AI agents pay for web resources with stablecoins via standard HTTP. You add one middleware. We handle signature verification, gas, and on-chain settlement.
How it works
Agent hits your API endpoint
GET /api/weather?city=londonServer responds with pricing
402 + PaymentRequirements{}Agent signs ERC-3009 off-chain
X-PAYMENT: <base64 payload>PayZap verifies sig, submits tx
transferWithAuthorization()Resource served, merchant paid
200 OK + { data: ... }The agent signs an off-chain authorization. PayZap submits the transaction and covers all network fees.
Every payment is cryptographically verified off-chain before on-chain settlement. No trust required.
API responds immediately after verification. On-chain settlement happens in the background via per-chain queues.
Use cases
If it has a URL and returns data, it can accept payments through x402.
Monetize APIs that AI agents consume
Your API returns a 402 status code with pricing info. The agent's wallet signs an ERC-3009 authorization. Our facilitator submits the transaction — the agent never touches gas.
Who: LLM tool providers, AI API marketplaces, autonomous agent platforms
No subscriptions, no API keys — just pay per request
Price data, market intelligence, weather, geolocation — any data endpoint. Agents pay the exact cost of each call in stablecoins. No rate limits, no plans to manage.
Who: Data providers, oracle services, real-time feed aggregators
GPU time, model inference, serverless compute
Sell compute on demand. An agent sends one HTTP request, pays $0.003 for a GPU inference call, and gets the result. Settlement happens in the background — you get the stablecoin.
Who: GPU cloud providers, model hosting platforms, serverless compute
Gated content, premium features, metered SaaS access
Protect any URL with a paywall. Human users get redirected to a payment page. AI agents negotiate and pay programmatically via the x402 handshake — same endpoint, both work.
Who: Content platforms, SaaS with metered tiers, research databases
Integration
import express from 'express';
import { createPaywall } from '@payzap/x402-middleware';
const app = express();
const paywall = createPaywall({
facilitatorUrl: 'https://api.payzap.cc',
payTo: '0xYourWallet...',
network: 'eip155:8453', // Base
asset: '0x833589...USDC',
amountUsd: 0.01,
});
app.get('/api/weather', paywall, (req, res) => {
// This only runs after verified payment
res.json({
city: 'London',
temp: 18,
receipt: req.x402Receipt,
});
});npm i @payzap/x402-middlewareX-PAYMENT header → middleware returns 402 with PaymentRequirementsTransferWithAuthorizationX-PAYMENT headerreq.x402ReceiptThe middleware is a standalone npm package with zero monorepo dependencies. Self-contained types, 6 KB gzipped. Works with any Express-compatible server.
Networks
Stablecoins
ERC-3009 allows the payer to sign a transfer authorization off-chain. The facilitator submits the transaction and pays gas. The payer never needs ETH or a wallet provider that supports transaction signing — only message signing.
Pricing
No subscriptions, no monthly fees. You only pay when a payment settles on-chain. Minimum fee: $0.001 per transaction.
| Payment | Fee | Merchant receives |
|---|---|---|
| $0.01 | $0.001 | $0.009 |
| $1.00 | $0.001 | $0.999 |
| $10.00 | $0.01 | $9.99 |
| $100.00 | $0.10 | $99.90 |
Gas fees covered by the facilitator. Included in the settlement fee.
One npm package. One facilitator URL. Every AI agent with a wallet becomes a customer.