DeepSeek API cost explained with peak pricing, cache hits, thinking tokens and errors, plus fixes that cut your bill.
Chapter 2
What One Ordinary Chatbot Really Costs in a Month
Numbers on a pricing page feel small until they meet real traffic. Take one ordinary support chatbot and follow its money for thirty days.
It answers 10,000 questions a day. Every request carries the same 3,000-token system prompt with product rules, plus a 200-token customer question. Each answer is about 400 tokens. It runs on deepseek-flash. That is 32 million input tokens and 4 million output tokens a day.
| Same chatbot, per day | Input cost | Output cost | Per day | 30 days |
|---|---|---|---|---|
| Off-peak, cache never hits | $4.80 | $2.40 | $7.20 | $216 |
| Off-peak, system prompt cached | $0.39 | $2.40 | $2.79 | $84 |
| Peak hours, cache never hits | $9.60 | $4.80 | $14.40 | $432 |
| Peak hours, system prompt cached | $0.78 | $4.80 | $5.58 | $167 |
Now run the same chatbot on deepseek-v4-pro instead of Flash. Off-peak with no cache, input costs $21.12 a day and output $7.92, about $871 for the month. With the system prompt cached, input falls to $1.98 a day and the month to about $297. The model choice alone moves the bill by three to four times, which is why Chapter 1 asks you to prove that a task needs Pro before you pay for it.
Notice how the gaps stack. Pro instead of Flash multiplies by about four. Peak instead of off-peak doubles. A missed cache multiplies the input side by fifty. A team that gets all three wrong can pay more than forty times what a careful team pays for the same answers.
The same code, the same customers and the same answers produce a monthly bill anywhere between $84 and $432. The biggest single lever is the cache. When the 3,000 stable tokens hit, 30 million daily input tokens move from $0.15 to $0.003 per million, and the input bill falls by more than ninety percent.
Look at the output column next. Once the cache works, output becomes most of the bill. That is why the length of answers, and the hidden thinking behind them, decides what you pay after the first fix.
These figures use the official rates in Chapter 1 and simple multiplication. Your own traffic will differ, so build the same small table with your real numbers before you trust any monthly estimate, including your own.
The cheapest token is the one that hits the cache. The next cheapest is the one you never generate.
Chapter 3
Why Your Cache Hit Count Stays at Zero
You send the same 3,000-word system prompt with every request. You expect most of it to bill at the cache-hit rate. The usage log shows prompt_cache_hit_tokens at zero, request after request.
The obvious fix, sending the prompt again, changes nothing. The reason is how the cache decides a match. DeepSeek caches on disk by default and needs no setting, but a request only hits when its beginning fully matches a stored prefix unit. Partial overlaps do not count. A single character that differs near the top turns the whole prompt into a cache miss.
The usual culprit is something dynamic placed early. A timestamp in the system message, a request ID, the user’s name in the first line, or a shuffled list of tools all change the opening bytes. Developers in public troubleshooting threads report the same pattern again and again, zero hits caused by a prefix that is never byte-for-byte identical.
Here is the order that works. First the fixed system instructions, word for word the same every time. Then the long reference material, such as a policy document or product catalogue. Then the tool definitions, always in the same order. Only after all of that comes anything that changes, such as today’s date, the customer’s name and the new question.
Retrieval systems break the cache in a quieter way. If your code pastes the five most relevant document chunks into the prompt, and the order of those chunks changes with every question, the prefix changes too. Put the chunks that never change, such as the product manual, before the chunks that are chosen per question, and sort the chosen chunks in a fixed order such as by document ID.
Multi-turn chats need one more habit. Append each new turn to the end of the history and never rewrite earlier messages. Summarising old turns to save tokens feels efficient, but it changes the prefix and throws away every cached unit behind the edit.
You can test this in ten minutes. Send the same request three times in a row and read the usage object each time. The first call will show mostly miss tokens. The second and third should show most of the stable part as hit tokens. If they do not, print the first two hundred characters of each prompt and compare them side by side, and the changing detail is usually obvious.
The log is the proof. Expect the first one or two requests to miss while the prefix is stored. After that, prompt_cache_hit_tokens should cover most of the stable part. The cache is best-effort and is cleared when unused, usually within hours to days, so a prompt you call once a week may rarely hit. That is a limit to plan around, not a setting you can change.
Chapter 4
When Long Prompts Stop Caching After an Update
Your long-document pipeline cached well for weeks. Then, around mid-October 2026, hit tokens fell sharply on prompts above roughly 256,000 tokens, and costs jumped with nothing changed on your side.
An open GitHub issue in a popular coding-agent project reports exactly this, with request-level numbers, and links it in time to an upgrade of the Flash model served under the same API name. The pricing page today names the model behind deepseek-flash as DeepSeek-V4.1-Flash-1017. The documentation describes the cache as best-effort, and no cause is confirmed there. The pattern is what matters for your budget.
Why would an upgrade touch the cache at all? A cache stores work the model has already done on a prefix. When the model behind a name changes, that stored work may no longer fit the new model, and large prefixes are the most expensive to rebuild. Whatever the exact cause here, the safe assumption is that any version change can reset or weaken caching until you see otherwise in your own numbers.
The real risk is that a model name can stay the same while what sits behind it changes. A pipeline tuned on last month’s behaviour can lose its cache without a single error message, and the first warning is the invoice.
Three habits protect you. First, alert on the ratio of hit tokens to total input tokens, not on cost alone, so a drop shows within a day. Second, where a task allows it, split very long contexts so the stable part stays well inside the range where hits are reliable for you, measured in your own logs. Third, watch DeepSeek’s change log whenever the model version string on the pricing page changes.
A simple daily check is enough for most teams. Divide yesterday’s hit tokens by yesterday’s total input tokens. If the share falls by more than a third from its usual level, stop and look before the month runs on. In the chatbot from Chapter 2, losing the cache for one week adds about $30 off-peak and about $60 at peak.
A model name is a label. The version behind it is what you are billed for.
Chapter 5
AI Powered Business: Become a Millionaire Using AI Agents
The complete architecture manual for founding and scaling AI-driven cash-flow engines with autonomous workflows.
Thinking Tokens and the Bill You Never See
Your answers look short and clean. The output column on the invoice says otherwise. Somewhere between the question and the answer, the model wrote far more than you read.
Both DeepSeek models run in thinking mode by default. Before the final answer, the model reasons step by step, and every one of those reasoning tokens is billed at the output rate. On Flash that is $0.60 per million off-peak, the most expensive column in the table.
Put a number on it. If the chatbot from Chapter 2 thinks for 1,500 tokens before each 400-token answer, its output grows from 4 million to 19 million tokens a day. Off-peak, the daily output bill rises from $2.40 to $11.40, about $270 more over thirty days, for answers the customer never sees.
Thinking earns its cost on hard problems, such as multi-step planning, tricky code or careful reasoning over long documents. It wastes money on simple ones, such as sorting tickets into categories, extracting a field from a form or rewriting a sentence. For those, switch the request to non-thinking mode as described in DeepSeek’s thinking-mode guide.
There is a middle path between all and nothing. Route each request by its job. A small rule in your code can send classification, extraction and formatting requests to non-thinking mode and keep thinking for planning, debugging and long reasoning. Many teams find that most of their traffic is the simple kind, so the saving is large while the hard answers keep their quality.
Test before you switch everything. Run a few hundred real requests in both modes, compare the answers, and keep thinking only where the quality difference is visible. Reasoning tokens also count against the context window, so long multi-turn chats in thinking mode can overflow sooner than you expect.
Chapter 6
Get New eBook Releases, Book Updates & Guides by Email
Receive instant updates when new RamthaMedia eBooks, printed editions, book companion resources, and deep research guides are published — 100% Free.
Old Model Names and the 402 and 429 Errors
A script that ran for months now fails on the first call. Another app works but throws errors at lunchtime. Both look like outages. Neither is.
The first is usually the model name. The current pricing page lists only deepseek-flash and deepseek-v4-pro. Code written for the older names deepseek-chat and deepseek-reasoner should be checked against the model list before anything else, because third-party pricing guides report that those names were retired in July 2026.
The second is the balance. Error 402 means insufficient balance, and it arrives without warning when a prepaid balance runs out. Granted balance is spent before topped-up balance, so a free credit can hide how fast real money is going. Set a low-balance alert and top up before batch jobs, not after they fail.
The third is speed. Error 429 means requests are arriving too fast. The pricing page lists a concurrency limit of 2,500 for Flash and 500 for V4 Pro. Fire too many parallel calls and the extras are refused. Retry with exponential backoff, cap your parallel workers below the limit, and spread batch work across the off-peak hours from Chapter 1, which helps both cost and refusals.
Build these three checks into your deployment, not into your memory. A startup check that calls the model list and fails loudly if your configured model name is missing. A balance check that warns the team when the balance falls below a set number of days of normal spend. A rate check that counts 429 responses per minute and slows the queue before the refusals pile up.
Retries have a cost of their own. A request refused with 429 is not billed, but a retry loop without a limit can turn one slow minute into thousands of repeated calls once capacity returns. Cap retries per request, add a small random delay, and log every refusal so you can see when your traffic pattern, not DeepSeek, is the problem.
Chapter 7
π You May Also Like: Recommended Strategic Guides
- Wonder Dynamics AI Visual Effects Architecture: Cloud VFX Pipelines, CGI Character Replacement, and Studio CapEx Economics
- Razorpay Enterprise Merchant Architecture: Payment Gateways, Automated B2B Settlements, and Corporate Treasury Float Economics
- Runway Gen-3 Alpha AI Video Architecture: Camera Motion Mechanics, Character Continuity, and Commercial Video Production Economics
Search and Fetch, the New Line on the Bill
Your agent got smarter last month. It now searches the web and reads pages before it answers. From 1 November 2026, that habit can show up as its own line on the invoice.
DeepSeek bills its Search and Fetch tools at $0.75 per 1,000 successful requests each. Calls made through DeepSeek Harness, Claude Code or Codex are free for now, and per-request billing for them starts at 00:00 Beijing time on 1 November 2026.
The amounts look small, so count them honestly. An agent that runs one search and two fetches for each of 1,000 tasks a day makes 3,000 tool calls daily. That is about $2.25 a day, or about $68 a month, before a single token is counted.
Agents multiply this quietly because each task can trigger several searches. A research agent that checks five sources for each of 2,000 daily tasks makes 10,000 searches a day, about $7.50 daily or $225 a month, which can be more than the token bill for the same work on Flash.
Fetch has a second cost that is easy to miss. The text of every page the agent reads goes back into the prompt as input tokens, usually fresh ones that cannot hit the cache. A fetched article of 3,000 tokens adds about $0.00045 on Flash off-peak, small once, but repeated for thousands of tasks a day it becomes a steady part of the input column.
Two habits keep this line under control. Cache your own search results for questions that repeat, so the same query is not paid for twice in a day. And let the agent search only when its first answer is uncertain, instead of on every step by default.
Chapter 8
Timing the Work and Knowing When to Look Elsewhere
You now know where the money goes. The last decision is when to run the work, and whether this is the right service for it at all.
For anything that does not need an instant answer, such as nightly summaries, document indexing or test runs, schedule it outside the peak windows. Weekends and Chinese public holidays are fully off-peak. Moving a batch from 9 a.m. to 4 p.m. India time halves its token price with no code change.
Before the month starts, run a five-point check. Is every stable part of the prompt at the front and identical? Is the cache hit share logged and alerted? Is thinking switched off where it adds nothing? Are batch jobs scheduled off-peak? Is there a low-balance alert above one day of normal spend?
Set one number before the month begins, a daily budget. Divide the amount you are willing to spend in a month by thirty, and alert the team when any single day passes that figure by half. A cache that stops hitting, a model left in thinking mode or a retry loop gone wild will all show up within one day instead of at the end of the month.
Keep a short monthly review as well. Compare the four columns from Chapter 1 against last month, note which one grew, and tie that growth to a change in traffic, prompts or model version. A bill you can explain line by line is a bill you can control.
DeepSeek is less suitable if your project needs a guaranteed cache hit rate for its budget, a fixed contract price that never moves by the hour, or predictable behaviour when the model behind a name is upgraded. In those cases a provider with explicit, developer-controlled caching or committed pricing is the shape of tool to look for, even at a higher list price.
If you do move part of the work elsewhere, keep the habits from this book. Stable prompt prefixes, short answers, thinking only where it pays, retries with limits and a daily budget alert lower the bill with almost every API provider, because almost every provider charges more for fresh input and generated output than for repeated input.
If your goal is cheap high-volume text work, stable prompts and off-peak scheduling make DeepSeek one of the lowest-cost options available. If your goal is a predictable monthly number above all, measure the four columns for a month before you commit.
Questions readers actually ask
Is DeepSeek API cost the same at every hour?
No. Peak hours on weekdays cost twice the off-peak rate. The current windows are listed on the official pricing page and should be checked before scheduling large jobs.
Do I need to enable context caching?
No. Disk caching is on by default for every request. You only need to keep the start of your prompt identical so later requests can match it.
How do I see whether my requests hit the cache?
Each response includes a usage object with prompt_cache_hit_tokens and prompt_cache_miss_tokens. Log both per request.
Are thinking tokens charged?
Yes. Reasoning tokens are billed at the output rate, so turning thinking off for simple tasks can lower the bill.
How much can caching save on a typical chatbot?
In the worked example in this book, caching a 3,000-token system prompt cuts the input bill by more than ninety percent, from $4.80 to $0.39 a day off-peak on Flash.
Are Search and Fetch calls free?
They are billed at $0.75 per 1,000 successful requests each. Calls through DeepSeek Harness, Claude Code or Codex are free until per-request billing starts on 1 November 2026.
What does error 402 mean on DeepSeek?
It means the account balance has run out. Top up or check whether a granted balance has been used up.
Can I pay in Indian rupees?
The official prices are listed in US dollars. Check the DeepSeek platform for the payment methods available in your country at the time you top up.