Loading pricing data…

Select Models

Token Inputs

⚙️ Advanced settings

Cost Comparison

ModelProviderInput/MOutput/MTotalvs Cheapest

Monthly & Yearly Cost

Per-call cost
Monthly cost
Yearly cost
🔤 Estimate tokens from text
~0 tokens

LLM Token Cost Calculator — Compare GPT-4o, Claude, Gemini, DeepSeek

TL;DR

A free, browser-based LLM API cost calculator that compares per-1M-token prices across 13 mainstream models (OpenAI / Anthropic / Google / DeepSeek / Qwen / GLM / Meta Llama) in real time. Enter your average input and output tokens, pick from a multi-select chips of models, and get a side-by-side cost table sorted cheapest-first. Toggle USD ⇄ CNY, set daily API call volume, and see monthly + yearly cost projections. For Anthropic models, factor in prompt caching with a configurable cache hit rate. All processing is browser-side — no signup, no API calls, no data leaves your device. Prices are sourced from official provider pages; the top banner shows the last update date.

What Is an LLM Token Cost Calculator?

Definition

An LLM token cost calculator is a tool that, given a model’s per-token pricing and your expected input/output token volume, computes the actual dollar cost of an API call (or batch of calls). It goes beyond the per-token unit price shown on official pricing pages — which is rarely the figure most developers actually make decisions on — by combining three things: per-model pricing, your workload shape (input-heavy vs output-heavy), and volume (daily calls / monthly / yearly).

Why Pricing Differs Across Models

The same 1,000-token prompt + 500-token response can cost $0.0075 on GPT-4o, $0.013 on Claude Sonnet 4.5, $0.00048 on DeepSeek V3, and $0.0005 on Gemini 2.0 Flash. The gap is ~30× between the cheapest and most expensive mainstream APIs as of 2026-08. This calculator lets you see all of them side-by-side without manually visiting 10+ pricing pages.

What This Tool Does NOT Do

This tool is for estimation, not invoicing. It does not call any LLM API, does not have access to your actual billing, and does not factor in enterprise discounts, custom contracts, or volume tiers. Always cross-reference with your provider’s billing dashboard before making budget decisions.

How to Use the Calculator

Step 1 — Select Models

Tick the model chips you want to compare. 5 models are preselected by default (Claude Sonnet 4.5, GPT-4o, Gemini 2.0 Flash, DeepSeek V3, Qwen Turbo) — covers the typical cross-vendor comparison. Click “All” to enable all 13, or “Clear” to start fresh.

Step 2 — Enter Token Counts

Two large number inputs: Input tokens and Output tokens per call. Defaults are 1,000 / 500 (typical chatbot exchange). Quick-add buttons (+1K / +10K / +100K) help with larger prompts. Or use the Token Estimator helper at the bottom to paste a prompt and get a rough estimate.

Step 3 — View the Comparison Table

The right panel updates in real time. The cheapest row gets a green highlight + 🏆 badge. Click any row to expand the breakdown (cache costs for Anthropic, batch discounts for OpenAI/Anthropic, self-hosted estimates for Llama).

Step 4 — Set Volume (Optional, in Advanced Settings)

Click “Advanced settings” at the bottom of the input panel. Enter your daily API call count (default 100) to populate the three big cards at the bottom: per-call cost, monthly cost, yearly cost.

Step 5 — USD ⇄ CNY Currency Toggle

In Advanced settings, toggle USD ($) / CNY (¥). Default rate is 1 USD = 7.20 CNYoverridable by typing a custom rate. The default is intentionally not fetched from any API (zero-network commitment); use your payment provider’s rate for actual transactions.

Step 6 — Anthropic Cache (Optional)

If you selected any Anthropic model (Sonnet 4.5 / Haiku 4.5 / Opus 4.1), a Cache panel auto-expands. Enter your cache hit rate (% of input tokens that hit the cache) and pick cache TTL (5 min default, or 1 hour for 2× write cost). The cache ROI section shows your monthly savings vs no-cache baseline.

Pricing Methodology & Sources

Unit Convention

All prices are quoted in USD per 1,000,000 tokens (i.e., “per $1 of input = 1M tokens at $1/M”). This is the unit used on every official pricing page — the calculator stays in this unit internally for precision, then converts to your selected display currency.

Data Sources

Prices are sourced from each provider’s official pricing page:

