Preface¶
When using OpenCode Go in DeepSeek Harness (DSH), you often want to see at a glance “how much quota remains, when the subscription expires, and whether it will auto-renew.” The public usage endpoint provided by OpenCode, GET https://opencode.ai/zen/go/v1/usage, can be called with API key authentication, but the response only contains percentages for rolling windows and reset times; it lacks monetary amounts and subscription expiration dates. Consequently, common OpenCode usage plugins in the community (such as vinyumao, LTctfer, dsh-go-balance, etc.) can usually only display percentages and cannot provide expiration times.
dsh-opencode-go-status is a DSH Web plugin (Category: Web Tools) released by maintainer 0x-0cd. It switches to reading the console status API, provides a “Usage” entry in the sidebar, and displays plan usage, remaining quota, expiration time, and renewal status in the main area. The following section introduces its positioning, capabilities, and installation/configuration methods.
What is this¶
A DSH Web plugin OpenCode Go Subscription Status Panel: Access the main panel via the dashboard icon in the sidebar to aggregate OpenCode Go quota and subscription information. Repository: 0x-0cd/dsh-opencode-go-status; Community Directory Page: skillhub entry. Licensed under MIT; package version is 0.1.1.
Unlike the public /zen/go/v1/usage, the host-side request is:
GET https://opencode.ai/console/api/go/status
Authorization: Bearer <OPENCODE_GO_API_KEY>
It still uses your existing OpenCode Go API key, requiring no browser cookies. The access.meters (fiveHour, week, month) in the response contain usedMicroCents / limitMicroCents (1e8 microCents = US$1), as well as access.startsAt / access.endsAt, cancelAtPeriodEnd, renewalPending, paymentMethodKind, useBalance, upgradePrice fields, etc., to support the interface in displaying monetary usage and renewal-related information.
Core Features¶
Quota & Progress¶
- One quota card for each of the three billing windows: Used / Limit amount (e.g., $9.96 / $60.00), Remaining amount, Percentage, Progress bar, and tiered color coding.
- The main panel auto-refreshes approximately every 60 seconds, with support for manual immediate refresh; the interface indicates the data source and update time.
Subscription & Renewal¶
- Expiration Time: Based on
access.endsAt, including a real-time countdown and the current period start time (access.startsAt). - Renewal Status: Readable fields such as auto-renew or cancel at end of period, whether renewal is processing, renewal currency and payment method, and Zen balance fallback switch (
useBalance).
UI Mounting¶
- Sidebar:
sidebar.panellistslot, order 40, dashboard icon; clicking switches to the main panel, and the icon status is maintained by the shell. - Main Area:
mainkeyed slot, where the key matches the entry id; three quota cards + expiration/renewal cards.
Host & Browser Division of Labor¶
The browser only accesses the same-origin route /api/dsh-opencode-go-status/status; the API key is resolved only within the DSH host process and used for the outbound GET, never entering the browser. Outbound requests point only to the configured statusURL (default https://opencode.ai/console/api/go/status), with no telemetry or third-party endpoints. Quota snapshots are cached in the host memory (default cacheSeconds 30) and are not written to disk.
Installation & Activation¶
The installation methods provided in the README are as follows (choose one; duplicate mounting will result in two instances):
dsh plugin --profile web add file:/Users/qianneng/Code/dsh_optimize/dsh-opencode-go-status
Or copy the insert line from cordis.patch.yml into $DSH_HOME/profiles/web/cordis.patch.yml, and then install by pointing file: to this plugin directory.
Refresh the browser after installation; if the host is already running, you may sometimes need to restart dsh web for the new plugin line to load. After modifying host-side code, you must re-install via file: (copy, not symlink), otherwise the profile will still use the old copy.
Configuration¶
Add config: under the insert line in cordis.patch.yml:
| Field | Default | Description |
|---|---|---|
apiKey |
None | Hardcode API key directly (not recommended, prefer credentials) |
apiKeyRef |
OPENCODE_GO_API_KEY |
DSH credential reference name, consistent with the opencode-go provider’s apiKeyEnv |
statusURL |
https://opencode.ai/console/api/go/status |
Upstream status API |
timeoutMs |
15000 |
Request timeout |
cacheSeconds |
30 |
Host-side cache window |
enabled |
true |
Master switch |
Key resolution order: apiKey → DSH credential service (apiKeyRef, covering $DSH_HOME/.credentials.yaml, startup environment, .env) → Process environment variables. Non-loopback statusURL forces HTTPS to prevent plaintext HTTP from leaking keys.
Typical Usage¶
- Ensure the OpenCode Go API key is configured via
apiKeyRef(defaultOPENCODE_GO_API_KEY) or DSH credentials, matching the opencode-go provider environment variable name. - Complete the Web profile installation as described in the previous section and refresh or restart
dsh web. - Click the dashboard “Usage” entry in the DSH Web sidebar to view the three-window quota, expiration countdown, and renewal status in the main area; click to refresh immediately if needed.
Development and local verification (from README):
git config core.hooksPath .githooks
node --check index.js && node --check client.js
node --test test/*.test.mjs
Use Cases & Notes¶
Who it is for: Users already using OpenCode Go in DSH Web who wish to see USD quota, remaining amount, subscription expiration, and renewal status within the same interface, rather than settling for the percentages provided by the public usage API.
Runtime Permissions: The plugin runs with the permissions of the current dsh process. Please read the source code and MIT license yourself before installation; security audit descriptions can be found in SECURITY-AUDIT.md in the repository.
Known Limitations (Key points from the original README):
/console/api/go/statusis an internal OpenCode console API and is not officially documented; fields may change with upstream updates. The host performs defensive parsing for missing fields, displaying “—” on the corresponding card instead of throwing errors.- Zen prepaid wallet balance cannot be read via API key (
/console/api/billing/statusreturns 403 for keys). The quota displayed by this plugin refers to the Go subscription quota, not the Zen wallet balance. - The host must be able to access
opencode.ai(README states both direct connection and HTTP proxy are acceptable). - When
cancelAtPeriodEnd=false, the expiration time is the renewal date. The “Expires” and auto-renewal semantics on the interface should be understood accordingly.
The DSH ecosystem emphasizes “Everything is a plugin”; skillhub.cn is a community directory and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-opencode-go-status completes OpenCode Go’s subscription status from “only percentages” to “Amount + Expiration + Renewal,” placing it in the DSH Web sidebar and main panel. Keys remain on the host, while the browser accesses same-origin APIs. For further information and installation, see the Directory Page and GitHub Repository.