How to make an AI agent pay for APIs
An AI agent pays for an API the same way a browser loads a page: over HTTP. The server answers an unpaid request with 402 Payment Required and a price, the agent pays from a wallet you gave it, then retries the request with proof of payment. No account, no API key, no card form. SatBotly has probed 527 pay-per-call endpoints without paying; 291 of 527 priced ones ask one cent or less per call. Here is how to set an agent up in five steps.
Step 1: pick a payment rail
Three HTTP 402 rails are live today. They differ in what the agent pays with, not in how the request looks.
| Rail | Agent pays with | Endpoints | Providers | Median per call | Most common asset | Start here |
|---|---|---|---|---|---|---|
| x402 | stablecoin signed by the agent wallet | 357 | 189 | $0.01 | USDC (Base) | cheapest x402 |
| L402 | a Lightning invoice paid in sats | 133 | 47 | 10 sat ($0.008151) | BTC (Lightning) | cheapest L402 |
| MPP | the method named in a Payment challenge | 37 | 36 | $0.005125 | USDC.e (Tempo) | cheapest MPP |
Rule of thumb: if the agent already holds USDC, start with x402 (largest catalog). If it holds sats on Lightning, start with L402. If you need the gateways sold over MPP, hold the asset its method asks for. L402 USD values use the sat rate stored in data/apis.json (0.00081513 USD per sat).
Step 2: give the agent a wallet with a budget
The agent needs a wallet it can use without a human clicking "approve" on every call, and you need a cap on what it can spend. Of the 199 wallets SatBotly tracks:
- 52 can pay x402 (stablecoin HTTP 402)
- 120 pay over Lightning, for L402 invoices
- 38 support Nostr Wallet Connect, so an agent can spend from a wallet it does not hold the keys to
- 78 ship an MCP server, so Claude, Cursor or any MCP client can pay as a tool call
- 41 document a spending limit, budget or allowance
Fund the wallet with a small amount first. A spending limit plus a small balance means a looping agent can only burn what you put in. Full ranking: agent wallet leaderboard.
Step 3: handle the 402 response
The flow is the same on every rail:
- The agent sends a normal request (GET or POST) with no payment.
- The server answers
402 Payment Requiredwith a challenge: the price, the asset and where to pay. - The agent's wallet pays (x402: signs a stablecoin payment matching one of the
acceptsoptions; L402: pays the Lightning invoice from theWWW-Authenticateheader and keeps the preimage; MPP: pays with the method in thePaymentchallenge). - The agent repeats the same request with the proof attached and gets the normal response.
Most agent wallets and SDKs wrap steps 2 to 4, so your code just makes the request and sets a maximum price. Check the price in the challenge before paying: never let the agent pay a 402 that asks more than you expect. Want to see a real challenge without paying? Paste any endpoint into try402.
Step 4: start with the cheapest live endpoints
- x402: x402wrapper $0.0001, Agent Tools: business days between two dates (skips weekends and national public holidays by country) $0.001, Agent Tools: currency exchange rates (ECB reference rates) $0.001. All cheapest x402 APIs
- L402: Agent Oracle: cheapest live NVIDIA A100 GPU provider $0.000815 (1 sat), Loop Gateway $0.000815 (1 sat), parsebit-lnd.fly.dev: Code explanation endpoint that accepts code or a code-file URL and r $0.000815 (1 sat). All cheapest L402 APIs
- MPP: Object Storage: List objects $0.0001, AIsa MPP Data APIs: Airbnb: Search Airbnb Listings $0.001, Alchemy: NFT API v3 $0.001. All cheapest MPP APIs
Prices are what each endpoint asked in an unpaid 402 challenge. No API was paid. Prices drift; re-check on try402 before you rely on one.
Step 5: compare rails before you commit
Side-by-side numbers for each pair: x402 vs L402 · x402 vs MPP · L402 vs MPP. The big picture is in the state of agent payments.
FAQ
How do AI agents pay for APIs?
Over HTTP 402 Payment Required. The API answers an unpaid request with a 402 and a price, the agent pays from its own wallet, then repeats the request with proof of payment. SatBotly has probed 527 such endpoints without paying (data as of 2026-11-13): 357 x402, 133 L402 and 37 MPP.
Which payment rail should my agent use?
Pick by what the agent can hold. x402 has the most endpoints here (357 from 189 providers, median $0.01 per call, mostly USDC (Base)). L402 is paid in Lightning sats (133 endpoints, median 10 sat). MPP has 37 endpoints, median $0.005125.
What wallet does an AI agent need?
A wallet the agent can drive from code or tools. Of 199 wallets in the SatBotly directory, 52 can pay x402, 120 pay over Lightning, 38 support Nostr Wallet Connect, 78 ship an MCP server and 41 document a spending limit.
How much does one paid API call cost?
Of 527 priced endpoints, 291 ask one cent or less per call. The cheapest prices seen were $0.0001 on x402, $0.000815 on L402 and $0.0001 on MPP.
Data and method
Each endpoint is probed with an unpaid request and kept only if it answers HTTP 402 with a readable price. Wallet features come from each wallet's own docs, with a source link and quote. Data date 2026-11-13. Browse all pay-per-call APIs or read how entries are checked.