LLM API Pricing Explained: Input, Output, and Cached Tokens
6 min read · Last updated 2026-11-24 · Pricetora Editorial
Understand how token-based API billing works, why output tokens cost 3x–10x more than input tokens, and how cache read/write rates change your effective unit cost.
Why LLM APIs Bill Separately for Input and Output Tokens
Large language model inference happens in two distinct hardware phases. During prefill (input tokens), the entire prompt is processed in parallel across GPU compute cores. During decode (output tokens), tokens are generated sequentially one step at a time, making decode memory-bandwidth bound and far more expensive per token. That is why most providers charge 3x to 10x more per million output tokens than per million input tokens.
The Core Monthly Cost Formula
Pricetora normalizes all text rates into USD per 1 million tokens using exact decimal arithmetic: Monthly Cost = (Uncached Input × Input Rate + Cache Read × Cache Read Rate + Cache Write × Effective Write Rate + Billable Output × Output Rate) / 1,000,000 + Fixed Request Fees. For example (illustrative rates): 10M uncached input tokens at $0.20/1M ($2.00) plus 2M output tokens at $0.80/1M ($1.60) equals $3.60 before taxes or tool fees.
Zero vs Unknown Rates
Never assume a missing pricing field means zero. On Pricetora, $0.00 means a provider has publicly documented a free tier or zero surcharge, while "Unknown" means the rate is undisclosed or not verified for that endpoint. When calculating workloads that rely on prompt caching or batch tiers, always check whether the endpoint publishes those rates explicitly.
Reasoning Tokens: Avoid Double-Counting
Reasoning-capable models generate internal thinking tokens before emitting visible text. Most providers bill those internal tokens at the standard output rate (included in completion tokens), while a few publish a distinct reasoning token rate. In either case, reasoning tokens must be counted once—never added twice on top of total completion tokens.