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.

ModelInput / 1MOutput / 1M1M tokens10M tokens100M 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

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.

Rate cards: Claude and GPT