← Blog

Your AI Gross Margin Is Probably Lower Than You Think. Here's How to Actually Calculate It.

For most of last year we thought we had an 82% gross margin business. It was a good number. We were proud of it. Then we looked at what our AI features were contributing to that margin, broken down by customer, by feature, by pricing tier. One product line had a 12% gross margin after AI costs. We were essentially running a charitable service and reporting it as a strength.

How most founders calculate it (and why it hides the problem)

The typical calculation: total revenue minus total AI costs, divided by revenue. If you're doing $200k MRR and spending $20k on AI, that's a 90% gross margin contribution. Good number. Problem solved.

Except that calculation hides the actual distribution. That same $20k AI spend might be $200 spent serving your 500 free users and $19,800 on your 50 enterprise customers. Or $12k on one feature used disproportionately by your lowest-paying tier. The blended number tells you you're fine while specific parts of the business are underwater. And you won't know until the problem is large enough to show up in the total.

The right way to calculate AI gross margin

Start at the customer level. For each customer, take the revenue they generate and subtract the AI costs attributable to serving them. Then group by pricing tier. Free tier: negative, always. The real question is how negative, and whether your conversion rate justifies it. Pro tier: where you should be making real margin. Enterprise: where most teams are surprised to find they're not.

Then do it at the feature level. Which AI feature has the best margin? Which has the worst? Our document summarisation tool was our most-used feature and our worst margin feature. We were spending $1.80 in AI costs every time it was used and charging nothing incremental. The feature that drove our sign-up conversion was the same feature bleeding our margin. We had never put those two numbers in the same spreadsheet.

What a healthy number looks like — and what to do when it isn't

Most AI product teams should aim for AI costs to be under 10–15% of the revenue generated by AI-powered features. Above 30% is a warning sign — usually fixable with pricing changes or model routing. Above 50% while overall gross margin still looks healthy means non-AI revenue is masking the problem, which usually means it'll surface at exactly the wrong time.

Almost every team that gets real per-customer margin data makes the same three moves within 90 days: they gate the most AI-intensive features on lower tiers, they add overages for the highest-consuming accounts on flat plans, and they raise prices on the tiers where they were accidentally subsidising usage. Churn after those changes is almost always lower than expected — because customers who were using the product heavily enough to be expensive were also getting enough value to accept a price increase.

None of those decisions are available to you with a total spend number. All of them become clear when you can see cost per customer and feature, matched against revenue. PerUnit connects your OpenAI, Anthropic, and Google accounts to your Stripe billing to give you exactly that view. If you want to start with the rough numbers today, our free AI margin calculator shows AI as a percentage of revenue and cost per customer from whatever numbers you have right now.

Need cost per customer, not just totals?

PerUnit breaks down your AI spend by customer, feature, and pricing tier — so you know who to charge more, what to gate, and where to cut.

Get early access to PerUnit →