Enter your token counts and request volume to see exact API costs across every major model, ranked cheapest to most expensive.
| Model | Provider | Per Request | Monthly Total |
|---|---|---|---|
Prices as of August 2026. Always verify current pricing at provider documentation. Cached input tokens may be billed at lower rates by some providers.
AI APIs charge separately for input tokens (your prompt) and output tokens (the model's response), both measured per million tokens. The formula is: Cost = (input_tokens × input_rate) + (output_tokens × output_rate). Multiply by your total request count for monthly spend. Input and output rates differ by model — GPT-4o charges $2.50/1M input and $10.00/1M output, meaning output is 4× more expensive. Always account for both when estimating costs.
For high request volumes (100,000+ per month), Gemini 2.0 Flash is typically the lowest cost at $0.10/1M input and $0.40/1M output. GPT-4o mini ($0.15/$0.60) and Claude Haiku 4.5 ($0.80/$4.00) are the next most affordable. However, cost alone shouldn't drive model selection — test output quality on your specific use case first. A cheaper model that requires more retries or produces lower-quality output may cost more in practice.
Prompt caching allows you to mark portions of your prompt (typically the system prompt or reference documents) for server-side caching. On subsequent requests, cached content is read at a lower "cache read" rate — typically 25–50% of the normal input price. Anthropic charges $0.30/1M for cached Claude Sonnet reads vs. $3.00/1M for uncached. OpenAI automatically caches prompts over 1,024 tokens at 50% discount. If your system prompt is 2,000 tokens sent with 100,000 monthly requests, caching can save hundreds of dollars per month.
Output tokens are typically 3–5× more expensive because generating text requires significantly more compute than reading it. During input processing, the model runs a single forward pass to build its internal representation. During output generation, the model runs a full forward pass for each token it generates — hundreds or thousands of sequential operations. This autoregressive generation process is computationally intensive and cannot be parallelized in the same way as input processing. This cost difference is one reason to prefer concise, high-information-density outputs when optimizing for cost.
A typical customer support interaction might involve 800 input tokens (system prompt + conversation history + user message) and 300 output tokens (agent response). Using GPT-5.6 Terra ($2.00 in / $12.00 out per 1M), that's (800 × $0.000002) + (300 × $0.000012) = $0.0016 + $0.0036 = $0.0052 per conversation. At 10,000 conversations per month: ~$52/month. Switching to GPT-5.6 Luna reduces this to approximately $2.60/month for the same volume. The model comparison table can help you identify the right price-performance tradeoff for your use case.
Context window size determines the maximum tokens you can send, not the base rate. Larger contexts don't cost more — you only pay for tokens you actually use. Google Gemini models stand out here with up to 1M token context windows, making them well-suited for processing large documents, codebases, or long conversation histories at competitive prices. The key insight is that context window capacity is free until you use it, so a model with a 1M context window gives you headroom without any upfront cost.
Flagship models (GPT-5.6 Sol at $4/$20 per 1M, Claude Fable 5 at $10/$50 per 1M) are 5–50× more expensive than budget models, but produce dramatically better results on tasks requiring nuanced reasoning, creative synthesis, and complex multi-step execution. For simple tasks — summarization, translation, classification, basic Q&A — the premium is not justified. For high-stakes or complex tasks where output quality directly affects business outcomes, flagship models can be more cost-efficient when you factor in reduced retries, better accuracy, and lower human review overhead. A practical approach: prototype with a flagship model, then evaluate whether a mid-tier model (GPT-5.6 Terra, Claude Sonnet 5) matches its quality for your specific prompts.