GintiCalcEvery calculation

MarginML

AI Feature Gross Margin Calculator

See whether an AI feature actually makes money once retries, tool calls, and heavy users are priced in.

Gross margin on a $20/month AI feature by usage

Cost to serve scales with tokens, price does not. These rows hold the price at $20 per user per month and raise usage, at $3 per million tokens with 8% retry overhead and a 25% cache hit rate.

Requests/userTokens/requestBilled tokensCost to serveGross profitMargin
2003,0000.49 M$1.46$18.5492.7%
5003,0001.22 M$3.65$16.3681.8%
1,0005,0004.05 M$12.15$7.8539.3%
1,0008,0006.48 M$19.44$0.562.8%

The heaviest users are the ones who destroy the margin: a flat price with metered costs means a 4x usage increase can take a 93% margin to nearly zero. Token and instance prices move constantly; treat the rates here as illustrative and put your own contracted rates into the calculator.

An AI feature gross margin calculator answers the question that a single 'average tokens per user' estimate almost always gets wrong: does this feature make money once real usage is priced in? Selling an AI-powered feature for a flat monthly price is only profitable if the cost to serve each user stays comfortably below what they pay — and that cost is driven by far more than a headline token price. This tool models the real cost stack per user and turns it into a gross profit and a gross margin you can defend to finance.

The calculation starts with how much a user actually exercises the feature: requests per month multiplied by the average tokens per request. But raw request volume understates true cost, because production AI systems retry failed calls, chain multiple tool and function calls behind a single user action, and re-prompt when a first answer is rejected. The retry-and-tool overhead percentage inflates the billable request count to reflect that. Working in the other direction, a cache hit rate removes the share of requests served from a prompt or response cache at effectively zero marginal token cost — one of the most powerful levers a team has. The result is the billable request count, which is multiplied by tokens per request and your blended cost per million tokens to give the cost to serve one user. Subtracting that from the monthly price yields gross profit per user, and dividing by price gives the gross margin.

The reason the document behind this tool insists on cohorts is that averages lie. A feature can show a healthy 70% margin on the median user while quietly losing money on the top few percent of power users who generate the bulk of the tokens. The fix is to run this calculator several times — once for a light user, once for the median, and once for a heavy power user — and look at the spread rather than a single blended number. If the power-user cohort is deeply negative, the answer is usually usage-based pricing, a fair-use cap, or aggressive caching, not a small tweak to the flat price. Adjust the inputs to match each cohort and watch the margin move.

Why the average user hides the risk

AI feature costs are highly skewed: a small fraction of power users often generate most of the token spend. A feature that looks 70% gross margin on the average user can be deeply loss-making on the top 5% — and those users rarely churn, because they get the most value. Always model the heavy cohort separately, not just the mean.

Caching and retries move the number most

Two inputs dominate real AI unit economics: cache hit rate and retry/tool overhead. A 40% cache hit rate cuts token cost by 40% for free; meanwhile agentic retries and tool chains can multiply the tokens behind a single user action several times over. Get honest numbers for both from your traces before trusting any margin estimate.

Frequently asked questions

I charge $20/user for 400 requests/month at 2,000 tokens each — what's my margin?

With 20% retry overhead and a 30% cache hit rate, that's ~336 billable requests, about 0.67M tokens. At $5 per million tokens the cost to serve is roughly $3.36, leaving about $16.64 gross profit — an ~83% gross margin. A power user doing 4× the requests would flip that far lower.

Why include retry and tool overhead?

In production, one user action rarely equals one model call. Failed calls are retried, agentic features chain multiple tool and function calls, and rejected answers get re-prompted. Ignoring that overhead is the single most common reason AI margin estimates come in far too optimistic.

How much does caching really help?

A cache hit serves a request at effectively zero marginal token cost, so a 30% hit rate cuts your token bill by roughly 30%. Prompt caching, response caching, and semantic caching stack, and for features with repetitive prompts a high hit rate can be the difference between a losing and a winning cohort.

How is this different from an LLM API cost calculator?

An LLM cost calculator tells you what a given number of tokens costs. This one goes further: it turns per-user usage — including retries and cache — into a cost to serve, compares it against your price, and reports gross profit and margin. It's about profitability, not just spend.

Related Developer calculators

You might also like

Last updated: August 26, 2026