Every major LLM API charges per token, and per-token cost differs between input and output. This is not arbitrary — it directly tracks the compute the provider must spend.
| Model (mid-2026 pricing) | Input ($/1M) | Output ($/1M) |
|---|---|---|
| GPT-4o | $2.50 | $10.00 |
| Gemini 2.5 Pro | $1.25 | $10.00 |
| Claude 3.7 Sonnet | $3.00 | $15.00 |
| Gemini 2.5 Flash | $0.30 | $2.50 |
Why output is 4-10× more expensive than input
Input tokens are processed in parallel during the prefill phase — one big matmul over the entire prompt. Output tokens are produced sequentially, one full forward pass per token through every layer, attending to the entire growing context. Per-token compute is similar; the per-token throughput on shared hardware differs by an order of magnitude. That gap is what the pricing reflects.
Implications for your application: long context is cheaper than long generation. RAG-style "stuff lots of retrieved documents in, generate a short answer" is favorably priced; "stuff a short prompt in, generate a 5,000-token essay" is the expensive shape. When you architect features, understanding this asymmetry shifts which strategies are economic.