The “Prices last updated: YYYY-MM-DD” banner at the top shows when the JSON data file was last refreshed. If your visit is more than 60 days after that date, the banner turns yellow as a soft warning.

What’s In the JSON

Each model entry includes:

  • inputPrice / outputPrice — base per-1M rates
  • cacheWritePrice / cacheReadPrice — Anthropic only (null for others)
  • batchInputPrice / batchOutputPrice — 50% off real-time, async 24h
  • contextWindow — max tokens per call
  • tier — flagship / mini / reasoning / self_hosted

Refresh Cadence

The pricing data is refreshed monthly by main agent (cron-style manual run). Provider pricing pages change every 3–6 months on average — between refreshes you can verify a price by clicking the provider source URL next to any chip in the UI.

Model Comparison: GPT-4o vs Claude vs Gemini vs DeepSeek

Cost Table Snapshot (2026-08)

ModelProviderInput $/MOutput $/MCheapest for…
Gemini 2.0 FlashGoogle0.100.40Ultra-cheap bulk calls
DeepSeek V3DeepSeek0.140.28Cheapest long-context
GPT-4o miniOpenAI0.150.60OpenAI ecosystem, low volume
Qwen TurboAlibaba0.300.60Chinese-language, low cost
DeepSeek R1DeepSeek0.552.19Reasoning, cheap
Claude Haiku 4.5Anthropic1.005.00Fast Anthropic, mid-cost
Gemini 1.5 ProGoogle1.255.00Long context (1M tokens)
GPT-4oOpenAI2.5010.00General multimodal flagship
Claude Sonnet 4.5Anthropic3.0015.00Coding & reasoning flagship
GLM-4-PlusZhipu7.007.00Chinese reasoning
o3-miniOpenAI1.104.40Reasoning, mid-cost
o3OpenAI10.0040.00Reasoning, flagship
Claude Opus 4.1Anthropic15.0075.00Premium Anthropic, max capability
Llama 3.1 405B (self-hosted)MetavariesvariesSelf-hosted: pricing varies by host

Cheapest to Most Expensive Ranking

For a 1,000-input + 500-output token call:

  • Cheapest: Gemini 2.0 Flash ≈ $0.0003
  • +9×: DeepSeek V3 ≈ $0.0005
  • +15×: GPT-4o mini ≈ $0.0005 (tie)
  • Most expensive: Claude Opus 4.1 ≈ $0.0525 (~150× the cheapest)

Use the calculator to see real-time ordering with your workload.

When to Pick Which (Cost vs Capability Matrix)

  • Cheapest no-frills: DeepSeek V3 / Gemini Flash — for bulk classification, embeddings-lite use
  • OpenAI ecosystem: GPT-4o mini for low volume; GPT-4o when multimodal/vision matters
  • Anthropic ecosystem: Sonnet 4.5 for coding/reasoning; enable prompt caching for ≥40% hit rate
  • Long context (≥500K tokens): Gemini 1.5 Pro or self-hosted Llama 3.1 405B
  • Chinese-language: Qwen Turbo (cheapest) or GLM-4-Plus (better reasoning)

OpenAI, Anthropic, Google, DeepSeek Pricing Breakdown

OpenAI (4 models)

  • GPT-4o: $2.50/M input + $10/M output — multimodal flagship, 128K context
  • GPT-4o mini: $0.15/M input + $0.60/M output — 17× cheaper, 128K context
  • o3: $10/M input + $40/M output — reasoning flagship
  • o3-mini: $1.10/M input + $4.40/M output — reasoning entry

Anthropic (3 models + cache)

  • Claude Sonnet 4.5: $3/M input + $15/M output + cache_write $3.75 + cache_read $0.30
  • Claude Haiku 4.5: $1/M input + $5/M output + cache_write $1.25 + cache_read $0.10
  • Claude Opus 4.1: $15/M input + $75/M output + cache_write $18.75 + cache_read $1.50

Google (2 models)

  • Gemini 2.0 Flash: $0.10/M input + $0.40/M output — cheapest mainstream API
  • Gemini 1.5 Pro: $1.25/M input + $5/M output — 1M-token context window

DeepSeek (2 models)

  • DeepSeek V3: $0.14/M input + $0.28/M output — ~18× cheaper than GPT-4o
  • DeepSeek R1: $0.55/M input + $2.19/M output — reasoning, competitive

