Introduction¶
DeepSeek Harness (dsh web) provides an agent runtime environment for developers. In long-running or multi-account switching scenarios, having real-time visibility into account balances, session consumption, and cumulative costs is essential. dsh-credits is a credits plugin for DeepSeek Harness that visually displays balances, consumption, and TPS in the interface, and supports multiple providers and custom endpoints.
Feature Overview¶
The plugin displays the account balance and estimated current-session consumption below the input box, and provides a draggable cumulative consumption capsule in the bottom-right corner. Settings are located under Quotas in the sidebar (currency coin icon) and support multiple collapsible cards. Core capabilities include:
* Multi-source quota support: Supports DeepSeek official balances or OpenCode Go subscription usage, and can connect to other quota sources via custom HTTP endpoints.
* Peak/off-peak pricing and TPS: Automatically applies DeepSeek V4 peak/off-peak pricing and calculates throughput TPS from settlement data in DSH Session v2.
* Multi-provider configuration: Supports independent configuration for multiple providers without interference.
* Visualization and export: Supports visualization of current-session estimates and cross-session cumulative consumption, as well as YAML configuration export.
Installation and Enablement¶
Install the plugin using the following command:
dsh plugin --profile web add dsh-credits
For local development, please use an absolute path:
dsh plugin --profile web add <本目录绝对路径>
After installation, restart dsh web to load the changes.
Configuration Notes¶
Plugin configuration is governed by providerQuotas. Sensitive credentials, such as Tokens, are stored in DSH credentials and are not written into regular YAML configuration. The configuration file is usually located at $DSH_HOME/profiles/web/cordis.patch.yml, and can also be modified by making changes in the sidebar Quotas settings and clicking save.
Provider Quota Configuration¶
In Settings → Quotas → Quota Query, the list is based on providers enabled in DSH. Each provider can independently select:
* Built-in template: Uses the template’s query URL and parsing rules, supporting DeepSeek, OpenCode Go, and other built-in balance/plan templates.
* Reuse another provider’s quota: When two model providers share the same account, directly display the quota already queried for the other provider.
* Custom HTTP endpoint: Manually configure the URL, authentication, response field mapping, and numeric conversion.
YAML Configuration Example¶
The following example shows how to configure quotas for two OpenCode Go accounts and set pricing in Chinese yuan (CNY):
- id: dsh-credits
config:
providerQuotas:
- providerId: opencode-go
enabled: true
sourceType: template
templateId: opencode-go
thresholdMode: percent
warningThreshold: 30
dangerThreshold: 10
refreshIntervalMs: 300000
- providerId: go-personal
enabled: true
sourceType: template
templateId: opencode-go
thresholdMode: percent
warningThreshold: 30
dangerThreshold: 10
refreshIntervalMs: 300000
currency: CNY
Compatibility and Notes¶
- Version requirement: Compatible with DSH Session v2 (
dsh 0.1.3-alpha.2and later); no longer compatible with legacy session events. - Sensitive information: Directly entered Tokens or Cookies are stored in DSH credentials and are not written into the exported regular configuration.
- Local development: Installing local plugins requires using an absolute path.
- Take-effect timing: After changing the configuration, restart
dsh webfor the changes to take effect.
Summary¶
dsh-credits provides a complete quota management solution for DSH Web, covering balance queries, consumption estimates, and cost visualization, helping developers control operating costs more precisely. The plugin supports flexible configuration methods: you can use built-in templates to quickly connect mainstream providers, or adapt to more scenarios through custom endpoints.
Link: GitHub Repository