DeepSeek V4 Pro 0813 悄然发布
摘要
DeepSeek 悄然发布了 V4 Pro (0813),其 API 文档显示支持 Responses API 格式并与 Codex 集成,可使用 deepseek-v4-flash/pro 模型。
暂无内容
查看缓存全文
缓存时间: 2026/08/12 17:20
# 使用 Responses API | DeepSeek API 文档 来源:https://api-docs.deepseek.com/guides/responses_api/ 为了满足 Codex 的需求,我们的 API 现在支持 Responses API 格式,`base\_url` 为 `https://api\.deepseek\.com`。通过简单配置,即可在 Codex 中使用 DeepSeek 模型。 ## 将 DeepSeek 模型集成到 Codex (https://api-docs.deepseek.com/guides/responses_api/#integrating-deepseek-models-into-codex) 请参阅与 Codex 集成 (https://api-docs.deepseek.com/quick_start/agent_integrations/codex)。 ## 通过 Responses API 调用 DeepSeek 模型 (https://api-docs.deepseek.com/guides/responses_api/#calling-deepseek-models-via-the-responses-api) `` # 请先安装 OpenAI SDK:`pip3 install openai`from openai import OpenAIclient = OpenAI(api_key="", base_url="https://api.deepseek.com")response = client.responses.create( model="deepseek-v4-flash", instructions="You are a helpful assistant.", input="Hi, how are you?",)print(response.output_text) `` ## 流式输出 (https://api-docs.deepseek.com/guides/responses_api/#streaming) 设置 `stream: true` 即可将响应作为一系列语义化服务器发送事件(SSE)接收。每个事件都带有 `event` 字段表示事件类型,以及一个单调递增的 `sequence\_number`。流以 `response\.completed`/`response\.incomplete`/`response\.failed` 事件结束——没有 `data: [DONE]` 消息。 `` stream = client.responses.create( model="deepseek-v4-flash", instructions="You are a helpful assistant.", input="Hi, how are you?", stream=True,)for event in stream: if event.type == "response.output_text.delta": print(event.delta, end="") `` 完整事件列表: 事件描述`response\.created`第一个事件;响应已创建,状态为`in\_progress``response\.in\_progress`响应正在生成中`response\.output\_item\.added`/`response\.output\_item\.done`某个输出项(`reasoning`/`message`/`function\_call`/`custom\_tool\_call`/`web\_search\_call`)开始 / 完成`response\.content\_part\.added`/`response\.content\_part\.done`输出项中的某个内容部分开始 / 完成`response\.reasoning\_text\.delta`/`response\.reasoning\_text\.done`增量思维链文本 / 完整思维链文本`response\.output\_text\.delta`/`response\.output\_text\.done`增量输出文本 / 完整输出文本`response\.function\_call\_arguments\.delta`/`response\.function\_call\_arguments\.done`增量函数调用参数 / 完整参数`response\.custom\_tool\_call\_input\.delta`/`response\.custom\_tool\_call\_input\.done`增量自定义工具调用(`apply\_patch`)输入 / 完整输入`response\.web\_search\_call\.in\_progress`/`response\.web\_search\_call\.searching`/`response\.web\_search\_call\.completed`服务端网页搜索工具调用的状态更新`response\.completed`响应正常完成时的最终事件,携带包含`usage`在内的完整`response`对象`response\.incomplete`响应被截断(例如达到`max\_output\_tokens`)时的最终事件,携带完整的`response`对象`response\.failed`响应失败时的最终事件,携带包含`error`详情的完整`response`对象## 兼容性详情 (https://api-docs.deepseek.com/guides/responses_api/#compatibility-details) 本节列出了 DeepSeek API 与 Responses API 的兼容性细节。完整的 Responses API 格式定义,请参考官方 OpenAI API 参考文档 (https://developers.openai.com/api/reference/resources/responses/methods/create)。 ### 顶层请求参数 (https://api-docs.deepseek.com/guides/responses_api/#top-level-request-parameters) 参数支持状态`model`支持。`deepseek\-v4\-flash`/`deepseek\-v4\-pro`,参见模型与定价 (https://api-docs.deepseek.com/quick_start/pricing)`input`支持。字符串或输入项列表;`input`和`instructions`至少需要提供一个`instructions`支持。作为第一条系统消息插入`stream`支持`temperature`支持(范围 [0.0, 2.0];思考模式下无效)`top\_p`支持(思考模式下无效)`max\_output\_tokens`支持`top\_logprobs`支持(范围 [0, 20])`tools`部分支持。`function`/`web\_search`支持;其他类型被忽略,见下方工具表格`tool\_choice`支持。`none`/`auto`/`required`/特定工具(`\{"type": "function", "name": \.\.\.\}`或`\{"type": "web\_search"\}`/`\{"type": "web\_search\_2025\_08\_26"\}`)`reasoning`部分支持。`effort`支持;`summary`被接受但不会生成摘要`text`部分支持。`format`完全支持;`verbosity`被接受但无效`user`支持。参见速率限制与隔离 (https://api-docs.deepseek.com/quick_start/rate_limit)`parallel\_tool\_calls`被忽略(始终启用并行工具调用)`max\_tool\_calls`被忽略`previous\_response\_id`不支持(无状态 API)`conversation`不支持(无状态 API)`store`不支持。响应始终携带`store: false``background`不支持`metadata`不支持`include`不支持`prompt`不支持`truncation`不支持。超出上下文窗口的请求会返回`400`错误`service\_tier`不支持`safety\_identifier`不支持`prompt\_cache\_key`/`prompt\_cache\_retention`不支持。上下文缓存自动管理,参见上下文缓存 (https://api-docs.deepseek.com/guides/kv_cache)`context\_management`不支持`stream\_options`不支持不支持的参数会被**静默忽略**,不会导致错误,因此现有的 Responses API 客户端可以无需修改直接连接。 ### 输入项 (https://api-docs.deepseek.com/guides/responses_api/#input-items) 类型支持状态`message`支持。角色`user`/`assistant`/`system`/`developer`(`developer`按`system`处理);内容支持字符串和`input\_text`/`output\_text`内容部分。不支持图像和文件输入(`input\_image`部分不会导致错误,但会被替换为占位文本)`function\_call`支持。合并到相邻的 assistant 消息中`function\_call\_output`支持`reasoning`支持。纯文本`content`合并到相邻的 assistant 消息中;不支持`summary`和`encrypted\_content``web\_search\_call`支持。按原样传回;服务器会自动恢复搜索结果其他类型被忽略### 工具 (https://api-docs.deepseek.com/guides/responses_api/#tools) 类型支持状态`function`支持`web\_search`/`web\_search\_2025\_08\_26`支持,在服务端执行。`search\_context\_size`和`user\_location`被忽略`custom`仅支持`\{"type": "custom", "name": "apply\_patch"\}`(为了 Codex 兼容性);其他名称返回`400`错误`file\_search`/`code\_interpreter`/`computer\_use`/`mcp`/其他内置工具被忽略### 响应字段 (https://api-docs.deepseek.com/guides/responses_api/#response-fields) 响应对象与 OpenAI Responses API 的`response`结构兼容。依赖不支持能力的字段始终取固定值(例如`store: false`、`previous\_response\_id: null`、`parallel\_tool\_calls: true`)。Token 用量在`usage`中返回: - `input\_tokens`:输入 token 数量,其中`input\_tokens\_details\.cached\_tokens`是命中上下文缓存 (https://api-docs.deepseek.com/guides/kv_cache) 的 token 数量 - `output\_tokens`:输出 token 数量,其中`output\_tokens\_details\.reasoning\_tokens`是思维链 token 数量
相似文章
DeepSeek-V4-Pro-0813 已上线!
DeepSeek 宣布,DeepSeek-V4-Pro-0813 现已上线。
The official release Deepseek V4 flash is live on the API
DeepSeek officially released DeepSeek-V4-Flash on the API in public beta, with significantly enhanced agent capabilities, new benchmark results, and native support for the Responses API and Codex integration.
DeepSeek V4 Pro 0813
DeepSeek V4 Pro 0813 现已推出,OpenRouter 上提供了 API 定价详情,标志着面向开发者的新模型发布。
DeepSeek-V4-Flash 已更新,“DeepSeek-V4-Pro 的正式发布将很快到来”
DeepSeek 宣布更新了 DeepSeek-V4-Flash,并预告 DeepSeek-V4-Pro 的正式发布将很快到来。
DeepSeek API 定价更新
DeepSeek 推出 V4-Pro 和 V4-Flash,支持灵活的推理强度、原生 OpenAI Responses API,以及针对 Codex 优化的智能体工作流,可通过 API 和应用/网页使用。