AI Running Cost

AI API Cost Calculator: Estimate Monthly Token Spend Across Providers

Compare OpenAI, Anthropic, and Google API pricing side by side. Enter your average request shape and volume, and this calculator ranks each model by projected monthly cost — with input, output, and per-1,000-request breakdowns so you can see exactly where your budget goes.

Last verified: July 2026

Models to compare

All API pricing shown in USD ($) — this is the standard billing currency used by all providers globally, regardless of your location.

ℹ️ Perplexity Sonar models charge both token costs and a per-request fee. Costs shown include both components. Deep Research queries may cost ~$0.41+ per query at typical usage levels.

Your results

At 100 requests/day, you'll use 1.5 million input tokens and 0.9 million output tokens per month.

ModelProviderMonthly costCost per 1K requestsInput costOutput costRequest fee
DeepSeek V4 FlashMost affordable
DeepSeek$0.462$0.154$0.21$0.252—
Gemini 2.5 Flash-Lite
Google$0.51$0.17$0.15$0.36—
GPT-4o mini
OpenAI$0.765$0.255$0.225$0.54—
GPT-5.4 Nano
OpenAI$1.43$0.475$0.30$1.13—
DeepSeek V4 Pro
DeepSeek$1.44$0.4785$0.6525$0.783—
GPT-4.1 mini
OpenAI$2.04$0.68$0.60$1.44—
Sonar
Perplexity$2.40$0.80$1.50$0.90—
Gemini 2.5 Flash
Google$2.70$0.90$0.45$2.25—
GPT-5.4 mini
OpenAI$5.18$1.72$1.13$4.05—
Claude Haiku 4.5
Anthropic$6.00$2.00$1.50$4.50—
GPT-5.6 Luna
OpenAI$6.90$2.30$1.50$5.40—
Grok 4.5
xAI$8.40$2.80$3.00$5.40—
Sonar Deep Research
Perplexity$10.20$3.40$3.00$7.20—
Sonar Reasoning Pro
Perplexity$10.20$3.40$3.00$7.20—
GPT-4.1
OpenAI$10.20$3.40$3.00$7.20—
Gemini 3.5 Flash
Google$10.35$3.45$2.25$8.10—
Gemini 2.5 Pro
Google$10.88$3.63$1.88$9.00—
Claude Sonnet 5
Anthropic$12.00$4.00$3.00$9.00—
GPT-4o
OpenAI$12.75$4.25$3.75$9.00—
Gemini 2.5 Pro (>200k tokens)
Google$17.25$5.75$3.75$13.50—
GPT-5.4
OpenAI$17.25$5.75$3.75$13.50—
GPT-5.6 Terra
OpenAI$17.25$5.75$3.75$13.50—
Sonar Pro
Perplexity$18.00$6.00$4.50$13.50—
Claude Opus 4.8
Anthropic$30.00$10.00$7.50$22.50—
GPT-5.6 Sol
OpenAI$34.50$11.50$7.50$27.00—

Monthly cost comparison

  • DeepSeek V4 Flash$0.462
  • Gemini 2.5 Flash-Lite$0.51
  • GPT-4o mini$0.765
  • GPT-5.4 Nano$1.43
  • DeepSeek V4 Pro$1.44
  • GPT-4.1 mini$2.04
  • Sonar$2.40
  • Gemini 2.5 Flash$2.70
  • GPT-5.4 mini$5.18
  • Claude Haiku 4.5$6.00
  • GPT-5.6 Luna$6.90
  • Grok 4.5$8.40
  • Sonar Deep Research$10.20
  • Sonar Reasoning Pro$10.20
  • GPT-4.1$10.20
  • Gemini 3.5 Flash$10.35
  • Gemini 2.5 Pro$10.88
  • Claude Sonnet 5$12.00
  • GPT-4o$12.75
  • Gemini 2.5 Pro (>200k tokens)$17.25
  • GPT-5.4$17.25
  • GPT-5.6 Terra$17.25
  • Sonar Pro$18.00
  • Claude Opus 4.8$30.00
  • GPT-5.6 Sol$34.50

Perplexity API pricing includes per-request fees in addition to token costs. The $5/month API credit included with Perplexity Pro subscriptions applies to the chat interface only — heavy API usage requires separate prepaid credits purchased through the Perplexity API dashboard.

How we calculate this

This calculator turns four inputs — average input tokens per request, average output tokens per request, requests per day, and which models to include — into a projected monthly bill for each provider. It uses published per-million-token prices from a single JSON file we update as vendors change their rates, so every model on the page is priced from the same source of truth.

