How the estimate works
For each request, the calculator splits your input tokens into fresh and cached tokens, multiplies each by the model’s rate, then adds output tokens at the output rate:
cost = (fresh input × input rate + cached input × cached rate + output × output rate) ÷ 1,000,000
Monthly cost is that figure times your request count. When a provider publishes a long-context threshold (for example, Gemini 3.1 Pro above 200K prompt tokens), requests above it use the higher rate.
What the estimate leaves out
- Cache writes. OpenAI and Anthropic charge a premium the first time a prompt prefix is cached. Heavy caching still saves money, but your first requests cost more.
- Tokenizer differences. The same text can be a different number of tokens on different models. Anthropic says its newer tokenizer produces about 30% more tokens than its previous one.
- Reasoning tokens. Thinking or reasoning tokens are billed as output. If you enable reasoning, raise your output estimate.
- Discounts and surcharges. Batch APIs, off-peak hours, priority tiers, data residency uplifts and tool calls such as web search all change the final bill.
New to token pricing? Read how AI API pricing works.