DeepSeek V4 API Migration Guide (2026): Replace deepseek-chat Before the Cutoff
DeepSeek's quiet-but-important API change became real on July 24, 2026 at 15:59 UTC: the legacy model names deepseek-chat and deepseek-reasoner reached their retirement deadline. DeepSeek's own pricing page says those names are deprecated, with deepseek-chat corresponding to the non-thinking mode of deepseek-v4-flash and deepseek-reasoner corresponding to the thinking mode of deepseek-v4-flash.
If your app still hard-codes the old aliases, this is the moment to clean it up instead of waiting for a broken deploy. The good news: most teams don't need a rewrite. They need a model-name migration, a pricing check, and one small decision about when to use V4 Flash versus V4 Pro.
TL;DR / Key Takeaways
- DeepSeek deprecated the
deepseek-chatanddeepseek-reasonermodel names on July 24, 2026 at 15:59 UTC. - DeepSeek V4 Flash costs $0.14 per million cache-miss input tokens and $0.28 per million output tokens through the official DeepSeek API.
- DeepSeek V4 Pro costs $0.435 per million cache-miss input tokens and $0.87 per million output tokens through the official DeepSeek API.
- Both DeepSeek V4 Flash and DeepSeek V4 Pro support a 1,000,000-token context window and a maximum output length of 384,000 tokens.
- For most production chat and agent workloads, migrating old aliases to
deepseek-v4-flashfirst is the safest low-cost path.
DeepSeek V4 Pricing and Context Window
Use actual numbers before changing your router. DeepSeek lists the following prices per one million tokens. Cache-hit input is dramatically cheaper, which matters if your app repeats long tool descriptions, system prompts, retrieval headers, or policy blocks.
| Model | Input price, cache miss | Input price, cache hit | Output price | Context window |
|---|---|---|---|---|
| DeepSeek V4 Flash | $0.14 per 1M tokens | $0.0028 per 1M tokens | $0.28 per 1M tokens | 1,000,000 tokens |
| DeepSeek V4 Pro | $0.435 per 1M tokens | $0.003625 per 1M tokens | $0.87 per 1M tokens | 1,000,000 tokens |
Which DeepSeek V4 Option Should You Use?
The trap is assuming “newer” means “always use Pro.” That's rarely true in API products. If your workload is a support bot, document assistant, batch classifier, lightweight coding helper, or routing layer, V4 Flash is probably where you should start. Pro is for the cases where quality is worth paying roughly three times more.
| Option | Context window | Official price | Best for | Key limitation |
|---|---|---|---|---|
| DeepSeek V4 Flash | 1,000,000 tokens | $0.14 input and $0.28 output per 1M tokens | High-volume chat, agents, summaries, routing, and old deepseek-chat migrations | Cheaper model; use evals before replacing a premium reasoning route |
| DeepSeek V4 Pro | 1,000,000 tokens | $0.435 input and $0.87 output per 1M tokens | Harder reasoning, code review, long-context analysis, and higher-value enterprise tasks | Higher cost and lower listed concurrency than V4 Flash |
| GPT-5.5 | Model page dependent | Check current provider pricing before deployment | OpenAI-compatible apps that need broad tool ecosystem support and stable client libraries | Often more expensive than DeepSeek V4 Flash for bulk text workloads |
The Migration Map
Here's the simple version:
- Replace
deepseek-chatwithdeepseek-v4-flashin non-thinking chat flows. - Replace
deepseek-reasonerwithdeepseek-v4-flashusing thinking mode if your client supports DeepSeek's thinking controls. - Use
deepseek-v4-proonly after evals show that Flash is not good enough. - Add logging for model name, input tokens, output tokens, cache-hit input tokens, latency, and error rate.
That last point matters. A migration that “works” in staging can still hurt production if the model gets slower, produces longer answers, or misses a formatting contract. Measure it from day one.
curl Example: OpenAI-Compatible Chat Completion
DeepSeek exposes an OpenAI-format base URL, so many clients only need a base URL and model change.
curl https://api.deepseek.com/chat/completions \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a concise API migration assistant."},
{"role": "user", "content": "Rewrite this legacy DeepSeek request for V4."}
],
"temperature": 0.2
}'
If your app already uses OpenAI-style request objects, put the model name behind config instead of scattering it across code. Hard-coded model names are how tiny deprecations become weekend incidents.
Python Example: Make the Model Configurable
This pattern lets you switch between V4 Flash and V4 Pro without redeploying application code.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEEPSEEK_API_KEY"],
base_url="https://api.deepseek.com"
)
MODEL = os.getenv("DEEPSEEK_MODEL", "deepseek-v4-flash")
def ask_deepseek(prompt: str) -> str:
response = client.chat.completions.create(
model=MODEL,
messages=[
{"role": "system", "content": "Answer with practical developer steps."},
{"role": "user", "content": prompt},
],
temperature=0.2,
)
return response.choices[0].message.content
print(ask_deepseek("What should I change after deepseek-chat deprecation?"))
Node.js Example: Add a Fallback Route
For production, I prefer a thin provider wrapper. It keeps failures boring.
import OpenAI from "openai";
const deepseek = new OpenAI({
apiKey: process.env.DEEPSEEK_API_KEY,
baseURL: "https://api.deepseek.com"
});
const fallback = new OpenAI({
apiKey: process.env.KISSAPI_API_KEY,
baseURL: "https://api.kissapi.ai/v1"
});
export async function complete(messages) {
try {
return await deepseek.chat.completions.create({
model: "deepseek-v4-flash",
messages,
temperature: 0.2
});
} catch (error) {
console.warn("DeepSeek route failed, using fallback:", error.message);
return await fallback.chat.completions.create({
model: "gpt-5.5",
messages,
temperature: 0.2
});
}
}
KissAPI is useful here because it gives teams an OpenAI-compatible backup route without rewriting the rest of the app. Don't overcomplicate it: your fallback should return a valid answer, preserve the same message format, and alert you that the primary route failed.
Migration Checklist
- Search your codebase for old aliases. Look for
deepseek-chatanddeepseek-reasonerin application code, config files, dashboards, tests, and documentation. - Move model names into environment config. Use
DEEPSEEK_MODEL=deepseek-v4-flashas the default for lower-risk migrations. - Run a small golden-set eval. Use 50 to 200 real prompts, not synthetic toy prompts. Compare answer quality, JSON validity, latency, and token count.
- Watch output length. A cheaper input model can still raise your bill if it writes twice as much.
- Add a fallback. Use a second provider or a unified API gateway for outages, rate limits, and regional problems.
- Update user-facing docs. If customers pass model names directly, publish the replacement names clearly.
Cost Example: Why Flash Is the Default
Suppose a document assistant processes 10 million fresh input tokens and 2 million output tokens per day. At official DeepSeek prices, V4 Flash costs:
10M input tokens × $0.14 / 1M = $1.40
2M output tokens × $0.28 / 1M = $0.56
Daily total = $1.96
The same volume on V4 Pro costs:
10M input tokens × $0.435 / 1M = $4.35
2M output tokens × $0.87 / 1M = $1.74
Daily total = $6.09
That difference is small for one internal tool. It is not small across dozens of customers, retried agent calls, or long-context document pipelines. Use the API cost calculator before switching the default model for everyone.
Practical opinion: start with DeepSeek V4 Flash, measure quality, then promote only the prompts that need it to V4 Pro. Model routing beats picking one expensive default and hoping finance doesn't notice.
FAQ
What replaced deepseek-chat and deepseek-reasoner?
DeepSeek says deepseek-chat and deepseek-reasoner are deprecated on July 24, 2026 at 15:59 UTC. For compatibility, deepseek-chat maps to the non-thinking mode of deepseek-v4-flash, while deepseek-reasoner maps to the thinking mode of deepseek-v4-flash.
Should I migrate to DeepSeek V4 Flash or DeepSeek V4 Pro?
Most teams should migrate to DeepSeek V4 Flash first because it is cheaper and keeps the 1,000,000-token context window. Use DeepSeek V4 Pro when your own evals show a quality gap that justifies the higher token price.
How do I estimate the migration cost?
Multiply input tokens and output tokens by the new per-million-token rates, then include cache-hit assumptions if your prompts reuse long stable prefixes. For quick estimates, use the KissAPI API cost calculator and token counter.
Need an OpenAI-Compatible Backup Route?
Create a free KissAPI account and keep a fallback endpoint ready while you migrate DeepSeek aliases, test V4 Flash, or compare routes in production.
Start FreeSources: DeepSeek API Docs, “Models & Pricing,” fetched July 25, 2026; Tech Insider, “DeepSeek V4 Hits GA: 1M Context, Old API Dies Today,” published July 24, 2026.