← All posts

Insights

Prompt Caching: When Does Reusing Context Lower AI API Costs?

Prompt caching lowers AI API costs when eligible input is reused enough. Compare cache writes, reads, misses, and total charges before claiming savings.

PRODUCT PERSPECTIVE · API ECONOMICS · NOVEMBER 2, 2026

Prompt caching lowers costs when enough eligible input is reused at favorable rates before the cache expires. Repetition creates an opportunity, not a guaranteed saving. The decision depends on the reusable portion of the request, observed cache hits, applicable charges, and the rest of the workflow.

A product that repeatedly sends the same instructions or reference material may benefit. A workload that changes its input on every call may not. Evaluate the real request pattern before applying a provider’s headline cache discount to the entire API bill.

Read first: the long-context model analysis separates input capacity from useful evidence. This article examines the economics of reusing that input.

Prepared for Token360 on November 2, 2026. Provider behavior is attributed to current official documentation. The numerical example uses invented normalized rates to explain break-even logic; it is not a Token360 price quote, benchmark, or observed saving.

What does prompt caching actually reuse?

Prompt caching reuses eligible input processing, rather than serving a previously generated answer. A shared instruction block or document prefix can be reusable while the current question and output remain different.

Anthropic’s prompt caching documentation describes reuse of prompt prefixes, with automatic placement or explicit breakpoints controlled through its API. It documents cache lifetimes and separate write and read pricing. Those details belong to that service and must not be assumed for every compatible endpoint.

A response cache solves a different problem: it returns a stored answer under an application-defined matching rule. Confusing the two leads to faulty expectations about freshness, identical outputs, and what work the model still performs.

MechanismWhat is reusedWhat to verify
Prompt cachingEligible input processingCache usage and applicable billing categories
Response cachingA stored answerWhether the answer is still appropriate for the request
RetrievalSelection of relevant source materialWhether the selected evidence supports the answer

Which workloads are plausible candidates?

Workloads with substantial stable input and recurring requests are good candidates to investigate. Examples include repeated questions over a shared reference document, an assistant with a stable instruction and tool definition set, or several tasks using the same examples.

The key is the actual reusable input, not merely a familiar topic. Two requests about the same product can contain different prefixes. A timestamp, reordered tool definition, or changing document content may alter the reusable structure depending on the implementation.

Separate stable instructions and reference material from changing questions where the API supports that arrangement. Do not remove relevant fresh information just to improve reuse. A lower bill is not useful if the application starts answering from an obsolete policy.

A stable instruction and reference prefix is shared across requests, while the question changes and a new answer is generated.
Conceptual request structure. Actual eligibility and matching rules depend on the model and service.

Why do similar requests sometimes miss the cache?

A cache hit depends on eligibility and reuse conditions, not semantic similarity alone. Relevant factors can include prefix matching, minimum input length, timing, model selection, and the serving implementation.

Google’s Gemini context-caching guide describes implicit caching and recommends placing large shared content early and sending similar-prefix requests close together. It also distinguishes API and model support. This is a useful reminder to inspect the exact interface rather than treating all caching mechanisms as interchangeable.

Measure misses in the production pattern. A rapid sequence of identical demonstration requests can show that caching is possible without showing that a workload spread across the day will benefit. Likewise, an aggregate hit rate can conceal one high-reuse workflow and another with almost no reuse.

How should you calculate whether caching pays off?

Compare the reusable-prefix cost with and without caching, then add the charges that the comparison leaves out. For a simple write-and-read design, the prefix-only comparison is n × B versus W + (n − 1) × R.

Here, n is the number of requests using the same eligible prefix during its usable lifetime, B is the normal charge for that prefix per request, W is its initial cache-write charge, and R is the charge for each successful read. Assume one write and all subsequent requests hit. Real workloads may require additional writes or have misses.

The formula describes a particular billing pattern, not every provider. If the service uses a different charging model, adapt the calculation. Add any storage or retention charges, changing input, output, tool usage, and other applicable fees before estimating a total bill.

What does a worked example reveal?

Reuse can make caching attractive, while a one-off request can cost more under a write-premium design. Consider a hypothetical prefix costing 1 unit without caching, 1.25 units to write, and 0.10 units to read. These are illustrative normalized charges, not dollars or current model rates.

Requests sharing one prefixWithout cachingOne write, then all hits
11.00 unit1.25 units
22.00 units1.35 units
1010.00 units2.15 units

For ten requests, the calculation is 1.25 + 9 × 0.10 = 2.15 units, compared with 10 units for the repeated prefix without caching. That is a 78.5% reduction in this prefix-only example, not a 78.5% reduction in the application’s bill.

