x402 · Pay-Per-Use APIs

Find the right x402 service for your project

Describe your use case. Pay $0.75 in USDC. Get AI-powered recommendations for the best x402-gated APIs — with code snippets ready to copy.

Trading bot with crypto data DeFi yield aggregator NFT rarity checker AI content generator Stock market screener

$0.75 USDC charged via x402 on Base · Requires MetaMask or Coinbase Wallet

Top Recommendations


For Developers

Call the recommendation engine directly via the REST API. All endpoints require an x402 payment header.

AI Recommendation Endpoint

Get the top 3 x402 service recommendations for any use case.

GET /recommend?usecase=I+need+real-time+crypto+data
$0.75 USDC per request

Crypto Data Endpoints

Live prices, market data, portfolios, and conversions.

GET /price?coin=bitcoin GET /top10 GET /compare?coins=bitcoin,ethereum GET /portfolio?coins=bitcoin:0.5,ethereum:2 GET /convert?from=bitcoin&to=ethereum&amount=1
$0.001 USDC per request

x402 Discovery Document

Machine-readable list of all gated endpoints on this server.

GET /.well-known/x402
Free

Quick Integration (Node.js)

// x402 client helper async function x402Fetch(url, wallet, chainId = 8453) { const res = await fetch(url); if (res.status !== 402) return res; const { accepts } = await res.json(); const req = accepts.find(a => a.scheme === 'exact'); const nonce = '0x' + [...crypto.getRandomValues(new Uint8Array(32))] .map(b => b.toString(16).padStart(2, '0')).join(''); const validBefore = Math.floor(Date.now() / 1000) + req.maxTimeoutSeconds; const typedData = { domain: { name: req.extra.name, version: req.extra.version, chainId, verifyingContract: req.asset }, types: { TransferWithAuthorization: [ { name: 'from', type: 'address' }, { name: 'to', type: 'address' }, { name: 'value', type: 'uint256' }, { name: 'validAfter', type: 'uint256' }, { name: 'validBefore', type: 'uint256' }, { name: 'nonce', type: 'bytes32' } ]}, primaryType: 'TransferWithAuthorization', message: { from: wallet, to: req.payTo, value: req.maxAmountRequired, validAfter: '0', validBefore: String(validBefore), nonce } }; const sig = await window.ethereum.request({ method: 'eth_signTypedData_v4', params: [wallet, JSON.stringify({ ...typedData, types: { EIP712Domain: [ { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContract', type: 'address' } ], ...typedData.types }})] }); const payment = btoa(JSON.stringify({ x402Version: 1, scheme: req.scheme, network: req.network, payload: { signature: sig, authorization: typedData.message } })); return fetch(url, { headers: { 'X-PAYMENT': payment } }); }