DeepSeek Harness · run failure

dsh run failed: “no API key for provider route” — how to set it

llm-deepseek: no API key for provider route "deepseek-official"

No credential is configured for the provider route this request needed. The turn ended with `{"kind":"error","code":"MISSING_CREDENTIAL"}`.

这次请求需要的 provider 路由没有配置任何凭证。turn 以 `{"kind":"error","code":"MISSING_CREDENTIAL"}` 结束。

Why it happens根因

The route exists but nothing is stored for it: the key was never set, was set in an environment dsh did not inherit (a different shell, a container, a GUI launch), or the route name changed with a model update.

路由存在,但没有为它存任何东西:key 从未设置、设置在了 dsh 没有继承的环境里(另一个 shell、容器、GUI 启动),或路由名随模型更新而改变。

How to fix it怎么修

  1. Set the credential for the route named in the message — the message names the exact variable to store.
  2. Prefer the web client’s Models page: it writes the store dsh actually reads, rather than an environment only your current shell sees.
  3. If you launch dsh from a GUI or a service, make sure the variable is exported in that context too.
  1. 为报错信息里点名的那条路由设置凭证——信息里写明了要存哪个变量。
  2. 优先用 web 客户端的 Models 页面:它写入的是 dsh 真正读取的存储,而不是只有你当前 shell 才看得到的环境变量。
  3. 如果从 GUI 或服务启动 dsh,确认那个上下文里也导出了该变量。

Is this my plugin’s fault?这是我的插件引起的吗?

No. This is a local configuration state, not code. Nothing in your plugin set can set or unset a credential.

不是。这是本地配置状态,不是代码问题。你装的任何插件都无法设置或取消一个凭证。

Related failures相关失败

FAQ常见问题

I set the API key but dsh still says there is none

The variable is almost certainly not reaching the process that runs dsh — a GUI launch, a container, or a different shell. Setting it through the web client’s Models page avoids that class of problem entirely.

What is a “provider route”?

A named endpoint-plus-credential pair in dsh’s model configuration. A key stored for one route does not apply to another, which is why adding a model can surface this error.

Is this the same as a 401?

No. A 401 means a credential was sent and rejected; this one means no credential was found to send. The fixes differ: replace versus configure.

我设了 API key,dsh 还是说没有

几乎可以确定是那个变量没有到达真正运行 dsh 的进程——GUI 启动、容器,或另一个 shell。通过 web 客户端的 Models 页面设置可以完全绕开这类问题。

什么是「provider route」?

dsh 模型配置里一个「端点 + 凭证」的具名组合。为一个路由存的 key 不适用于另一个路由,这就是新增模型会暴露出这个错误的原因。

这和 401 是一回事吗?

不是。401 表示发了凭证但被拒绝;这一条表示压根没找到凭证可发。修法不同:一个是替换,一个是配置。