DeepSeek context window: its size and how to use it without overpaying
The window size of current DeepSeek models in Zukko, how it differs from the answer length, and how to measure a request in advance and price it without surprises.
5 min · · models · экономия
The question "what is DeepSeek's context window" looks simple but has two layers: how many tokens the model can hold at all, and how much you will pay if you actually use it. Below are the figures for the current DeepSeek models in Zukko, a way to measure a request in advance and a price calculation for a long request.
What a context window is
The context window is the maximum number of tokens a model takes into account in a single request. It includes all messages you send (the system instruction, the conversation history, pasted documents) and the model's answer. If the sum exceeds the window, the request either fails with an error or the answer is cut off. More about that error: context_length_exceeded.
A token is not a word. An English word usually takes one or two tokens, a Russian one more, so the same window holds fewer Russian words than English ones. Measure your own text rather than converting by word count.
The window of DeepSeek models in Zukko
Data as of 18 October 2026. Prices are $ per 1M tokens.
| Model | Context | Input / output | Image input | Strength index |
|---|---|---|---|---|
deepseek-v4-pro | 1M | 0.075 / 0.225 | yes | 36 |
deepseek-v4.1-flash | 1M | 0.013 / 0.038 | no | 39 |
deepseek-v4-flash | 1M | 0.025 / 0.063 | no | 35 |
So all three current models have a 1M-token window. R1 is not in this list, so look for "DeepSeek R1 context window" in the DeepSeek documentation: we do not quote it so as not to give outdated data. The current model list and parameters are GET https://api.zukko.pro/v1/models or the "Models" page in the dashboard.
Two remarks:
- Window size is not quality on long input. That 1M tokens fit does not mean the model is equally attentive to every paragraph. Test on your own data: put the needed fact at the start, middle and end of a document and see whether the model finds it.
- The window is not the answer length. The maximum number of tokens in an answer is set separately (the
max_tokensparameter or its equivalent), and its limit may be smaller than the window. Look up the exact value in the DeepSeek documentation and check it in practice.
How to measure a request in advance
To avoid guessing, count tokens before sending. Zukko has the POST /v1/messages/count_tokens endpoint for this (description). It counts input tokens without running generation and supports DeepSeek. Note that, according to the documentation, counting is paid: the counted tokens are charged at the model's input price. For an 800,000-token document on deepseek-v4.1-flash that is the same $0.0104 as the input of the request itself, so measure a large document once rather than before every question.
import anthropic
client = anthropic.Anthropic(
base_url="https://api.zukko.pro", # no /v1: the SDK adds the path itself
api_key="fetch_your_key",
)
with open("contract.txt", encoding="utf-8") as f:
text = f.read()
count = client.messages.count_tokens(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "List all deadlines from the contract:\n\n" + text}],
)
print(count.input_tokens)Or with curl:
curl https://api.zukko.pro/v1/messages/count_tokens \
-H "Authorization: Bearer fetch_your_key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Your long text"}]
}'Treat this as an estimate: models have different tokenizers, so the final figure is given by the usage field in the response to a real request. Compare the two numbers on one document to see how far you can trust the preliminary count.
What a long request costs
The formula: cost = input tokens × input price + output tokens × output price (each price is per 1M, so divide by 1,000,000). Suppose you send a document of 800,000 tokens and ask for an answer of 4,000 tokens (an assumption for the example).
deepseek-v4.1-flash: 800,000 × 0.013 / 1,000,000 + 4,000 × 0.038 / 1,000,000 = $0.0104 + $0.000152 = $0.010552, about one cent.deepseek-v4-flash: 800,000 × 0.025 / 1,000,000 + 4,000 × 0.063 / 1,000,000 = $0.02 + $0.000252 = $0.020252.deepseek-v4-pro: 800,000 × 0.075 / 1,000,000 + 4,000 × 0.225 / 1,000,000 = $0.06 + $0.0009 = $0.0609.
For comparison, claude-sonnet-5-5 (input $0.4, output $2) for the same request: 800,000 × 0.4 / 1,000,000 + 4,000 × 2 / 1,000,000 = $0.32 + $0.008 = $0.328. Which model handles the task better we cannot say in advance: compare price, strength index and your own test on a sample.
The conversation catch: history is resent every time
In a chat the model does not remember earlier turns: you send the whole history in every request. So input tokens add up. Suppose a conversation grows by 10,000 tokens per turn, 20 turns in total. Input tokens per request: 10,000, 20,000, ... 200,000. The sum is 10,000 × (1 + 2 + ... + 20) = 10,000 × 210 = 2,100,000 tokens.
deepseek-v4.1-flash: 2.1 × 0.013 = $0.0273.deepseek-v4-pro: 2.1 × 0.075 = $0.1575.
(Here 2.1 is millions of tokens; output is not counted.) The money goes not on a "long request" but on resending the same material again and again.
How not to overpay for context
- Do not send extras. Cut headers and footers, repeated blocks and unimportant appendices before sending.
- Trim the history. For long conversations keep the latest turns and a short summary of the old ones; the summary can be made by a cheap model.
- Pick the model for the task. For bulk digests start with the cheapest
deepseek-v4.1-flashand check quality on a sample, and bring in a pricier model only at the step where the cheap one fell short. - Mind the cache. For DeepSeek models in the Zukko table the cache read price equals the input price ($0.013 for V4.1 Flash, $0.075 for V4 Pro), and writes are not billed separately. So there is no discount for a repeated prefix here, and the calculation goes at the input price. Cache reads are counted if the provider reports them in the response.
- Check whether you need a million at all. Often searching the document and passing the model the right fragments is enough. When a million is justified is covered in a million-token context.
Connecting DeepSeek models and their particulars are described in DeepSeek in Russia.
FAQ
What is DeepSeek's context window?
For deepseek-v4-pro, deepseek-v4.1-flash and deepseek-v4-flash in Zukko it is 1M tokens as of 18 October 2026. For other DeepSeek models, including R1, see the DeepSeek documentation and the GET /v1/models list.
How many Russian words fit into 1M tokens?
There is no single number: it depends on the text and the tokenizer. Take your document, count tokens with count_tokens and work out the ratio for your material.
Does the model's answer count toward the window?
Yes, the window is shared by the request and the answer. Leave a reserve for the answer.
How do I check this in practice?
Create a key in the Zukko dashboard, measure your document with count_tokens and send it to deepseek-v4.1-flash. Actual spending is visible on the "Usage" page.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Grok API price: cost of Grok 4.7, 4.6 and 4.5 with examplesWe price requests to Grok 4.7, 4.6 and 4.5 in Zukko on three scenarios and compare with official xAI prices. Formulas are shown and the arithmetic can be checked.
- DeepSeek API for free: is there a free tier and what is the minimum costWe do not promise free access, but the minimum is very low. A formula-based count of how many requests fit into one dollar.
- DeepSeek API price: cost of V4 Pro and V4.1 Flash worked throughWhat requests to three DeepSeek models cost: the formula, three typical scenarios at 10,000 requests, the role of the cache and a usage-based cost script.
- opencode agents: setting up roles, models and toolsA custom agent in opencode is a role, a model and a set of permissions. A working config where a cheap model handles routine work and a stronger one edits code.