Chinese (2 models)

  • Qwen Turbo (Alibaba): $0.30/M input + $0.60/M output — cheapest Chinese API
  • GLM-4-Plus (Zhipu): $7/M input + $7/M output — equal pricing, strong reasoning

Meta Llama (1 entry, self-hosted)

  • Llama 3.1 405B: input/output price null (self-hosted); equivalent cost varies by host (AWS p5 ≈ $32/hr → ~$0.001/1M tokens equivalent) — see calculator’s “Custom pricing” option in Advanced Settings for manual override

Monthly & Yearly Cost Estimation

Formula Breakdown

  • Single-call cost = (input/1M × input_price) + (output/1M × output_price) [ + cache components if Anthropic + cache hit ]
  • Monthly cost = single-call × daily_calls × 30
  • Yearly cost = single-call × daily_calls × 365
  • Annual savings = (yearly_most_expensive - yearly_cheapest) across selected models

Worked Example

For 1,000 input + 500 output tokens, 100 calls/day:

  • GPT-4o: $0.0075/call → $22.50/month$273.75/year
  • DeepSeek V3: $0.00048/call → $1.44/month$17.52/year
  • Savings switching GPT-4o → DeepSeek V3: ~$256/year

The savings card below the three cost cards auto-displays the gap between your selected most-expensive and cheapest models.

Anthropic Prompt Caching Cost Savings

Cache Pricing Explained

Anthropic charges 3 distinct prices for cached prompt tokens:

  • Cache write (1.25× base input): paid once when the cache is first created or refreshed
  • Cache read (0.1× base input): paid each time a cache hit occurs
  • TTL choice: 5 min (default) or 1 hour (2× cache_write cost)

If your prompt has an 80% cache hit rate (e.g., a system prompt + RAG context reused across calls), your effective input cost drops from $3/M to ~$0.84/M (assuming write cost amortized over many reads — see disclaimer in the tool).

80% Cache Hit Example (Sonnet 4.5)

  • 1,000 input, 500 output, 100 calls/day
  • Without cache: $0.0105/call → $31.50/month
  • With 80% cache: $0.0083/call (amortized) → **$25.02/month**
  • Savings: ~$6.48/month, ~$78/year

The exact figure depends on your real cache hit rate — adjust the slider in the Cache panel to see live numbers.

Break-even Cache Hit Rate

For Sonnet 4.5 specifically: above ~30% cache hit rate, enabling caching starts saving money. The tool displays your break-even rate based on your actual input volume.

Cache TTL (5min vs 1h)

  • 5 min (default): standard cache_write cost — for short-window reuse (chat sessions)
  • 1 hour (2× cache_write cost): for longer-window reuse (daily batch jobs); only worth it if read count > ~50 per write

USD ⇄ CNY Currency Conversion

Default Rate (7.20)

The default exchange rate is 1 USD = 7.20 CNY, approximately the Q3 2026 level. This is a reference value, not a real-time rate — we deliberately do not fetch live FX rates (zero-network commitment).

Custom Rate

If your actual transactions use a different rate (Wise / Stripe / PayPal all vary slightly), override the input field in Advanced Settings. The conversion factor is used everywhere internally; UI displays update instantly.

Disclaimer

FX rates displayed are reference only. Actual transactions use your payment provider’s settlement rate, which may include fees. Use this tool for estimation, not for invoicing.

Privacy & Data Disclaimer

Zero Network Fetch

This tool does not call any AI API and does not send your inputs to any server. All computation happens in your browser. The price data JSON is fetched once on page load from the same-origin static /data/pricing.json file.

No Signup, No Cookies, No localStorage

  • No accounts
  • No cookies set
  • No localStorage used (your inputs are not persisted across reloads)

Prices Are Reference Only

Prices are verified against official sources at the time of the data file’s lastUpdated field (shown in the top banner). Provider pricing may change without notice. Verify critical pricing decisions on each provider’s official pricing page.

Frequently Asked Questions (FAQ)

Q1. How much does GPT-4o cost per 1M tokens?

GPT-4o costs $2.50 per 1M input tokens and $10.00 per 1M output tokens (as of 2026-08). For a typical 1,000-token prompt with 500-token response, that’s $0.0025 + $0.005 = $0.0075 per call (0.75 cents). At 1,000 calls/day, monthly cost = $225. GPT-4o mini is cheaper at $0.15/M input + $0.60/M output — about 17× cheaper. Use this calculator above to compare GPT-4o with Claude Sonnet, Gemini Flash, DeepSeek V3, and other models side by side.

