API Overview
Everything you need to monetize your API with x402 micropayments.
Base URL
Quick Start
Create a metered endpoint
Go to /developers, connect your wallet (this is where you'll receive payments), and create an endpoint with your upstream URL and price.
Share your metered URL
You'll get a URL like easepay.xyz/m/ep_abc123. Share this with agents instead of your direct API.
Get paid via x402
When agents call your metered URL and pay, EasePay verifies via x402 facilitators and forwards the request to your API. You receive 95% of each payment directly to your wallet.
Non-custodial: EasePay never takes custody of your funds. Payments are settled by x402 facilitators directly to your wallet, minus our 5% platform fee.
End-to-End Example
Here's how an AI agent discovers and pays for your API via x402:
1// 1. Agent discovers your metered endpoint2const discovery = await fetch('https://easepay.xyz/.well-known/x402.json')3const endpoints = await discovery.json()4 5// 2. Agent calls your metered endpoint6const response = await fetch('https://easepay.xyz/m/ep_abc123', {7 method: 'POST',8 headers: { 'Content-Type': 'application/json' },9 body: JSON.stringify({ query: 'analyze PEPE tokenomics' })10})11 12// 3. Gets 402 with x402 payment instructions13if (response.status === 402) {14 const paymentInfo = await response.json()15 // paymentInfo = { price: 1.00, currency: 'USDC', recipient: '0x...', facilitators: [...] }16 17 // 4. Agent pays via x402 facilitator (or on-chain)18 const txHash = await payUSDC(paymentInfo.recipient, paymentInfo.price)19 20 // 5. Agent retries with payment proof21 // Note: In production, agents use full x402 payment objects.22 // This simplified example uses the transaction hash directly.23 const result = await fetch('https://easepay.xyz/m/ep_abc123', {24 method: 'POST',25 headers: {26 'Content-Type': 'application/json',27 'X-PAYMENT': txHash // x402 payment proof28 },29 body: JSON.stringify({ query: 'analyze PEPE tokenomics' })30 })31 32 // 6. Gets the actual response (payment verified via x402 facilitators)33 const data = await result.json()34 // data = { analysis: '...', risk_score: 7.2, ... }35}Key Concepts
Metered Endpoints
Wrap any API with pay-per-call pricing. Set prices from sub-cent to $100 per call.
x402 Protocol
HTTP 402 Payment Required. The standard for agent-to-agent payments.
Payment Verification
CDP + 7 ecosystem facilitators with on-chain fallback. Payments always verify.
Webhooks
Get notified when payments are received and verified.