Every LLM pricing comparison you've read compares input and output tokens. For a coding agent, both are close to irrelevant. The number that decides your bill is cached input - and it varies by more than 300× across providers.
DeepSeek charges $0.003 per million cached input tokens. OpenAI's gpt-6-astra charges $1.00 for the same thing. If your workload re-reads the same context over and over - which is exactly what an agent does - that ratio, not the headline input price, is your actual cost driver.
Why agents are a caching problem
A chatbot sends a short prompt and gets a short answer. An agent does something very different: it loads a codebase, a system prompt, and a tool schema, then loops. Read file, think, edit, run tests, read output, think again. Every turn re-sends the entire accumulated context.
Twenty turns against a 50,000-token context is a million input tokens - for one task. Almost all of it is identical to the turn before. That repetition is what prompt caching bills differently, and it's why two models with the same sticker price can differ 10× on the invoice.
Cached input prices, 2026
| Model | Input /1M | Cached /1M | Output /1M | Cache discount |
|---|---|---|---|---|
| deepseek-flash | $0.15 | $0.003 | $0.60 | 50× |
| deepseek-v4-pro | $0.66 | $0.022 | $1.98 | 30× |
| Haiku 5.5 | $0.10 | $0.01 | $0.50 | 10× |
| gpt-6-luna | $0.10 | $0.01 | $0.50 | 10× |
| Gemini 3 Flash | $0.75 | $0.075 | $3.75 | 10× |
| Sonnet 5.5 | $2.00 | $0.10 | $10.00 | 20× |
| Opus 5.5 | $4.00 | $0.20 | $20.00 | 20× |
| gpt-5.3-codex | $1.75 | $0.175 | $14.00 | 10× |
| grok-4.7 | $2.00 | $0.50 | $6.00 | 4× |
| Fable 5.1 | $10.00 | $0.25 | $50.00 | 40× |
| gpt-6-astra | $10.00 | $1.00 | $50.00 | 10× |
Prices as tracked on October 22, 2026. The live LLM API marketplace has current rates across all 8 providers.
The discount column is the one to read
Note how much the ratio varies independently of the sticker price. Anthropic discounts cached input 20-40×. OpenAI standardises on 10×. xAI only gives 4× - the shallowest on the board, which means grok's competitive $2.00 input price stops being competitive the moment your workload is cache-heavy.
Fable 5.1 is the clearest example of why this matters. At $10/1M input it looks like one of the most expensive models available. But its cached rate of $0.25 is a quarter of gpt-6-astra's $1.00 at the identical headline price. On an agent workload, the "expensive" model is four times cheaper on the dominant cost line.
Worked example: one agent task
A realistic coding task: 50k tokens of context, 20 turns, ~1k output tokens per turn. The first turn pays full input price; the rest hit cache.
| Model | First turn | 19 cached turns | Output | Total |
|---|---|---|---|---|
| deepseek-flash | $0.0075 | $0.0029 | $0.012 | $0.022 |
| Haiku 5.5 | $0.005 | $0.0095 | $0.010 | $0.025 |
| Sonnet 5.5 | $0.100 | $0.095 | $0.200 | $0.395 |
| gpt-5.3-codex | $0.088 | $0.166 | $0.280 | $0.534 |
| Opus 5.5 | $0.200 | $0.190 | $0.400 | $0.790 |
| Fable 5.1 | $0.500 | $0.238 | $1.000 | $1.738 |
| gpt-6-astra | $0.500 | $0.950 | $1.000 | $2.450 |
Run that task a thousand times a month and the gap between deepseek-flash and gpt-6-astra is $22 versus $2,450. Same task, 110× the bill.
Look at the two $10-input models in that table, too. Fable 5.1 and gpt-6-astra have identical headline pricing, and Fable comes out $0.71 cheaper per task - entirely because of the cache rate.
Things that quietly break your cache
Cache discounts only apply on a hit. These are the usual ways to miss:
- A timestamp in the system prompt. Changing one token at the front invalidates everything after it. Put volatile content at the end.
- Reordering tools or context. Caches key on an exact prefix. Shuffled tool definitions are a new prefix.
- TTL expiry. Most caches live ~5 minutes. An agent that pauses for user input pays full price on resume.
- Minimum lengths. Short prefixes often aren't cacheable at all, so small-context agents may never see the discount.
Bottom line
- Cheapest agent workload, by a distance: deepseek-flash at $0.003/1M cached. Nothing else is close.
- Best capable-model value: Sonnet 5.5 - 20× cache discount at a mid-tier price.
- Best frontier-tier value: Fable 5.1 over gpt-6-astra. Same input price, a quarter the cached rate.
- Watch out for: grok's 4× discount. Fine for chat, poor for agents.
- Structure prompts with the stable parts first. It's free money.
Costing out an AI feature?
Tell the Planner your workload shape and it picks the model, estimates the monthly spend, and compares providers on your actual token mix.
Estimate my AI costs →Related: full LLM API pricing comparison for standard input/output rates, and the frontier model price war for how the top tier compares on capability.