How to Estimate LLM API Cost: Input, Output, Caching and Batching
Model monthly LLM API spend accurately across input/output asymmetries, prompt caching hit rates, and batch discounts.
Updated 2026-11-28
Output tokens usually dominate cost
Most LLM APIs price output tokens 3x to 8x higher than input tokens. Keeping generated responses concise or structured often yields larger cost reductions than trimming short user prompts.
Prompt caching and batch APIs
When requests share a long static system prompt or repository context, prompt caching lowers repeated input token rates dramatically. Offline evaluation or classification jobs that tolerate async turnaround can often use batch endpoints at reduced pricing — always verify current provider terms.