How to Calculate Your AI Margin Per Customer (With a Simple Formula)
All posts
Unit EconomicsAugust 14, 2026

How to Calculate Your AI Margin Per Customer (With a Simple Formula)

Most founders can tell you their overall margin without blinking. Ask them what a single customer costs in AI spend, and the answer is usually a shrug. That gap is where money quietly leaks out of AI-powered products — and it's fixable with one formula and a few minutes of math.

The formula

Per-customer AI margin is simple in principle:

Customer Margin = Revenue from that customer − AI cost attributable to that customer

The hard part was never the math. It's getting the second number; most teams only have a single blended AI bill, not a per-customer breakdown. That's the gap covered in our guide to AI cost management: tag every API call with a customer_id, and this number stops being a guess. (Link this phrase to the pillar post once live.)

A worked example

Say a customer is on your $49/month Pro plan. Over the last billing cycle, their usage across your AI features generated $37 in OpenAI and Anthropic costs.

Customer Margin = $49 − $37 = $12/month

That's a real but thin margin, positive, but not much room to absorb a usage spike, a pricing change, or a support cost. Now compare a second customer on the same plan whose usage generated $61 in AI costs:

Customer Margin = $49 − $61 = −$12/month

Same plan, same price, opposite outcome. Nothing on your revenue dashboard would show you this difference. Only a per-customer cost breakdown does.

What to do once you find a margin-negative customer

Finding one isn't a crisis; it's information. From there, you generally have three options:

  1. Reprice or move them to a higher tier that better matches their usage pattern
  2. Add reasonable usage guardrails on the features driving the cost, especially for free or entry-tier accounts
  3. Accept it deliberately — some margin-negative accounts are worth keeping for referrals, logos, or strategic reasons, but that should be a choice you make knowingly, not a surprise you find at renewal

The failure mode isn't having margin-negative customers. It's not knowing you have them.

A common mistake worth naming

It's easy to conflate your overall gross margin with your AI-cost margin and assume they move together. They don't. A customer can look perfectly healthy on revenue and support cost while quietly losing you money on AI spend specifically, because AI cost scales with usage, not with plan price, and usage doesn't always correlate with how "good" a customer looks on paper.

Where this goes next

The same math extends past individual customers: run it across a whole feature, and you get per-feature margin, which tells you whether a feature is a genuine cash cow or losing money on every call. Run it across a pricing tier, and you find out whether that tier covers its own AI cost or is being subsidized by everyone above it. Same formula, three different lenses.

If you'd rather not build the customer_id tagging and cost breakdown by hand, this is exactly what AI Observly automates: connect your OpenAI, Anthropic, or Gemini usage, and the per-customer margin numbers above show up without the spreadsheet work.

AI Observly

Stop guessing. Start seeing your AI margins.

Know exactly which customers and features are eroding your margins — before you find out on the invoice.

Start monitoring now