If you compare LLMs by price per token alone, you can easily choose the wrong model. For structured AI work, the more useful metric is cost per accepted task: what you actually pay for outputs that pass your quality bar.

Why token price is not enough

Procurement and engineering teams often start with a simple question: which model is cheaper? But for JSON extraction, classification, field filling, and other checkable tasks, the better question is different: which setup gives us the lowest cost for outputs we can actually accept?

A low-priced model can still be expensive if it fails often, needs retries, or creates errors that trigger manual review. A more expensive model can also be wasteful if a cheaper one handles most tasks well enough. That is why buyers increasingly look at the full unit economics of a task, not just the per-token list price.

The core metric

At its simplest:

cost per accepted task = total model cost / number of accepted outputs 

That sounds straightforward, but in practice you should decide four things before you calculate it:

  1. What counts as a task? For example, one invoice, one product record, one classified document.
  2. What counts as accepted? You need a pass/fail rule, ideally based on your own expected output.
  3. Which costs are included? Include retries, self-checks, and escalations, not just the first model call.
  4. Which errors matter most? Some failures are minor; others are critical and should be tracked separately.

Use acceptance tests, not vibes

The cleanest way to compare structured LLM tasks is to define acceptance in advance. For a JSON extraction workflow, that usually means the output must match an expected result exactly, or field by field according to a rule you control.

Example for invoice extraction:

Field Acceptance rule
invoice_no Exact string match after normalization
date Same ISO date
seller Match normalized company name
currency Exact code match
subtotal Numeric match within your tolerance
tax Numeric match within your tolerance
total Numeric match within your tolerance

For some teams, acceptance is strict equality. For others, small normalization rules are acceptable. What matters is consistency. If you move the goalposts while comparing models, the result will not be trustworthy.

Track critical failures separately

Acceptance rate alone can hide important risk. Suppose two model setups both pass 95% of tasks, but one occasionally returns a wrong currency or incorrect total. In finance-related extraction, that may be far more serious than a missing non-critical field.

Create a short list of critical errors for your workflow. Examples might include:

  • Wrong total amount
  • Wrong currency
  • Misread tax value
  • Swapped supplier and buyer identifiers

This gives stakeholders a better view than a single accuracy number. Cost, acceptance, and critical failures should be read together.

Include the real routing policy

Many teams underestimate costs because they only price the first model call. In production, the true workflow may include:

  • A cheaper model first
  • A deterministic self-check
  • A retry or repair step
  • Escalation to a stronger baseline model when the check fails

If that is how you intend to operate, then that is what you must measure. A cheap-first strategy can be very attractive, but only if you include the cost of the cheap pass, the checking step, and every escalation back to the stronger model.

A simple comparison table helps:

Setup Included costs What to watch
Baseline only Main model call Higher direct cost, simpler operations
Cheap model only Single low-cost call May fail too often for business use
Cheap + check + escalation Cheap call, self-check, fallback to baseline Best measured on real tasks

A practical measurement workflow

  1. Sample tasks from real traffic. Use a representative set, not just the easiest examples.
  2. Prepare expected outputs. For each task, define the result you would accept.
  3. Run your baseline model. Measure acceptance, critical errors, cost, and latency.
  4. Run the candidate policy. This may be a cheaper model alone or a routing policy with checks and escalation.
  5. Calculate cost per accepted task. Use the same acceptance test on both.
  6. Review edge cases. Inspect failures, not just aggregates.

If your sample is small, be honest about uncertainty. A result from a handful of tasks can be directionally interesting, but not decision-grade.

Example calculation

Imagine 200 extraction tasks.

This example is purely illustrative and not based on Luna’s internal test data.

  • Baseline cost: $40 total
  • Baseline accepted outputs: 190
  • Baseline cost per accepted task: $40 / 190 = $0.2105

  • Cheap-first policy cost: $18 total including checks and escalations

  • Cheap-first accepted outputs: 182

  • Cheap-first cost per accepted task: $18 / 182 = $0.0989

In that example, the routed setup is less than half the cost per accepted task. But if accepted outputs dropped sharply, or if critical failures appeared, the decision could change. This is exactly why the metric is more useful than token price alone.

Common mistakes

  • Comparing prompts, not systems. Buyers approve workflows, not isolated prompts.
  • Ignoring escalations. Fallback traffic can materially change savings.
  • Using unrepresentative tasks. A clean demo set can make almost any model look good.
  • Skipping critical error analysis. Equal acceptance does not mean equal business risk.
  • Assuming savings from benchmarks alone. Open benchmarks are useful, but your own traffic is what matters.

When this metric is most useful

Cost per accepted task is especially helpful when:

  • You process high volumes of structured documents
  • You already have, or can create, expected outputs
  • Your workflow has clear pass/fail rules
  • You are considering routing some traffic away from an expensive baseline

It is less useful for open-ended chat, creative writing, long reasoning, or tasks where “good enough” is subjective and hard to score consistently.

A simple way to validate the economics

If your team is evaluating whether a cheaper model can safely handle JSON-extraction style work, Luna AI Cost Autopilot is built around this exact measurement: cost per accepted task against your current model, using your own acceptance tests. It is a free shadow pilot rather than a production change, and the pilot does not use personal data, which makes it a practical way to gather evidence before a broader rollout.

If you want a rough estimate first, use the LLM savings calculator. It is a quick estimate, not a guarantee, and a practical way to frame the opportunity before you run a real measurement on your own task mix. You can also review the JSON extraction use case or see the demo.

FAQ

What is the difference between accuracy and cost per accepted task?

Accuracy tells you how often outputs pass your test. Cost per accepted task combines quality and cost by dividing total spend by the number of accepted outputs.

Should I include fallback and retry costs?

Yes. If your intended workflow uses retries, self-checks, or escalation to a stronger model, those costs belong in the calculation.

Is this metric useful for chatbots?

Usually less so. It works best for structured tasks with a clear expected result and a consistent acceptance test.

Originally published at otopilot.lunafzai.com. Disclosure: written by the team behind Luna AI Cost Autopilot.