Q2. What’s the cheapest LLM API in 2026?

As of August 2026, the cheapest mainstream APIs are: ① DeepSeek V3 at $0.14/M input + $0.28/M output (≈ 18× cheaper than GPT-4o) ② Gemini 2.0 Flash at $0.10/M input + $0.40/M output ③ Mistral Small at $0.20/M input + $0.60/M output ④ GPT-4o mini at $0.15/M input + $0.60/M output. Note that price isn’t everything — DeepSeek has slower latency for non-Chinese workloads, and Gemini Flash has tighter rate limits. This calculator lets you toggle all models on/off to find the best price/performance trade-off for your workload.

Q3. Is Claude cheaper than GPT-4o?

No, Claude is roughly 4× more expensive than GPT-4o for typical workloads (as of 2026-08). Claude Sonnet 4.5 costs $3/M input + $15/M output, while GPT-4o is $2.50/M input + $10/M output. However, Claude offers prompt caching that can reduce effective input cost by up to 90% for repeated prompts. With 80% cache hit rate, Claude’s effective input cost drops to ~$0.60/M — cheaper than GPT-4o. This calculator includes an Anthropic cache savings panel that automatically factors in your cache hit rate. Try it above with cache hit rate = 80% to see the real-world cost.

Q4. How do I estimate my monthly LLM API bill?

Multiply: (avg_input_tokens × input_price + avg_output_tokens × output_price) × daily_calls × 30. For example, 2,000 input + 500 output tokens per call × 500 calls/day × 30 days = 30M input + 7.5M output tokens/month. On GPT-4o, that’s 30 × $2.50 + 7.5 × $10 = $75 + $75 = $150/month. On DeepSeek V3, the same workload costs 30 × $0.14 + 7.5 × $0.28 = $4.20 + $2.10 = $6.30/month (24× cheaper). Use the “Monthly Cost” panel above and input your daily call volume to see the exact number.

Q5. Does Anthropic’s prompt caching actually save money?

Yes, dramatically — up to 90% on input cost for repeated prompts. Anthropic charges $3.75/M for cache writes (1.25× base) but only $0.30/M for cache reads (0.1× base). If your prompt has an 80% cache hit rate (e.g., system prompt + RAG context that’s reused), your effective input cost drops from $3/M to roughly $0.60/M. At 1M cached tokens/month, that’s $3,000 → $600 = $2,400/month savings. The cache panel above shows your exact savings based on your cache hit rate and prompt size. Note: cache TTL is either 5 minutes (default) or 1 hour (extended, 2× write cost).

Q6. Should I use OpenAI or Anthropic for production?

It depends on 3 factors: ① Cost — GPT-4o is 20% cheaper than Claude Sonnet 4.5 for non-cached workloads, but Claude wins with caching enabled ② Capability — Claude Sonnet 4.5 scores higher on coding/reasoning benchmarks (SWE-bench 70%+); GPT-4o is faster on multimodal/vision ③ Latency — GPT-4o mini has ~300ms TTFT; Claude Sonnet ~500ms; DeepSeek V3 ~800ms. Use this calculator to compare costs based on your specific token volumes, then weigh capability and latency. For cost-sensitive high-volume workloads, DeepSeek V3 + GPT-4o mini is the typical combo in 2026.

  • AI Image Prompt Builder — build SD/MJ/Flux/DALL-E prompts in one click (the “output-side” twin of this cost tool — estimate both prompt-time and image-time costs together)
  • Claude Skills Template Gallery — 50+ Anthropic Skills YAML templates (pairs naturally with this tool’s Anthropic cache ROI feature)
  • JSON Schema Validator — validate JSON schemas (useful when validating pricing.json schema updates)
  • Markdown URL Slug Generator — slugify titles for prompt or Skill IDs (when building reusable cost calculators in your own tools)
  • dlsome.top Home — browse all developer tools in the dlsome.top ecosystem

Disclaimer

Prices are reference only — sourced from official provider pricing pages (linked in §Pricing Methodology & Sources). Pricing changes frequently (every 3–6 months on average across providers); verify on each provider’s site before making budget decisions. This tool does not call any LLM API and does not have access to your billing data. All computation is browser-side. Tool is not affiliated with any LLM provider.


Last updated: 2026-08-10 · LLM Token Cost Calculator · 13 models · zero-network commitment.