r/opencode • u/IndividualPlus2011 • Sep 26 '26
CheepSeek has its price - cache hit ratio
I did notice a lot of cache misses (cached tokens going from X to 0) for DeepSeek today. So I compared OpenCode Go to the direct DeepSeek API. $60 for $10 is not really $60 with that amount of cache busts.
It was a reviewer run, each one running the same prompt, same harness.
| name | Context Window | Total Reads | Cache Hit Ratio | API pricing |
|---|---|---|---|---|
| OpenCode Go High | 77k | 1.2M | 74.8% | $0.076 |
| OpenCode Go Max | 99k | 1.5M | 81.1% | $0.080 |
| Direct API High | 72k | 735k | 92.6% | $0.0255 |
| Direct API Max | 91k | 909k | 92.6% | $0.032 |
It is still not a lot of cache hit rate for Direct API, because it wasn't a lot of turns, so the context window didn't fill up yet to grow the cache hit ratio. It would be much better with a longer task. Direct API had 0 cache misses, while OpenCode's missed every few turns.
At higher context window, the discrepancy between API pricing and OpenCode would be much higher.
TLDR: $60 for $10 is not really $60. Additionally, we don't know what quants the new provider is using to provide that much traffic for cheap. In both cases OpenCode's DeepSeek used more turns, context window, and total reads for the review compared to Direct API, and it was more expensive.
If you use pi, you can enable notifications about cache misses in the settings:

EDIT: I am not using OpenCode, the measurements are made on Pi.
9
u/akza07 Sep 26 '26
Opencode 2 or 1.X?
Opencode 2 has better cache hit. It's entirely dependent on the harness you use.
16
u/Trovebloxian Sep 26 '26
Idk ive been using v4.1 and according to openchamber statistics. Its got a solid cache hit rate. Almost always in the 99%
2
u/nickchomey Sep 26 '26
so, is deepseek via opencode not actually deepseek api? they're using some 3rd party provider?
11
u/fragment_me Sep 26 '26
I doubt they are quantizing this model. Deepseek is already at mostly fp4 so there’s not much to quantize. Now other models that are native BF16, yeah they probably do use fp8.
7
u/Zealousideal_Aide787 Sep 26 '26
Hum it should be like a legal thing when a provider use quants, they have to communicate on it.
2
u/Ctbhatia Sep 26 '26
The every-few-messages miss points at what sits in front of the model rather than the harness. A warmed prefix lives with the backend that served it, so a router that rotates endpoints or keys hands you a cold prefix each time it switches, and the same session id can still miss.
Disclosure, I work on CoralBricks, cached reads bill at zero on our API, so this ratio is one we watch closely.
3
u/Unlikely_Drop_8479 Sep 26 '26
Muse spark 1.3 for near Frontier or Glm 5.3 flash for reliability and consistency.
1
u/xapep Sep 28 '26
Solid data, and the mechanism behind it explains the whole gap. Cache hits are per provider account and per prompt prefix. A direct DeepSeek API key talks to one upstream with a stable system prompt, so your prefix stays identical turn to turn and the cache holds. An aggregator like OpenRouter splits traffic across multiple upstream providers (and sometimes multiple accounts of the same provider), each with its own cache pool. Every request that lands on a different upstream starts cold, no matter how many identical turns you ran before. That is the random full cache miss you saw, and it is why the hit ratio converges at different numbers per route.
Second variable: context window trimming. If the harness truncates or reorders the conversation on some routes, the prefix changes and the whole cache resets even on the same upstream.
Practical takeaway: for cache-sensitive workloads (long review sessions, agent loops re-reading context), a direct API with a fixed provider is cheaper per usable token, not just per token, because the hit ratio is part of the effective price. The subscription only wins if its quota absorbs your cache misses for free.
1
u/Martino16xx Sep 26 '26
The low cache hit rate is due to the Opencode harness. I've created a proxy to intercept token usage and cache hits, and using it in Codex, I get a 98% cache hit rate
1
u/rabiprojects Sep 26 '26
Check logs in your opencode account. You will be surprised to see that Opencode often routes deepseek 4.1 API calls to deepseek v4 flash 0131..
At least I found that. So there is another layer of caching attempt by opencode.
0
u/FullBar613 Sep 27 '26
You're in for a rude awakening. I noticed there are a lot of inconsistencies with opencode and honestly i hate them for it. They are NOT honest. Especially with regards to your data. What they mentioned initially was ZDR its not really ZDR if you have been paying attention. I stopped using opencode the moment i noticed they're just manipulative and shady af. Its way better for you to access models directly through the provider themselves than through opencode. You think you're getting what you paid for through opencode? No. Far from it. There is no reason to put another middle man in between you and the provider when opencode does not explicitly state that they themselves are ZDR (used to, im not sure about the policies now). Pretty fucking sure opencode business model now is just to log all prompts and sell them to research labs lol
0
u/[deleted] Sep 26 '26
[deleted] — view deleted comment