Token demand
Spends on: What you send the model, and how much you let it write back.
Hides in: A prompt template that gathered context. Nobody re-checked it after it stopped being small.
Watch: p95 tokens per request
Six surfaces, 24 named levers, five ways a cost estimate lies, and a scoreboard that keeps them honest. This is the discipline behind the cost stage of the Handbook. It sells no tool.
A per-token price on a pricing page prices one clean call. Production does not run one clean call per outcome. It runs as many attempts as it needs. Retries, fallbacks and chained agent calls never show up in "tokens times price." That gap is why real spend often lands well above the budget. Teams find it on an invoice, after the design review is over.
Cost has six surfaces. Spend hides in the one nobody measures. Skipping a surface does not make it free. The spend still happens. The monthly invoice just attributes it to no one in particular.
Each surface hides spend a different way. None of them replace each other.
Spends on: What you send the model, and how much you let it write back.
Hides in: A prompt template that gathered context. Nobody re-checked it after it stopped being small.
Watch: p95 tokens per request
Spends on: Which model tier ever sees a given request.
Hides in: A feature that defaulted to the frontier model on day one and never got benchmarked against anything cheaper.
Watch: Blended cost per resolved request
Spends on: Whatever gets computed, embedded, or generated twice for the same reason.
Hides in: A single volatile token near the front of a prompt, which voids a discount nobody checked against provider usage data.
Watch: Cache-read share of input tokens
Spends on: Embedding, vector storage, and reindexing, running whether or not anyone reads the result.
Hides in: A finance review that reads this as an infrastructure line item and never connects it to the AI budget at all.
Watch: Tokens of retrieved context per query
Spends on: Every retry, fallback call, and extra step in an agent run that technically finished.
Hides in: A per-token estimate that priced one clean attempt, when production runs however many attempts it actually takes.
Watch: Retry spend as a share of total spend
Spends on: Nothing directly. This is the instrumentation layer that says which feature spent everything above.
Hides in: A cost spike that shows up as "the AI bill went up" with no feature name attached to it.
Watch: Share of spend with a resolved feature tag
Filter by stage: design, pre-launch or in production. Then copy the visible list as a Markdown checklist.
Showing all 24 levers
Every dollar starts here. You pay for what you send the model and for how much you let it write back. A demo prompt is small and hand-trimmed. A production prompt grows. It gathers retrieved chunks, resent conversation history and few-shot examples. Soon nobody remembers why half of it is still there. None of that shows up as its own line on the bill. It shows up as more tokens, priced at the input or output rate.
Not every request needs the strongest model on the price list. Many teams pay frontier rates for a classification task that a small model would get right. That is the easiest saving they leave unclaimed. This surface covers which model tier handles each request. Decide it per request class, not once for the whole feature. Then check one thing: when a cheaper option clears the bar, is the switch a config change or a rewrite?
You do not get a cache discount once. You must earn it again on every call. One volatile token near the front of a prompt voids it for the whole request. The system gives no error and no warning. This surface covers everything that stops you paying twice for the same computation. That includes prompt caching, retrieval caching and reuse of an answer in place of a new generation.
Teams rarely count retrieval spend as AI spend. It looks like a database and infrastructure bill, not a model bill. Vector storage, embedding calls and reindex jobs run on a schedule. They run whether or not anyone reads what they produce. Most cost conversations skip this surface. Then someone asks why the vector-store invoice keeps climbing.
A retry on a malformed response is a billed event. So is a fallback to a pricier model, and so is an extra step in an agent loop. A per-token estimate prices none of them. The estimate assumes one clean attempt per outcome. Production runs as many attempts as it needs. Most of the gap between the sticker price and the real invoice comes from this surface.
The five surfaces above do not help if nobody can trace a cost spike to its feature. They do not help if nobody can stop that feature without waiting for a deploy window. This surface is the layer under every other one. It holds tagging, budgets, alerts and kill switches. With it, you find a regression the same afternoon. Without it, you find it on the monthly invoice.
No levers match that combination. Clear a filter to see more.
Every one of these produces a confidently wrong number, not an obviously broken one.
Looks like: A cost estimate multiplies a single blended $-per-token rate by a token count, as if input and output tokens cost the same.
Costs you: The estimate is wrong in a predictable direction, usually low. Output tokens are typically priced well above input tokens. A chatty feature spends most of its budget on the more expensive half.
Fix: Price the input and output halves of every request separately, each at its own rate. Then add them together.
See the lever: Bound output length on purpose →Looks like: A volume forecast counts real user requests only: no retries, no dev and staging traffic, no eval-suite runs against the same model.
Costs you: Every one of those omitted categories is a billed call. A retry-heavy feature can run several billed attempts per completed task, even in a healthy system. The happy-path forecast counted none of them.
Fix: Model cost per completed task, including every retry and fallback it took. Do not model cost per request on the assumption that the first attempt lands.
See the lever: Cap retry and fallback depth explicitly →Looks like: The estimate applies a caching discount because the prompt "should" cache well. Nobody pulled the cache-read number from provider usage data.
Costs you: A single volatile token near the front of the prompt voids the discount. The system reports no error when that happens. The estimate keeps assuming a saving that stopped weeks ago.
Fix: Read the real cache-read share from provider usage data before you build it into a forecast. Re-check it on a schedule.
See the lever: Measure the cache-read share, don't assume it →Looks like: The reported figure is spend divided by API calls made. The business pays for resolved outcomes, and cares about them.
Costs you: A feature with a low failure rate and a feature that retries three times per success can report the same cost-per-call number. The second feature costs three times as much per outcome.
Fix: Divide total spend by completed-task count, not call count. Track the ratio between the two over time.
See the lever: Budget cost per completed task, not per call →Looks like: A cost projection multiplies the pilot's per-user cost by the target user count. It assumes cost scales in a straight line with volume.
Costs you: Context growth and agent fan-out tend to grow faster than user count. A chat feature that resends growing history costs more per user at scale than the pilot showed. So does an agent workflow that spawns more sub-tasks under real load.
Fix: Model the growth curve for context size and step count apart from the curve for user count. Extrapolate each on its own.
See the lever: Give every agent run a hard ceiling →Every one of these is measurable today. None of them is trustworthy read alone. Pair it with the number next to it.
No invented benchmark numbers, no vendor price list. Just what's already documented on this site.
The cost-management framework our cost model's phases map onto. Retrieved 2026-08-24.
The capability list our cost levers are checked against. Retrieved 2026-08-24.
A Ship Audit runs this model against your own system. It tells you which surface costs you money. It also shows which surfaces only look incomplete on paper.
What teams ask us before they model AI spend.
The estimate almost certainly priced one clean call per outcome. Production runs retries and fallbacks. For agents, it runs several chained calls per completed task. A simple tokens-times-price model shows none of them. See the five ways an estimate lies above. The gap is usually more than one of them at once.
Link to this answer: Why is our inference bill so much higher than what we estimated?Measure cost per completed task, not cost per call. It costs nothing to build beyond a completion event. It also makes every other cost problem on this page visible, so nobody has to assume.
Link to this answer: What's the single fastest lever to pull first?No. Start with token demand and model routing. Every feature has those two surfaces, whatever its shape. Add caching once volume is real. Add retrieval-pipeline cost once there is a knowledge base to maintain. Add failure economics and attribution once there is enough traffic for a regression to cost money.
Link to this answer: Do we need all six surfaces on day one?It can. That is why every lever on this page is checked against the eval suite. The invoice alone is not enough to ship a cut. A cut that drops the golden-set pass rate is a quality regression with a smaller bill. It is not a cost win.
Link to this answer: Isn't cutting tokens just going to hurt quality?The calculator turns your own volume and failure-rate assumptions into a number. This page covers the levers that move that number once you have it. It lists six surfaces and 24 named changes. It also lists five ways the estimate behind the calculator can be wrong before you touch a lever.
Link to this answer: How is this different from the AI Cost Calculator?Per-token prices change every few weeks. A table of them would be the fastest-rotting page on this site within a quarter. This page uses ratios, shapes and levers. They stay true whatever a provider charges this month. For the arithmetic, use the calculator.
Link to this answer: Why no per-token price table?Source: https://customlabs.io/cost/