AI
AI API Cost & Pricing Calculator
Calculate and compare AI API costs across OpenAI, Anthropic, Google Gemini, DeepSeek, and more. Supports caching, batch API discounts, pricing overrides, and custom units.
About This Tool
Use this calculator to model and optimize AI API spend before launch. Select a provider and model, configure request volumes, and optimize with prompt caching and batch API discounts.
AI API Cost & Pricing Calculation Formula
Monthly Cost = [Uncached Input Tokens * Input Price + Cached Input Tokens * (Input Price * (1 - Cache Discount))] * (1 - Batch Discount) + [Output Tokens * Output Price] * (1 - Batch Discount)Input and output tokens are priced separately. Prompt caching discounts apply only to the cached portion of input tokens. Batch API discounts apply a percentage discount to the final compiled input and output costs.
How To Model Real AI Spend
Start with request volume, average input tokens, and average output tokens. Then separate repeatable context from unique user content so prompt caching is modeled realistically.
For production estimates, add margin for retries, tool calls, failed requests, evaluation jobs, embeddings, logging, and traffic spikes. A calculator total is a baseline, not a budget ceiling.
Common Pricing Mistakes
Do not price only the prompt. Output tokens often cost more than input tokens and can dominate chat, agent, coding, and summarization workloads.
Do not assume every request gets a cache discount. Cache hit rates depend on provider rules, prompt stability, request timing, and how much context is reused exactly.
Examples
Standard GPT-5 Chatbot Workflow
100,000 requests, 1,000 input tokens, 500 output tokens. No caching or batching.
Result: Based on GPT-5 list price ($2.00/1M input, $8.00/1M output), cost is $200.00 input, $400.00 output, totaling $600.00 monthly.
Optimized Gemini 2.5 Flash Pipeline
10,000,000 requests, 5,000 input tokens (with 60% cached at 75% discount).
Result: Utilizing prompt caching saves substantial budget by charging only 25% of the rate for the 60% cached input tokens.
FAQ
How does prompt caching affect my monthly AI costs?
Prompt caching allows providers to reuse previously processed context (like system instructions or documents). By hitting the cache, you only pay a fraction (e.g. 25% for Claude or Gemini) of the standard input price for those tokens, leading to large savings.
What is the Batch API discount and when should I use it?
Batch API allows you to submit requests that do not require immediate responses (typically completed within 24 hours). Providers like OpenAI give a flat 50% discount on both input and output tokens for using the Batch API.
Can I enter custom enterprise prices?
Yes. Select any model as a preset, then edit the input and output price fields. The calculator will automatically switch to a 'Modified' state, allowing you to model custom discounts or pricing tiers.
References
Important Note
Results are estimates for planning and education. They do not replace financial, tax, legal, or professional advice. Review assumptions before making decisions.