What this AI API cost calculator estimates
The calculator estimates text-token charges for one repeatable workload shape. It multiplies monthly request count by average input and output tokens per request, separates cached from uncached input, applies the selected model’s published rate, then adds the optional extra monthly amount. Results are sorted by estimated dollars—not intelligence, latency, reliability, safety, regional availability or success rate.
monthly estimate = requests × ((uncached input × input rate) + (cached input × cache-read rate) + (output × output rate)) ÷ 1,000,000 + extras“Requests / month” is not an ornamental field. Several providers change the rate when a single prompt crosses a context threshold. A workload with ten million monthly input tokens could be ten short requests or one million tiny requests; those shapes may receive different rates. The old version of this page collected request count but never used it, which made that distinction impossible.
Why monthly token totals alone can be wrong
OpenAI’s GPT-5.6 model pages state that prompts above 272,000 input tokens receive a 2× input and 1.5× output multiplier for the full request. Gemini 3.1 Pro Preview publishes different input, cache and output rates above 200,000 prompt tokens. xAI similarly publishes long-context rates from 200,000 tokens for Grok 4.5. The calculator tests the average input tokens per request against those boundaries before multiplying by monthly volume.
An average still hides a distribution. If half your requests contain 5,000 input tokens and half contain 400,000, entering 202,500 as one average can put every request into a tier that only the long half actually reaches. For a serious forecast, split traffic into two or more scenarios and add the totals. Export each one with a descriptive filename or keep the scenario URLs alongside your budget notes.
How cached input is modeled
The cache field represents the share of input tokens that the provider reports as cache reads or hits. Repeated text does not automatically qualify. Cache keys, prefix ordering, minimum token requirements, retention windows and routing behavior differ. Check actual response usage fields before entering a high percentage.
This calculator prices confirmed cache reads using the rate listed by each provider. It deliberately excludes cache writes and storage. That matters: OpenAI GPT-5.6 documents cache writes at 1.25× uncached input, Anthropic publishes separate five-minute and one-hour write multipliers, and Gemini lists cache storage by token-hour. A workload that constantly creates new cache entries can cost more than the simplified read-only estimate. Add a measured cache-write/storage amount under “Extra monthly charges” or build a separate ledger from provider usage exports.
Standard versus Batch processing
Batch is for asynchronous work that can wait for provider scheduling. The comparison only applies a Batch rate where the linked official source publishes one. OpenAI’s GPT-5.6 launch documentation describes Batch and Flex at half the standard API rate; Anthropic publishes 50% Batch input/output rates and says caching multipliers stack; Gemini publishes explicit Batch rows. DeepSeek Batch pricing is not modeled, so those rows show unavailable instead of inventing a discount. xAI’s pricing page says models not named in its discount list receive no Batch discount, so Grok 4.5 remains at the standard token rate.
Cheaper asynchronous processing is not automatically the better architecture. Compare completion window, cancellation behavior, data residency, rate limits, retry semantics and the operational cost of delayed failures. Interactive chat, agents waiting on tools and user-facing autocomplete normally need Standard or priority processing.
Thinking tokens, tools and other missing charges
Provider invoices can contain more than text input and visible text output. Gemini explicitly includes thinking tokens in its output price. Reasoning models from other providers may also bill internal or summarized reasoning through their output token accounting. Use the provider’s reported output usage rather than counting words in the visible answer.
- Server-side search and grounding: may be billed per query, prompt or tool call in addition to tokens.
- Tool schemas and results: often increase input and output tokens even when client-side tool execution itself is free.
- Images, audio and video: can use different token rates, per-second rates or per-image prices; they are outside this text calculator.
- Cache storage and writes: can erase part of the expected cache-read saving.
- Priority, fast or regional processing: can add provider-specific multipliers.
- Cloud marketplaces: Bedrock, Google Cloud, Azure and other resellers can use different regional prices and contracts.
A defensible forecasting workflow
- Measure production or a representative evaluation. Record provider-reported request count, uncached input, cache reads, cache writes, output/reasoning and tool calls. Do not estimate tokens from character count when billing data exists.
- Segment the workload. Separate short chat, long-document processing, agent loops and batch jobs. Their prompt sizes, cache behavior and success rates differ.
- Use accepted results as the denominator. A cheap model that needs more retries or human repairs may have a higher cost per completed task.
- Add non-token charges. Put measured search, storage, media, regional and fixed fees into the extra field or maintain them as separate line items.
- Run sensitivity cases. Compare median, 90th-percentile and worst credible traffic. Cache hit rate and output length often move more than the headline input price.
- Recheck the official page before purchase. Model names, preview status, promotional rates and discounts change. A dated snapshot is evidence of what was reviewed, not a promise that the price remains unchanged.
Why “cheapest model” is not a valid universal answer
The table ranks one arithmetic scenario. It does not test whether models can complete your task. Providers use different tokenizers, so identical text can generate different input counts; Anthropic notes that newer Claude tokenization can produce more tokens for the same text. Models also vary in tool behavior, output efficiency, context use and retry rate. Compare cost per accepted outcome on a fixed evaluation set, not only dollars per million tokens.
Preview models deserve an additional lifecycle penalty in planning. Gemini 3.1 Pro is labeled Preview in the official documentation, which can imply tighter limits and a shorter migration horizon. The badge is visible here so a low estimate is not mistaken for production stability.
Verified standard-rate snapshot
The following values are the same Standard rates loaded by the calculator for 2026-08-02. Prices are USD per one million text tokens. Long-context thresholds, known scheduled rates and exclusions are applied or explained in the interactive table.
| Model | Provider | Input | Cached input | Output | Source |
|---|---|---|---|---|---|
| GPT-5.6 Sol GA | OpenAI | $5 | $0.5 | $30 | Official rate |
| GPT-5.6 Terra GA | OpenAI | $2.5 | $0.25 | $15 | Official rate |
| GPT-5.6 Luna GA | OpenAI | $1 | $0.1 | $6 | Official rate |
| Claude Fable 5 GA | Anthropic | $10 | $1 | $50 | Official rate |
| Claude Opus 5 GA | Anthropic | $5 | $0.5 | $25 | Official rate |
| Claude Sonnet 5 GA | Anthropic | $2 | $0.2 | $10 | Official rate |
| Claude Haiku 4.5 GA | Anthropic | $1 | $0.1 | $5 | Official rate |
| Gemini 3.6 Flash GA | $1.5 | $0.15 | $7.5 | Official rate | |
| Gemini 3.5 Flash-Lite GA | $0.3 | $0.03 | $2.5 | Official rate | |
| Gemini 3.1 Pro Preview Preview | $2 | $0.2 | $12 | Official rate | |
| DeepSeek V4 Flash GA | DeepSeek | $0.14 | $0.0028 | $0.28 | Official rate |
| DeepSeek V4 Pro GA | DeepSeek | $0.435 | $0.003625 | $0.87 | Official rate |
| Grok 4.5 GA | xAI | $2 | $0.3 | $6 | Official rate |
Primary pricing references
- OpenAI API model comparison and token rates
- OpenAI GPT-5.6 Sol model page and long-context rule
- Anthropic Claude API pricing, caching and Batch rules
- Google Gemini Developer API pricing
- DeepSeek API models and pricing
- xAI API token, long-context and Batch pricing
Editorial and implementation review: 2026-08-02. Every built-in row links to the provider source. Arithmetic, tier boundaries, scheduled pricing, serialization and CSV output are covered by deterministic tests in the site build.