LLM API Cost Calculator
Turn a token count and a traffic guess into a real monthly bill. Set the prompt size, the answer size and how many requests you expect, and every priced model is compared side by side.
تعمل بالكامل داخل متصفحك — ما تكتبه لا يغادر الصفحة.
⚠ لم تُترجم هذه الأداة بالكامل إلى العربية بعد، لذا تُعرض النسخة الإنجليزية. الترجمة قيد التنفيذ.
آخر تحديث للأسعار: ١ فبراير ٢٠٢٥ أسعار قائمة مرجعية، تم التحقق منها في ١ فبراير ٢٠٢٥. لا تشمل خصومات الحجم ولا نقاط المعالجة الدفعية ولا أسعار الساعات غير المزدحمة — تحقق من المزوّد قبل إعداد الميزانية.
التكلفة لكل نموذج
انقر عنوان العمود للترتيب.
| أقصى إخراج | يوميًا | سنويًا | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Gemini 1.5 FlashالأرخصA million-token context at well under a cent per thousand input tokens. | ١٫٠M | ٨٫٢K | ٠٫٠٧٥ US$ | ٠٫٣٠٠ US$ | ٠٫٠٠٠٣ US$ | ٠٫٣٠ US$ | ٩٫٠٠ US$ | ١٠٨ US$ | |
| Mistral AI | Mistral Small 3Open weights under Apache 2.0, but also served per token — both options are costed here. | ١٢٨K | — | ٠٫١٠٠ US$ | ٠٫٣٠٠ US$ | ٠٫٠٠٠٤ US$ | ٠٫٣٥ US$ | ١٠٫٥٠ US$ | ١٢٦ US$ |
| Gemini 2.0 FlashSuccessor to 1.5 Flash at a similar price point. | ١٫٠M | ٨٫٢K | ٠٫١٠٠ US$ | ٠٫٤٠٠ US$ | ٠٫٠٠٠٤ US$ | ٠٫٤٠ US$ | ١٢٫٠٠ US$ | ١٤٤ US$ | |
| OpenAI | GPT-4o miniCheapest OpenAI model for high-volume classification and extraction. | ١٢٨K | ١٦٫٤K | ٠٫١٥٠ US$ | ٠٫٦٠٠ US$ | ٠٫٠٠٠٦ US$ | ٠٫٦٠ US$ | ١٨٫٠٠ US$ | ٢١٦ US$ |
| DeepSeek | DeepSeek-V3 (deepseek-chat)Open weights and very cheap per token; off-peak discounts also apply. | ٦٤K | ٨٫٢K | ٠٫٢٧٠ US$ | ١٫١٠٠ US$ | ٠٫٠٠١١ US$ | ١٫٠٩ US$ | ٣٢٫٧٠ US$ | ٣٩٢ US$ |
| Anthropic | Claude 3 HaikuLegacy budget tier with a large context window. | ٢٠٠K | ٤٫١K | ٠٫٢٥٠ US$ | ١٫٢٥٠ US$ | ٠٫٠٠١١ US$ | ١٫١٣ US$ | ٣٣٫٧٥ US$ | ٤٠٥ US$ |
| OpenAI | GPT-3.5 TurboLegacy small model; tokenizes with cl100k_base, not o200k. | ١٦٫٤K | ٤٫١K | ٠٫٥٠٠ US$ | ١٫٥٠٠ US$ | ٠٫٠٠١٨ US$ | ١٫٧٥ US$ | ٥٢٫٥٠ US$ | ٦٣٠ US$ |
| DeepSeek | DeepSeek-R1 (deepseek-reasoner)Open-weights reasoning model; long chains of thought are billed as output. | ٦٤K | ٨٫٢K | ٠٫٥٥٠ US$ | ٢٫١٩٠ US$ | ٠٫٠٠٢٢ US$ | ٢٫٢٠ US$ | ٦٥٫٨٥ US$ | ٧٩٠ US$ |
| Anthropic | Claude 3.5 HaikuFast tier; long, repeated prompts gain the most from caching. | ٢٠٠K | ٨٫٢K | ٠٫٨٠٠ US$ | ٤٫٠٠٠ US$ | ٠٫٠٠٣٦ US$ | ٣٫٦٠ US$ | ١٠٨ US$ | ١٬٢٩٦ US$ |
| OpenAI | o3-miniSmall reasoning model; reasoning tokens count toward the output bill. | ٢٠٠K | ١٠٠K | ١٫١٠٠ US$ | ٤٫٤٠٠ US$ | ٠٫٠٠٤٤ US$ | ٤٫٤٠ US$ | ١٣٢ US$ | ١٬٥٨٤ US$ |
| Gemini 1.5 ProPrompts longer than 128K tokens are billed at a higher tier than the price shown. | ٢٫١M | ٨٫٢K | ١٫٢٥٠ US$ | ٥٫٠٠٠ US$ | ٠٫٠٠٥٠ US$ | ٥٫٠٠ US$ | ١٥٠ US$ | ١٬٨٠٠ US$ | |
| Mistral AI | Mistral Large 2Mistral does not publish a max-output figure for this endpoint. | ١٢٨K | — | ٢٫٠٠٠ US$ | ٦٫٠٠٠ US$ | ٠٫٠٠٧٠ US$ | ٧٫٠٠ US$ | ٢١٠ US$ | ٢٬٥٢٠ US$ |
| OpenAI | GPT-4oFlagship multimodal generalist; cached input is billed at 50% of the fresh-input rate. | ١٢٨K | ١٦٫٤K | ٢٫٥٠٠ US$ | ١٠٫٠٠٠ US$ | ٠٫٠١ US$ | ١٠٫٠٠ US$ | ٣٠٠ US$ | ٣٬٦٠٠ US$ |
| Anthropic | Claude 3.5 SonnetCache reads are about 90% cheaper than fresh input. | ٢٠٠K | ٨٫٢K | ٣٫٠٠٠ US$ | ١٥٫٠٠٠ US$ | ٠٫٠١ US$ | ١٣٫٥٠ US$ | ٤٠٥ US$ | ٤٬٨٦٠ US$ |
| OpenAI | GPT-4 TurboPrevious flagship generation, and a cl100k_base tokenizer. | ١٢٨K | ٤٫١K | ١٠٫٠٠٠ US$ | ٣٠٫٠٠٠ US$ | ٠٫٠٤ US$ | ٣٥٫٠٠ US$ | ١٬٠٥٠ US$ | ١٢٬٦٠٠ US$ |
| OpenAI | o1Reasoning model: hidden reasoning tokens are billed as output tokens. | ٢٠٠K | ١٠٠K | ١٥٫٠٠٠ US$ | ٦٠٫٠٠٠ US$ | ٠٫٠٦ US$ | ٦٠٫٠٠ US$ | ١٬٨٠٠ US$ | ٢١٬٦٠٠ US$ |
| Anthropic | Claude 3 OpusThe highest output price here — useful as a worst case when planning. | ٢٠٠K | ٤٫١K | ١٥٫٠٠٠ US$ | ٧٥٫٠٠٠ US$ | ٠٫٠٧ US$ | ٦٧٫٥٠ US$ | ٢٬٠٢٥ US$ | ٢٤٬٣٠٠ US$ |
أوزان مفتوحة
- Meta — Llama 3.1 8B· استضافة ذاتية
- Meta — Llama 3.1 70B· استضافة ذاتية
- Meta — Llama 3.1 405B· استضافة ذاتية
- Alibaba — Qwen2.5 72B· استضافة ذاتية
How LLM API pricing actually works
Every major provider bills the same way: two meters, priced per one million tokens. The input meter counts everything you send — system instructions, conversation history, retrieved documents, the user’s question. The output meter counts everything the model writes back. There is no per-request fee and no per-keystroke fee, which is why a short question with a long answer can cost more than a long question with a short answer.
- Input tokens are processed in a single parallel pass, which is comparatively cheap per token.
- Output tokens are produced one at a time, each requiring a read of the model’s memory, so providers price them several times higher than input — usually 3× to 5×.
- Cached input is a discount on the part of the prompt the provider still has in memory from the previous request. It is the largest single lever on a repetitive workload.
- Reasoning tokens on o1/o3/R1-class models are billed as output even though you may never see them, which can multiply the output meter unexpectedly.
The table uses each provider’s published list price and shows the date it was checked. Volume agreements, committed-spend discounts, batch endpoints and off-peak rates all change the real number — confirm with your provider before you commit to a budget.
How to use the calculator
- 1Average input tokens per request. Use the token counter on the text you really send, not on the user’s question alone — long system prompts dominate this number in practice.
- 2Average output tokens per request. Typical chat answers are 200–600 tokens; summaries and generated documents are far longer.
- 3Requests per day. Traffic at the top of your expectation, so the answer is a ceiling rather than an average.
- 4Days per month. 30 is the usual accounting convention; use 22 for a weekday-only internal tool.
- 5Cached input share. The fraction of the prompt that repeats between calls — a fixed system prompt can be 100% cached, a fresh document 0%.
The table then shows cost per request, per day, per month and per year for every model with a published per-token price. Models without one — open-weight releases you host yourself — are listed separately rather than shown as free, because "no API bill" and "no cost" are not the same thing: with self-hosting you pay for GPU hours instead, and the cost moves from the invoice to the infrastructure.
A worked example you can check by hand
Take a support assistant that receives 2,000 input tokens (a long system prompt plus history) and writes 500 output tokens, at 1,000 requests per day. With GPT-4o mini at $0.15 per million input and $0.60 per million output: input costs 2,000 ÷ 1,000,000 × 0.15 = $0.0003, output costs 500 ÷ 1,000,000 × 0.60 = $0.0003, so a request is $0.0006 — a little over half a thousandth of a cent. A day of traffic is $0.60 and a 30-day month is about $18.
Run the identical workload through Claude 3.5 Sonnet at $3.00 per million input and $15.00 per million output instead: input becomes $0.006 and output $0.0075, so a request is $0.0135, a day is $13.50 and the month lands near $405. Nothing changed except the model name — a 22× difference on the same product. That gap is the entire reason this page exists: model choice is a product decision with a price tag, and it is better seen before launch than after.
Prompt caching: the one discount worth engineering for
Most prompts repeat themselves. A fixed system prompt, a style guide, a long document the user is asking about — the same tokens arrive on every request. Providers noticed, and now keep part of that prefix in memory so the second request can skip recomputing it. A cache hit is billed far below fresh input: OpenAI charges half the input rate, Anthropic about a tenth, DeepSeek a similar fraction, and the calculator applies whichever figure the provider publishes.
The effect on the worked example is easy to feel. If 80% of those 2,000 input tokens are a stable system prompt and therefore cached, GPT-4o mini input drops from $0.0003 to $0.00018 per request — a 40% cut in the total request cost, achieved by reordering the prompt so the constant part comes first. That ordering matters: a cache only matches a prefix, so one changing word near the beginning invalidates everything after it.
- Put the stable text first — system instructions and reference documents — and the volatile text last.
- Caches expire, and providers enforce minimum sizes, so short prompts may not benefit at all.
- Only some providers price cache writes separately; where they do, the first request of a session costs slightly more.
Where costs hide in a real product
- Retries and validation loops. A failed JSON parse that triggers a second call is a 100% cost increase on that request, not a 0% one.
- Agent steps. A tool-using loop of eight steps sends the transcript again on every step, so input tokens grow roughly quadratically through the conversation.
- Unbounded output. Asking for "a full report" can produce 4,000 tokens where 400 would have done — and output is the expensive meter.
- Context creep. History that is never trimmed keeps billing the same stale turns over and over.
- Long-context tiers. Some providers charge a higher rate once the prompt passes a threshold — 128K tokens, for example — so a prompt that just crosses the line can cost more than one twice its size.
- Development and evaluation. Benchmarking a feature against fifty test prompts on a frontier model can cost more than a week of production traffic on a small one.
How to choose a model with this table
- 1Sort by monthly cost and note the cheapest three that plausibly pass your quality bar.
- 2Check the context window column against your real prompt size — the cheapest model is useless if your document does not fit, or if the prompt must be truncated to make it fit.
- 3Check the max-output column before you design a feature that generates long documents.
- 4Prototype on the cheapest candidate first. Most tasks that feel like they need a frontier model are solved by a small one with a better prompt.
- 5Re-run the numbers whenever you change the system prompt: a few hundred extra tokens per request multiplies by your traffic, not by your effort.
One caveat worth stating plainly: this page compares list prices. It cannot see your traffic mix, your quality thresholds or the engineering cost of switching providers. Treat the output as a shortlist to argue about, not a decision — and re-check the figures against each provider’s pricing page, which is the link printed next to every model.
الأسئلة الشائعة
- Are these the prices I will actually be charged?
- They are published list prices, checked on the date shown at the top of the table. Volume agreements, committed spend, batch endpoints, off-peak discounts and regional pricing all change the invoice. Use the calculator to compare models and to sanity-check an order of magnitude, then confirm the number on your provider’s pricing page — the link next to every row goes there.
- Why is output more expensive than input?
- Because of how the two are processed. All input tokens are handled in one parallel pass, while output tokens are generated one at a time, and each one needs the model’s attention state read again. Providers therefore price output roughly three to five times higher than input. It is the main reason a feature that generates long text costs far more than one that classifies short text.
- How do I know how many tokens my prompt is?
- Use the token counter on the exact text you send, including system instructions and retrieved context. Guessing from word count is unreliable: the same English sentence is 10 tokens in English and up to 20 in Hindi with the current OpenAI vocabulary, and code is much denser than prose.
- Does prompt caching always make things cheaper?
- Only when the beginning of your prompt repeats and the provider keeps it in cache. Caches expire, some providers charge for the write, and short prompts may fall below the minimum cacheable size. When it applies, it is the single biggest saving available — moving a fixed system prompt to the front of the request often cuts the input bill by 40% or more.
- What about open-weight models like Llama or Qwen?
- They have no per-token price, because there is no API invoice: you pay for GPUs instead. That is why they are listed with a dash rather than a dollar figure. Costing them means estimating VRAM, quantization and hourly GPU rates — a different calculation from the one on this page, and one where long contexts become a memory constraint rather than a billing line.
- Do you store or send my inputs anywhere?
- No. Every calculation happens in your browser with plain arithmetic over a static price table. No number you type is transmitted, logged or shared, and the tool works with JavaScript offline once the page has loaded.
تعلّم هذا في الدورة
هذه الأداة رفيق تطبيقي لهذه المراحل من الدورة المجانية المكوّنة من 11 مرحلة.
أدوات ذات صلة
- AI Token Counter →
Paste any text to see exactly how a language model will split it into tokens — the units that decide what you pay and how much of the context window is left. The counter runs entirely in your browser.