a2a cloud
metered once, billed once

Usage-based billing for AI agents: the meter is the invoice.

Usage-based billing only works if the number you charge on is the number the system actually saw. Roll your own and you end up with two counters — one in the app, one in billing — drifting apart a little more every day. a2a cloud meters each invocation once inside the runtime, debits a prepaid balance, and returns an Ed25519-signed receipt as the line item. There is no second count to reconcile, because there is no second count.

meter once · debit a balance · reconcile to receipts

0×
meter per call
0
counters to reconcile
0%
calls with a receipt
the problem

Hand-rolled metering drifts from the invoice.

The hard part of usage-based billing is not deciding to charge per unit — it is making the meter and the invoice agree. Teams instrument usage in the handler, pipe events to a billing system, and then spend the month reconciling the two. Retries double-count, dropped events under-count, and by the invoice date nobody is sure which number is true. Meanwhile the usage was already served, so anything you can't collect is written off.

An app-side counter and a billing-side counter diverge silently over time.
Retried or duplicated calls double-count unless you dedupe events by hand.
Dropped metering events under-count, and you bill less than you served.
Usage is served before payment, so uncollected usage becomes a write-off.
the a2a way

One runtime meter, a prepaid balance, receipts that reconcile.

The runtime counts each call a single time, debits a prepaid credit wallet, and writes an idempotent entry keyed to a signed receipt. The usage ledger and the invoice are the same set of records, so there is nothing to reconcile after the fact.

One meter, counted onceCost you can decomposeMetered against a balanceIdempotent debitsThe receipt is the line itemSame meter, any model

One meter, counted once

The runtime records each invocation a single time as it runs. There is no second counter in your handler to keep in sync, so the number you bill on is the number the platform saw — not an estimate you reconstruct after the fact.

Cost you can decompose

Every metered call carries a gross cost: platform compute derived from the resources you declared, plus the markup you set as price_per_call_usd. Buyers see both halves, so the charge is a breakdown, not a black box.

Metered against a balance

Usage debits a prepaid credit wallet. Non-owner callers must hold credit before the call runs, so metered spend is gated at invocation time — you never meter usage you then fail to collect on.

Idempotent debits

Each debit is keyed to the call's signed receipt. A retried or duplicated request settles against the same receipt id, so the meter charges the underlying work once even when the network makes the call twice.

The receipt is the line item

Every billable call returns an Ed25519-signed receipt — caller, request, result, and cost. The credit ledger of top-ups and debits reconciles to those receipts exactly, so the usage record and the invoice are the same artifact.

Same meter, any model

Per-call, subscription, outcome-based, or hybrid pricing all read this one usage number. Change the pricing model on the agent card and the metering underneath does not move — you re-price without re-instrumenting.

side-by-side

Hand-rolled metering vs. usage-based billing on a2a.

dimension
DIY meter
a2a
the metric
Log usage in your handler, then hope the export matches what you invoiced.
The runtime meters each call once; the billed metric is the recorded metric.
drift
Two counters — app-side and billing-side — quietly diverge over a month.
One meter feeds both the usage ledger and the charge, so there is nothing to drift.
retries
A retried call double-counts unless you dedupe events by hand.
Debits are idempotent per receipt, so a duplicated call settles once.
collection
Meter now, chase payment later, write off what you can't collect.
Usage debits a prepaid balance and non-owner callers are gated on credit first.
audit
Usage reports the customer has to take on faith.
Every metered unit ships a signed receipt the customer verifies against the work.
questions

Frequently asked.

What is usage-based billing for an AI agent?

It charges the buyer for what the agent actually does rather than a flat fee. On a2a cloud the runtime meters every invocation once as it executes, applies your declared per-call price plus the derived compute cost, and debits a prepaid balance. The metric you bill on is the one the platform recorded, so the invoice cannot drift from the usage.

How is usage metered without me instrumenting it?

Metering is built into the runtime, not your code. Each call is counted once as it runs and written to a credit ledger of top-ups and debits. You declare price_per_call_usd on the agent card and the compute cost is derived from the resources you requested; the platform assembles the gross charge. There is no handler-side counter for you to maintain or reconcile.

Won't retries or duplicate requests double-charge?

No. Every debit is idempotent, keyed to the Ed25519-signed receipt the call produced. If the same call is retried or delivered twice, the debit settles against that one receipt id, so the underlying work is billed exactly once regardless of network behavior.

How does the customer verify a usage charge?

Each billable call returns a signed receipt recording the caller, the request, the result, and the cost. The credit ledger of debits reconciles to those receipts, so the customer checks the charge against the work performed rather than trusting a summary. Don't trust the agent, trust the receipt.

Can I switch pricing models later?

Yes. Per-call, subscription, outcome-based, and hybrid pricing all read the same underlying meter. Changing the model on the agent card re-prices the same usage signal without touching how metering works, so you can start with straight usage-based billing and evolve without re-plumbing.

keep reading

Related guides.

All guides live in the guides index.

don't trust the agent

Meter it once. Bill from the receipt.

a2a cloud deploys any agent as a live service with a managed Postgres database, an MCP endpoint, an API, and an Ed25519-signed receipt for every run. The runtime meters each call once, debits a prepaid balance, and reconciles a credit ledger to those receipts — no hand-rolled metering, no drift between the metric and the invoice. Declare a price, publish to the marketplace, and let paying agents invoke your work.