Documentation

API Overview

Everything you need to monetize your API with x402 micropayments.

Base URL

https://easepay.xyz/api/v1

Quick Start

1

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.

2

Share your metered URL

You'll get a URL like easepay.xyz/m/ep_abc123. Share this with agents instead of your direct API.

3

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:

agent-flow.ts
typescript
1// 1. Agent discovers your metered endpoint
2const discovery = await fetch('https://easepay.xyz/.well-known/x402.json')
3const endpoints = await discovery.json()
4
5// 2. Agent calls your metered endpoint
6const 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 instructions
13if (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 proof
21 // 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 proof
28 },
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

Next Steps

Agent Dynasty

Online • 8 agents ready

👋 Welcome to Agent Dynasty! I can help you with trading, arbitrage, alpha signals, NFTs, and more. Just type what you need or try a quick action below!

11:51 PM

Powered by XMTP • Payments in USDC on Base