10 min read
Usage-Based Billing for AI Products: Charge for Tokens, Calls and Credit on One Invoice
How to bill an AI product by usage: meter tokens or API calls, include an allowance in the plan, draw down prepaid credit, and put the overage on the same renewal invoice. With worked examples.

In short
An AI product's costs grow with use, so a flat price either loses money on heavy users or overcharges light ones. Usage-based billing fixes that: your app sends an event each time a customer uses something (1,250 tokens, one API call, one image), and the bill follows. With Comecero, usage rides on the subscription you already sell. Each renewal invoice carries the plan's price for the next period plus the usage above the plan's allowance for the period that just ended, after any prepaid credit. One invoice, one charge, on the customer's saved card.
Why do AI products need usage-based billing?
Every request to a model costs you money: tokens in, tokens out, GPU minutes, storage. Two customers on the same plan can cost you ten times apart. Flat pricing leaves three bad options:
- Price high and lose the light users who would have paid a little.
- Price low and lose money on the heavy users who love your product most.
- Cap usage and cut off your best customers right when they get value.
Usage-based billing lets the price follow the cost. The common shapes for AI products are:
| Model | What the customer pays | Good for |
|---|---|---|
| Plan with an allowance, then overage | A monthly fee that includes some usage, plus a price per unit above it | Most AI SaaS: predictable base, fair at scale |
| Prepaid credit | Credit bought up front, drawn down as they use | Developer tools, API products, agencies |
| Pure pay as you go | Only what they used, billed each period | Infrastructure-style APIs |
| Peak-based | The highest level they reached, such as peak seats or agents | Team and workspace products |
Comecero supports all four, and you can mix them on one customer.
How does usage-based billing work in Comecero?
It takes four steps, and only the first one is your code:
- Your app counts. Each time a customer uses something, your server sends an event to the Comecero usage meter: "customer
cust_8412used 1,250ai_tokens". Send them as they happen or in batches of up to 1,000. - The meter adds it up. Events are counted by customer, metric and UTC hour. A resend of the same event is never counted twice, and events up to 30 days late are still billed.
- Comecero bills each period. When the customer's subscription renews, Comecero reads the period's usage, takes off what the plan includes, prices the rest, and takes that from prepaid credit if the customer has any.
- The customer pays one invoice. What is left goes on the renewal invoice next to the plan's price, and is charged with the saved payment method, like every renewal.
There is no separate billing job for you to run and no second invoice in a normal month.
How do I send usage from my app?
One HTTP call from your server:
curl -X POST https://usage.comecero.com/v1/events \
-H "Authorization: Bearer $COMECERO_USAGE_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"operation_id": "req_7Hk2p9",
"external_customer_id": "cust_8412",
"metric_key": "ai_tokens",
"quantity": "1250",
"timestamp": "2026-11-01T09:41:07Z",
"properties": { "model": "large" }
}
]
}'
operation_idis your own id for the request or job, so a retry is safe: the same id for the same metric is counted once.external_customer_idis your own id for the customer. You link it to their Comecero subscription once, with a billing agreement.propertieslet you tag an event, for example with the model, so you can see it later when you check a bill.
Usage keys start with apk_live_ or apk_test_ and must stay on your server. The full reference is in the usage meter docs.
What should I meter: sum or gauge?
Each metric adds up one of two ways:
sumadds every event's quantity in the period. Use it for things that get used up: tokens, API calls, images, minutes of compute, messages.gaugekeeps the highest hourly reading. Use it for levels: seats in use, active agents, connected workspaces.
Storage is a sum of hourly readings in GB-hours, so customers pay for how long they held the data, not only the peak.
If you charge different prices for different models, make one metric per price, for example ai_tokens_small and ai_tokens_large.
A worked example: an AI writing tool
Say you sell a Pro plan at 49 USD a month that includes 1,000,000 tokens, with overage at 0.00002 USD per token (2 USD per 100,000 tokens).
In October a customer uses 1,600,000 tokens. They also bought a 5 USD credit pack earlier.
| Step | Amount |
|---|---|
| Tokens used | 1,600,000 |
| Included in Pro | 1,000,000 |
| Billable tokens | 600,000 |
| Price: 600,000 × 0.00002 USD | 12.00 USD |
| Taken from prepaid credit | 5.00 USD |
| Usage charged | 7.00 USD |
On 1 November the renewal invoice shows two lines: Pro, November: 49.00 USD and AI tokens (token), 1,600,000 used in October: 7.00 USD. One charge of 56.00 USD on the customer's card.
How do customers avoid bill shock?
Usage billing only works if customers trust it. Comecero gives them, and you, ways to see usage before it is billed:
- Usage this period, in their account. Customers see each metric's use against what their plan includes, with a progress bar, on their account page.
- Usage in your app. Read the same numbers with one API call and show them in your own product.
- Alerts. A
usage:threshold_reachedwebhook fires when a customer passes 50%, 80% or 100% of their allowance, so you can send a "running low" email or offer an upgrade. - Hard limits when you want them. Set an entitlement's overage policy to
block, and usage past the allowance and credit is never charged. - Big bills are checked first. A bill above 5,000 USD, or more than 10 times the customer's last usage bill, is held, and nothing is charged until Comecero has checked it with you. That protects you and your customer from a bug or a leaked key.
What happens when something goes wrong?
- Late events up to 30 days old are billed on the next invoice as their own line. Invoices already made never change.
- The renewal is never held back because of usage. Usage that arrives after the renewal is billed as late usage next time.
- Usage that can't go on a renewal, for example after a cancellation, goes on its own usage invoice, charged the same way. Amounts under 1.00 USD wait for the next invoice.
- A declined payment is retried on your renewal schedule, like any renewal.
Do I need a separate billing tool?
No. Usage billing in Comecero works with the subscriptions, checkout and payments you already run on Comecero, on your own payment gateway or on Comecero Express Payments. The same events and setup work either way. Usage billing is turned on per account: ask Comecero to turn it on, then set up metrics and prices in Usage Billing in the dashboard or with the API. Every step is in the usage billing docs.
See the pricing models in detail in Usage-based pricing models explained, and how prepaid credit draws down in Prepaid credits for SaaS and AI.
Frequently Asked Questions
How do I bill customers for AI tokens?
Create a sum metric for tokens, give it a price with an included allowance and an overage price, link each customer's subscription with a billing agreement, and send an event with the token count after each request. Comecero bills the tokens above the allowance on the next renewal invoice.
Can usage go on the same invoice as the subscription?
Yes. That is the default. Each renewal invoice carries the plan's price for the period ahead and the usage of the period that just ended.
What happens if my app sends the same event twice?
It is counted once. Events are matched by operation_id and metric.
Can customers prepay for usage?
Yes. Sell credit as a normal product, add it to the customer's credit entitlement when the order is paid, and usage above the allowance is paid from the credit before anything is charged.
Can I stop usage at a limit instead of charging overage?
Yes. Set the entitlement's overage policy to block. Usage beyond the allowance and credit is then never charged.
Can I test usage billing before going live?
Yes. Test tokens make test objects and apk_test_ keys send test usage, billed only to test subscriptions with test payment methods.
The bottom line
AI products need a price that moves with cost. Meter what customers use, include a fair allowance, let them prepay if they want, and bill it all on the renewal they already expect. See usage billing, or read how it fits SaaS and AI companies.




















