To reduce DeepSeek API costs, first find out which workload and which token type are spending the money. Then work through eight levers in order: keep the prompt prefix stable so input bills as a cache hit, move work that can wait into off-peak hours, use deepseek-flash unless a request needs deepseek-v4-pro, set thinking and reasoning_effort per request, cap the output, trim the input, update old model names, and add a router last. On DeepSeek, caching matters more than on most providers. In November 2026 a cache-hit input token on deepseek-flash cost $0.003 per million off-peak, against $0.15 for a cache miss, so a hit costs 2% of a miss.
This is a checklist, not a benchmark. It contains no savings percentage, because the result depends on your traffic. Prices, peak hours, caching behaviour and thinking controls come from DeepSeek's own API documentation as of November 26, 2026. DeepSeek has repriced several times in 2026, so check the [DeepSeek pricing page](https://api-docs.deepseek.com/quick_start/pricing) before you plan around a number.
Where a DeepSeek bill comes from.
DeepSeek bills per token from a prepaid balance, with three token types and two times of day:
| Per 1M tokens (Nov 2026) | deepseek-flash off-peak | deepseek-flash peak | deepseek-v4-pro off-peak | deepseek-v4-pro peak |
|---|---|---|---|---|
| Input, cache hit | $0.003 | $0.006 | $0.022 | $0.044 |
| Input, cache miss | $0.15 | $0.30 | $0.66 | $1.32 |
| Output (answer and thinking) | $0.60 | $1.20 | $1.98 | $3.96 |
Four things set the rate on a given request:
- Cache hit or miss. A hit costs 2% of a miss on
deepseek-flashand about 3% ondeepseek-v4-pro. Caching is on by default and needs no code change. Whether you get hits depends on how you build the prompt. - The hour. Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday, excluding Chinese public holidays. Every other hour bills at half the peak rate, including weekends. The history of this split, and why it raised prices for some workloads, is in Rush-Hour Pricing for Tokens.
- The model.
deepseek-v4-procosts about 4.4xdeepseek-flashon uncached input and 3.3x on output. - Thinking. Thinking mode is on by default at
higheffort. The chain of thought bills as output.
Server-side web search and fetch calls triggered by the model are no longer billed per call since November 18, 2026. The results they return go into the context and bill as input tokens, so a search-heavy agent shows up as input spend.
Step 0: measure before you change anything.
- The `usage` object on every response reports
prompt_cache_hit_tokensandprompt_cache_miss_tokensas well as the output tokens. Log them per request together with the feature that sent it, the model, the thinking setting and the UTC hour. The hour matters on DeepSeek because the same request costs twice as much at peak. - Keys and `user_id`. Concurrency limits apply per account, whichever key you use, so a separate key per workload is for attribution, not isolation. Log your own feature tag next to each request. A chargeback design is in Who Spent the Tokens?.
- Prepaid balance. When the balance runs out, requests fail with HTTP 402 Insufficient Balance. Treat that as an outage, not a budget control, and put your own per-feature limit in the request path, as argued in Spend Caps Are Not Cost Cuts.
If cache-miss input is the largest share, start with levers 1 and 6. If peak-hour traffic is a large share and some of it can wait, start with lever 2. If output is the largest share, start with levers 4 and 5.
The eight levers.
1. Keep the prompt prefix stable
DeepSeek caches prompt prefixes on disk automatically. Its documentation says a later request hits the cache only if it fully matches a stored prefix unit. Units are stored at the end of each request's input and output, at fixed token intervals in long prompts, and wherever the system notices a prefix shared across requests. In practice:
- Put everything that does not change first: system prompt, tool definitions, reference documents, few-shot examples. Put the user's input last.
- Keep that start byte-identical. A timestamp, request ID or reordered tool list near the top breaks the match for everything after it.
- In multi-turn chat, append to the history instead of rewriting it. Request two then fully matches the stored prefix of request one.
- Expect the second request with a new shared prefix to miss as well. DeepSeek detects the common prefix after it has seen it twice and stores it for the third.
- Keep
user_idstable per end user. DeepSeek uses it to isolate the cache per user for privacy, so auser_idthat changes per request also breaks the cache.
Caching is best effort, building a cache entry takes seconds, and unused entries are cleared within hours to days. If prompt_cache_hit_tokens stays near zero on requests that share a long prefix, something near the top of the prompt is changing. Why caching comes first is in The Closest Thing to Free Money.
2. Move work that can wait into off-peak hours
DeepSeek's documentation lists no Batch API. Its discount for flexible work is the off-peak window, which halves every token type. Evaluations, backfills, enrichment, nightly classification and document processing can be queued and released outside 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays. The peak window falls in the European morning and the Asian afternoon, so interactive traffic from those regions pays the peak rate whatever you do. Schedule only the jobs you control. Batch and time-of-day discounts across providers are compared in Half Price, One Day Late.
3. Use deepseek-flash unless a request needs deepseek-v4-pro
Both models have a 1M-token context and support JSON output and tool calls. Flash also takes images, and its concurrency limit is 2,500 against 500 for Pro. Classification, extraction, short summaries and most chat run on Flash. Send a request type to Pro when you have measured that Flash fails on it, and compare cost per completed task rather than per token. In a multi-turn conversation, choose the model at the start, because the cache is per model and a switch re-sends the whole prefix at the miss rate. That cost is worked through in Your Router Is Fighting Your Prompt Cache.
4. Set thinking and reasoning effort per request
Thinking is on by default at high effort on both models, so a team that never set it pays for thinking on every request. On the OpenAI-format API, turn it off with extra_body={"thinking": {"type": "disabled"}}, or keep it on and set reasoning_effort to low, high or max. DeepSeek maps minimal to low and medium to high, so asking for medium does not save anything over high. Disable thinking for lookups, formatting and extraction, and use max only where you have measured that the task needs it.
The history rules differ from other providers. Without tools, earlier reasoning_content is ignored if you send it back, so it does not inflate later turns. With tools, DeepSeek expects the earlier reasoning to be passed back and it is added to the context, so in an agent loop thinking tokens are also billed as input on every later turn. Cross-provider settings are in The Overthinking Tax.
5. Cap and shrink the output
Output costs four times uncached input on deepseek-flash and three times on deepseek-v4-pro, and the maximum output is 384K tokens. Set max_tokens to what the feature needs. Ask for the format you will parse, a label or a JSON object with only the fields you read, and use JSON output so a malformed answer does not cost a retry that pays the full input again. More patterns are in The Expensive Half.
6. Trim the input
A 1M-token context window makes it easy to send far more than the model needs, and every uncached token bills at the miss rate. Send the relevant chunk, not the whole document, and check how many retrieved chunks each query adds, as covered in Twenty Chunks, Three Read. Drop tool definitions the request cannot use. In agent loops, clear old tool results instead of carrying them forward, and watch what web search and fetch add to the context. Trimming inside the cached prefix changes the prefix, so trim when you deploy, not on each request.
7. Update old model names and check prices on a schedule
DeepSeek renames and retires models often. The legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted, but those models are retired and the requests are served by the current Flash model at the Flash price. Code using the older deepseek-chat and deepseek-reasoner aliases needs checking too. Move to the documented names so that what you test is what you pay for. Read the pricing page on a schedule as well. A price table hard-coded in routing logic goes stale without any error, as described in The Cheapest Model in Your Routing Table Just Sent a Warning Shot.
8. Add a router last
Choosing the model and thinking setting in code (levers 3 and 4) works until the request types blur and nobody can say which ones need Pro or max effort. A router helps when traffic is a real mix of easy and hard requests. It does not help when Flash with thinking off already passes nearly everything, which on DeepSeek is common, or when a switch would throw away a warm cache. We published our own negative results in When LLM Routing Does Not Help, and compared the products in How to Choose an LLM Router.
Self-hosting the open weights is a utilization bet.
DeepSeek publishes open weights, so self-hosting is possible. At DeepSeek's API prices it rarely pays: the GPUs have to stay busy to beat $0.15 per million input tokens, and off-peak and cache-hit rates are lower still. Teams usually self-host for data residency or control rather than price. Measure your sustained tokens per minute on the API first. The arithmetic is in Self-Hosted LLM vs API.
Where Nadir fits.
Nadir covers lever 8 and part of lever 4, and on DeepSeek it does that through the decision API.
- Model and effort per request, without moving your traffic. The decision API returns a plan for each request, covering model, reasoning effort, cache and policy, without calling any model provider. Your code then calls DeepSeek with your own key, and DeepSeek bills you directly at its own rates. Nadir starts in shadow mode and returns a receipt for each decision, so you can compare its choices against what you send today before you enforce anything. Nadir costs $0.002 per request, with the first 50 a month free, and takes no markup on model spend.
- The managed proxy does not take DeepSeek keys today. Nadir's OpenAI-compatible proxy at
https://api.getnadir.com/v1executes requests with keys for OpenAI, Anthropic, Google, Amazon Bedrock, xAI, Groq, OpenRouter, Qwen, Kimi and MiniMax. If your requests must run on DeepSeek, use the decision API. Nadir also runs beside an existing gateway, including LiteLLM as the nativenadir/autoprovider.
Nadir does not do levers 1, 2, 5, 6 or 7 for you. Prompt prefix, scheduling, output size, input size and model names are yours to change, and on DeepSeek, where a cache hit costs 2% of a miss, they are usually the larger share of the bill. Nadir publishes no universal savings rate. Measure first, then decide whether a router is worth adding.
The same checklist for the other platforms is How to Reduce OpenAI API Costs, How to Reduce Claude API Costs, How to Reduce Gemini API Costs, How to Reduce Amazon Bedrock Costs, How to Reduce Azure OpenAI Costs and How to Reduce Mistral API Costs. The provider-neutral version is How to Reduce LLM API Costs.
Conclusion.
First find out which workload, which token type and which hour are spending the money. Keep the prompt prefix stable and user_id consistent so input bills as a cache hit. Move work that can wait out of the weekday peak windows. Use deepseek-flash by default, turn thinking off where it adds nothing, cap the output and trim the input. Update old model names and re-read the price page on a schedule. Add a router once the model choice needs to happen without anyone maintaining it by hand.