A single chat call to Flash costs a rounding error. An agent does not make a single call. It makes a chain of them, and on every step it re-sends the system prompt, the full tool schema, and a conversation history that grows with each turn. That structure is why teams stand up an agent on the cheapest model they can find and still open the console to a bill they did not expect. The model was never the problem; the loop was. This is how to build on Flash so the loop stays cheap.
Do the token math once and it changes how you design. Suppose your agent carries a 6,000-token system prompt and 4,000 tokens of tool definitions — modest for a real tool-using agent — plus a history that climbs from near zero to 30,000 tokens over a twelve-step task. Naively, the input you send across those twelve turns runs to a few hundred thousand tokens for a single task, almost all of it the same prefix repeated. At the $0.14 cache-miss rate that is real money at volume. At the $0.028 cache-hit rate it is a fifth of that. The difference between a viable agent product and a leaky one is often just whether that repeated prefix is landing as a cache hit.
So caching is not a nice-to-have for agents; it is the primary cost lever. DeepSeek's cache keys on the prefix of your request, matched from the very first token, and the match has to be exact. The design consequence is simple: put everything stable at the front — system prompt first, then tool definitions, then durable context — and let the volatile parts trail at the end. The API reports prompt_cache_hit_tokens and prompt_cache_miss_tokens in each response's usage block, so you do not have to guess whether your layout is working. Log that ratio per turn from day one; it is the single most useful number for an agent's unit economics.
Most cache misses on agents are self-inflicted, and they cluster in a few habits. Injecting a timestamp or a per-request UUID near the top of the system prompt busts the prefix on every call. So does serializing tool definitions in a non-deterministic order, or letting a JSON library reorder keys between requests. Anything that changes the leading bytes of the prompt throws away the discount for that entire turn. The fix is boring and effective: freeze the prefix, make serialization deterministic, and move anything that must change — the current time, the user turn, retrieved snippets — to the tail of the message array where it cannot poison the cache.
Put concrete numbers on a realistic turn. Take an agent step with 100,000 tokens of cached input and 10,000 tokens of output. On a warm cache that is about 100,000 at $0.028 plus 10,000 at $0.28 per million — roughly $0.0028 for input and $0.0028 for output, call it $0.0056 for the step. The same step cold, at the $0.14 miss rate, is closer to $0.017. Run ten thousand of those a day and the warm path saves you well over a hundred dollars daily on one prompt pattern alone. That is the whole argument for treating cache discipline as an engineering requirement rather than an optimization to revisit later.
Notice which side of the ledger dominates once the cache is warm. Cache-hit input is $0.028 per million; output is $0.28 — a full 10x more. That means the expensive agents are the ones that talk too much: models that narrate every step, dump verbose reasoning into the transcript, or return sprawling JSON when a terse structure would do. Constrain output aggressively. Ask for compact structured responses, cap reasoning length on the steps that do not need it, and keep intermediate tool results out of the model's output path when a summary will carry the loop forward. Output tokens are where an agent's bill actually accumulates.
Routing is the next lever, and the rule is the same one the rest of this site keeps arriving at: Flash by default, Pro on escalation. Classify the step before you spend on it. Planning, tool selection, extraction, summarization, and the great majority of intermediate reasoning are Flash work. Reserve Pro's heavier activation for the steps that measurably fail on Flash — a hard refactor, a subtle multi-constraint judgment, a final answer whose cost of being wrong is high. The Flash-versus-Pro routing page has the task-by-task triggers; the point for an agent is that escalation should be a decision the loop makes deliberately, not a default you pay for on every step.
Reliability quietly doubles token costs if you ignore it, because a retry re-sends the whole prompt. DeepSeek's API is prepaid, and under load you will see 429 rate limits and the occasional 500 or 503. A retry policy that fires blindly can turn one paid request into three, and the tokens bill each time. Back off with jitter, cap retries, and if uptime matters, keep a fallback route ready — OpenRouter lists Flash around $0.089 input and $0.18 output, and for an agent that loses money to failed calls during peak hours, a more robust route can be cheaper in practice than the nominally lower first-party price. Measure failed-request cost, not just headline price.
On the tooling side, OpenClaw makes the default-route decision concrete. You can point it straight at the model with a single launch line — 'ollama launch openclaw --model deepseek-v4-flash:cloud' — which replaces a hand-built gateway config and is currently the fastest way to run Flash as an agent's default. Set your escalation policy at the adapter boundary so the switch to Pro happens in one place rather than scattered through your prompt logic, and design your cache layout there too, so the stable prefix is guaranteed identical on every turn the adapter emits.
One deadline belongs on an agent team's radar specifically. If any part of your stack still calls the legacy deepseek-reasoner alias for its chain-of-thought steps, that ID retires on 2026-07-24 and afterward routes to Flash's default non-thinking mode — which can change an agent's behavior silently, with no error to catch. Move those calls to an explicit Flash thinking mode or to Pro before the cutoff. The migration checklist has the ID mapping and the failure modes worth testing.
None of this is exotic. Freeze your prefix, measure the cache-hit ratio, keep output short, route by difficulty, and retry like you are paying for it — because you are. Do those five things and Flash's price holds all the way from a demo to production traffic. Skip them and you will rediscover, one invoice at a time, that the model was never what made agents expensive.
Sources and publication record
Source material is linked for readers who want to verify the underlying announcement or documentation.