AI agent cost per task: the metric that actually matters
Nobody's budget is denominated in tokens. You pay for completed tasks — and the model with the cheapest token price is often not the model with the cheapest completed task. Here's the math.
Tokens are the raw material, not the bill
Token pricing — dollars per million input or output tokens — is how vendors quote. But your bill is determined by three more things the quote doesn't show: how many tokens each task consumes, how often tasks fail (failures still burn tokens), and which price tier each token falls into (fresh input, output, and cache reads are priced very differently). The number that actually predicts your spend is:
cost per task = (input tokens × input price + output tokens × output price + cached tokens × cache price) ÷ completion rate
Every term in that numerator matters, and the denominator — the completion rate — is the one most people forget. A model that fails half its tasks effectively doubles its per-token price, because you pay for the failures too.
Not all tokens cost the same
A single agent turn consumes tokens at three different prices. Fresh input — new prompt text the model hasn't seen — is the most expensive. Output tokens (what the model generates) are priced higher still. And cached reads — previously seen context served back from the provider's cache — are dramatically cheaper. Current pricing for the two leading agent models:
| Model | Fresh input / M | Output / M | Cache read / M |
|---|---|---|---|
| GPT-6 Astra | $10 | $50 | $1.00 |
| Claude Opus 5.5 | $4 | $20 | $0.20 |
Look at the cache-read column: Opus 5.5 charges $0.20 per million cached tokens — 5% of its fresh-input price — while Astra charges $1.00, 10% of its $10 input price. That 5× gap between the two models' cache pricing is invisible if you only compare headline input prices, and it dominates the bill in exactly the workloads that matter most: long, multi-turn agent sessions.
When does the expensive model win?
Take the verified September 2026 pricing: GPT-6 Astra at $10/M input against Claude Opus 5.5 at $4/M — a 2.5× per-token gap. For the pricier model to tie on cost per task, it must do the same work with fewer tokens. The break-even condition, holding completion rate and input/output mix equal, is simple:
A model priced 2.5× per token must consume at most 40% of the cheaper model's tokens to tie on cost per task (1 ÷ 2.5 = 0.40). Use 50% of the tokens and you pay 25% more per task despite the "better" model.
Two things shift this line. Completion rate: if the expensive model completes 90% of tasks and the cheap one completes 60%, divide each side by its rate — the expensive model effectively gets a 1.5× cost credit. Token mix: if the expensive model is more concise (fewer output tokens) or the workload is cache-heavy (where the price gap differs from the headline 2.5×), the real break-even moves. This is why Anthropic's reported result is so striking: Opus 5.5 beats Astra's top FrontierCode score at roughly one-fifth the cost per task — not by being 5× cheaper per token, but by combining lower token prices with fewer tokens and fewer failures. See our head-to-head comparison for the full picture.
Why long agent sessions are cache-dominated
A one-shot prompt is input-dominated: you pay full price for the prompt, the model answers, done. A multi-hour agent session is the opposite. Every turn, the model re-reads the accumulated context — the system prompt, the repo files it opened, the conversation history, the tool results so far. Almost all of that is unchanged between turns, so almost all of it is served from cache at the discounted read rate. By turn fifty, the session's cost is overwhelmingly cached reads of old context, not fresh input or new output.
This has two practical consequences. First, the cache-read price — the tier everyone skips — is the single most important number for long-running agents: Opus 5.5's $0.20/M vs. Astra's $1.00/M is a 5× cost difference on the dominant term. Second, prompt and context hygiene is a cost lever, not just a quality lever: every kilobyte of stale context you leave in the window gets re-read (and re-billed, at cache rates) on every subsequent turn. Compact context, aggressive summarization of old turns, and dropping irrelevant files isn't just good agent design — it's the difference between a session that costs cents and one that costs dollars.
Imagine a 100-turn session where each turn re-reads 200K tokens of accumulated context, 95% cached. That's ~19M cached tokens. At $0.20/M that's about $3.80; at $1.00/M it's about $19. Same session, same work — a 5× difference from one pricing tier. Fresh input and output are rounding errors by comparison.
Budgeting missions by cost per task
For governed missions, this math isn't academic — it's how contracts get written. A mission contract bounds acceptable cost, so model selection becomes a constrained optimization: pick the cheapest model whose completion rate clears the mission's quality bar, and reserve expensive models for the stages where failure is costly (final verification, security review, irreversible actions). Measure cost per task on your own workload — tokens per attempt × tier prices ÷ your completion rate — re-measure monthly as prices and models move, and never let a headline token price make the decision alone. Our September benchmark landscape gives you the scores to pair with this math, and the execution-chain docs show where cost bounds live in a governed mission.
Frequently asked questions
What is cost per task?
Total token cost across all attempts at a task, divided by the number of completed tasks. It folds together token consumption, tier pricing (input, output, cache reads), and completion rate — everything your budget actually feels.
How much cheaper are cache reads than fresh input?
Dramatically. Claude Opus 5.5 prices cache reads at $0.20/M vs. $4/M fresh input (5%); GPT-6 Astra at $1.00/M vs. $10/M (10%). In long sessions, cached reads are the dominant cost term.
When does a more expensive model cost less per task?
When it uses few enough tokens — or fails rarely enough — to offset its price. At 2.5× per token, it must use ≤40% of the cheaper model's tokens to tie, at equal completion rates. Higher completion rates move the line in its favor.
Why are long agent sessions cache-dominated?
Each turn re-reads accumulated context (system prompt, files, history), which is mostly unchanged and served from cache. Over dozens of turns, cached re-reads dwarf fresh input and new output — making cache-read pricing the number that matters.
How do I reduce my agents' cost per task?
Three levers: (1) pick the cheapest model that clears your completion-rate bar; (2) keep context compact — summarize old turns, drop irrelevant files; (3) raise completion rates with better prompts and verification, since failures are paid tokens too.
Scores plus math
⚖️ Astra vs. Opus 5.5
Pricing, benchmark wins, and the head-to-head verdict by use case.