Quota ring beside the DSH model selector that reads OpenCode Go and 14 other coding-plan quotas or balances, cycles the 5-hour, weekly and monthly windows, and colours itself by urgency.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/sxwer001/dsh-coding-plan-quota/releases/download/v0.2.1/dsh-coding-plan-quota-0.2.1.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:sxwer001/dsh-coding-plan-quota
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
dsh-coding-plan-quota
Supports DSH 0.2.0-rc.2 and 0.2.1-rc.5 on Node.js ≥22.19.0. Version 0.2.3 declares the verified hosts and preserves the GLM percentage fix from 0.2.2. Windows checks cover native installation, a simulated quota endpoint, the ring/card and live disable/re-enable. On 2026-11-04, the installed rc.5 executable and 0.2.3 package successfully read real OpenCode Go usage through the native credential service: three percentages/reset times, the native HTTP route, cache reuse, POST 405 and cross-origin 403 all passed. Other providers have no current-release live endpoint acceptance.
A quota ring in the DSH composer tool row, immediately left of the model selector. It reads the usage windows or account balances of your coding plans and shows one source at a time.
- Click the ring to cycle that source's windows: 5-hour → weekly → monthly. A balance-only source refreshes instead.
- Colour by urgency: green
<50%→ blue<75%→ orange<90%→ red≥90%. - Hover for the used percentage, a live reset countdown and a bar per window.
- The card names the current source in one
额度来源 · <name> ›row. Click it to switch to another — the picker lists the sources that can actually answer, with a toggle for the rest. - A source that fails keeps its last good numbers, marked
stale, instead of going blank.
The chosen source and window persist in localStorage.
Screenshots

Install
From the DSH plugin market (category Usage & Billing), or:
dsh plugin --profile web add dsh-coding-plan-quota # npm
dsh plugin --profile web add github:sxwer001/dsh-coding-plan-quota # GitHub
Restart DSH afterwards.
To work on the source instead of copying it:
New-Item -ItemType Junction -Path "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-coding-plan-quota" -Target "D:\Antigravityproject\dsh-coding-plan-quota"
Sources
| Source | id |
Credential | Notes |
|---|---|---|---|
| OpenCode Go | opencode-go |
OPENCODE_GO_API_KEY |
5-hour / weekly / monthly |
| 智谱 GLM | glm |
ZHIPU_API_KEY |
5-hour / weekly; region: cn uses open.bigmodel.cn |
| Kimi | kimi |
KIMI_API_KEY |
|
| MiniMax | minimax |
MINIMAX_COOKIE |
needs a browser session cookie, not an API key |
| 火山方舟 | ark |
ARK_API_KEY |
no public quota URL — set endpoint yourself |
| Claude 订阅 | claude |
CLAUDE_CODE_OAUTH_TOKEN |
OAuth token, not an API key |
| Codex / ChatGPT | codex |
CHATGPT_ACCESS_TOKEN + CHATGPT_ACCOUNT_ID |
chatgpt.com is unreachable from some networks |
| Gemini CLI | gemini |
GEMINI_ACCESS_TOKEN |
cloudcode-pa.googleapis.com is unreachable from some networks |
| GitHub Copilot | copilot |
COPILOT_API_TOKEN |
set insecureTls: true if a TLS proxy blocks the handshake |
| DeepSeek 余额 | deepseek |
DEEPSEEK_API_KEY |
balance only |
| Moonshot 余额 | moonshot |
MOONSHOT_API_KEY |
balance only |
| OpenRouter 余额 | openrouter |
OPENROUTER_API_KEY |
balance only |
| 硅基流动余额 | siliconflow |
SILICONFLOW_API_KEY |
balance only |
| 阶跃星辰余额 | stepfun |
STEPFUN_API_KEY |
balance only |
| Novita 余额 | novita |
NOVITA_API_KEY |
balance only |
A source without a credential just reports which one it needs. Percentages reported as remaining are
inverted into used; where a plan reports one window per model (GLM, Gemini), the worst model wins.
Configuration
apply(ctx, config) merges the config over these defaults:
| Key | Default | Meaning |
|---|---|---|
cacheMs |
60000 |
host-side cache lifetime per source |
timeoutMs |
12000 |
upstream request timeout |
thresholds |
[50, 75, 90] |
green → blue → orange → red boundaries |
defaultProvider |
"opencode-go" |
what to show before you pick one |
hideUnconfigured |
false |
hide sources with no credential |
insecureTls |
false |
skip certificate verification |
providers |
{} |
per-source overrides, keyed by id |
Per-source overrides:
| Key | Meaning |
|---|---|
enabled |
false removes the source from the card |
endpoint |
replace the built-in URL (this is how you enable ark) |
apiKey |
a literal key, which beats every other credential source |
apiKeyEnv |
read the key from this environment variable instead |
region |
"cn" switches to the vendor's mainland endpoint |
insecureTls |
per-source override of the global flag |
- insert:
- id: coding-plan-quota
name: dsh-coding-plan-quota
config:
thresholds: [50, 75, 90]
defaultProvider: opencode-go
providers:
ark:
endpoint: "https://<your-ark-quota-url>"
Credentials
For each source, the first hit wins: providers.<id>.apiKey → the environment variable named by
providers.<id>.apiKeyEnv (or the built-in name) → DSH's credentials service →
$DSH_HOME/.credentials.yaml → the vendor's own CLI file, where one exists (OpenCode, Claude, Codex,
Gemini, Copilot).
Credentials are read on the node half and never sent to the browser.
Notes
- The card follows the DSH UI language (zh / en) live, with no setting of its own.
- The browser half reads a same-origin route on the node half:
/plugins/dsh-coding-plan-quota/usage.json(?refresh=1,?provider=<id>,?debug=1). - Editing
lib/host.jsneeds a DSH restart; editinglib/client.jsonly needs a page refresh. node scripts/verify.mjsruns the end-to-end checks.
Layout
dsh-coding-plan-quota/
├── package.json dsh.bundle.patch + dsh.client { platform: web }
├── cordis.patch.yml - insert: [{ id, name }]
├── lib/
│ ├── host.js node half — sources, credentials, cache, HTTP route
│ └── client.js browser half — the ring, the card and the picker
├── scripts/
│ └── verify.mjs end-to-end checks
├── README.md Chinese (default)
└── README.en.md English
License
MIT
Links
More in this category
bowenliang123/dsh-context★ 5607
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 771
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 292
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 207
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 192
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
PolinniZhong/dsh-personal-center★ 114
Personal center for DeepSeek Harness: cross-session usage statistics with per-provider and per-model breakdown (auto-discovers configured models), per-model cost estimation, global custom instructions, a data-driven desktop pet with bitmap & vector skins, and a conversation status overview, all local and offline.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.