The only formula you need for v1 text APIs
For standard chat and completion APIs, estimated cost is (input tokens / 1,000,000 × input price per million) + (output tokens / 1,000,000 × output price per million). Do that per model, sort, and you have a comparison. TokenCost runs that formula in the browser from a typed pricing file — no account, no backend, no live scrape.
A token is not a word. English often lands near 100 tokens ≈ 75 words, but code, JSON, CJK text, and newer tokenizers break that rule. The honest workflow is: sample real requests, read usage.prompt_tokens and usage.completion_tokens (or the vendor equivalent), average them, then type those averages here. Guessing from word counts is fine for a back-of-envelope, not for a purchase order.
Input and output are different products. Providers set a higher output rate because generation is more expensive to run. An app that returns long essays will be output-bound; a RAG bot that stuffs 20k tokens of policy text and answers in two sentences will be input-bound. Changing models without changing that shape rarely fixes the bill.
Why two apps with “the same tokens” pay different amounts
Caching: if the same prefix is reused, many APIs bill cache hits far below list input. Batch: asynchronous endpoints are often ~50% off. Routing: some vendors charge more to pin inference to one region. Thinking: reasoning models may emit extra tokens you never show the user but still pay for as output. None of those are in the table math. The disclaimer under the calculator is there so a screenshot does not become a fake invoice.
Image, audio, and video tokens are a different meter. A JPEG sent to a vision model is not priced like 2,000 words of English. This v1 tool is text-in / text-out only. If your production mix is multimodal, treat these numbers as the language slice of the bill.
DeepSeek V4 Flash / Pro are included as low-cost references at official peak cache-miss rates ($0.44 / $1.32 and $1.32 / $3.96). Off-peak is half. Kimi K3 is $3 / $15 cache-miss. MiniMax M3 is $0.30 / $1.20 billed (≤512k, permanent 50% off). GLM-5.3 is Z.ai international USD $1.4 / $4.4; GLM-5.3-Flash is list $0.15 / $0.50. Qwen3.8-Max is converted from official CNY at 7.2 CNY per USD. Grok 4.6 is $2 / $6 under 200k prompt tokens. Mistral Large 3 is $0.50 / $1.50; Medium 3.5 is $1.50 / $7.50. Llama 4 and Nova are Amazon Bedrock OnDemand, not Meta Model API. None of these are OpenRouter blended rates.
A practical way to use this page
Pick the models you actually can call in production — not the whole internet. The calculator opens on a shortlist; use Show all models plus All / OpenAI / Anthropic / Google / Mistral / Amazon / xAI / China to keep the table readable. China is Chinese labs only (Z.ai, Tencent, Xiaomi, Moonshot, MiniMax, DeepSeek, Alibaba). The active filter and shortlist/full toggle are stored in the share URL. Set tokens from logs. Set requests per day from a calm week. Enable monthly projection for a 30-day view.
Cheapest is not best. The highlight on the lowest row is a cost signal. Run quality evals on the same prompts. A Haiku or Flash miss that causes retries can cost more than Sonnet or Pro on the first try. Use this site to bound the money, then let evals bound the model.
For provider-specific write-ups see the OpenAI API cost calculator, Claude API pricing calculator, and Gemini API cost calculator. The full rate dump lives at /pricing for crawlers and for humans who want every row without the narrative.
Frequently asked questions
What is an LLM token cost calculator?
A tool that turns token counts and public per-million prices into an estimated USD cost per request, per day, and per month so you can compare models before you ship.
How many tokens are in a word?
There is no fixed ratio. A common English rule of thumb is ~0.75 words per token, but you should prefer API usage counters. This calculator never converts words to tokens for you.
Which providers are included?
OpenAI (GPT-6 Astra, GPT-5.6 Sol / Terra / Luna, GPT-5.5), Anthropic (Fable 5.1 / 5, Opus 5, Sonnet 5, Haiku 4.5), Google (Gemini 3.8 / 3.7 Flash, 3.1 Pro, 2.5 Pro / Flash), Mistral (Large 3, Medium 3.5), Amazon (Nova Micro / Lite / Pro / Premier / 2 Lite plus Llama 4 Scout / Maverick on Bedrock), xAI (Grok 4.6), Moonshot (Kimi K3), MiniMax M3, Z.ai GLM-5.3 / Flash, DeepSeek V4 Flash / Pro, Alibaba Qwen3.8-Max, Tencent Hunyuan Hy3 / Hy4 preview, and Xiaomi MiMo-V2.5. About 35 SKUs. Filter chips keep the table usable. See /pricing for the full snapshot.
Is the monthly estimate a calendar month?
It is requests per day × 30. February and 31-day months will differ slightly. Scale rpd if you need a different window.