For each selected model we assume a 30-day month. Monthly requests are simply requests-per-day multiplied by 30. Monthly input tokens are the average input tokens per request multiplied by monthly requests; the same holds for output tokens. Input cost is monthly input tokens divided by one million, multiplied by the model's input price per million; output cost is calculated the same way with the output price. Total monthly cost is the sum of the two.

We also compute a "cost per 1,000 requests" figure, which is the cost of a single average request multiplied by one thousand. This number lets you compare models independently of your traffic assumptions — it's the same regardless of whether you run 100 or 100,000 requests a day. It's the cleanest way to reason about unit economics when planning a new feature.

Results are sorted cheapest first and the lowest-cost model gets a "Most affordable" badge. The bar chart below the table renders each model's monthly cost as a proportion of the most expensive selected model, so you can eyeball orders-of-magnitude gaps that are easy to miss in a table of numbers. Cheapest is not always best — a model that needs fewer retries or produces shorter output can end up cheaper in practice than a lower per-token price suggests. Treat these figures as a starting budget, not a guarantee.

We deliberately don't estimate quality, latency, or rate limits here. For subscription plans, use the AI Subscription Calculator. For productivity payoff, use the ROI Calculator. This page answers one question: given your traffic and request shape, what will each model actually cost you next month?

All models compared

Reference of every API model in the calculator, with per-million token prices and context window.

ModelProviderInput ($/M tokens)Output ($/M tokens)Context window
Gemini 2.5 Flash-LiteGoogle$0.10$0.40—
DeepSeek V4 FlashDeepSeek$0.14$0.28—
GPT-4o miniOpenAI$0.15$0.60128,000 tokens
GPT-5.4 NanoOpenAI$0.20$1.25—
Gemini 2.5 FlashGoogle$0.30$2.50—
GPT-4.1 miniOpenAI$0.40$1.60—
DeepSeek V4 ProDeepSeek$0.435$0.87—
GPT-5.4 miniOpenAI$0.75$4.50—
Claude Haiku 4.5Anthropic$1.00$5.00200,000 tokens
GPT-5.6 LunaOpenAI$1.00$6.00—
SonarPerplexity$1.00$1.00—
Gemini 2.5 ProGoogle$1.25$10.00200,000 tokens
Gemini 2.5 Pro (>200k tokens)Google$2.50$15.001,000,000 tokens
Gemini 3.5 FlashGoogle$1.50$9.00—
Claude Sonnet 5Anthropic$2.00$10.00200,000 tokens
Sonar Deep ResearchPerplexity$2.00$8.00—
Sonar Reasoning ProPerplexity$2.00$8.00—
Grok 4.5xAI$2.00$6.00—
GPT-4.1OpenAI$2.00$8.00—
GPT-4oOpenAI$2.50$10.00128,000 tokens
GPT-5.4OpenAI$2.50$15.00—
GPT-5.6 TerraOpenAI$2.50$15.00—
Sonar ProPerplexity$3.00$15.00—
Claude Opus 4.8Anthropic$5.00$25.00200,000 tokens
GPT-5.6 SolOpenAI$5.00$30.00—

Frequently asked questions

How are API tokens counted?
A token is a chunk of text — roughly 4 characters or about 0.75 of an English word. Both your prompt (input) and the model's reply (output) are tokenized and billed separately. Providers publish official tokenizers (OpenAI's tiktoken, Anthropic's counter endpoint) so you can measure exactly before you send a request.
Which AI API is cheapest for high volume?
For pure per-token cost at the time of writing, Gemini 2.0 Flash is the cheapest of the mainstream models at $0.10 input and $0.40 output per million tokens, followed by GPT-4o mini. Cheapest isn't always best — for reasoning-heavy work, a more expensive model may need fewer retries and produce shorter output, which can flip the total cost.
What is the difference between input and output tokens?
Input tokens are everything you send to the model: system prompt, chat history, retrieved documents, and the current user message. Output tokens are what the model generates in response. Output tokens are almost always priced higher than input tokens — often 3–5x — so shortening replies has a bigger cost impact than shortening prompts.
How do I reduce my API costs?
Trim prompts and system messages, cap max_tokens on responses, cache frequently reused context (many providers offer prompt caching), pick the smallest model that meets your quality bar, and batch offline workloads if the provider offers a batch API. For chat apps, summarize old messages instead of resending full history on every turn.
Is the API cheaper than a subscription for my use case?
If your monthly API bill for a single user comes in under $20, the API is usually cheaper than a $20/month ChatGPT Plus or Claude Pro subscription — and you get programmatic access. If you're doing typical chat-style usage of 20–50 messages a day, a subscription is often cheaper and simpler. Use this calculator alongside the subscription calculator to compare.