Pay Per Call API: What It Is and Why AI Agents Need It
A pay per call API charges the consumer for each individual request rather than bundling usage into a subscription or seat-based plan. For developers building AI agents, this model aligns cost directly with work performed, so an agent that makes five calls pays for five calls and nothing more.
What a pay per call API actually means
In a pay per call API model, every HTTP request to an endpoint carries a discrete price. The provider publishes that price, the caller pays it at request time, and the response is delivered once payment clears. There is no monthly commitment, no prepaid credit pool, and no seat license. Usage and cost scale together linearly.
Prices can vary by endpoint within the same API. A lightweight lookup might cost $0.002 while a compute-heavy generation endpoint might cost $0.44. This granularity lets providers reflect actual resource consumption rather than averaging it into a flat rate. For a deeper look at how sub-dollar pricing works at the protocol level, see the guide on api micropayments.
Pay per call vs. subscription vs. seat pricing
Subscription pricing bundles a quota of calls into a monthly fee. It works when usage is steady and predictable, but it punishes bursty workloads. An AI agent that runs intensively for two days then idles for a month still pays the full period.
Seat pricing charges per user or per API key. It was designed for human teams, not software agents. An autonomous agent that spawns parallel workers or rotates credentials breaks the seat model entirely, often triggering overage charges or terms-of-service violations.
Pay per call sidesteps both problems. The agent pays exactly for what it consumes. There is no penalty for idle time and no concept of a seat. Cost tracks directly to output, which makes budgeting and attribution straightforward for agent orchestrators.
When pay per call wins for AI agent workloads
AI agents exhibit unpredictable, spiky request patterns. A coding agent might hit a search API hundreds of times while debugging a single issue, then not call it again for days. Subscriptions force the developer to provision for peak usage; pay per call lets the agent scale to zero cost when idle.
Multi-provider workflows amplify the advantage. A single agent task might call a web search API, a code analysis endpoint, and a data enrichment service in sequence. Managing three separate subscriptions, each with its own billing cycle and quota, adds operational overhead that grows with every new provider. A unified pay-per-call balance eliminates that overhead. AgentCash addresses this directly as part of the broader challenge of payments for ai agents.
Cost attribution also becomes trivial. When every call has a known price, developers can tag spend to a specific agent run, task, or user. This is critical for multi-tenant agent platforms where usage-based billing needs to flow through to end customers.
How providers price per call: endpoints, tokens, and output
The simplest model is a flat fee per endpoint. Every request to a given URL costs the same regardless of payload size. This is common for lookup-style APIs such as DNS resolution, geocoding, or domain reputation checks.
Token-based pricing charges per unit of input or output. Large language model APIs typically bill per thousand tokens, but when wrapped behind an x402 endpoint, the provider can quote a single price per request that accounts for average token consumption. The caller sees a flat per-call price even though the provider calculated it from token economics.
AgentCash currently indexes 1 payment-protected origin spanning 1 API category, with 30 priced endpoints available. The observed median price per paid call is $0.028, and prices range from $0.002 to $0.440. These figures, current as of 2026-04-07, show how wide the per-call pricing spectrum can be even within a single origin.
Tradeoffs: cost predictability and budget caps
The primary objection to pay per call pricing is unpredictable spend. A runaway agent loop can burn through a balance fast if nothing constrains it. Budget caps solve this at the wallet level. With AgentCash, developers set spending limits that the wallet enforces before signing any payment. If the cap is reached, the agent receives an error rather than an approved payment.
Another concern is price volatility. If a provider changes per-call pricing, agent costs shift immediately. Subscription contracts offer short-term price stability. In practice, x402 endpoints publish prices in the 402 response headers before any payment is made, so the agent or its orchestrator can inspect the quoted price and reject calls that exceed a threshold.
Reconciliation is simpler with pay per call. Every charge maps to a single request with a timestamp, endpoint URL, and on-chain settlement record. There is no ambiguity about what a monthly invoice covers, because each transaction is individually verifiable on Base, Solana, or Tempo.
How agents track and manage per-call spend
Because x402 settles each payment on-chain, every call generates a transaction record. Developers can query chain explorers or index settlement events to build dashboards showing spend per agent, per task, or per API provider.
At the protocol level, the x402 handshake gives the agent full visibility before committing. The server responds with HTTP 402 and a payment terms payload that includes the exact USDC amount, the recipient address, and the settlement chain. The agent's wallet evaluates this against its budget policy, signs the payment only if approved, and retries the request with an X-Payment header. This inspect-then-pay loop means no call is ever billed without the agent explicitly authorizing the amount.
For developers using coding agents like Claude Code or Cursor, AgentCash exposes this flow through its MCP server. The agent calls APIs through the MCP tool, and the wallet handles the 402 negotiation in the background. Spend logs are available through the CLI via npx agentcash.
Getting started with pay per call APIs through AgentCash
AgentCash provides the wallet, routing, and MCP integration needed to call any x402-protected pay per call API from a single USDC balance. 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.
Once configured, every x402-enabled endpoint in the AgentCash index becomes available to your agent without per-vendor signup or API key management. The agent hits an endpoint, receives a 402 with pricing, the wallet pays, and the data comes back. One balance, one integration point, all providers.
To explore what is available today, browse the AgentCash directory of priced endpoints. As the x402 ecosystem grows, new pay per call APIs will appear automatically in the index.
Frequently asked questions
How does a pay per call API differ from a metered API with monthly billing?
A metered API tracks usage but invoices on a billing cycle, often requiring a credit card on file. A pay per call API settles each request individually at the moment it is made. With x402, payment happens inline with the HTTP request, so there is no deferred invoice and no account to create.
Can I set a maximum budget so a runaway agent does not drain my wallet?
Yes. AgentCash wallets support spending caps that are enforced before any payment is signed. If an agent's accumulated spend reaches the cap, the wallet rejects further payment requests and the agent receives an error.
What happens if a pay per call API raises its price between two requests?
The x402 protocol includes the current price in every 402 response. Your agent sees the updated price before paying. You can configure the wallet or orchestrator to reject any call above a price threshold, giving you control over unexpected cost increases.
Do I need to sign up with each API provider separately?
No. AgentCash routes payments from one USDC balance to any x402-protected provider. You fund the wallet once and the x402 handshake handles authentication and payment per call. No per-vendor API keys or accounts are required.
Which blockchains does AgentCash use to settle pay per call transactions?
AgentCash settles on Base, Solana, and Tempo. All three chains use USDC as the payment currency. The specific chain is determined by what the API provider accepts, and the wallet handles chain selection automatically.
Is pay per call pricing viable for high-volume agent workloads?
It depends on the price per call and the volume. At the observed median of $0.028, one thousand calls cost $28. For latency-sensitive, high-throughput pipelines, developers should evaluate whether per-call settlement adds acceptable overhead. The x402 handshake adds one extra round-trip on the first call, but subsequent calls to the same endpoint can reuse cached payment terms.
How do I see a breakdown of what my agent spent on each API?
Every x402 payment settles on-chain, so each call maps to a verifiable transaction. You can query settlement records by recipient address to group spend by provider. The AgentCash CLI via npx agentcash also surfaces spend logs organized by endpoint and time.
Can I use pay per call APIs from an MCP server inside Cursor or Claude Code?
Yes. AgentCash provides an MCP server that plugs into coding agents like Cursor and Claude Code. The MCP tool wraps the x402 wallet so your agent can call paid endpoints directly from within the development environment without manual payment steps.
Related
Payments for AI agents let autonomous software pay per API call using USDC and x402. Learn how stablecoin rails replace API keys and subscriptions.
API micropayments let AI agents pay fractions of a cent per call with USDC stablecoins over x402. Learn why they work and how to start.
Get started with AgentCash
One balance, USDC on Base · Solana · Tempo. Call any payment-protected API from your agent — no API keys.
This page is compiled from live OpenAPI specs published by each API provider. Content last reviewed Apr 7, 2026 by the AgentCash team. How we build these pages.