If you count only the AI model bill, the made-up plan worked through below earns a 73% gross margin. Count everything else it takes to deliver the result, and the margin is 34%. That includes search over the customer's documents, human review, safety checks, support and content rights. An AI product can keep adding customers and usage while its economics get worse inside that gap. The gap sits between the reported cost of goods sold (COGS) and the full cost of delivering one result a customer paid for.
In ordinary SaaS, hosting costs grow slowly compared with subscription revenue. AI breaks that pattern. Long prompts, repeated tool calls, poorly cached searches and handoffs to humans all add real cost after the sale. If you set prices for average token use, while customers buy results with very uneven workloads, your reported margin looks better than it is. The heaviest users quietly eat the money that should pay for sales, product and support. Gross-margin discipline asks one question: what does it cost to deliver one thing a customer pays for? You answer it with three tools: a log of every step, a written rule for counting costs, and a split by customer type. Together they show loss-making behavior before it grows.
Margin starts with the unit the customer pays for
Pick a unit that links what the customer values, what they pay and what you spend. For example: a finished document review, a resolved support case, an approved claim, a minute of generated video or an AI agent task that worked. A chat message is a poor unit. Messages differ hugely in length, tool use and how well they solve the problem.
Use the same unit in your product data and in finance. With usage pricing, revenue maps straight to paid units. With subscriptions, spread the revenue across the completed units for analysis, but leave the official accounting as it is.
Gross Margin = (Recognized Revenue minus COGS) / Recognized Revenue
Unit Contribution = Allocated Revenue per Paid Unit minus Cost to Serve per Paid Unit
Here "cost to serve" means everything it costs you to deliver one paid unit. Finance still owns the official COGS rules. This second view exists so product and engineering can see which tasks eat money, and why.
Trace COGS through the request path
Every request should leave a trail. The log should tie the customer, plan, feature, version of the task and its result to each step you pay for. A monthly bill from the AI provider can't tell you which feature, customer group or agent path caused a jump. Keep costs that come from the task itself apart from shared running costs.
| Cost layer | Events to join | Margin question |
|---|---|---|
| Model inference | input/output tokens, model, batch or real-time mode | Which prompts and models drive cost per outcome? |
| Retrieval and tools | embeddings, vector queries, web search, API calls, retries | Does tool use improve the outcome enough to cover cost? |
| Serving | GPU/CPU time, storage, egress, queues | Is idle capacity assigned fairly? |
| Human operations | review minutes, specialist queues, incidents | Which paths require intervention? |
| Trust and safety | moderation calls, policy review, fraud checks | Are safety costs stable by workflow and segment? |
| Customer support | ticket type, resolution effort, credits | Is product friction showing up as support COGS? |
| Third-party content | data licenses, royalties, per-call services | Is revenue net of the rights to produce it? |
Not every cost counts as COGS. Salaries of the core product team, general admin and company software usually sit below gross margin. A reviewer whose job is to check each customer request is a clear cost to serve. Write down where each cost goes, who decides and how it is split. Moving costs around to make a dashboard look better doesn't improve the business.
The token invoice leaves out most of the bill
Token spend matters, but averages hide what the workload is doing. Cost per request goes up for different reasons. Prompts get longer. Answers are allowed to run longer. Search stuffs in too much text. Agents repeat calls. Or the system picks a more expensive model. Each cause needs a different fix.
Next to the money spent, track a few more numbers for each paid unit:
- how many tokens go in and out, and how many model calls, tool calls and retries it takes;
- how often the cache is used, and how much that saves. Cached input costs far less than fresh input, so a long shared prompt start that is never reused wastes money;
- response time and how often requests time out, for each version of the task;
- how often users give up, correct the answer or redo the work;
- how often a human has to step in, measured in review minutes per unit.
Fewer tokens aren't always better. A cheaper model that causes retries, worse answers or more review can raise the total cost. Measure the whole path, from the first click to the accepted result. The first model call is only the start.
How you run a call matters as much as which model you use. Providers give discounts for batch jobs that can wait hours for a result. That suits overnight reports or sorting large piles of data. It doesn't suit a support agent waiting for a reply. Tag every call as batch or real-time. Then the margin model shows how much work that could wait is still paying real-time prices.
Provider prices change. Keep a dated copy of the prices your forecast uses, and check each invoice against your own usage logs. The OpenAI, Anthropic and Google Cloud Vertex AI pricing pages show current prices per unit. They don't replace checking invoices, committed-spend deals or regional charges.
Teams that run models on their own servers have a different hidden cost: memory, more than computing power. Woosuk Kwon and colleagues at UC Berkeley found that existing serving systems wasted 60% to 80% of the memory set aside for one part of the model's working memory (the "key-value cache"). Their fix, PagedAttention, was published at SOSP 2023 and released as vLLM. It handled two to four times more requests at similar speed. The lesson for your margin model: on your own GPUs, cost per token depends a lot on your software setup and how many requests you process together. Someone else's benchmark is not your COGS.
Shared capacity needs a defensible rule
Some costs don't grow smoothly with use. Dedicated servers, search databases, monitoring and orchestration tools are often fixed, or jump in steps. Charge all of it to your biggest customer and the margin story looks dramatic but is wrong. Charge none of it, and every customer looks too profitable.
Keep two views:
- The extra-unit view asks what the next finished unit costs with the capacity you have now. Use this number for pricing, model choice and volume decisions.
- The full-cost view spreads shared capacity using a written rule, based on something like GPU seconds, requests, stored data or run time. Budgets and capacity planning should rest on this view.
Split costs by what customers actually use. A flat amount per customer is easy, but it breaks when one account runs long agent tasks and another sends short sorting requests. The FinOps Framework describes these practices. Whatever formula you pick, the key is that anyone can trace how a cost was assigned.
A margin bridge: 73% on the invoice, 34% in reality
Take a fictional monthly plan: $120 recognized revenue from 1,000 completed paid workflows. These figures are illustrative, not a benchmark.
| Monthly item | Cost |
|---|---|
| Model inference | $32 |
| Retrieval, tool calls, and data APIs | $8 |
| Serving and observability allocation | $9 |
| Human review and escalations | $15 |
| Safety checks and fraud controls | $4 |
| Support allocation and service credits | $6 |
| Third-party content rights | $5 |
| Total cost to serve | $79 |
With all costs counted, the margin is (120 minus 79) / 120 = 34.2%. Counting only model costs gives (120 minus 32) / 120 = 73.3%, which is true only if you define cost very narrowly. The breakdown shows where to look first. Human review costs $15. So ask which kinds of failure end up in review, whether review actually changes the result, and whether a product change could prevent the handoff without hurting quality or safety. Cutting model tokens can wait.
Which customers actually fund the usage?
An average margin can hide one group of customers paying for another. Light users may be funding heavy users while the total looks fine. Split revenue and cost by plan, sales channel, customer size, use case, task version and, where server costs differ, region.
Add time to the picture. Group customers by the month they started and compare them at the same age. A new group may lose money at first: trials are heavy, setup needs support, and people experiment with prompts. That's fine only if later retention and revenue earn it back within the payback period you chose.
Keep a table for each group: revenue, finished paid units, direct cost, share of shared cost, gross margin, retention and support load. Next to it, check how concentrated usage is. A handful of accounts can cause most of the token spend or review work.
Quality controls belong in the margin model
Cutting costs can damage the very result the customer paid for. A shorter context may save model costs but cause more factual errors. Fewer safety checks may speed things up but raise the risk of abuse, lost trust or trouble with regulators. If you hit a margin target by making the product worse, the loss just moves into cancellations and service credits.
Every change needs one main number, some guardrails (numbers that must not get worse) and some diagnostics. Say you want to send low-risk requests to a cheaper model. Make cost per accepted task the main number. Guardrails can include task success, corrections, handoffs to humans, response time, complaints and retention. Before launch, decide who is included, how they are split into groups, what they see and how long you measure. Then ask whether the result matters in practice. A small saving with a visible drop in quality isn't worth shipping. Roll the rule out step by step once it keeps quality and lowers the cost per accepted result.
Price to the workload, not the model
A plan's price has to cover the work the plan invites. Unlimited use is risky when customers can trigger expensive agent loops, very long answers or repeated uploads. You have options: usage credits, tiers by number of results, charges for going over the limit, extra fees for premium models, minimum commitments and limits on expensive tools. The right choice depends on whether customers understand what is being counted and can control it. Prices that are hard to predict make sales harder. Prices that ignore variable costs turn growth into a problem.
Model every pricing proposal before release. Revenue is active customers times the price they actually pay. Cost is finished units times cost per unit. Run three cases: normal, fast adoption and heavy usage. Write down your assumptions for prompt length, model mix, cache use, tool calls, review rate and support. Weak plans show up in the heavy-usage case. Treat discounts the same way. Write down the expected usage, what you promised and the lowest margin you accept. Revisit the deal when real usage moves away from the forecast.
When per-unit costing is overkill
Founders often say the problem will solve itself, because AI at the same quality gets much cheaper every year. In this view, a seed-stage team that spends a month building cost tracking is burning runway on a cost the market will shrink anyway. And the tracking itself costs engineering time and storage.
Test that view on the numbers above. If model prices drop tenfold, model costs fall from $32 to $3.20. Total cost to serve falls from $79 to about $50. Margin rises from 34.2% to 58.2%. That is a big improvement, but still short of a typical SaaS margin. The reason: $47 of the $79 never depended on token prices. Human review at $15 is the biggest of those costs, and no price cut from an AI provider touches it.
The founders' argument holds in one case: when model costs are most of the cost to serve and the plan already meets its margin target. A simple test helps. If model spend is above 70% of cost to serve, a light monthly check is enough and the rest can wait. If it is below 50%, as in this example, start tracking tasks now. The costs that matter will not fall on their own.
Run a weekly review, then scale
Variable costs move from week to week within whatever limits your pricing sets. The monthly finance close is necessary, but it is too slow for fast-changing AI workloads. Hold a weekly review with the product, engineering, finance and sales owners. Talk about what changed, why and what you will do. The scorecard can show:
- revenue and finished paid units;
- cost per accepted result and profit per unit;
- how cost splits between models, search, servers, human review and support;
- gross margin by plan, task and customer group;
- the releases, customers and provider events that moved cost most that week;
- how far reality is from the approved pricing and usage forecast.
For each big change, write down what changed, the evidence and who checks it next. "Model cost rose" only describes the problem. "Input tokens per accepted task rose after version 4.2 added more retrieved text, cache use unchanged" is something you can test. Good tracking matters just as much. Missing model names, untagged tool calls and weak links between billing and product data create fake precision. Fix them before you base pricing or architecture decisions on shaky numbers.
Weak margin data does the most harm when you scale spending or launch unlimited plans, because both multiply every error in how costs were assigned. The same records also feed usage-based pricing, retention analysis by customer group and experiment guardrails, so the work pays off more than once.
Before either decision, run one check. Take the top 10% of accounts by usage and work out the profit per accepted result. If it is negative, fix the plan limits first and buy growth second.