AI API Cost Calculator

Enter your tokens per request and volume to see what any AI model costs per request, per month and per year, and compare the same workload across 24 models.

  • 100% free
  • No sign-up
  • Runs in your browser
  • Add this calculator to your website

    Free for blogs, schools and businesses. Paste the code into your page's HTML; it resizes automatically and has no ads.

    Preview

    Please keep the credit link below the widget. See all free calculator widgets.

  • Updated October 2026 · How we check our tools

Was this tool helpful?

How to use the AI API Cost Calculator

  1. 1Pick a model, or start from a typical use case such as a chatbot or document Q&A.
  2. 2Enter the input and output size of one request in tokens (or words) and how many requests you make.
  3. 3Add the share of input that is cached and whether you use the Batch API, then compare every model below.

How AI API pricing works

AI providers charge per token, a chunk of text of roughly four characters or three quarters of an English word. Every request is billed twice: once for the input (your instructions, documents and chat history) and once for the output the model writes. Output tokens usually cost four to eight times more than input tokens.

Monthly cost = requests × (input tokens × input price + output tokens × output price) ÷ 1,000,000. A chatbot that sends 1,500 tokens and gets 400 back, 1,000 times a day, uses about 45 million input and 12 million output tokens a month.

Four ways to cut your AI bill

  • Prompt caching: repeated system prompts, tool definitions and documents can be cached and are billed at around a tenth of the normal input price on most providers.
  • Batch API: if results can wait up to 24 hours (reports, tagging, evaluations), batch requests are usually 50% cheaper.
  • Right-size the model: budget models handle classification, extraction and short replies at a fraction of the cost of flagship models.
  • Trim the context: long chat histories and full documents in every request add up quickly; send only what the model needs.

Long-context pricing

Some models charge a higher rate for the whole request once the prompt passes a size limit, for example 272,000 tokens for OpenAI's GPT-6 models or 100,000 tokens for Claude Haiku 5.5. The calculator switches to the long-context price automatically when your input is over the limit.

AI API prices compared (October 2026)

Standard pay-as-you-go list prices in US dollars per million tokens. Every model also has its own pricing page with worked examples (see the list below the calculator).

ModelProviderInputOutputCached inputBatchContext
Grok 4.7xAI$2$6$0.5—500K
Qwen3.8 MaxAlibaba (Qwen)$2$6$0.25—1M
Gemini 4 ArgonGoogle$2$10$0.150% off1.05M
Kimi K3.1 ProMoonshot AI$2$10$0.2—1.05M
Claude Opus 5.5Anthropic$4$20$0.250% off1M
GPT-5.5OpenAI$5$30$0.550% off1.05M
Claude Fable 5.1Anthropic$10$50$0.2550% off1M
GPT-6 AstraOpenAI$10$50$150% off1.05M
Command A+Cohere$0.3$1.5$0.15—192K
DeepSeek V4 ProDeepSeek$0.66$1.98$0.022—1.05M
Gemini 3.8 FlashGoogle$0.825$4.13$0.082550% off1.05M
Mistral Large 4Mistral$1.36$4.18$0.14—1.05M
Claude Sonnet 5.5Anthropic$2$10$0.250% off1M
GPT-6.1 SolOpenAI$2$10$0.150% off1.05M
Claude Haiku 5.5Anthropic$0.1$0.5$0.0150% off1M
GPT-6 LunaOpenAI$0.1$0.5$0.0150% off1.05M
Qwen3.8 FlashAlibaba (Qwen)$0.15$0.47$0.016—1M
DeepSeek V4.1 FlashDeepSeek$0.15$0.6$0.003—1.05M
Mistral Small 4Mistral$0.15$0.6$0.01550% off262K
Llama 4 MaverickMeta (open model)$0.1875$0.6525$0.05—1.05M
GPT-5.4 nanoOpenAI$0.2$1.25$0.0250% off400K
Gemini 3.1 Flash LiteGoogle$0.25$1.5$0.02550% off1.05M
Gemini 3.5 Flash LiteGoogle$0.3$2.5$0.0350% off1.05M
GPT-5.4 miniOpenAI$0.75$4.5$0.07550% off400K

Cheapest model in each tier

For a support chatbot (1,500 tokens in, 400 out, 30,000 chats a month):

  • Flagship: Qwen3.8 Max at about $123 a month ($2 input / $6 output).
  • Balanced: Command A+ at about $28.13 a month ($0.3 input / $1.5 output).
  • Budget: Claude Haiku 5.5 at about $8.47 a month ($0.1 input / $0.5 output).

Worked example: what a chatbot really costs

A support bot with a 1,000-token system prompt, 500 tokens of conversation and a 400-token answer sends 1,500 input tokens and receives 400 output tokens per message. At 1,000 messages a day that is 45 million input and 12 million output tokens a month.

On a model priced at $2 input and $10 output per million, that is $90 + $120 = $210 a month. Caching the system prompt (two thirds of the input) at a tenth of the price cuts the input cost to about $36, for roughly $156 in total. Moving the same bot to a budget model at $0.10 / $0.50 brings it to around $10 a month.

Sources & review

Figures last checked in October 2026 against the official sources below. Published pay-as-you-go list prices per million tokens, with prompt-caching, batch and long-context rates. Checked against provider price lists every week.

Results are estimates for general information, not financial, tax or legal advice. How we check our tools

Frequently asked questions

How many tokens is a word?

In English, one token is about 0.75 words, so 1,000 words is roughly 1,300 tokens. Other languages, code and numbers usually need more tokens per word.

Which AI API is the cheapest?

Budget models such as GPT-6 Luna, Claude Haiku 5.5, DeepSeek V4.1 Flash and Qwen3.8 Flash cost around $0.10–$0.15 per million input tokens. The cheapest choice depends on your input-to-output mix, so compare your own workload in the table.

Does the calculator include the subscription price of ChatGPT or Claude?

No. Consumer subscriptions such as ChatGPT Plus or Claude Pro are billed separately from the developer API. This calculator covers pay-as-you-go API usage.

How current are the prices?

Prices are checked against each provider's published list prices and reviewed weekly; the date is shown on the page. Always confirm on the provider's pricing page before committing to a budget.

What is the difference between input and output tokens?

Input tokens are everything you send: instructions, documents, chat history and tool definitions. Output tokens are what the model writes back. Output is priced several times higher because generating text takes more computing than reading it.

Are reasoning or thinking tokens billed?

Yes. Models that think before answering bill their reasoning as output tokens, even when the reasoning isn't shown. Allow for extra output on hard tasks, or lower the model's effort setting.

Is it cheaper to run an open model myself?

Only at high, steady volume. Hosted open models such as Llama, DeepSeek and Qwen are already cheap per token; running your own GPUs adds hardware, power and engineering costs that usually only pay off at very large scale.