Introduction¶
When developing with DeepSeek Harness interfaced with OpenCode Go, a common pain point is opaque quotas: knowing which account the current session is on, and how many hours/weeks/months are left for that account. You cannot see this next to the input box; you have to switch to the OpenCode console to verify one by one. It becomes even harder to remember after opening multiple providers, and quota exhaustion is often only discovered when sending a message fails.
dsh-opencode-go-multi-quota is a client plugin designed for this problem. It is maintained by jackgucarbon. It displays the remaining quota of all configured OpenCode Go accounts below the DSH composer and automatically switches to the corresponding account’s quota following the session provider.
What is it¶
One-line positioning: A client plugin for DeepSeek Harness that aggregates the usage of multiple OpenCode Go accounts below the composer and follows the session provider. The repository is jackgucarbon/dsh-opencode-go-multi-quota, current version 1.1.0, license MIT, stars 0. It only solves “viewing quotas” and does not handle switching accounts or forwarding credentials.
Core Features¶
Below are the implemented capabilities, all taken from the README.
- Multi-account auto-detection: Reads configuration from
llm-pi-ai.providersand selects all providers that look like OpenCode Go. The plugin code does not hardcode the number of accounts. - Follows session provider: Uses the session-scoped
modelDirectoriesstore. When switching models, the parameter bar immediately switches to the quota of the corresponding account. - Adaptive layout: 1 account uses a 320px compact card; 2 accounts use a 360px two-column matrix; 3 or more use a “Current account card + expandable rows for other accounts”. No horizontal scrolling occurs. The current account is highlighted, and
Rate limitedis displayed in red. - Compact status information: Each cell displays the remaining percentage, used percentage, and
↻reset time. Daily resets only showHH:mm, while other dates showMM/DD HH:mm. - Per-account caching: The Host caches 60 seconds for each provider individually. A failure in a single account does not affect others.
- No keys on the browser side: Credentials are only parsed in the Host process. The page only receives percentages; keys are not sent down.
How Accounts Are Discovered¶
Every time a request is made, the Host reads the loaded @deepseek-ai/dsh-llm-pi-ai entry and its config.providers. A provider is included if it has apiKeyEnv and satisfies at least one of the following:
- The provider ID starts with
opencode; - The
baseURLcontainsopencode.ai; - The
apiKeyEnvcontainsOPENCODE.
The value of apiKeyEnv is the credential reference that needs to be parsed. Providers that have stored credential records but no apiKeyEnv will not be displayed.
If the loader configuration cannot be read, the Host falls back to two convention references, OPENCODE_GO_API_KEY and OPENCODE_API_KEY. If no matching provider is found, “No OpenCode accounts found” is displayed instead of a spinning loader.
Installation and Enabling¶
This package is only distributed from GitHub and has not been published to npm. It is recommended to open Plugins → Install in the DSH Web UI and install using the GitHub spec below:
github:jackgucarbon/dsh-opencode-go-multi-quota
The Plugin Manager will add the bundle to the profile and reload.
CLI installation only adds package dependencies; you still need to add the bundle to dsh.profile.bundles yourself. The command is:
dsh plugin --profile desktop add github:jackgucarbon/dsh-opencode-go-multi-quota
Then confirm the bundles list in the configuration:
{
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-opencode-go-multi-quota"]
}
}
}
After installation, if the Host does not reload automatically, you need to restart DSH and then refresh the page.
Host API¶
The plugin registers a same-origin read-only route on the Host side, which the client uses to retrieve quotas:
| Request | Response |
|---|---|
GET /plugin/opencode-go-multi-quota |
Default provider (first discovered, or opencode-go) |
GET /plugin/opencode-go-multi-quota?provider=opencode |
A provider specified by name |
GET /plugin/opencode-go-multi-quota?provider=all |
All discovered accounts, with detected flag |
Any of the above URLs with &refresh=1 |
Bypass 60-second cache |
The upstream interface is GET https://opencode.ai/zen/go/v1/usage, using a Bearer token. This call is read-only and does not consume plan quota.
Typical Usage¶
After configuring accounts, simply chat normally in DSH. The plugin is injected below the composer and defaults to displaying the quota of the first discovered account; when switching models in the parameter bar, the change in modelDirectories drives the display to switch to the corresponding provider. When there are multiple accounts, you can expand on the right to view others; the current account column is highlighted.
When troubleshooting quota anomalies, you can directly request the read-only route, for example, to get all accounts:
curl http://localhost:<端口>/plugin/opencode-go-multi-quota?provider=all&refresh=1
Adding refresh=1 bypasses the 60-second cache, allowing you to see the current value immediately. This is suitable for verifying whether a specific account has just been exhausted.
Applicability and Notes¶
Suitable for developers who have already configured one or more OpenCode Go providers in DSH and wish to see remaining quotas at any time. It relies on @deepseek-ai/dsh-client-ui-model-selection in the standard Web client, so the corresponding client bundle must be used.
Three points need attention.
- The plugin runs with the permissions of the current dsh process. You should review the source code and license (MIT) before deciding to enable it.
- The quota route is same-origin and read-only, but unauthenticated, and
refresh=1bypasses the cache. Do not expose the DSH Web service to untrusted networks; add a proxy or authentication layer in front. - The auto-discovery rules are intentionally relaxed. If there is an OpenCode provider that is not Go and contains
OPENCODEin its credential reference, it may be included and fail to display. In this case, you can narrow the rules or remove it fromllm-pi-ai.providers.
In terms of compatibility, the plugin is built and tested on DeepSeek Harness 0.2.1-rc.5, with the engines.dsh constraint set to >=0.2.1-rc.5 <0.3.0. It uses the client modelDirectories service and the Host side loader, credentials, and webServer services. If these services undergo breaking changes, the plugin needs to be updated. The README mentions testing with fake keys and mock fetch, so npm test can be run without real credentials.
Conclusion¶
The value of this plugin lies in centralizing the remaining quotas scattered across multiple accounts to a fixed position and following the current session provider, saving the repetitive action of opening the console to confirm. It only performs display and read-only queries; credentials never leave the Host process.
Directory: https://www.skillhub.cn/plugins/jackgucarbon/dsh-opencode-go-multi-quota
GitHub: https://github.com/jackgucarbon/dsh-opencode-go-multi-quota