Shows the selected model provider's account balance next to the composer's model seat once a model and reasoning effort are selected.
Install
# from npm (prebuilt)
dsh plugin --profile web add @kkbsgg/dsh-balance
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:kkbsgg/dsh-balance
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
DeepSeek Harness plugin that displays the selected model provider's account balance as a small text next to the composer's model seat, once a model (and its reasoning effort) is selected for the active conversation.
How it works
- Host half (
lib/index.js, a Cordis plugin) mounts one loopback HTTP route —GET /dsh-balance/balance?provider=<route>— on the webserver. The route resolves the selected provider's own API key through the standard credentials service (thellm-deepseeksection for the DeepSeek official route, thellm-pi-aiproviders table for custom/other routes), then probes the provider's balance: DeepSeek-styleGET <baseURL>/user/balancefirst, falling back to the OpenAI-styleGET <baseURL>/v1/dashboard/billing/credit_grants. The key never crosses the wire boundary. - Client half (
client/client.js, a web client plugin) registers a seat into theconversation.input.rightslot (immediately beside the model selector). It subscribes to the active session's model-selection directory (modelDirectories), passes the selected provider to the route, and only renders after a model with a non-empty id is selected — an empty selection hides the text instead of retaining a stale balance. Polls every 60s; clicking the text refreshes immediately.
Installation
From source (any DSH profile)
The package declares a dsh.bundle manifest, so it installs through the
standard plugin command once the repo is resolvable:
dsh plugin add @kkbsgg/dsh-balance
Manual (packaged DSH Desktop)
With the package resolvable from the profile's node_modules, add one loader
row to the profile patch ($DSH_HOME/profiles/<profile>/cordis.patch.yml):
- insert:
- id: balance
name: 'dsh-balance'
and restart the application so the loader composes the new row. Subsequent edits to the client bundle hot-reload through the client HMR channel.
For the packaged DSH Desktop app, the package lives in the app's unpacked
node_modules and is linked into $DSH_HOME/profiles/node_modules as a
junction, so the profile loader resolves it exactly like the in-box plugins.
Note: the package is installed by hand into the pnpm-managed hoisted store. A future
pnpm installin the profile may prune it; re-create the link if the balance text disappears after a plugin-market install.
Repository layout
dsh-balance/ (@kkbsgg/dsh-balance)
├── lib/index.js # host half (Cordis plugin + balance route)
├── client/client.js # client half (web client plugin bundle)
├── test/smoke.test.mjs # host-half smoke test (run: node test/smoke.test.mjs)
├── cordis.patch.yml # dsh.bundle patch (market installability)
├── package.json # dsh.bundle + dsh.client manifest
├── CHANGELOG.md
├── .editorconfig
└── README.md
The live copy currently installed in the DSH Desktop app lives under the app's
unpacked node_modules; this repository is the source of truth. After
changing code here, re-sync the files into the installed copy (or install the
package from this repo and re-create the profile link).
Response shape
{ "ok": true, "isAvailable": true,
"balanceInfos": [{ "currency": "CNY", "totalBalance": "110.00", "grantedBalance": "10.00", "toppedUpBalance": "100.00" }],
"fetchedAt": "2026-01-01T00:00:00.000Z" }
{ "ok": false, "code": "no-api-key", "message": "no credential configured for DEEPSEEK_API_KEY" }
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 8567
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 8567
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 4363
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
ccch1mneyyy/dsh-TUI★ 4235
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 4081
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
Devin-AXIS/deepseek-design#deepseek-idesign★ 1441
Visual design studio for websites, app prototypes, posters, cards, reports, and magazines, with templates, direct element editing, selection-aware AI draft handoff, and export.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.