Pay-Per-Call APIs: Why AI Agents Need Them

A pay-per-call API charges the consumer for each individual request rather than bundling usage into a subscription or a seat-based plan. Every HTTP request carries a discrete price, so cost and usage scale together, which fits AI agents that call services in unpredictable bursts.

What a pay-per-call API means

Every request carries its own price, and there is no monthly commitment, prepaid credit, or seat license. Usage and cost move together in a straight line. Prices vary by endpoint, so one call might cost $0.002 while another costs $0.440, depending on what it does.

Pay per call vs subscription vs seat pricing

Subscriptions bundle calls into a monthly fee, which penalizes bursty workloads that sit idle most of the month. Seat pricing charges per user or per API key, which does not map onto an autonomous agent that has no seat. Pay per call removes both problems: no idle-time penalty and no seat constraint.

When pay per call wins for AI agents

Agents make unpredictable, spiky request patterns, and a multi-provider workflow would otherwise stack up several subscriptions. Paying per call keeps cost attribution clean, which matters for a platform running work on behalf of many tenants. You pay for exactly the calls you make and nothing else.

How providers price per call

There are two common models. A flat fee per endpoint charges the same regardless of payload size. Token-based pricing charges per unit of input or output. AgentCash tracks one origin with 30 priced endpoints today, at a median of $0.028 per call and a range of $0.002 to $0.440.

Tradeoffs: predictability and budget caps

The main risk is a runaway agent loop burning the balance quickly. The fix is spending limits enforced before a payment is signed, plus price visibility, since the 402 response shows the price before the agent commits. On-chain settlement then gives you a clean audit trail of what was spent.

How agents track and manage per-call spend

Because x402 settles each payment on-chain, every call leaves a transaction record. The handshake gives the agent the price before it commits, the wallet checks it against your budget policy, and the agent explicitly authorizes the amount. For coding agents, the AgentCash MCP server for Claude Code and Cursor handles this in the background.

Getting started through AgentCash

Run npx agentcash to create a wallet, fund it with USDC on Base, Solana, or Tempo, and install the MCP server into your coding agent. One balance then covers every x402-enabled endpoint. As a rough sense of scale, 1,000 calls at the median price is about $28.

Reference: the x402 protocol site.

Frequently asked questions

How is pay per call different from a metered API?

A metered API tracks usage and invoices you on a billing cycle, so you settle later. A pay-per-call API settles each request individually at call time, usually on-chain, with no deferred invoice. That immediacy is what lets an autonomous agent pay for a service it has never registered with.

What if a price increases between requests?

Each 402 response includes the current price, so the agent sees any change before it pays. If a call would exceed the threshold you set, the wallet refuses to sign and the agent handles the error. You never pay a new, higher price without the agent first checking it against your cap.

Is pay per call viable for high-volume workloads?

It depends on the per-call price and your volume. The x402 handshake adds one HTTP round-trip per paid call, and subsequent calls can reuse cached terms, so overhead stays low. For heavy usage, compare the per-call total against a flat subscription, since one is not always cheaper than the other.

Put it into practice

AgentCash gives your AI agent a wallet to pay for any payment-protected API — no keys, USDC on Base.