OpenClaw 通过 deepseek/* 命名空间接入 DeepSeek 模型,API 兼容 OpenAI 格式,支持深度思考(reasoning)模式。

认证方式

{
  env: { DEEPSEEK_API_KEY: "sk-..." },
  agents: {
    defaults: { model: { primary: "deepseek/deepseek-v4-flash" } }
  }
}

DeepSeek API 与 OpenAI API 格式兼容,底层使用相同的请求结构。

内置模型

模型说明
deepseek-v4-flash默认模型,速度快,适合日常任务
deepseek-v4-pro高性能版本,适合复杂推理
deepseek-chat通用对话模型
deepseek-reasoner专用推理模型(R1 系列)

思考模式

DeepSeek V4 支持 thinking 控制,可在会话中动态调整推理深度:

/think xhigh   # 请求最大推理深度
/think max     # 同上,等效命令
/think off     # 关闭思考模式

也可通过配置设置默认思考级别:

{
  agents: {
    defaults: {
      model: { primary: "deepseek/deepseek-v4-pro" },
      params: { thinking: "high" }
    }
  }
}

工具调用与 reasoning_content

DeepSeek V4 在 thinking 会话中,工具调用响应包含 reasoning_content 字段(推理过程)。后续请求需要将此字段 replay 回去,否则模型会报错。

OpenClaw 自动处理此逻辑,无需手动管理 reasoning_content。

相关