Skip to content
ByteMath

How much does prompt caching save on LLM API costs?

Caching 70 % of an 8,000-token prompt at a 90 % discount cuts a $4,725 monthly bill to about $2,457, a 48 % saving at example $3/$15 prices.

Last updated:

Inputs

Cost per month

$2,457.00

Cost per request
$0.01638
Cost per 1,000 requests
$16.38
Cost per year
$29,484
Tokens per month
1,275 M tokens
Share from output tokens
46 %

Results are engineering estimates for planning. Final designs must follow your local code and be checked by a qualified professional.

This scenario at a glance

Input
Requests5,000 per day
Input tokens per request8,000 tokens
Output tokens per request500 tokens
Input price per 1M tokens3 $/1M
Output price per 1M tokens15 $/1M
Share of input served from cache70 %
Discount on cached input90 %
Batch API (50 % off)No (real-time)
Calculated
Cost per month$2,457.00
Cost per request$0.01638
Cost per 1,000 requests$16.38
Cost per year$29,484
Tokens per month1,275 M tokens
Share from output tokens46 %

Engineering notes for this workload

Prompt caching lets an API provider store the processed state of a prompt prefix and reuse it on later requests that start with the same tokens. Cached input is billed at a fraction of the normal price, commonly around 10 %, and responses can start faster because the prefix does not have to be processed again.

This scenario takes the RAG workload from the companion page, 5,000 queries a day with 8,000 input and 500 output tokens, and assumes that 70 % of the input, the system prompt, policies and a stable document set, is identical across requests and served from cache. The effective input price drops from $3 to $1.11 per million tokens, and the monthly cost falls from $4,725 to about $2,457, a saving of 48 %.

Structure prompts for caching. Caches match exact prefixes, so place stable content first and variable content last: system instructions, tool definitions, reference documents, then the conversation and the user's question. A single changed character early in the prompt, such as a timestamp or a user name in the system prompt, invalidates the cache for everything after it.

Understand the provider's rules. Some providers cache automatically above a minimum prompt length; others require explicit cache markers. Cache entries usually expire after a few minutes without use, though some offer longer retention for a fee, and writing to the cache can cost more than a normal input token. Steady traffic keeps the cache warm; bursty or rare requests may not benefit.

Measure, do not assume. API responses typically report how many input tokens were read from cache and how many were written. Log those fields, compute your real cache hit rate per endpoint, and enter it in the calculator to forecast cost accurately.

Caching complements, rather than replaces, reducing prompt size: trimming unnecessary context lowers both cached and uncached costs.

Reference table

Typical token counts by LLM workload
WorkloadInput tokensOutput tokensNotes
Chat turn with system prompt500–2,000150–600History grows each turn
RAG answer3,000–10,000300–800Retrieved chunks dominate
Document summary2,000–20,000200–500Batch-friendly
Classification / tagging100–5001–20Ideal for small models
Coding assistant10,000–50,000500–3,000Large cached context
Agent tool step5,000–50,000200–2,000Many steps per task

Rule of thumb for English: 1 token ≈ 4 characters ≈ 0.75 words. Other languages and code usually need more tokens per word.

Questions about this scenario

What is prompt caching?

A provider feature that reuses the processed prefix of a prompt across requests and bills those tokens at a discount.

How much does prompt caching save?

Here 48 % of the monthly cost, with 70 % of input cached at a 90 % discount. Savings depend on the cache hit rate and output share.

Why is my prompt not being cached?

Common causes are changing content early in the prompt, prompts below the minimum cacheable length, or cache expiry between infrequent requests.