
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.
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.
Common mistakes: mixing planner math with the invoice
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 mind — Read the verified date on the pricing calculator, then confirm batch eligibility and % on the provider docs before you brief finance.
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 mind — Start with 0 cached tokens, then raise the field only for a documented stable prefix (system prompt, tools, pinned context).
×30 assumes every day looks like today. Account discounts, cached-token nuances, failed retries and regional prices never enter this formula.
Keep in mind — Use Per month (30 days) to rank options; reconcile spend on the provider dashboard. The tool will not match the invoice to the cent.
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 mind — Count 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
Rates live in a manually maintained llm-models.json file, reviewed at least monthly. The verified date on the tool reflects that review.
The calculator is an indicative planner for chat/completion-style token bills.
All math and optional token derivation run in the browser. FastMinify does not call provider pricing APIs or upload prompts.
Four USD levers: input, output, batch and cache
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.
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.
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.
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.
Workflow: token counter → pricing calculator → monthly line
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).
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.
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.
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).
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.
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.
Related Articles

RAG, multi-turn agents, system prompts: calculate context-window usage and remaining headroom before calling the API.

Honest guide: uniform tabular data, convert → count → price → context workflow; not a JSON/YAML replacement manifesto.

Before calling an LLM API: count tokens, estimate USD cost and check context-window fit — 100% in the browser without sending your prompt.