Install
Inside DeepSeek Harness, with dsh-market
dsh plugin --profile web add dshmarket
Or from the command line
dsh plugin --profile web add github:kai-GitHubaccount/dsh-usage-panel
Installing runs third-party code with your own permissions — it can read your files, use your credentials and reach the network. Review the source first, and pin a commit (github:owner/repo#sha) when you can.
README
English | 简体中文
DeepSeek account balance and per-session token usage for the DSH (DeepSeek Harness) web GUI, rendered as a colored pill in the session header (top right).

Features
- Balance from the official
GET /user/balance(total / topped-up / granted). - Token usage from the host
tokenUsageprojection: uncached input, cache read, cache write, output, total, and cache-hit rate. - Three-level balance alert with user-editable thresholds: sufficient / warning / insufficient, recoloring the pill and the detail card.
- Recharge entry: top-up, usage detail, sign-in, and copy-link, with three open modes (new tab / same tab / copy link).
- Query efficiency: visibility-aware polling (paused on hidden tabs), exponential backoff on failure, a 30s host cache with single-flight, and manual refresh.
- Version tolerant: the host prefers
ctx.connection.fetchand falls back toctx.webServer; the browser tries the session-header seats in order.
Install
Option 1 - install it as a plugin package (recommended):
dsh plugin --profile web add dsh-usage-panel
Option 2 - local installer:
node install.mjs --home ~/.dsh --profile web
Restart dsh web (or let the live patch watcher apply it) and refresh the GUI.
Configuration (host)
apply(ctx, config) reads an optional config object from the patch row:
| Field | Default | Meaning |
|---|---|---|
routePath |
/api/usage-panel/balance |
route served by the host half |
cacheMs |
30000 |
upstream cache and single-flight window |
apiKeyEnv |
DEEPSEEK_API_KEY |
resolved via ctx.credentials, then env |
baseUrl |
https://api.deepseek.com |
provider base URL |
baseUrlEnv |
DEEPSEEK_BASE_URL |
env var overriding baseUrl |
Compatibility
- Host: Node >= 18, no imports, so it loads from any path. Prefers
ctx.connection.fetch.registerand falls back toctx.webServer.register. Key resolution usesctx.credentialswhen present. - Browser: requires only the seeded React module and the
slotsservice. Preferred seat isconversation.session.header.utilities, thenconversation.session.header.corner;sidebar.footer.actionis a delayed (4s) fallback, so the pill never pre-empts the header on a normal boot. Token usage needs the session-scopeduseProjectionhook; without it the balance still renders. - No platform-specific code, so it is machine independent.
Verify
node tools/verify.mjs --port 3080 --home ~/.dsh
Reports boot-graph presence, the HMR channel, and the served bundle features.
Uninstall
Remove the usage-panel insert row from the profile patch and delete <home>/plugins/dsh-usage-panel.
Author
Mysterious Mark
License
Comments
Comments live in GitHub Discussions. Sign in with GitHub to post or react.