What actually drives an API bill
Per-token rates are the only lever that scales with usage, but they are not the whole bill. Coding agents resend accumulated context every turn, output tokens cost a median of several times the input rate, and caching only pays after a break-even number of hits. The guides below work through each of those with real numbers.
The same workload, priced three ways
Assumes a 3:1 input-to-output token mix at the gateway rates published today, with no caching and no batch discount. The formula is (0.75 × input + 0.25 × output) × total tokens ÷ 1M. Change the mix and the ranking changes, which is why sorting by input price alone misranks output-heavy agents.
| Model | Input / 1M | Output / 1M | 1M tokens | 10M tokens | 100M tokens |
|---|---|---|---|---|---|
claude-sonnet-5 | $1 | $5 | $2.00 | $20.00 | $200.00 |
deepseek-v4-pro | $0.66 | $1.98 | $0.99 | $9.90 | $99.00 |
Browse the other clusters
All 17 guides in this cluster
- Batch API pricing vs realtime gateway rates
- How much Claude Code costs per month — and what actually drives the number
- How to calculate LLM cost without guessing
- How to monitor AI API spend before it becomes a surprise
- How to reduce Claude API cost (eight levers), measured
- Migrating from the OpenAI API to the Claude API
- Output tokens are most of your bill, and the ratio varies by 12×
- Prompt caching: what a cache hit actually costs
- The 4× rule in model pricing
- The thinking tax is not in the multiple
- There is no cheapest model — only a cheapest model for your token mix
- What a coding agent costs per month
- What a month of Aider actually costs
- What a month of Cline actually costs
- What a month of Codex CLI costs
- What hitting the context limit actually costs you
- Why Cursor gets expensive faster than you use it
FAQ
Which rate matters more, input or output?
Output, for most agent workloads. It carries the higher per-token rate, and agent loops generate far more of it than a chat session. A model that looks cheap on input can be the expensive choice for a code-generation loop.
Is there a cheapest model for my workload?
There is only a cheapest mix. Re-ranking the catalogue by a 3:1 input-to-output blend changes the order substantially compared with sorting on the input column, so start from your own token ratio.
Does prompt caching always save money?
Only after enough reuse. A cache hit is cheaper, but the break-even depends on how often the same prefix is sent. The caching guide works out the reuse count per model.
Check the current rate for your model before you commit a workload.