跳转到内容
中文

DeepSeek V4 Pro API

POST Base URL: https://api.hiapi.ai /v1/responses

该模型推荐使用兼容 OpenAI 的 Responses 接口,并继续保留 /v1/chat/completions 兼容入口。同一个 HiAPI API Key 可调用账户分组内已开放模型;图片、视频或音频模型使用 /v1/tasks 及对应请求结构。

模型概览

模型名称deepseek-v4-pro
版本DeepSeek-V4-Pro-0813
类型文本生成 · Responses + Chat Completions
上下文窗口1,000,000 Tokens
最大输出384,000 Tokens
默认模式思考模式 · high
能力流式输出、JSON 输出、工具调用、Codex 接入
价格查看 HiAPI 实时定价

DeepSeek V4 Pro 0813 是 DeepSeek V4 Pro 的正式版 API 模型,面向高难度推理、编程和 Agent 工作负载。它支持 100 万 Token 上下文、最高 38.4 万 Token 输出、思考与非思考模式,以及原生 Responses 和 Chat Completions 接入。

生产建议

API Key 与端点
  • 同一个 HiAPI API Key 可以调用账户分组内所有已开放模型。
  • 推荐使用 /v1/responses;兼容客户端仍可使用 /v1/chat/completions。
  • 媒体生成使用 /v1/tasks 和不同的请求结构;API Key 只保存在服务端。
Responses 无状态契约
  • DeepSeek Responses 是无状态接口,不要传 store、previous_response_id、conversation 或 background。
  • 每一轮都在 input 中重新传入仍需使用的上下文。
  • 流式响应以 response.completed、response.incomplete 或 response.failed 结束,不使用 Chat Completions 的 [DONE]。

适用场景

复杂推理

长链路分析和高难度专业任务。

reasoning.effortinput
编程 Agent

代码库分析、实现和迭代工具工作流。

toolsinput
长上下文任务

大型代码库、文档和多步骤调研。

inputmax_output_tokens
结构化输出

为下游系统返回机器可读结果。

text.format

请求参数

model string 必填

固定填写 deepseek-v4-pro。

示例 deepseek-v4-pro
input string | array 必填

文本,或带 role 与 content 的消息数组。

instructions string 可选

定义角色和回答要求。

stream boolean 可选

设为 true 时返回语义化 SSE 事件。

默认 false
max_output_tokens integer 可选

限制本次响应的最大输出 Token;模型规格上限为 384K。

示例 4096
reasoning object 可选

控制推理强度;默认 high。

effort enum 可选

none 关闭推理;档位越高通常延迟和 Token 消耗越高。

默认 high 可选值: nonelowhighmax
text object 可选

通过 text.format 配置结构化输出。

tools array 可选

工具定义;具体类型需按已验证能力使用。

tool_choice string | object 可选

控制工具选择策略。

API 接入示例

调用示例

最大推理强度

明确传入 max,使用最高推理档位。

请求体
{
  "model": "deepseek-v4-pro",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "评审这个服务设计,并列出最重要的三个风险。"
        }
      ]
    }
  ],
  "reasoning": {
    "effort": "max"
  },
  "max_output_tokens": 4096,
  "stream": false
}
关闭推理

使用 reasoning.effort=none 获得低延迟生成。

请求体
{
  "model": "deepseek-v4-pro",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "评审这个服务设计,并列出最重要的三个风险。"
        }
      ]
    }
  ],
  "reasoning": {
    "effort": "none"
  },
  "max_output_tokens": 4096,
  "stream": false
}
流式响应

设为 stream=true,并按语义事件类型分发。

请求体
{
  "model": "deepseek-v4-pro",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "评审这个服务设计,并列出最重要的三个风险。"
        }
      ]
    }
  ],
  "reasoning": {
    "effort": "high"
  },
  "max_output_tokens": 4096,
  "stream": true
}

响应结构

非流式响应从 output 中读取 output_text;流式响应按事件类型处理。计费明细以 usage 为准。

{
  "id": "resp_example",
  "object": "response",
  "status": "completed",
  "model": "deepseek-v4-pro",
  "output": [
    {
      "id": "msg_example",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "稀疏注意力只计算部分关键 Token 之间的关联。"
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 24,
    "output_tokens": 18,
    "total_tokens": 42,
    "input_tokens_details": {
      "cached_tokens": 0
    }
  }
}
  1. 非流式调用从 output 中的 output_text 项读取结果。
  2. 流式调用拼接 response.output_text.delta,并在终态事件结束。
  3. 从 usage 读取输入、输出、缓存及总 Token 数。
  4. 显式处理 response.incomplete 和 response.failed。

常见问题

什么是 DeepSeek V4 Pro?

DeepSeek V4 Pro 0813 是 V4 Pro API 模型的正式版,面向高难度推理、编程和 Agent 工作负载,支持 100 万 Token 上下文、最高 38.4 万 Token 输出,以及思考和非思考模式。

应该使用哪个模型 ID 和端点?

model 固定填写 deepseek-v4-pro。HiAPI 推荐 POST /v1/responses;兼容客户端也可以使用 POST /v1/chat/completions。

如何控制推理强度?

Responses 使用 reasoning.effort,可选 none、low、high、max,默认 high;Chat Completions 使用 thinking.type 和 reasoning_effort。

Responses 会保存对话状态吗?

不会。DeepSeek Responses 是无状态接口,不要传 store、previous_response_id、conversation 或 background;下一轮需要在 input 中重新传入上下文。

输入、输出和缓存 Token 如何计费?

输入、输出和缓存读取 Token 分别计费,最终以 HiAPI 实时定价页为准。 查看实时价格。

可以接入 Codex 或 OpenAI 兼容客户端吗?

Codex 类工作流推荐使用 Responses。现有 Chat Completions 客户端可以保留 messages 请求结构,只替换 base URL、API Key 和模型 ID。

下一步