How Do AI Agents Pay for APIs? Paying Per Call, Explained

AI agents pay for APIs the way you feed a vending machine: the server names a price, the agent's wallet drops in the coin, and the data comes out. No account, no sign-up form, no monthly plan. The coin is almost always a stablecoin - usually USDC, designed to stay worth about a dollar - and the amount is often a fraction of a cent.
Why not just put it on a card?
Because a card payment has a floor. Processing one costs the seller a fixed slice of around twenty to thirty cents, so charging two tenths of a cent for a single data lookup is impossible. A program also cannot do the human parts: filling in a sign-up form, confirming an email, passing an identity check at three in the morning. A stablecoin transfer on a cheap network such as Base or Solana settles in seconds for a tiny fee, and it cannot be charged back six weeks later.
What does the handshake look like?
The best-known version is x402, published by Coinbase, and it reuses a part of the web that sat unused for thirty years: HTTP status code 402, "Payment Required". It runs in three steps:
- The agent asks for the data. The server answers 402 with a price, the token it wants, an address and a network.
- The agent's wallet signs the payment and asks again, with proof attached.
- The server checks the payment and returns the data.
Cloudflare built a gateway that lets a site put a price on a single route this way. Stripe and Tempo's Machine Payments Protocol does a similar job with one authorisation signed up front instead of a signature on every call, and it also accepts ordinary cards.
What does it cost in practice?
Published endpoints tend to sit between a fraction of a cent and a few cents per call - CoinGecko's x402 price feed charges about a cent. Pay-per-call wins when usage is spiky and a flat subscription wins when it is heavy and steady, which is the same arithmetic as a phone plan.
If you ever hand an agent a wallet, treat it as a petty-cash tin: a small float, topped up deliberately, with a daily cap you actually look at. The realistic failure is not theft, it is a loop buying the same thing ten thousand times. Next, read what x402 is and how an agent proves it is allowed to buy.