Back to Home
Glossary

What Is DeepSeek Context Caching?

DeepSeek context caching (also called disk caching) stores the computation for prompt prefixes and reuses it on matching requests, billing cached input at about 1/50 of the normal input price.

Analyze My DeepSeek Usage100% private — data never leaves your browser

How prefix matching works

DeepSeek caches the computation results for prompts starting from the first token. When you send a new request, the system checks whether the beginning of your prompt matches a previously cached prefix. If it does, the cached computation is reused — and you're charged the cache-hit price instead of the full input price.

The critical detail: matching is prefix-based and starts from token 1. Change anything at the beginning of your prompt — even a single character — and the entire cache is invalidated.

The pricing difference

As of September 10, 2026, DeepSeek V4 Flash charges ¥2.00 per million input tokens for cache misses at peak (¥1.00 off-peak), but only ¥0.04 per million for cache hits (¥0.02 off-peak) — a 98% discount. For V4 Pro the ratio is roughly the same: ¥9.00 miss vs ¥0.30 hit at peak. Off-peak, both are halved again.

This makes caching the single biggest cost lever in DeepSeek's billing model. A stable system prompt plus reusable context is effectively free to send, while unique one-off prompts pay full input price.

How to exploit it

Keep system prompts absolutely fixed and placed at the front of every request. Put dynamic content — user queries, timestamps, results — after the reusable prefix. Version prompt changes deliberately and watch the hit-rate trend after each change.

The four usage CSV types make caching visible: input_cache_hit_tokens and input_cache_miss_tokens are exported per request, so you can measure your real hit rate and per-key cache economics from billing data alone.


Frequently Asked Questions

What is the difference between context caching and cache hit rate?

Context caching is the mechanism (storing and reusing prefix computation); cache hit rate is the metric (the share of input tokens billed at the reduced rate). Good prompt structure raises the hit rate, which is how you capture caching's savings.

How much does DeepSeek context caching save?

Cached input is billed at about 1/50 of the uncached input rate — a ~98% discount. On a high-hit-rate workload this can cut total input cost by more than half.

Does changing my system prompt break the cache?

Yes. DeepSeek caching is prefix-based from token 1, so any change at the start of the prompt invalidates the whole cache. Treat prompt changes like code releases and monitor the hit-rate trend afterward.


Dive deeper


Related terms

Recommended Tools We ARE USING

We are using these tools ourselves for Development / Deployment. Check out for more details.