Loomal

Pay-Per-Call API

A pay-per-call API is an API priced so that each individual request is billed separately — often via x402 — instead of through a subscription or pre-purchased credits.

Also known as: per-call pricing, per-request billing

What is a pay-per-call API?

A pay-per-call API charges at the granularity of a single request: one call, one price, settled at the moment of use. There is no monthly plan to pick, no credit pack to pre-buy, and no invoice at the end of the month — the commercial relationship begins and ends with each request.

The model has always been attractive in theory; what made it impractical was payment infrastructure. Card rails cannot profitably move $0.01, so APIs historically aggregated usage into subscriptions and tiers. Per-call USDC settlement removed that constraint.

How a pay-per-call request works with x402

The caller sends a normal request with no payment attached. The server responds with HTTP 402 Payment Required, including the price, the currency (USDC), and the payment address. The caller's wallet signs the payment requirement and retries the request with a payment header. The server verifies the payment, settlement lands on Base in roughly two seconds, and only then does the handler execute.

The response carries an Ed25519-signed receipt and the Base transaction hash, so both sides hold cryptographic proof of exactly what was bought and when. Because the agent pays before the handler runs and on-chain settlement is final, there are no chargebacks and no unpaid usage to chase.

Pay-per-call vs API keys and subscriptions

Key-and-subscription billing front-loads friction: create an account, store a card, choose a tier, provision a key, then track usage against quota. That sequence assumes a human with a browser. Pay-per-call inverts it — the first request is also the signup, because the payment itself is the credential.

The economics differ too. Subscriptions overcharge light users and undercharge heavy ones; the provider absorbs the mismatch with rate limits and overage fees. Per-call pricing maps revenue one-to-one onto cost: a request that costs the provider compute earns the provider money, every time.

Why pay-per-call suits AI agents

Agents are sporadic, wide-ranging consumers. A single task might require one geocoding call, three searches, and a PDF extraction from three different providers — then never touch any of them again for a week. Negotiating contracts or maintaining subscriptions with every provider an agent might conceivably use does not scale; paying $0.01 at the moment of need does.

For the agent's operator, per-call pricing also makes spend legible: the wallet's transaction log is the cost report, itemized down to the individual request. Budget enforcement moves into wallet policy — a per-call ceiling here, a per-task cap there — instead of waiting for an end-of-month invoice to reveal what happened.

Listing a pay-per-call API on Loomal

Loomal's marketplace lets developers list MCP servers and API endpoints as pay-per-call: claim the listing, set a per-call price (minimum $0.01), and any x402-capable agent can discover and pay for it with no contract negotiation. Repricing is a single field in the console, so you can adjust as you learn what calls are worth. Loomal takes a 5% fee on settled transactions, currently waived.