LLM API Cost: Batch API, Prompt Caching and Monthly Projection

LLM API Cost: Batch API, Prompt Caching and Monthly Projection

Lower your OpenAI/Anthropic/Gemini bill: estimate input/output, model batch and caching in your calculations — verified rates, 100% local.

21.08.2026
10 min read
Share this article:
llm
pricing
batch-api
prompt-caching
openai
ai
Tutorial

From a token count to a monthly API bill

Input and output tokens are billed at different per-million rates. Counting tokens tells you volume; it does not tell you whether Batch API, prompt caching or call frequency will dominate the invoice. This guide starts where the token counting guide stops: turning counts into USD levers. On FastMinify, the LLM pricing calculator applies a dated llm-models.json table in your browser — it is a planner, not a billing authority. Pair it with the LLM token counter when you still need Exact or Estimate counts. Explore the AI & LLM tools hub for the rest of the cluster.

Separate input vs output USD using (tokens / 1e6) × $/1M
Model a simplified Batch API −50% on the subtotal
Price a cached input slice at 10% of the input rate
Project a 30-day total from calls per day
No prompt uploaded to OpenAI, Anthropic or Google

Common mistakes: mixing planner math with the invoice

Treating −50% batch as your live provider tier

Batch discounts differ by vendor, model and whether the job meets batch constraints. FastMinify's toggle is a flat v1 stand-in so you can see the shape of the saving — not a quote.

Keep in mindRead the verified date on the pricing calculator, then confirm batch eligibility and % on the provider docs before you brief finance.

Entering cached tokens you have never measured

Cache savings only apply to the slice that actually hits cache. If you type 80% cached on a fully unique user prompt, the estimate looks cheap and production will not.

Keep in mindStart with 0 cached tokens, then raise the field only for a documented stable prefix (system prompt, tools, pinned context).

Reading the monthly line as an invoice

×30 assumes every day looks like today. Account discounts, cached-token nuances, failed retries and regional prices never enter this formula.

Keep in mindUse Per month (30 days) to rank options; reconcile spend on the provider dashboard. The tool will not match the invoice to the cent.

Pricing the wrong token counts

A word count or another model's tokenizer will skew USD. Claude and Gemini counts on FastMinify are Estimate-tier (±5–15%), not provider-official.

Keep in mindCount on the target model in the LLM token counter first, then transfer input/output into the pricing calculator.

Honest limits and how to use the numbers

Dated table, not a live price API

Rates live in a manually maintained llm-models.json file, reviewed at least monthly. The verified date on the tool reflects that review.

List rates change on provider sites without notice — re-check before large spend
Account discounts, credits and regional prices are out of scope
Disputes belong on the provider dashboard, not this page
Custom $/1M is the what-if path when you have a contract rate
USD only in v1
What v1 does not model

The calculator is an indicative planner for chat/completion-style token bills.

No embeddings, image, audio or tool-call token rules
No simulation of cache TTL, prefix pinning or provider hit-rate
Batch −50% is not each vendor's published batch matrix
Estimate-tier input counts: ±5–15% — do not budget to the last dollar on Estimate alone
Output tokens stay manual — the paste field does not guess completions
Privacy

All math and optional token derivation run in the browser. FastMinify does not call provider pricing APIs or upload prompts.

Suitable for proprietary prompts and internal specs
No account required to estimate
512 KiB paste cap — split very large exports
Instrument provider usage tokens in production as the source of truth
Hub workflow: token counter → pricing calculator → context window calculator if the prompt also risks overflow

Four USD levers: input, output, batch and cache

Input vs output: two meters, two rates

Providers publish list prices as $ per 1M input tokens and $ per 1M output tokens. FastMinify computes (tokens / 1,000,000) × $/1M locally for the selected model. Completions are often several times more expensive per token than prompts — a short question with a long answer can cost more than a large RAG paste with a one-paragraph reply. Output tokens are not auto-derived in v1: set them from logs or from what you expect the model to generate.

Subtotal = fresh input + cached input + output; Batch API −50% applies to that subtotal
Paste a prompt to derive input tokens via the same countTokensAsync path as the token counter
Exact badge (OpenAI encodings) vs Estimate (±5–15%) for Claude and Gemini
Use number fields when you already have usage from provider logs
512 KiB UTF-8 max per paste on FastMinify AI tools
Batch API: a flat −50% v1 stand-in

