Introduction¶
When resolving provider credentials, DeepSeek Harness (DSH) typically expects an API Key to be configured. However, locally installed Codex CLI or Claude Code usually only holds OAuth tokens and does not have a traditional API Key. The dsh-llm-local-token plugin bridges this gap by directly reading the credential files maintained by the local CLI, converting OAuth tokens into model routes usable by DSH, and providing a real-time usage display for subscriptions.
Plugin Overview¶
This is a DeepSeek Harness plugin maintained by tianxia-- and released under the MIT license. Its core purpose is to directly convert locally signed-in Codex and Claude subscriptions into internal DSH model routes, without requiring a separately configured API Key for DSH.
Core Features¶
- Reuse local subscriptions: Reads local OAuth tokens from Codex and Claude and registers them as
openai-codexandanthropicroutes. - Usage badge: Displays subscription usage in the Composer toolbar (quota, utilization, reset countdown).
- Automatic token refresh: Automatically refreshes the token when it is close to expiring.
- Automatic configuration injection: Automatically inserts the loader line via the profile bundle, removing the need to manually edit
cordis.patch.yml.
Installation and Activation¶
Install it using the official command:
dsh plugin --profile web add dsh-llm-local-token
After installation, restart dsh. The plugin declares a profile bundle (dsh.bundle.patch -> cordis.patch.yml), and DSH will automatically handle the configuration file injection. You do not need to manually modify cordis.patch.yml under the profile.
Typical Usage¶
After installation, the route will automatically appear in the model selector. To set Codex as the default model, configure it in ~/.dsh/settings.yaml:
agent-default-model:
provider: openai-codex
model: gpt-5.6-terra
reasoningEffort: medium
Notes and Use Cases¶
- Missing route handling: If credentials for a route are missing, the plugin skips that route instead of causing DSH to fail to start.
- GLM behavior: The plugin only reports the GLM Coding Plan quota and does not register a new GLM route (DSH itself already serves GLM through the
zai-coding-cnroute). - Transport protocol and quota: The quota badge depends on the
ssetransport protocol. IfcodexTransportis set toauto, DSH preferentially uses WebSocket, and Codex quota data cannot be retrieved in this case. - GLM quota source: GLM quota is read preferentially from configuration items, environment variables (
ZAI_CODING_CN_API_KEY),credentials.yaml, or localzcodefiles. - Version requirement: Node.js >= 22.13.0 is required.