What DeepSeek’s API won’t tell you
Notes from building px: cache hits at 2% of a miss, a model that spent its whole output budget thinking, images that vanish, and the $16 day that taught me to price a sweep before running it.
Before I wrote px, my DeepSeek-native coding agent, I spent a day probing DeepSeek’s API to find out what it actually does. Most of what mattered was invisible in the responses. This is what I found, and what each finding turned into.
The cache is the price
On the flash model a cache hit costs $0.003 per million input tokens and a miss costs $0.15: a hit is 2% of a miss. An agent re-sends its whole conversation every turn, so the cache hit rate is most of the bill. The cache matches exact bytes in 128-token steps, and the response won’t tell you when you broke it: prompt_tokens stays the same either way.
That became px’s design. The prompt prefix is assembled byte by byte, frozen and hashed, and px checks every turn for a cache break the API won’t report. In its reference session the hit rate is 86%. One changing value leaking into the prefix took it to 25%.
Thinking can eat the whole answer
I gave V4 Pro a prompt with max_tokens at 4,096. It spent all 4,096 on reasoning and returned empty content: no error, just nothing. On high reasoning effort the same kind of call took 305 to 390 seconds. Flash with thinking off answered the same prompt in 6.9 seconds.
So in px thinking is off by default. When a hard question needs reasoning, it goes to a separate, short conversation with a large output budget.
Images vanish
DeepSeek’s Anthropic-compatible endpoint accepts images in a request and silently drops them. The model answers as if there were no image. If your agent sends screenshots, check that the model actually sees them.
Silence is the pattern
Every finding above failed silently: a broken cache with the same token counts, an empty answer with no error, a dropped image, and model names that quietly alias to something else. (My local model server does the same thing: ask for a model it doesn’t have and it serves whatever is loaded.) That’s why px has a doctor command that re-probes these behaviours against the live API, and why I don’t trust a cost number I haven’t measured recently.
The $16 day
The day I set this up cost about $16 across providers, $5.94 of it DeepSeek. Almost none of that was px: every px run that day together cost $0.0083. Most of it was research subagents, and one probing sweep made about 900 calls.
The fixes were boring and they worked: a $1 daily cap on px, a cap on output tokens, and a rule that any fan-out of live API probes states what it will cost before it runs.
I also tried dsh, an existing DeepSeek harness with web, terminal and headless front ends, and ran it with reasoning off. General-purpose harnesses treat the provider as an interchangeable text endpoint. Everything above is why px treats DeepSeek’s behaviour as the design input instead.