What will this actually cost to run, and where does the spend hide?
The per-token sticker price on a pricing page is not what an AI feature costs to run — retries, fallbacks, context growth, and agent loops routinely push real production spend to 5-20x the naive estimate.
What actually happens at this stage
Cost modeling for AI systems fails for a specific, recurring reason: a per-token estimate prices one clean attempt at a task, and production never runs one clean attempt per outcome. It runs however many attempts it actually takes — retries on rate limits or malformed responses, fallback calls to a second, often pricier model when the first one fails, and for agentic workflows, several chained calls to reach a single completed task. None of that shows up in "tokens per request times price per token," which is exactly why the actual invoice is so often a multiple of the number that was budgeted.
The fix is to measure and budget cost per successful outcome, not cost per call — divide total spend for a feature by the count of tasks that actually completed, not the count of API calls made. Tracking the calls-to-completions ratio over time catches a cost regression at the same moment it would catch a reliability regression, because they're usually the same underlying problem: an unbounded retry policy or a stalling agent loop is a cost incident before it's ever reported as a quality one.
Model-agnostic routing is the most direct lever for controlling spend once volume is real: send the easy, high-volume requests to a cheap, fast model and reserve the expensive model for the requests that actually need its extra capability. A model cascade — try cheap first, escalate only on low confidence or failure — routinely cuts spend meaningfully without a corresponding drop in quality, but only if the routing logic and the confidence threshold are themselves measured, not set once and forgotten.
Prompt caching is the second lever, and it's the one teams most often leave on the table entirely by accident. Caching only pays off when the prefix of a request is byte-identical to a previous one — a single volatile token near the front (a timestamp, a per-request UUID, a reordered tool list) busts the cache for the entire prefix, even though the request looks "basically the same" to a human reading it. The fix is pure ordering discipline: static instructions and tool definitions first, anything that changes per request last — and it's worth checking your actual cache-read share against your provider's usage data, because a broken cache is a pure cost and latency defect that produces no other visible symptom.
CostMon exists because we hit this exact reconciliation problem running our own stack: AI, cloud, and SaaS spend land across a dozen billing consoles, each with a different export format and a different definition of "usage," and reconciling that by hand every month is precisely the kind of manual process this studio would tell a client to stop doing. Whatever tooling you use, the discipline that matters is the same one CostMon is built to make self-serve: one normalised number engineering and finance both trust, checked against the modeled estimate on a schedule, not discovered as a surprise on the monthly invoice.
The common mistake
The most common mistake at this stage is budgeting from the vendor's per-token price sheet and never revisiting it against actual billing data — so the first real signal that something is wrong is a monthly invoice three times the estimate, discovered well after the retries, fallbacks, or loop that caused it are already old news in the logs.
How do you know this stage is finished?
- Cost is modeled and tracked per successful outcome, not per API call.
- The calls-to-completions ratio is tracked over time, not just total spend.
- Easy, high-volume requests are routed to a cheaper model; the expensive model is reserved for what actually needs it.
- Prompt cache-read share is checked against provider usage data, not assumed from how the prompt looks.
- Actual billing is reconciled against the modeled estimate on a schedule, not discovered as a surprise.
What backs this up
Insights
- What AI Actually Costs in Production, by Workload
What cost per outcome actually looks like broken down by workload shape.
Case studies
- Cutting Inference Spend 40% Without Betting on One Vendor
The model-cascade lever above, applied to a real engagement.
Patterns
- Model cascade
The routing shape that sends easy requests to a cheap model automatically.
- Stable-prefix prompt caching
The ordering discipline that makes prompt-caching discounts actually land.
Failure modes
- Retry-amplified spend
Why the invoice runs 3x the estimate — the failure this stage's cost-per-outcome fix addresses.
- Prompt cache never hits
The specific, invisible way a caching discount silently never applies.
Glossary
- Inference Cost
The line item this entire stage is about keeping honest.
- Idempotency
What makes a retry on a write-scoped call safe instead of a second, silent mutation — the fix behind retry-amplified spend above.
Tools
- AI Cost Calculator
Model your own volume and failure rate instead of trusting the sticker price.
More
- CostMon
The billing-reconciliation problem this stage describes, built as the product answer to it.
Questions on this stage
What comes up before and during cost.
01 Why is our inference bill so much higher than we estimated?
The estimate almost certainly priced one clean call per outcome. Production runs retries, fallbacks, and — for agents — several chained calls per completed task, none of which show up in a simple tokens-times-price model. Measure cost per successful outcome, not per call, to find where it's actually going.
02 What's the fastest lever for cutting AI spend?
Model-agnostic routing — send easy, high-volume requests to a cheap model and reserve the expensive one for what genuinely needs it. A model cascade (try cheap first, escalate on low confidence) is the standard shape, but only works if the escalation rate itself is measured.
03 Why aren't we getting prompt-caching discounts?
Something volatile — a timestamp, a request ID, a reordered tool list — is almost certainly sitting near the front of the prompt and busting the cache on every call. Caching only works on a byte-identical prefix; put static content first and anything that changes per request last.
A Ship Audit checks your actual system against every stage of this handbook and hands back a written, prioritized plan.