Suppose the unchanged remainder of those ten requests costs another 10 units in both designs. The full illustrative subtotal changes from 20 to 12.15 units, a 39.25% reduction. This second calculation assumes the remainder is identical and excludes any additional cache-management charges. It shows why the share of reusable input matters.

In a hypothetical ten-request example, prefix cost falls from ten to two point one five units; adding ten unchanged units changes the total from twenty to twelve point one five.
Original normalized arithmetic. Neither percentage is an observed saving or a provider quote.

Which measurements make the estimate credible?

Record cache-related usage and actual charges alongside quality and timing. Keep the model, route, request pattern, input construction, and observation window identifiable so another person can understand what was tested.

A practical comparison includes a first request, eligible repeats, and representative requests after a meaningful gap. Change the variable input as the real application would. Use the selected provider’s documented usage fields; do not assume that a generic input-token total separately identifies cached reads.

Report the share of input tokens read from cache as well as the share of requests with any hit, when those quantities are available. A request with a tiny cached prefix is not economically equivalent to one with most input cached. Define the denominator before comparing results.

Reconcile the observed categories with the bill or charge record. The AI API cost management guide provides a broader framework for connecting usage to spending, while the observability guide helps keep workload and request evidence connected.

Can caching improve latency without changing the answer?

Prompt reuse can reduce input-processing work, but measure the latency experienced by the application. It does not remove the work of generating a new output, and it is not an answer-quality improvement by itself.

Compare similar requests and output requirements. A shorter answer can finish faster for reasons unrelated to caching. A streamed application may care about time to first visible content as well as total completion time; a background task may care mainly about end-to-end completion.

Check answer correctness independently. The point of the comparison is to preserve the task while changing how reusable input is processed. If the prompt layout changes during the experiment, that is a second variable worth recording.

What should you verify when using a gateway?

Verify the exact route’s caching support, usage reporting, and commercial treatment. Provider documentation establishes provider behavior; it does not prove that every gateway forwards the same fields or applies the same prices.

Token360 provides enterprise access to text and media models, with model rates negotiable for an engagement. For caching, separately confirm the selected route’s cache behavior and applicable cached-input rate. A volume discount does not establish cache-discount pass-through. Use the model schema and agreed pricing record rather than treating either discount as automatic. About Token360. Token360’s model capability documentation.

If a route change affects reuse, the effective economics may differ from a direct-provider experiment. Validate the configuration the application will actually use. Do not count a provider-side discount twice or substitute an upstream list price for an observed downstream charge.

When should you prioritize another optimization?

Prioritize another change when repeated eligible input is a small part of the workload or another cost dominates. Caching cannot compensate for unnecessary requests, excessive output, or a task that needs repeated correction.

First identify the expensive component. Removing irrelevant context may reduce both ordinary and cached input. Improving task quality may reduce retries. A different workflow may avoid repeating the task altogether. Compare these options using accepted outcomes, not only a lower price for one billing category.

For recurring document work, use the long-context analysis to decide what evidence belongs in the request, then evaluate reuse. The two decisions are complementary: useful input still needs to be useful when cached.

FAQ: What do teams ask about prompt caching?

Does prompt caching return the same answer?

No. It reuses eligible input processing; the model still generates a response to the current request. Returning a saved answer is response caching.

Is every repeated prompt a cache hit?

No. Eligibility, prefix matching, timing, model, and serving rules matter. Confirm hits using documented usage information rather than the similarity of the text alone.

Can a cache write cost more than ordinary input?

Yes, some pricing designs charge a write premium. Evaluate the selected service’s rates and expected reuse instead of assuming the first request is cheaper.

Does a large cache discount apply to the whole bill?

No. It applies to the eligible billing category. Changing input, output, tools, misses, and other charges can make total savings much smaller.

Should I keep outdated content to preserve a cache hit?

No. Update the context when the task requires current information. Cache efficiency should not override answer correctness.

What would count as original evidence for this decision?

A documented comparison of representative requests, cache usage, timing, actual charges, and answer quality on the chosen route. This article supplies a calculation framework, not those test results.

Read next: apply the model evaluation framework to preserve task quality while comparing costs.

Commercial scope reviewed November 4, 2026. Token360 pricing and engagement scope are company-confirmed; individual discounts, capacity commitments and compliance evidence require a written proposal. Token360 enterprise page. Historical test charges remain dated observations, not current universal quotes.

Editorial revision: November 4, 2026. Test dates and dated source snapshots remain as stated in the article.

  • API
  • Prompt Caching
  • Cost Management

Build faster with one AI API.

Use Token360 to call video, image, audio, and text models with one key and one bill.

Get started