#OpenClaw 连接 DeepSeek 一直返回 401 认证失败

1 messages · Page 1 of 1 (latest)

restive steppe
#

【问题】OpenClaw 连接 DeepSeek 一直返回 401 认证失败

【环境】
Windows 10/11
OpenClaw 版本: 2026.4.27 (cbc2ba0)
模型: DeepSeek
错误类型: HTTP 401

【已尝试的操作】

  1. 重置配置并重新运行 openclaw onboard
  2. 使用不同的 API Key 测试
  3. 用 curl 命令直接测试 DeepSeek API(返回 invalid)
  4. 手动修改 openclaw.json 配置 baseUrl 为 https://api.deepseek.com
  5. DeepSeek 账户余额充足,未欠费

【诊断结果】
openclaw models status 显示:

  • Default: deepseek/deepseek-v4-flash
  • Auth store 存在
  • api_key=1 (Key 已配置)

auth-profiles.json 内容:
{
"version": 1,
"profiles": {
"deepseek:default": {
"type": "api_key",
"provider": "deepseek",
"key": "sk-0aa75...ace2"
}
}
}

【错误现象】
Web 界面一直显示: [assistant turn failed before producing content] 和 Bootstrap pending

【补充说明】
同一批 API Key 在 DeepSeek 平台显示正常且有余额,但 curl 测试返回 "Authentication Fails, Your api key is invalid"。
怀疑新版 OpenClaw (2026.3.12以后) 对 DeepSeek 的认证机制有变更,不能在 json 里直接写 apiKey 了。

求教正确的配置方式!