DeepSeek V4 Flash API 2026:Agent 之王,价格仅 Pro 版 1/3
2026-07-31,DeepSeek 上线 DeepSeek-V4-Flash-0731 正式版 API — 一款在自家 Agent 基准上登顶、价格却仅为 V4-Pro 三分之一的快速模型。同样的 1M 上下文、384K 最大输出、原生支持 Anthropic API,并且是 DeepSeek 旗下目前唯一支持 OpenAI Codex Responses API 的模型。迁移只需一行代码:把 model 改成 deepseek-v4-flash,就能立刻享受更低的账单与更高的 Agent 分数。
Preview 与正式版的变化
正式版与 DeepSeek-V4-Flash-Preview 在架构、参数量、上下文窗口上完全一致。区别在于一次全新的后训练,让所有公开 Agent 基准都超过了 V4-Pro-Preview:
| 基准 | V4-Flash-0731 | 衡量内容 |
|---|---|---|
| Terminal Bench 2.1 | 82.7 | 真实 Shell 端到端 Agent 任务 |
| NL2Repo | 54.2 | 自然语言到代码库合成 |
| Cybergym | 76.7 | 攻击性网络安全 Agent 任务 |
| DeepSWE | 54.4 | SWE-Bench 风格仓库真实修 bug |
| Toolathlon | 70.3 | 多工具选择与恢复 |
| Agent Last Exam | 25.2 | 开放式 Agent 推理极限 |
注 1:官方基准使用 DeepSeek 自研的 DeepSeek Harness 极简模式(即将发布)配合 max effort、top_p=0.95、temperature=1.0 测得。自行使用其他框架跑分会略低 — Agent 评测的差距主要来自框架而非模型本身。
价格:Pro 版 1/3,并发 5 倍
DeepSeek 沿用了 V4 体系的三档 token 定价(缓存命中、缓存未命中、输出)。V4-Flash 是预算档,但 Agent 性能反而更强:
| 每百万 token | V4-Flash | V4-Pro | Flash / Pro |
|---|---|---|---|
| 输入(缓存命中) | $0.0028 | $0.003625 | 约 77% |
| 输入(缓存未命中) | $0.14 | $0.435 | 约 32% |
| 输出 | $0.28 | $0.87 | 约 32% |
| 并发上限 | 2,500 | 500 | 5.0x |
| 上下文长度 | 1M | 1M | 相同 |
| 最大输出 | 384K | 384K | 相同 |
注 2:DeepSeek 已警告将实行峰谷分时定价,高峰时段所有计费项为上述价格的 2 倍。生效日期待官方单独公告。届时上表为下限而非上限。
核心结论:对以缓存未命中为主的 Agent 工作负载(冷前缀 prompt),单次请求成本约为 V4-Pro 的三分之一;配合 5 倍并发上限,V4-Flash 是首个无需企业合约就能让高吞吐 Agent 集群跑得起的 DeepSeek 模型。
三种 API,同一模型:OpenAI、Anthropic、Responses
V4-Flash 是 DeepSeek 首款同时接入 Agent 生态三种主流 API 协议的模型:
- OpenAI ChatCompletions —
https://api.deepseek.com,模型名deepseek-v4-flash。可直接替换gpt-4o-mini或o4-mini调用。 - Anthropic Messages API —
https://api.deepseek.com/anthropic。Claude Code 与 Claude SDK 用户改一行 base_url 即可使用 DeepSeek,无需切换到 OpenAI 协议。 - Responses API — OpenAI Codex 使用的格式。V4-Pro 暂不支持,Flash 是当前唯一可用于 Codex 的 DeepSeek 模型。V4-Pro 对 Responses API 的支持预计 2026 年 8 月初上线。
原生 JSON 输出、Tool Calls、Chat Prefix Completion(Beta)、FIM Completion(Beta,仅非思考模式)在 V4-Flash 上均受支持。思考模式开关沿用 {"thinking": {"type": "enabled"}} 模式。
Codex 原生接入:一份脚本,三个客户端
DeepSeek 提供一份一键配置脚本,可同时配置 Codex CLI、ChatGPT 桌面端和 VS Code Codex 扩展。macOS / Linux:
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup.sh)
Windows PowerShell:
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
脚本会写入 ~/.codex/config.toml,Codex IDE 扩展、Codex CLI 和 ChatGPT 桌面端共用同一份 DeepSeek 配置。手动接入等价于:
# ~/.codex/config.toml
[model]
name = "deepseek-v4-flash"
[providers.deepseek]
base_url = "https://api.deepseek.com"
api_key = "${DEEPSEEK_API_KEY}"
无论哪种方式,都能让 Codex 跑在 Terminal Bench 2.1 = 82.7 的 DeepSeek 模型上 — 显著高于 Codex 默认模型在同类 Agent 评测中的公开分数。
思考模式与 V3.x 下架时间表
V4-Flash 同时支持非思考与思考两种模式。默认开启思考(模型先输出思维链再给最终答案)。切换方式:
// OpenAI 格式
{ "thinking": { "type": "enabled" } } // 或 "disabled"
// Anthropic 格式
{ "thinking": { "type": "enabled" } } // extended-thinking 变体
// Responses API 格式
{ "reasoning": { "effort": "high" } } // effort: low | medium | high | max
DeepSeek 同时确认了 V3.x 模型名的下架时间表:
- deepseek-chat 与 deepseek-reasoner 将于 2026-10-24 下架(V4 公告三个月后)。
- 在此之前,
deepseek-chat继续指向 V4-Flash 的非思考模式,deepseek-reasoner指向思考模式。 - 当前仍以 V3.x 别名运行的代码今天并不会报错,但 10 月会硬性失败。建议现在就把所有引用改为
deepseek-v4-flash并显式声明模式。
迁移:从 V3.x 或 Preview 只需 3 行改动
从 deepseek-chat 或 deepseek-reasoner 迁到 V4-Flash,本质上就是把模型名换掉。base URL、请求体格式、流式协议完全不变:
// 改之前(V3.x)
const r = await fetch("https://api.deepseek.com/chat/completions", {
method: "POST",
headers: { Authorization: "Bearer " + DEEPSEEK_API_KEY,
"Content-Type": "application/json" },
body: JSON.stringify({
model: "deepseek-chat", // 别名指向 V4-Flash 非思考模式
messages: [{ role: "user", content: prompt }],
stream: false,
})
});
// 改之后(V4-Flash 正式版)
const r = await fetch("https://api.deepseek.com/chat/completions", {
method: "POST",
headers: { Authorization: "Bearer " + DEEPSEEK_API_KEY,
"Content-Type": "application/json" },
body: JSON.stringify({
model: "deepseek-v4-flash", // 显式,未来安全
messages: [{ role: "user", content: prompt }],
thinking: { type: "enabled" }, // 显式思考模式开关
stream: false,
})
});
如果想先评估再全量切换,DeepSeek 推荐灰度方案:用 48 小时把 10% 生产流量切到 V4-Flash 并显式开启思考模式,另外 90% 保持原模型别名不变,对比 token 消耗和任务完成率,再决定是否整体迁移。
V4-Flash vs V4-Pro vs Kimi K3 vs Claude Opus 4.7
与 2026 年中段的开源/Anthropic 阵营同档位模型相比,V4-Flash 的定位如何?下表以"缓存未命中输入"为主指标,因为大多数 Agent 流量都是冷前缀:
| 模型 | $ / 百万 输入 | $ / 百万 输出 | 最佳场景 |
|---|---|---|---|
| DeepSeek V4-Flash | $0.14 | $0.28 | 高并发 Agent 循环、Codex 替换 |
| DeepSeek V4-Pro | $0.435 | $0.87 | Flash 撑不住的极限 Agent 推理 |
| Kimi K3(开源) | 自托管 | 自托管 | 1M 上下文、本地或主权云 |
| Claude Opus 4.7(Anthropic API) | 约 $15 | 约 $75 | 前沿推理、成本不是首要约束 |
与 Opus 4.7 的 100 倍价差不是笔误。如果你的工作负载在 V4-Flash 上 Terminal Bench 2.1 能跑到 70+,Pro 档 Anthropic 的开销通常并不划算。
当前局限
- 峰谷分时价即将上线 — 高峰时段 2 倍。能离线跑的批量任务尽量压在低谷。
- Responses API 当前仅 Flash 可用 — V4-Pro 对 Responses 的支持计划 2026 年 8 月初上线。在那之前,依赖 Pro 跑 Codex 的 Agent 栈只能临时锁在 Flash。
- Codex 一键脚本要求 Codex 已初始化 — 脚本假定
~/.codex目录已存在。运行脚本前需先启动一次 Codex CLI 或 ChatGPT 桌面端。 - 推理 effort 受协议限制 — Responses API 暴露
low | medium | high | max四档,但 OpenAI 与 Anthropic 协议只提供enabled | disabled二元开关,无法精细调节思考预算。需要细致控制思考预算的 Agent 必须走 Responses API。 - 官方基准依赖尚未发布的 Harness — Terminal Bench / NL2Repo 等公开数字基于即将上线的 DeepSeek Harness 极简模式测得。第三方 harness 跑分会低几个点。
总结:今天就把 model 改成 "deepseek-v4-flash"
V4-Flash 是少见的"标题即真相"的发布:在 DeepSeek 自家每一个 Agent 基准上击败 V4-Pro,价格只是三分之一,并发却是 5 倍。再加上它是目前唯一支持 Codex 的 DeepSeek 模型,对于任何跑规模化 Agent 的团队都是显而易见的默认选择。这不是开源前沿崩塌,而是 Flash 已经成为当下 API 市场上"每美元 Agent 分数"最高的选项。
对今天绝大多数 Agent 重负载的工作流,正确做法是:把最难的 5–10% 任务保留给 Pro,其余一切默认 Flash。V3.x 在 2026 年 10 月的下架让这次迁移无论如何都避不开 — 既然早晚要做,不如现在落地,在 Flash 与 Pro 性能差距最小的窗口期把成本压下来。
想让 V4-Flash 与多家供应商走同一把密钥? 如果你不想同时管理 DeepSeek、OpenAI、Anthropic、Google 的账单与配额,FreeModel 把 V4-Flash(以及 V4-Pro、Kimi K3、Claude Opus 4.7、GPT-5.6 Sol)通过同一个 API key 暴露出来,配有跨模型成本/任务的看板 — 当"Flash / Pro"分配需要动态调整时尤其好用。