All articles

Stop Measuring the Cost of AI in Tokens

Token prices explain a model invoice. Cost per successful task explains whether an agent is worth running, and exposes the economic value of better retrieval.

An agent that gives up quickly is wonderfully cheap. It reads little, makes few tool calls and produces a short answer. A token dashboard can make it look like your most efficient configuration.

The customer still has the problem.

Tokens are useful for explaining where money went. They are a poor final objective for deciding whether an AI system is getting cheaper. That decision needs a denominator: how much useful work did the system finish?

Put success in the denominator

Cost per successful task is the total cost of running a defined workload divided by the number of tasks that meet a predefined success criterion. Include unsuccessful attempts in the numerator. Otherwise, the metric quietly forgives the work you paid for and couldn't use.

cost per successful task =
  (model + tools + retrieval + allocated infrastructure + human handling)
  / successful tasks

Define the boundary before collecting the number. If a failed agent hands a ticket to a person who resolves it, you can measure the cost of the whole support workflow, including the person. Or you can measure autonomous resolutions and report escalation cost separately. Either can be useful. Calling both “agent success” makes comparisons meaningless.

For a coding workflow, success could require passing tests and an accepted change. For a support workflow, it might require a verified resolution with no reopening during a fixed observation window. A generated answer or a tool call returning HTTP 200 is usually an intermediate event.

This measurement problem predates today's agents. AI Agents That Matter argues that accuracy-only evaluation encourages unnecessarily expensive systems and demonstrates joint optimization of cost and accuracy. A buying decision needs both. The cheapest model call doesn't tell you how many calls, retries or corrections the task will require.

A retrieval change can move the denominator more than the bill

BrowseComp-Plus provides a useful example. Across 830 questions, replacing BM25 with Qwen3-Embedding-8B raised GPT-5 accuracy from 55.90% to 70.12%. Total model API spending fell by 9.9%. Dividing spending by correct answers makes the saving 28.2%.

The following reductions are our calculations from the paper's Table 8, comparing each model with itself after the retriever change:

Model Lower model API spend per question Lower model API spend per correct answer
Claude Sonnet 4 7.5% 63.9%
Claude Opus 4 9.9% 61.2%
Gemini 2.5 Pro 27.9% 52.1%
o3 11.4% 31.3%
GPT-5 9.9% 28.2%

For GPT-5, the relative cost per correct answer is 0.90096 × 55.90 / 70.12 = 0.71825.

These are historical model API costs, excluding retrieval infrastructure. The experiment used a fixed corpus of roughly 100,000 documents and difficult research questions. It neither establishes the same savings for another workflow nor measures the full cost in our formula. BrowseComp-Plus, Tables 1 and 8.

What makes the comparison useful is the separation between the two columns. A component can contribute little to direct spending yet substantially change how much useful work the rest of the system produces. Your invoice groups costs by supplier. The causal chain crosses those boundaries.

More retrieval can be the cheaper decision

Consider a hypothetical workload of 1,000 tasks. Configuration A spends 1,000 cost units and finishes 600 tasks successfully. Its cost per success is 1.67 units. Configuration B performs an extra evidence check, spends 1,100 units and finishes 750 tasks. Its cost per success is 1.47 units, about 12% lower despite spending 10% more overall.

The budget owner still needs to approve the extra 100 units. Cost per success isn't a reason to ignore a spending cap. It explains what that spending buys.

Retrieval changes can work in either direction. Better evidence may save a chain of reformulations. A larger candidate set may help a reranker find the right passage, while an indiscriminate increase in returned text may bury it. Fetching the full document may reveal the exception that a short snippet omitted. It can also waste an entire context window on an irrelevant result.

Measure the completed task to distinguish those cases. Recall and nDCG help explain what happened inside search, but neither proves the final answer improved. Track which evidence was retrieved, what the agent actually read and whether its answer was supported.

The same reasoning applies to model routing. A smaller model with adequate evidence may finish a workflow cheaply. A larger model may earn its price by avoiding expensive human correction. Test combinations of model, retrieval configuration and response format on the same tasks; changing all three at once makes a win difficult to diagnose.

WarpSearch's hybrid search exposes lexical and vector retrieval, shared filters and tunable fusion. Those are useful experiment controls. Whether a particular setting lowers total task cost has to be established in the application using it.

A cheap average can hide an unreliable agent

Repeated runs matter. An agent that completes a task on one attempt and fails on the next may have an attractive average while creating an operational headache.

τ-bench introduced pass^k to measure success across repeated trials. Its pass^8 asks about succeeding on all eight trials, unlike a best-of-eight metric that accepts any single success. That distinction matters when your user gets one attempt and doesn't know whether it was the lucky one.

Keep repeated-run reliability beside cost per success. Also keep a minimum quality threshold. A very cheap system that solves only easy cases can score well on cost per success while leaving most customers stranded. If selective automation is the intended product, report its coverage explicitly and include the cost of the remaining work.

For open-ended writing or research, success labels will be less crisp. Use a fixed rubric, sampled human review and a held-out task set. If a model grades the output, calibrate it against those reviews. Report uncertainty when samples are small; a difference of two successful tasks shouldn't support a confident purchasing decision.

Build a task ledger, then choose the experiment

Start with a task ID that follows every model call, search, reranker request and retry. Record configuration versions, usage, elapsed time, terminal status and the success label. Allocate shared infrastructure over a stated interval and workload. Keep pending tasks visible until their evaluation window closes.

A useful dashboard shows attempted tasks, success rate, total spend, cost per success and escalation rate together. Break them down by workflow and difficulty. Otherwise, a shift toward easier traffic can look like an engineering improvement.

Tokens remain a diagnostic underneath that dashboard. When costs rise, they help distinguish larger prompts, more output, lost cache reuse and extra turns. But the decision at the top should be concrete: did this change let us complete the same work more economically, at the quality and reliability we require?

Before negotiating a cheaper token rate, inspect a few expensive failed tasks. If the agent spent six turns reading the wrong evidence, the first experiment is already waiting for you.

Cookie settings

Optional tracking stays off until you choose it. Your choice applies to this browser for 180 days. Read the details.

Essential storage keeps you signed in, protects forms, and remembers this choice. It is always available.