What is AI billing?
AI billing meters, prices, and invoices AI products where every request has a provider cost. How it works, which pricing models fit, and how to track margin per customer.

AI billing is how a company meters, prices, and invoices an AI product where each request carries a provider cost (tokens, tool calls, compute). Customers pay when they consume a unit or reach an outcome, such as an agent resolving a ticket. The vendor carries that cost, so AI billing tracks provider cost and margin per customer, unlike seat-based billing.
GitHub ran into this problem in public. In April 2026 it announced that every Copilot plan would move to usage-based billing on 1 June 2026. Its reason: a quick chat question and a multi-hour autonomous coding session cost the user the same amount, and GitHub had been absorbing the inference cost behind the difference. Copilot plans now include monthly AI credits that are consumed by tokens at each model's published API rates.
If you sell an AI agent, your customers create the same spread. Each one runs a different mix of models, tool calls, and retries, so each one costs you a different amount to serve. AI billing is the system that turns that usage into revenue you can collect and margin you can see.
Two meanings of AI billing
The term AI billing is used for two different jobs. One is charging customers for an AI product they use. The other is using AI inside a finance team to process invoices, payables, or medical claims. For a company that sells AI agents or AI features, AI billing means the first.
| Billing for AI products | AI-assisted billing | |
|---|---|---|
| What it does | Charges your customers for the AI service they use | Uses machine learning to read and process invoices or claims |
| Direction of money | Revenue coming in | Payables and claims handled by back-office teams |
| What gets priced | Tokens, credits, outcomes, seats | Nothing; it is an internal tool |
| Who needs it | Companies selling AI agents, APIs, or AI features | Accounts payable, finance operations, and medical billing teams |
How does AI billing work?
AI billing works in five steps: check the customer's balance or limit, run the action, record a usage event with its provider cost, price the event against the plan, then invoice and settle. Each step has to be correct on its own, because an error in one compounds in every step after it.

The balance check runs before the action, and the usage event feeds both the invoice and the margin view.
1. Check the balance or limit before the action runs
Agent workloads can spend money faster than a person can step in. Before an expensive action, the billing layer checks the customer's wallet, credit balance, or spend limit. If the balance can't cover it, the plan's overage policy decides what happens: block the action, trigger an automatic top-up, or allow it and bill the overage. Stripe compares this step to a card preauthorization.
2. Record a usage event for every billable action
Every completion, tool call, or agent step emits a usage event, also called a signal. A useful signal carries:
- the customer, and the agent or feature that acted
- the model used and the quantity (input, output, and cached tokens, tool calls, or seconds)
- the time the action happened, which can differ from the time the event arrived
- a unique ID, so a retried event is counted once
3. Record the provider cost behind each event
This is where AI billing departs from standard usage billing. The same event that earns revenue also has a cost: the model provider's token charge, third-party API calls, search, and compute. Storing that provider cost on the event lets you see margin per customer, per agent, and per model. Without it, you learn your margin when the provider's invoice arrives, weeks after the usage.
4. Price the event against the plan
Rating converts raw quantities into money or credits using the customer's plan: a price per token, a credit conversion rate, a price per outcome, or a tiered rate. Version your pricing rules so that last month's events are always priced under last month's rules.
5. Invoice, apply credits, and settle
Events roll up into an invoice for the period. Prepaid credits and wallet balances apply first, then overages, discounts, and tax. Under ASC 606, revenue on usage contracts is usually recognized as the usage happens, so finance needs the same event data that billing uses.
AI billing vs subscription billing
Subscription billing charges a fixed price per period. AI billing charges for consumption that changes every month and costs the vendor money on every request. The differences show up in six places.
| Subscription billing | AI billing | |
|---|---|---|
| What the customer pays for | A seat or a tier | Tokens, credits, outcomes, or a mix |
| Cost to serve one customer | Close to fixed | Varies with model choice, tool calls, and retries |
| When the bill is known | At signup | After the period's usage is counted |
| Billable events per customer | One renewal per period | Thousands of usage events a day |
| What billing tracks | Revenue | Revenue, provider cost, and margin per customer |
| When limits apply | Rarely | Before each action, against a balance or cap |
The cost-to-serve row is the one that decides your margin. A flat seat price charges your lightest and heaviest users the same, while their provider cost can differ many times over. Most subscription systems can still produce the final invoice, but they were built for one billable event per customer per month. AI usage needs a metering layer in front of them that counts every event and the cost behind it.
Which pricing models work for AI products?
Most AI products use one of four pricing models: tokens, credits, outcomes, or a hybrid of a fixed fee and one of the others. The model decides what you meter, what the invoice shows, and where your margin risk sits. Whichever you choose, AI billing has to meter both the unit you charge for and the provider cost behind it.
| Model | Customer pays for | Example (November 2026) | Where your margin risk sits |
|---|---|---|---|
| Tokens | Input, output, and cached tokens, priced per model | OpenAI and Anthropic APIs | Low on the model line, since price follows cost; anything outside the token count still needs its own meter |
| Credits | A prepaid unit that converts into usage | GitHub Copilot: monthly AI credits equal to the plan price, consumed by tokens at each model's API rate | The conversion rate between a credit and your cost, which drifts when providers reprice or customers change models |
| Outcomes | A defined result | Intercom Fin: $0.99 per outcome, charged once per conversation | Fully on you: cost per outcome varies by customer while the price stays fixed |
| Hybrid | A fixed fee plus metered usage | Copilot Business: $19 per user per month, including $19 of AI credits | How much usage the fixed fee includes, and what happens after it runs out |
Tokens
Token pricing passes model cost through with a markup. It suits APIs and developer platforms whose buyers already think in tokens. Business buyers usually find token invoices hard to predict.
Credits
Credits put a stable unit between the customer and your provider cost, so you can change models without changing the price list. Keep the conversion rate in configuration, because it needs updating whenever a provider changes prices. Write expiry rules, and the order in which credit types are used, into the contract.
Outcomes
Outcome pricing charges for the result the customer cares about. Intercom defines its outcome precisely: the customer confirms the issue is resolved, doesn't ask for more help after Fin answers, or Fin completes a workflow. That precision is what makes each charge defensible when a customer disputes it. Our guide to outcome-based pricing covers how to define one.
Hybrid plans
A fixed fee gives the customer a predictable bill and gives you committed revenue. The included usage, and the rule for what happens after it runs out, decides whether the plan protects your margin. GitHub lets Copilot admins choose between allowing more usage at published rates and capping spend once the included pool is used.
How do you protect margin per customer?
You protect margin per customer by recording the provider cost behind every usage event and comparing it with the revenue that event earns, per customer, per agent, and per model. A blended margin across all customers can look healthy while individual customers lose money.
A worked example: one price, three customers
The numbers below are illustrative. An AI support agent sells for $1.00 per resolved ticket, and three customers pay that same price. Customer A's tickets are short and a small model answers them. Customer C's tickets need a frontier model, six tool calls to search a knowledge base and update a CRM, and frequent retries.
| Customer | Resolutions per month | Revenue | Provider cost | Margin | Margin % |
|---|---|---|---|---|---|
| A | 20,000 | $20,000 | $3,600 | $16,400 | 82% |
| B | 8,000 | $8,000 | $3,360 | $4,640 | 58% |
| C | 4,000 | $4,000 | $4,600 | −$600 | −15% |
| All customers | 32,000 | $32,000 | $11,560 | $20,440 | 64% |

