- Count all included work, including retries and failed tasks.
- Compare routes using the same acceptance rule and accounting boundary.
- Keep caching savings, extra attempts and shared allocations from being counted twice.
The smaller bill looks attractive.
Fewer customers receive an accepted answer.
The useful unit is the completed task.
Hypothetical scenario. Act 4, the rebuild. Northwind compares two policy-assistant routes on the same 100 tasks. Route B has the lower batch bill, but Priya accepts fewer answers. Maya needs a comparison that preserves both the spending and the useful outcomes rather than choosing the smallest token-rate headline.
Define the outcome before comparing the rate
Cost per accepted task divides the complete included cost of a declared task population by its accepted outcomes. An accepted task meets the application’s evidence, permission and deadline rules. The accounting includes work on failed tasks as well as successful ones when both belong to that population.
A token price is a unit rate for a metered input or output category. It becomes a charge only after multiplying by billable volume and applying the provider’s rules. Different rates, retry counts and response lengths can make a lower advertised rate coexist with a higher complete task cost.
A task ledger connects one user goal to all model attempts, tool calls and review work spent on it. Northwind keeps the goal’s identity stable across retries and fallback routes. That prevents a second attempt from looking like another useful customer outcome and prevents abandoned work from disappearing from the numerator.
A token rate is not a complete ledger
A rate needs a volume and a billing rule before it becomes a cost. Input and output can have different rates, and caching, batching, failures, or special processing can have separate terms. Use the actual service contract for a real estimate rather than assuming every submitted token has one universal price.
Tasks may also consume tool calls, application compute, storage, review work, and support or recovery effort. Decide which are in scope. A provider bill and a complete service-cost allocation are different views, both useful when their boundaries are explicit.
Define acceptance through the customer-visible outcome: a supported policy answer delivered within the required deadline and access scope. A completed model call is only a component observation, not the denominator for successful tasks.
Draw the accounting boundary around the task
Assign a logical identity to each user task and connect all its attempts, tool operations, and review decisions to it. A retry is another attempt within the same task, not another successful user outcome. A fallback route belongs in the same ledger if it contributes to completing that task.
For a declared batch and accounting scope, cost per accepted task is total included cost divided by accepted task count. Report acceptance rate alongside it. If no tasks are accepted, that ratio has no finite value; reporting zero because nothing succeeded would reverse its meaning.
Keep cash charges distinct from allocated shared costs. If a model API charge already covers model execution, do not also allocate the provider's model hardware as though it were your separate bill. An application-host allocation can be included if it covers different work and the allocation rule is stated.
Keep the acceptance criterion fixed across routes. A response that sounds helpful but lacks current evidence should not become accepted merely because the cheaper route generates more such responses. Report partial and escalated outcomes separately.
Derive two complete cost ledgers
Hypothetical scenario. Compare two routes on 100 tasks each under the same acceptance rule. All dollar figures below are chosen accounting assumptions, not vendor offers, measured bills, or wage recommendations. Include model charges, tools, application-host allocation, and review allocation; exclude any costs not listed and disclose that limitation.
Route A makes 120 attempts. Each attempt has 2,000 input and 500 output tokens. Choose illustrative rates of $1 per million input tokens and $4 per million output tokens. Input volume is 120 × 2,000 = 240,000 tokens, costing 240,000/1,000,000 × $1 = $0.24. Output volume is 60,000 tokens, costing 60,000/1,000,000 × $4 = $0.24. Model cost totals $0.48.
Route B makes 100 attempts, each with 1,000 input and 250 output tokens. Its chosen rates are $2 and $8 per million respectively. Input costs 100,000/1,000,000 × $2 = $0.20; output costs 25,000/1,000,000 × $8 = $0.20. Model cost totals $0.40. Its higher unit rates coexist with a lower model subtotal because volumes differ.
| Included batch item | Route A | Route B |
|---|---|---|
| Model charges | $0.48 | $0.40 |
| Tool charges | $0.72 | $0.30 |
| Application-host allocation | $0.80 | $0.30 |
| Review allocation | $2.00 | $2.00 |
| Total included cost | $4.00 | $3.00 |
| Accepted tasks | 80 | 50 |
A's total is $0.48 + $0.72 + $0.80 + $2.00 = $4.00. B's is $0.40 + $0.30 + $0.30 + $2.00 = $3.00. Acceptance rates are 80/100 = 80% and 50/100 = 50%. Cost per accepted task is $4/80 = $0.05 for A and $3/50 = $0.06 for B.
Thus B has a lower model subtotal and lower total batch cost, yet a higher cost per accepted outcome. This is an accounting result under chosen assumptions, not a measured model ranking. The two routes can also differ in latency or failure consequences that the ledger does not capture.
Holding these costs fixed, A beats B's $0.06 per accepted task when $4/q < $0.06, or q > 66.666… accepted tasks. For integer q, at least 67 suffice. This is a sensitivity calculation. A change that raises acceptance can also change attempts, review, and costs, so the fixed-cost assumption must be reconsidered before predicting an improvement.
Conversation growth is conditional accounting
Hypothetical scenario. A four-call task starts with 1,000 input tokens and appends exactly 200 tokens between calls, retaining everything. Input lengths are 1,000, 1,200, 1,400, and 1,600. Submitted input sums to 5,200 tokens, compared with 4,000 if each call used only the original 1,000.
Under that specific constant-growth, no-truncation policy, N calls with starting input S and growth g submit N × S + g × N × (N − 1)/2 input tokens. For N = 4, S = 1,000, and g = 200, the result is 4,000 + 1,200 = 5,200.
The expression does not prove quadratic billing or elapsed time for every agent. Summarization, context selection, prefix reuse, and actual pricing rules can change the relationship. Count the actual submitted and billed categories rather than converting a conversation-length formula into a universal cost claim.
Excluding failures can reverse the message
Hypothetical scenario. A dashboard totals only the charges attached to successful tasks. Failed attempts, abandoned requests, and fallback work go to separate logs. The displayed unit cost falls after a change that causes more tasks to fail early, even though the service delivers fewer useful outcomes.
The dashboard is measuring successful-path cost, not the full batch's cost per accepted result. Both views can be retained, but label them differently and preserve reconciliation to the total included ledger. Otherwise an apparent efficiency gain can be an exclusion rule.
Retries deserve particular attention because the caller may not know the remote outcome after a connection failure. HTTP's idempotency discussion clarifies that repetition needs appropriate semantics. It does not promise that a retry is free or that a correlation identifier prevents duplicate execution.
Four ways to game the denominator accidentally
“Completed calls count as completed tasks.” A task may require several calls and still fail the acceptance criterion. Preserve the logical identity.
“Rejected tasks cost nothing.” They can already have used admission, retrieval, model, or review resources. Include costs within the declared scope.
“Higher acceptance proves better economics.” The numerator can grow too. Review the complete ledger and the consequences of remaining failures.
“The benchmark score supplies our production success rate.” Workload, allowed tools, acceptance checks, and task distribution may differ. Keep that boundary explicit.
Choose a budget with a quality boundary
Use cost per accepted task to compare routes when the task population, acceptance definition, and accounting scope are sufficiently aligned. Pair it with latency, acceptance rate, and important failure categories. A low average can hide costly outliers or a rejected class of users.
Choose the required quality and deadline boundary before optimizing spend. A cheaper answer that fails that boundary belongs in the cost numerator but not the accepted-outcome denominator.
Do not treat this metric as a substitute for demand planning or a complete business case. Shared fixed costs, staffing, and long-term maintenance may need another accounting view. Declare what the comparison includes and what decision it supports.
In the wild: caching changes a ledger component
OpenAI’s prompt-caching guide documents reuse of eligible matching prompt prefixes. The accounting lesson is to distinguish cached and uncached input according to the actual service’s billing rules. A reused prefix does not make the entire task free, and a cache hit does not establish that a policy answer is acceptable.
Hypothetical extension to the ledger: if Route A’s model subtotal falls from $0.48 to $0.38 through a chosen $0.10 cache saving, and retries add $0.10 in new model charges, the net model subtotal remains $0.48. Report the saving and additional charge as separate components. Do not subtract the cache saving again after using a net invoice subtotal.
AWS’s retry guidance explains why repeated attempts consume additional work. OpenAI’s evaluation guide supports defining acceptance with task-specific checks. OpenTelemetry’s GenAI attribute registry provides input and output token categories, but sampled usage is not automatically a complete bill. Reconcile the financial ledger with actual billing records under a declared boundary.
Limits: these prices are hypothetical, allocations can change with scale, and one average hides workload differences. If the same hypothetical batches repeat 1,000 times with identical cost and acceptance, A spends $4,000 for 80,000 accepts and B spends $3,000 for 50,000 accepts. The unit ratios remain $0.05 and $0.06; this linear projection is an assumption, not a demand forecast.
Check yourself: audit the unit-cost claim
A batch costs $12 under its declared scope and accepts 30 of 50 tasks. What should be reported?
Cost per accepted task is $12/30 = $0.40 and acceptance is 30/50 = 60%. Report the accounting boundary and other relevant outcomes. Dividing by all 50 instead gives $0.24 per submitted task, a different measure.
A route accepts no tasks but spends $5. Is cost per accepted task zero?
No. The denominator is zero, so there is no finite ratio. Report the $5 total, zero accepted tasks, and the failure condition explicitly.
An optimization removes conversation history and cuts token volume, but valid answers fall sharply. Has lower token spend established an improvement?
No. Compare total included cost per accepted outcome and inspect the lost capabilities, latency, and failure consequences. Lower volume is one resource observation, not a complete quality-adjusted result.
Next read: LLM Provider Failover: Capacity, Equivalence, and Retry Storms.