Configuring dsh-usage-stats
DeepSeek Harness reads credentials from ~/.dsh/.credentials.yaml; the installer does not read, create or modify this file. Provider profiles normally supply apiKeyEnv. Account-specific references include OPENROUTER_MANAGEMENT_KEY, OPENCODE_GO_API_KEY, ZAI_API_KEY, KIMI_API_KEY and MINIMAX_API_KEY. Optional region keys are ZAI_API_REGION (global by default) and MINIMAX_API_REGION (global by default). OpenRouter requires a management key, not a normal inference key.
Custom monitors are merged into the existing Cordis entry named dsh-usage-stats:
| Key |
Purpose |
monitors.<provider>.adapter |
Selects an adapter such as new-api, sub2api, general or declarative |
warning.warnBelow / criticalBelow |
Absolute balance thresholds |
request.path |
Restricted GET path for a declarative monitor |
extract.* |
JSON Pointer locations for extracted values |
Declarative monitors use credentialRef and do not execute JavaScript. Unknown provider IDs, adapters or invalid mappings stop startup before routes and timers register.
Commands for dsh-usage-stats
DeepSeek Harness manages the plugin with dsh plugin --profile web update dsh-usage-stats and dsh plugin --profile web remove dsh-usage-stats. After adding or updating the plugin, restart the running dsh web process and hard-refresh the browser. The alternative npx installer supports --dry-run, --check and --no-enable, but it is a separate installation path and must not be combined with a manual Cordis entry.
Requirements and behaviour
DeepSeek Harness requires the web profile and @deepseek-ai/dsh >= 0.1.0-rc.6. The service refreshes configured accounts and local token aggregates at startup and every five minutes, regardless of whether the panel is open. The browser requests only the selected provider. A manual refresh updates tokens and the provider list, and forces the selected account rather than all accounts.
Known limits
Providers without a public account interface can still contribute token usage, but their account card reports that balance checks are unsupported. OpenCode Go uses a non-public bearer usage endpoint that may change. Cookie credentials are equivalent to login credentials. Future timestamps are excluded, and “last 14 days” uses local calendar dates.
Written from the project's own documentation and kept in sync with it. Where the two disagree, the source is authoritative — read the README on GitHub