Home/Tools/AI API Cost

REQUEST-SHAPED · CACHE-AWARE · SOURCE-LINKED

AI API Cost Calculator

Estimate monthly text-token spend across current OpenAI, Anthropic, Gemini, DeepSeek and xAI models. Use average tokens per request so long-context tiers are applied to the right workload shape—not guessed from a monthly total.

Estimate boundary: this is not a quote, invoice or model-quality ranking. It covers the published text-token rates listed below. Cache writes, cache storage, web/search tools, files, images, audio, video, data residency, priority tiers, taxes, negotiated discounts and cloud marketplace markups are excluded unless you add them as an extra monthly cost.

Build a monthly usage scenario

Pricing snapshot verified 2026-08-02 · calculations stay in this browser

NO SIGNUP
Load example:

Providers

Filter the comparison without changing the scenario.

Add a custom rate

Custom rates are Standard-only and are not treated as verified provider data.

0requests / month
0total input tokens
0total output tokens
0/0priced models
lowest estimate
Estimated monthly text-token cost. Rate columns are input / cached input / output USD per one million tokens.
ModelRates / 1MInputOutputExtraTotal / monthPer 1K requestsSource & exclusions

Preparing the local comparison.

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

  1. 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.
  2. Segment the workload. Separate short chat, long-document processing, agent loops and batch jobs. Their prompt sizes, cache behavior and success rates differ.
  3. Use accepted results as the denominator. A cheap model that needs more retries or human repairs may have a higher cost per completed task.
  4. Add non-token charges. Put measured search, storage, media, regional and fixed fees into the extra field or maintain them as separate line items.
  5. 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.
  6. 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.

ModelProviderInputCached inputOutputSource
GPT-5.6 Sol GAOpenAI$5$0.5$30Official rate
GPT-5.6 Terra GAOpenAI$2.5$0.25$15Official rate
GPT-5.6 Luna GAOpenAI$1$0.1$6Official rate
Claude Fable 5 GAAnthropic$10$1$50Official rate
Claude Opus 5 GAAnthropic$5$0.5$25Official rate
Claude Sonnet 5 GAAnthropic$2$0.2$10Official rate
Claude Haiku 4.5 GAAnthropic$1$0.1$5Official rate
Gemini 3.6 Flash GAGoogle$1.5$0.15$7.5Official rate
Gemini 3.5 Flash-Lite GAGoogle$0.3$0.03$2.5Official rate
Gemini 3.1 Pro Preview PreviewGoogle$2$0.2$12Official rate
DeepSeek V4 Flash GADeepSeek$0.14$0.0028$0.28Official rate
DeepSeek V4 Pro GADeepSeek$0.435$0.003625$0.87Official rate
Grok 4.5 GAxAI$2$0.3$6Official rate

Primary pricing references

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.