Provider batch endpoints trade latency for a lower per-token rate. The calculator's Batch API toggle applies a flat 50% discount on the subtotal (input + output USD before discount). That is a simplified v1 model — not a live scrape of OpenAI, Anthropic or Google batch tiers, eligibility windows or delayed-processing SLAs. Confirm the real tariff and whether your workload qualifies before you lock a budget.

Batch on → Total per call is 50% of the batch-off total
Discount is applied after input/output (and cache) math, on the subtotal
Offline / overnight jobs are typical batch candidates; chat UIs usually are not
Eligibility and actual % live on the provider site — not in this tool
Toggle off to compare interactive vs batch on the same token counts
Prompt caching: 10% of the input rate on the cached slice

Repeat calls that share a stable prefix (system prompt, tool definitions, a pinned RAG corpus) can hit a prompt cache. FastMinify bills the cached input slice at 10% of the model's input rate (90% savings on that portion only). You enter how many input tokens you expect to be served from cache — the tool does not simulate provider cache-hit logic, TTLs or minimum prefix lengths.

Cached input cost uses 10% of the input $/1M; the cached field is clamped so it cannot exceed total input
Remaining fresh input still pays the full input rate
Output tokens are never cached in this v1 model
Stable system prompts are better cache candidates than unique user turns
Treat the field as a what-if — not a guaranteed hit rate
Monthly projection: calls per day × 30

When calls per day is greater than zero, the calculator sets daily USD = Total per call × calls per day, then Per month (30 days) = daily × 30. It is a straight 30-day extrapolation: no weekends, no seasonality, no burst days. Use it to compare models or levers, then reconcile against the provider dashboard.

Example: 10 calls/day → Per month (30 days) = Total per call × 300
Zero calls per day → no Per month line (Total per call still shows)
Compare-all-models uses the same token counts and options across the registry
Custom $/1M overrides exist for contract or what-if rates
USD only in v1 — no VAT, committed-use or regional currency

Workflow: token counter → pricing calculator → monthly line

Step 1 — Get honest input tokens

Open the LLM token counter. Paste the prompt or messages JSON you will send. Pick the same model you will call. Copy the input total (Exact or Estimate badge).

Same countTokensAsync pipeline as the pricing calculator paste field
Exact (OpenAI) vs Estimate (Claude, Gemini) — do not hug Estimate as gospel
API messages mode adds ChatML overhead vs plain text
512 KiB max — split oversized RAG dumps
Tokenizer detail is in the token counting guide linked above
Step 2 — Apply USD levers in the pricing calculator

Open the LLM pricing calculator. Enter input and output token counts (or paste to derive input). Set expected output tokens manually. Toggle Batch API, cached input tokens and calls per day. The verified date on the page is the last table review — not your invoice date.

Cost breakdown: Fresh input tokens, Cached input tokens, Output tokens, Batch API discount, Total per call
Batch API −50% on the subtotal (simplified v1)
Cached slice at 10% of the input rate
Custom $/1M when your contract differs from list rates
Compare all models — same counts, every registry row
Scenario — nightly RAG batch vs interactive chat

You run a 200k-input / 2k-output summarisation 50 times per day. Half of the input is a stable system + corpus prefix you hope to cache. Interactive chat cannot wait for a batch window.

1

Baseline the interactive call

Enter 200k input, 2k output, 0 cached, batch off, 50 calls/day. Read Total per call and Per month (30 days).

2

Add cache on the stable prefix

Set cached input to the prefix size you actually reuse (not 100% of the paste). Watch Cached input tokens in the breakdown — cheaper than Fresh input; output is unchanged. Batch −50% then applies to the whole subtotal, including that already-reduced cached slice.

3

Switch the nightly job to batch

For the non-interactive run, enable Batch API and compare Per month (30 days). Keep batch off for the latency-sensitive chat path — the −50% toggle is a planner, not an SLA.

Conclusion

A useful cost estimate splits input from output, then tests Batch API and prompt-cache levers on counts taken from the target model. FastMinify's pricing calculator does that locally with a dated rate table, a flat −50% batch stand-in, cached input at 10% of the input rate, and a ×30 monthly line. It will not match the invoice to the cent — and that is the point: plan here, reconcile on the provider dashboard. Count tokens first if you still need volume; then price the levers.

Estimate per-call and monthly USD from your token counts

Count on the target model before you price
Treat −50% batch as a v1 shape, not a quote
Raise cached tokens only for a measured stable prefix
Read Per month (30 days) as a straight 30-day line, not seasonality
Check the verified date, then the provider docs, before large spend
Share this article
Share this article: