SSolvren
← All guides
Customer economics

How to calculate AI customer contribution margin

A model bill tells you what the supplier charged. It does not tell you which customer contract earned or lost money. To answer that question, reconcile signed revenue, customer-attributed usage, and direct delivery cost over the same period.

Start with one contract and one period

Use the signed contract price and allowance that applied during the period. If a contract changed mid-month, split the calculation at the effective date. Keep credits, overages, and one-time charges separate until their treatment is clear.

The basic formula is contribution = recognized contract revenue − attributable AI supplier cost − other direct delivery cost. Contribution margin is contribution divided by revenue. This is a direct-cost view, not company gross profit or net income.

Trace usage to the customer

Capture a stable customer or contract identifier with each inference event, plus provider, model, timestamp, and billable usage units. Map those events to the same customer and period as the contract. Retries and background jobs need ownership too; otherwise the biggest cost drivers can disappear into an unallocated bucket.

Price the attributed usage with the applicable model rates, then compare the total with provider cost statements. A supplier total can include traffic outside the application, credits, rounding, or costs that cannot yet be mapped to a customer. Display that variance rather than spreading it across customers without evidence.

A worked example

Suppose a contract earns $50,000 in a month. Customer-attributed model usage costs $20,000 and other direct delivery costs $4,000. Known contribution is $26,000, or 52% of revenue. If some usage remains unpriced, 52% is a ceiling on contribution margin, not a final result.

A target floor of 45% leaves $3,500 of headroom for additional direct cost: $50,000 × (52% − 45%). An unresolved supplier variance or unpriced usage larger than that headroom could change the decision. Resolve it before declaring the contract healthy.

Make the result decision-ready

Report source coverage alongside the number. Label missing contract terms, unmapped events, unknown model rates, and unreconciled supplier totals. When coverage is incomplete, show known contribution and the open questions together.

The useful output is a next action: confirm an allowance, inspect an expensive workflow, review a renewal price, or collect missing cost evidence. The calculation should lead to a contract decision, not just another dashboard.

Apply this to your own contracts

Test one contract’s known margin with the free calculator, or explore how Solvren keeps source gaps and decisions together.

Continue learning

How to price AI features without losing margin

Read guide →

Allocate OpenAI and Anthropic costs to customers

Read guide →