Calculating a Real Cost-Per-Transaction Number
Total infrastructure spend tells you whether the bill is growing. It doesn't tell you whether that growth is healthy, since a bill that doubles alongside a tripling of transaction volume is actually a unit cost improvement, not a problem. Cost per transaction, or cost per query, per API call, per whatever unit your product actually delivers, is the number that separates growth from waste.
Building it well takes more care than dividing one number by another, and most teams get the denominator wrong before they get the numerator wrong.
Which unit should you divide infrastructure cost by?
The unit has to match what actually drives cost, not just what's easiest to count. Total API calls is a reasonable unit if calls are roughly uniform in cost; it's a misleading one if a small share of calls, a bulk export, a complex search, cost far more than a typical call and get averaged away into a number that looks stable while the mix underneath it is shifting.
Test your candidate unit against a simple question: if a customer doubled their usage of the expensive call type only, would your chosen unit's cost figure actually move in a way that reflects that. If it wouldn't, because the unit averages that call type away with everything else, it's the wrong denominator for what you're actually trying to see.
What belongs in the numerator of cost per transaction?
Include compute, storage, and data transfer directly attributable to serving that transaction type, and be explicit about what you're leaving out, shared platform overhead, monitoring, the parts of the bill that don't scale cleanly with any single transaction type. A cost-per-transaction number that quietly excludes a growing share of shared overhead will look better every quarter for reasons that have nothing to do with actual efficiency.
Decide on an allocation method for shared overhead rather than dropping it entirely, even a simple even split across transaction types is more honest than leaving it out, since a number that ignores a real and growing cost isn't actually measuring efficiency, it's measuring how much of the bill you chose not to count.
A worked example
Say your infrastructure bill for a specific service runs $80,000 a month and it handled 4 million transactions that month, that's a cost per transaction of two cents; if next month the bill rises to $95,000 but transactions rise to 5.5 million, your cost per transaction actually falls to roughly 1.7 cents even though the total bill grew, which is exactly the distinction a raw total-spend number would have missed.
Where this number gets gamed without anyone meaning to
- Redefining what counts as a billable transaction to make the denominator look better, without a corresponding change in what's actually being delivered
- Excluding a specific expensive transaction type from the calculation because it makes the average look worse, rather than tracking it as its own segment
- Comparing this quarter's number to a stale baseline instead of the immediately preceding period, which hides a recent regression inside a longer, more flattering trend
- Averaging across transaction types with very different cost profiles instead of reporting cost per transaction type separately
Making this a routine number, not a one-time analysis
Calculate cost per transaction on the same cadence you review total infrastructure spend, and segment it by transaction type whenever the mix is uneven enough that a single blended average would hide a real difference. A rising blended average with a falling number in every individual segment usually means your mix has shifted toward more expensive transaction types, which is a genuinely different story than a real efficiency regression, and the segmented view is the only way to tell the two apart.
Share this number with whoever owns product pricing as well as with engineering, since a shifting transaction mix is often a signal worth feeding back into how a specific plan or feature is priced, not just an engineering efficiency question to solve on the infrastructure side alone.
What Good Looks Like
The standard is a cost-per-transaction number calculated with a consistent, well-defined unit and numerator, segmented by transaction type when the mix is uneven, reviewed on the same cadence as total spend.
Building The Capability (5-Stage Skill Ladder)
How to Get Started
Frequently Asked Questions
What if different transaction types have wildly different costs?
Report cost per transaction separately for each meaningfully different type rather than blending them into one average. A single blended number across very different transaction types tends to hide exactly the shift you'd want to catch, a growing share of expensive transactions dragging up the average while looking stable at a glance.
How often should we actually calculate this?
On the same cadence as your regular infrastructure spend review, monthly for most teams, so a shift in unit cost shows up close to when it actually happened rather than buried in a quarterly total that averages the change away.
Is a falling cost per transaction always a good sign?
Usually, but check what's driving it before celebrating. A falling number driven by genuine efficiency, caching, better routing, is a real win; one driven by quietly excluding an expensive transaction type from the calculation is not, and it's worth periodically auditing what's actually included in the numbers.
About the numbers
This guide doesn't quote a sourced benchmark. Figures in it are estimates or general guidance, so check them against your own numbers.
Related Guides
Per-Seat or Consumption Pricing: Which AI Vendor Contract Actually Fits
How to tell whether a per-seat or usage-based AI software license actually fits your team's real usage pattern, and what to negotiate either way.
The Real Cost per Resolved Ticket Once AI Handles Support
Why cost per ticket looks better with AI support automation than it actually is, and how to calculate a number that accounts for escalations and rework.
Tracking Token Cost per Active User on a Simple FinOps Dashboard
How to pick the right denominator, the numbers to track weekly, and how to build a token cost per active user dashboard finance actually reads.
Getting Engineering to Actually Own Its Cloud Cost Number
How to move cloud cost accountability from a finance report nobody reads into a number engineering teams actually manage against, with real governance.
What Evaluating Your AI Agent Actually Costs to Run
See where AI agent evaluation cost comes from: judge-model calls, human review and test set upkeep, with a worked run example and ways to keep spend in check.
Build Your Own AI Inference Cost Model in Three Tabs
How to structure a spreadsheet that turns token usage into a real cost per customer, so you can see GPU and API spend before the invoice arrives.