Model tokens alone stay under the price for every customer. Tool calls and retries push Customer C over it.
The blended 64% margin looks fine in a board deck. Customer C still loses $600 a month, and the loss grows with every ticket C sends. A billing system that records only revenue shows C as a paying customer. You find the loss when you reconcile the provider's invoice against revenue, weeks later and across all customers at once.
What a provider price change does
Provider prices move in both directions, and each change lands on customers differently. Suppose the frontier model behind Customer C's tickets cuts its price by 30%. C's token cost falls from $0.70 to $0.49 per resolution, its total cost from $1.15 to $0.94, and C moves to a 6% margin. Customer A runs on a small model and sees no change. You can see these shifts per customer only if each event records the model it used and the cost at the time it ran.
What a token markup covers
Some billing tools now sync model prices from providers and apply your markup to each token automatically. Stripe offers this in public preview through Metronome. A markup keeps the model line profitable on every call. For an agent business, three costs sit outside it:
- Tool calls, search, and third-party APIs, which are not tokens. In the example, they are $0.35 of C's $1.15.
- Retries and failed steps, which you pay for and usually can't bill.
- Outcome and credit prices, where the customer never sees tokens and your price stays fixed while your cost moves.
What to track
An AI billing system should report three numbers per customer for every period: revenue, provider cost broken down by model, tool, and agent, and the margin between them. Set an alert for when a customer's margin falls below a floor you choose, so you can reprice, change models, or cap usage before the quarter closes.
What are the challenges of AI billing?
The hardest parts of AI billing come from how agents run: one request can fan out into many billable steps, and the cost of each step is known only after it finishes.
- Agent fan-out. One request can trigger dozens of model calls, tool calls, and retrieval steps. You have to decide which steps are billable and tie each one to the right customer and task.
- Token counts that vary by run. The same prompt can return 50 tokens or several thousand. Usage events have to be emitted after each step completes, with the actual counts.
- Multi-model routing. A feature that routes between models by cost or load has a different cost per call. Billing has to record which model ran, or margin per model is lost.
- Duplicates and late events. Retries create duplicate events, and some events arrive after a period closes. Idempotent ingestion and a written late-event policy keep invoices from double-counting or dropping usage.
- Disputes. Customers dispute usage they don't recognize. Resolving a dispute takes an event-level audit trail from each invoice line back to the actions that produced it.
- Revenue recognition. Usage revenue is recognized as consumption happens, and expiring prepaid credits need their own treatment. Finance needs event data in a form its revenue system can use.
How to set up billing for an AI product
Setting up billing for an AI product comes down to six decisions, made in this order.
- Define the usage event. Write down the fields every event carries: customer, agent or feature, model, quantities, action time, provider cost, and a unique ID. Changing the schema later means migrating every report built on it.
- Pick the unit you charge for. Price on a unit you can already meter reliably. If you can't yet tell from your data when an outcome happened, start with credits and move to outcomes once the definition holds across customers.
- Set wallets, limits, and the overage rule. Decide whether a customer at zero balance is blocked, topped up automatically, or billed for overage. Put the rule in the contract and enforce it before the action runs.
- Attach provider cost to every event. Record the model, token types, tool calls, and the provider price in effect when the step ran. Keep provider price tables in configuration, so a provider's price change doesn't need a deploy.
- Version your pricing rules. Price each event under the rules in effect when it happened, and make plan changes a configuration change.
- Decide build vs buy. A basic pipeline for one product at low volume is feasible to build in-house. The work grows with shared balances under concurrent requests, late events, multi-currency invoices, revenue recognition, and margin reporting. Weigh that engineering time against an AI billing platform built for agent usage.
When usage-based billing is the wrong fit
Usage-based billing is the wrong fit when usage, and the cost behind it, barely varies between customers. A seat or flat-fee plan is then simpler to sell, easier for the customer to forecast, and cheaper for you to run. Three other situations also call for a simpler plan:
- Early pilots. With a handful of customers, a flat pilot fee teaches you more than a meter you haven't tuned. Keep recording provider cost per customer, so you can price from data later.
- Outcomes you can't define yet. If you and the customer would argue about whether an outcome happened, every invoice becomes a negotiation. Price on credits until the definition settles.
- Buyers who need a fixed annual number. Some procurement teams can't approve a variable bill. A commitment with included usage and a capped overage gives them a fixed number while the meter keeps running underneath.
Whatever plan you sell, keep the cost side of AI billing running. A flat price still has a variable provider cost behind it.
How Clocknext handles AI billing
See your margin on every customer, every agent, and every model. Clocknext records the provider cost behind each signal your agents send, across models and tools, next to the revenue that signal earns. You see which customers are profitable while the billing period is still open, before the provider's invoice arrives.
Plans are built from six entitlement types: credits, outcomes, units, composites, wallets, and flat fees. You can price a support agent per outcome, sell a credit pack to a developer team, and add seats for an enterprise contract in one plan, with the same view of cost and margin across all of them.
Frequently asked questions
What is the difference between AI billing and AI invoice processing?
AI billing charges your customers for an AI product they use, metering tokens, credits, or outcomes and turning them into invoices. AI invoice processing uses machine learning to read and route the invoices your company receives from suppliers, or the claims in medical billing. AI billing is a revenue system for AI companies. AI invoice processing is a back-office tool for finance teams.
How does token-based billing work?
Token-based billing charges a rate per million tokens, usually with separate rates for input, output, and cached tokens, and a different rate for each model. Each completed call emits a usage event with its token counts, model, and customer. The billing system prices those counts, totals them for the period, applies prepaid credits, and invoices the rest. List input and output tokens separately on the invoice, because customers often count only the output they see.
What happens when a customer's AI credits run out?
The plan's overage policy decides. The three common choices are a hard stop that blocks usage until the customer buys more credits, an automatic top-up charged to a stored payment method, and pay-as-you-go overage billed at the standard rate. Write the policy into the contract and enforce it before each action runs, so the customer is never surprised and you never carry unpaid usage.
How is billing for AI agents different from billing for API calls?
An API call is one request and one response, so it maps to one billable event. An agent run is a process: it calls tools, retries failed steps, and can use several models before it produces a result. Billing an agent means recording every step against its parent task, removing duplicate retries, and rolling the steps up into the unit you charge for, such as credits or an outcome.
How do you track margin per customer?
Record the provider cost on every usage event: model tokens at the price in effect, tool and API calls, and compute. Group the events by customer for the period and subtract that cost from the revenue the same events earned. Break the cost down by model, tool, and agent, so a falling margin points to its cause. Set an alert for when any customer's margin drops below your floor.
Should you build AI billing in-house?
Building AI billing in-house works for one product, low volume, and one simple pricing unit. The hard parts arrive as you grow: balance checks under concurrent requests, duplicate and late events, pricing changes, revenue recognition, and margin reporting across models. Compare the ongoing engineering time with the cost of a billing platform before you write the first metering pipeline.

Manish Balaji
A fan of compelling stories, memorable product experiences, and Liverpool FC, not necessarily in that order.




















