Skip to content
FluxMeter
中文

Writing

AI SaaS unit economics: LLM token cost per customer

Compute per-customer revenue vs LLM token cost, margin, and loss alerts from Redis rollups, with no ClickHouse or BI warehouse required.

2026-07-11 · Intelligence · 6 min read

Finance teams ask a simple question: which customers make money after LLM costs? Engineering has Grafana traces; billing has invoices — but neither produces per-customer margin with recommendations. Warehouses add months of pipeline work.

FluxMeter Intelligence computes unit economics from the same Redis rollups that power budget enforcement and per-customer usage queries; period/month/customer/model slices already exist from ingest.

Revenue overlay — the missing half

Cost alone is insufficient. POST /intelligence/revenue/{customer_id} or OpenMeter overlay ingest supplies revenue per customer. GET /intelligence/unit-economics?period=2026-07 returns margin, loss status, and rule-based recommendations (upgrade, cap, repricing).

Customers without revenue return status: unknown_revenue — honest partial answers beat a blank dashboard.

A worked example: token cost vs revenue per customer

Here is the arithmetic the unit-economics endpoint automates, with illustrative numbers. Assume a model price of $3 per million input tokens and $15 per million output tokens (illustrative, not any provider's list price) and one month of rollups for three customers:

CustomerRevenue (POSTed)Input tokensOutput tokensToken costMargin
acme$50040M8M$240$260 (52%)
beta$20060M12M$360−$160 (−80%)
gamma—10M2M$60unknown_revenue

Token cost is input tokens × input price plus output tokens × output price. For acme, that is 40 × $3 + 8 × $15 = $240. Margin is revenue minus token cost, divided by revenue.

Across the two customers with revenue, the blended picture looks healthy: $700 of revenue against $600 of token cost is a 14% margin. Per customer, beta is losing $160 a month, and a blended dashboard hides exactly that account. This is where the rule-based recommendations (upgrade, cap, repricing) are meant to start a conversation, and where POST /intelligence/simulate lets you try a cheaper model mix for beta before you change anything.

gamma shows why the revenue overlay matters. The cost is real, but with no revenue on file the API reports unknown_revenue instead of guessing a margin.

Two caveats. Token cost here covers LLM spend only, not hosting, support, or payment fees, so read it as gross margin on model cost. And every recommendation is heuristic: validate it with finance before you change a price or a customer's plan.

From unit economics to finance reviews

Pair unit economics with GET /intelligence/profitability for cross-customer trends, GET /intelligence/root-cause for spend delta drivers, and GET /intelligence/report?format=markdown for a Markdown export your finance team can review.

POST /intelligence/simulate models model-switch or token-grant promos before you commit — closing the loop from diagnosis to decision.

Try it in five minutes

Run make demo, ingest a few events with distinct customerIds, POST revenue for each customer, then curl /intelligence/unit-economics. Full walkthrough in docs/intelligence-api.md on GitHub.