Preface¶
When switching models or connecting to multiple vendors in DeepSeek Harness (DSH), usage data is often scattered across various platform consoles or other plugins. It is difficult to check “how fast the budget is being spent” or “when the reset window occurs” during an active session. If you can see the corresponding numbers directly on the sidebar next to the service currently used in the session, decision-making becomes much easier. dsh-usage-meter is exactly the DSH sidebar widget designed for this scenario: released by the community maintainer gaolin89898, under the MIT license, requires DSH ≥ 0.1.7 (README marks the current version as v1.1.1; npm package name is @gl070900/dsh-usage-meter).
What is it¶
dsh-usage-meter is a DSH web sidebar widget (dsh.client.platform: web). It follows the service currently used by the session and displays the quota or balance for that service in real-time, such as the 5-hour/week/month usage window for OpenCode GO, the rolling and weekly usage for MiniMax, and the available balance for DeepSeek, OpenRouter, Moonshot, and other paths. Below each usage bar is a time bar, comparing the consumption rhythm with the elapsed and remaining ratios. Key queries are completed by the Host’s same-origin proxy; the browser does not carry the API key directly and does not involve cross-domain requests.
Core Features¶
Summarized below based on capabilities already documented in the README, within the scope of the documentation.
Usage Display & Sidebar Interaction¶
- OpenCode GO: Three usage bars for 5 hours, week, and month, each with a reset countdown; when the sidebar is collapsed, it can shrink into a compact percentage badge.
- Time bar stacked below usage bar: A gray segment represents elapsed time, and a blue segment represents remaining time; hovering reveals percentages on both sides; when the window resets, the gray segment fills up to zero.
- Switching models or sessions: The sidebar instantly switches to the quota or balance of the corresponding service; old requests will not overwrite data for the new service.
Multi-service Coverage¶
The Host queries via GET /opencode-go/usage?provider=<service route>&model=<model>, parses credentials based on the current service configuration, and caches are isolated by service, model, and credentials. The service table in the documentation is roughly as follows:
| Service | Display Content | Source Note |
|---|---|---|
| OpenCode GO | Rolling, weekly, and monthly usage with reset times | Can go through dsh-opencode-go or built-in providers (dual source) |
| MiniMax Domestic · International | Coding Plan rolling and weekly usage | Built-in direct connection |
| DeepSeek API · Login Account | Available balance, etc., by currency | Built-in |
| OpenRouter | Total recharge minus used amount | Built-in |
| Moonshot Domestic · International | Available balance | Built-in |
| AI Toolbox Gateway | Remaining and total points displayed by model prefix | Built-in |
| Other Services · Custom Proxy | Prompts that querying is temporarily not supported | — |
When credentials are not configured, not logged in, or the interface fails, the widget displays the corresponding status instead of being blank.
Quota Source & Fallback¶
The configuration item quotaSource determines where the number comes from. By default, it can prioritize dsh-opencode-go current account, falling back to the built-in provider and marking the reason on the panel if it fails; it can also be fixed to builtin to always use baseUrl + /v1/usage.
The plugin registers a configuration page in the plugins.bundle.config slot of DSH: Sidebar → Plugin Panel → @gl070900/dsh-usage-meter Card → Configuration Page, where you can switch sources, view detection and fallback status, and save quotaSource via POST /opencode-go/settings (modifying the same entry configuration as Settings → Plugins → Plugin Configuration).
Session Header Injection (OpenCode GO)¶
Addressing the issue where the GO gateway lacks x-opencode-session causing HTTP 400 MissingSessionID, the plugin can wrap globalThis.fetch at runtime, listen to llm/stream events to inject session headers; the switch is the configuration item injectSessionHeader (default true), and the gateway base is parsed from the real-time configuration of the called provider, not a hardcoded domain.
Installation & Enablement¶
The path given in the README is to install from a local source code directory or a Release package, not by concatenating the repository name with dsh plugin add github:.... For first-time use, follow the steps in the User Guide inside the repository.
1. Install to web profile¶
Depends on pnpm; if not available, run corepack enable first. Add the plugin to the currently used profile (Web example below, Desktop is the same with the profile name replaced):
# install into the web profile
$ dsh plugin --profile web add ./dsh-usage-meter
You can also download dsh-usage-meter-1.0.1.tgz from the v1.0.1 Release and execute:
$ dsh plugin --profile web add ./dsh-usage-meter-1.0.1.tgz
The documentation notes that the same-named package on npm belongs to a different project and you should use this repository’s package or source code directory. dsh plugin add will automatically merge the package’s dsh.bundle.patch, and generally you don’t need to manually modify cordis.patch.yml.
2. Write Credentials¶
Configure OpenCode GO related keys in ~/.dsh/.credentials.yaml (even if mainly using dsh-opencode-go, they will still be used when falling back to the built-in path):
OPENCODE_GO_API_KEY: sk-...
You can create the Key at opencode.ai/auth. Configure credentials for other services according to existing methods in DSH and each built-in path.
3. Restart and Hard Refresh¶
After fully exiting DSH, restart (do not just refresh the page), and the browser should execute Cmd/Ctrl+Shift+R. After installation, the widget should appear at the bottom of the sidebar.
For upgrades: users with local directory installation should update the source code first, then repeat the installation command for the same directory; confirm that only one usage component is enabled in the plugin panel before starting and hard refreshing.
Typical Usage & Configuration¶
Sidebar & Command¶
Daily usage or balance can be viewed in the sidebar. Typing /opencode-go in any chat can output numbers consistent with the widget (as noted in README).
Common Configuration Items¶
The following fields are volatile; they take effect immediately after modification in the plugin configuration or profile patch, no restart required (full list in README ‘Configuration Items’ section):
| Key | Default | Description |
|---|---|---|
quotaSource |
opencode-go |
opencode-go or builtin |
apiKeyEnv |
OPENCODE_GO_API_KEY |
Environment variable name for credentials in the built-in path |
baseUrl |
https://opencode.ai/zen/go |
Gateway for the built-in path |
cacheMs |
30000 |
Upstream cache TTL on the Host side |
updateCheck |
false |
Whether to check for new GitHub Releases |
injectSessionHeader |
true |
Whether to inject session headers for GO chat requests |
Example profile patch:
- id: dsh-opencode-go-usage
config:
cacheMs: 60000
quotaSource: builtin
If you start with a local link: installation and get an error Cannot find package '@deepseek-ai/schemastery', you need to handle the junction as described in the README “Local link install dependency resolution”. The volatile settings page requires schemastery ≥ 3.18.4; the plugin can still be enabled with an old copy, but hot-editing quotaSource may not work.
Suitable Scenarios & Notes¶
Suitable for: Users who use OpenCode GO, MiniMax, DeepSeek, OpenRouter, Moonshot, or AI Toolbox Gateway in DSH Web (or Desktop with the same profile) for a long time, and hope to see quota, balance, and reset times next to their coding sessions, rather than repeatedly opening various platform consoles.
Runtime & Trust Boundary: The plugin runs with the permissions of the current DSH Host process, will read profile credentials and request upstream or built-in interfaces on your behalf. Before installation, you should review the GitHub repository source code and MIT license yourself to ensure Acceptable Use and key storage methods fit your environment policy.
Ecosystem Note: DSH follows the philosophy “Everything is a plugin”; the SkillHub Directory Page is a community plugin index, with no official affiliation with DeepSeek / Moonshot; this article also does not describe it as an official app store entry.
Ending¶
After the above steps, you can obtain a multi-service usage and balance view that switches with the session in the DSH sidebar, and control the source of OpenCode GO numbers via quotaSource and the configuration page when needed. For more HTTP routes, fallback reason codes, and compatibility details, refer to the repository README.