We Value Your Privacy

We use cookies to enhance your browsing experience and analyze site traffic. All calculations happen locally in your browser - we never see or store your data. Learn more in our Privacy Policy

/
/
CalculateYogi
  1. Home
  2. Technology
  3. LLM API Cost Calculator
Technology

LLM API Cost Calculator

Model your monthly LLM API bill across 20 current models. Prices prompt caching, batch discounts and long-prompt surcharges from provider documentation.

Start from a workload

Model and volume

Tokens per request

Split the prompt into the part that repeats on every call and the part that changes. Only the repeating part can be cached.

Cost levers

Caching is an architectural choice; batching is a share of your traffic. Both are priced from provider documentation.

Prices are transcribed from provider documentation read on August 22, 2026 and change without notice. Cache and batch behaviour depends on your traffic pattern; treat this as a planning estimate, not a quote.

Did this calculator solve your problem today?

Contributor

Reviewed by

Last updated: August 22, 2026
SupportI build these free tools with love, late nights, and way too much coffee. If this calculator helped you, a small donation would mean the world to me and help keep this site running. Thank you for your kindness!

Related Calculators

You might also find these calculators useful

Prompt Cost Calculator

Price one LLM API call and compare it across every model

Token Count & Word Converter

Convert words, pages or code to tokens — exact for OpenAI models

Context Window Calculator

See whether your prompt fits an LLM context window

AI Inference Cost Calculator

Compare self-hosted GPU vs API inference costs

What your LLM API bill will actually be

Multiplying tokens by a published rate gives you the price of one call, not the size of your invoice. Three mechanics decide the invoice, and all three are published: prompt caching, which bills a repeated prefix at a fraction of a fresh one; batch processing, which halves the rate for anything that can run asynchronously; and the long-prompt surcharge, which re-prices an entire request once the input crosses a threshold. This calculator prices all three from provider documentation, and it will tell you when caching is the wrong choice.

How an API bill is built

Every request bills input tokens and output tokens at different rates. If part of the prompt is identical every time — a system prompt, tool schemas, a pinned document — a cache can serve it at 0.1x the input rate on OpenAI, Anthropic and Google, 0.25x on xAI and about 0.03x on DeepSeek. But writing the cache costs 1.25x a fresh token, and the entry expires: 30 minutes on OpenAI's current models, 5 minutes on Anthropic's default. Below roughly one request per expiry window you pay a write every single time, and caching becomes more expensive than not caching.

Monthly bill

How to use this calculator

1

2

3

4

5

Common use cases

Budgeting a launch

Turning an expected request volume and prompt shape into a monthly figure you can put in a plan, before any traffic exists.

Deciding whether to cache

Finding the request rate at which a prompt cache starts paying for itself on your model, instead of assuming a flat 90% saving.

Sizing a batch pipeline

Costing an overnight classification or enrichment job at the 50% batch rate against running the same work synchronously.

Choosing between providers

Comparing the identical workload — same tokens, same volume, same levers — across every current model rather than comparing headline rates.

Why the levers matter more than the rate

A repeated prefix dominates a chat bill

A support bot sending a 2,400-token system prompt with 250 new tokens per turn spends about 90% of its input budget re-sending the same text. Caching that prefix is usually the single largest saving available, and it needs no model change.

Caching can lose money, and only volume decides

Below the break-even the cache expires between requests, so every call pays the 1.25x write instead of the 0.1x read. This calculator computes the break-even in requests per day for your model and says plainly when to leave caching off.

Batch halves the rate for work that can wait

OpenAI, Anthropic and Google all publish a 50% batch discount. Classification, enrichment and summarisation backfills rarely need a synchronous answer, so the share of traffic you can defer is a direct multiplier on the bill.

One long request can re-price a whole session

Above 272,000 input tokens OpenAI bills 2x input and 1.5x output — and keeps doing so for the rest of the session. Google and xAI step up at 200,000 for the oversized request only. A flat per-token estimate is wrong for exactly the large-context work people size in advance.

Frequently asked questions

The prompt cost calculator prices one call. This one prices a month, which is a different calculation because it has to account for a prefix that repeats across calls, a share of traffic that can be deferred to a batch endpoint, and a threshold that re-prices whole requests. Use that one to compare rates; use this one to budget.

When requests arrive more often than the cache expires. A cache read costs about a tenth of a fresh input token, but writing the cache costs 1.25 times a fresh one, and the entry lives 30 minutes on OpenAI's current models or 5 minutes by default on Anthropic's. Anthropic states the 5-minute cache pays off after a single read. Below roughly one request per window every call pays a write, and caching costs more than doing nothing.

Anthropic documents that they do, and states the multipliers combine. The other providers do not publish a statement either way, so this calculator applies the batch discount to the whole per-request cost including cache lines and says so here rather than quietly assuming. If that matters to your budget, price the batch share at zero and treat the result as the conservative figure.

Because a month here is 365 divided by 12, or about 30.4 days, rather than a flat 30 days. Using 30-day months for the monthly figure and 365 days for the yearly one makes the two disagree by 1.4%, which is the kind of discrepancy a reader finds by multiplying and then stops trusting the page.

No, and it deliberately does not offer them. Embeddings are billed input-only at a completely different rate — around 0.02 US dollars per million tokens against 0.20 or more for a chat model — so pricing them with a chat rate overstates the bill by an order of magnitude. Fine-tuning adds training cost plus a higher inference rate. Both belong on their own pages.

DeepSeek is the only provider here that prices by clock time. Its published off-peak rates are half the peak rates, with peak hours running 01:00 to 04:00 and 06:00 to 10:00 UTC. The catalogue stores the off-peak figure, so a DeepSeek row is right for a nightly job and half of what a daytime interactive workload pays.

CalculateYogi

The most comprehensive calculator web app. Free, fast, and accurate calculators for everyone.

Calculator Categories

  • Math
  • Finance
  • Health
  • Conversion
  • Date & Time
  • Statistics
  • Science
  • Engineering
  • Business
  • Everyday
  • Construction
  • Education
  • Technology
  • Food & Cooking
  • Sports
  • Climate & Environment
  • Agriculture & Ecology
  • Social Media
  • Other

Company

  • About
  • Contact
  • Contributors

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy

© 2026 CalculateYogi. All rights reserved.

Sitemap

Made with by the AppsYogi team