View DeepSeek API account balance and billing info in DSH, with a /deepseek-billing slash command.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:golitter/dsh-deepseek-billing
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
Features
Adds a “Billing” page to the Web settings of DeepSeek Harness, providing:
- DeepSeek API available, topped-up, and granted balance display
- Manual refresh plus loading, empty, and error states; a refresh failure keeps the last successful balance and timestamp
- Live switching between Chinese and English
- Light/dark theme and narrow-screen support; amounts wrap within narrow content areas without truncating their values
- Secure API Key access through the DSH credential store; the key is never sent to the browser
- A
/deepseek-billingslash command for quickly checking the balance in a conversation; a new blank session stays on its current view and shows a transient notice, which is cleared when the session becomes active, after one minute, or when navigating away, and balance queries made while blank do not reappear after activation
First Principles
This plugin solves one fundamental problem: reliably showing the real DeepSeek account balance without exposing the API Key.
The feature set is intentionally focused. The Host securely reads the credential and calls DeepSeek's official balance endpoint, while the Client only displays the returned balance, supports manual refresh, and presents stable error feedback. The plugin does not implement usage history, trend charts, consumption forecasts, balance alerts, automatic top-ups, or API Key management. Those features either lack a reliable data source or fall outside the core responsibility of querying the balance. Omitting them is a deliberate first-principles scope decision, rather than filling the interface with fabricated data.
Installation and Usage
Install the plugin:
dsh plugin --profile web add github:golitter/dsh-deepseek-billingConfigure the DeepSeek API Key in
$DSH_HOME/.credentials.yaml:version: 1 refs: DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxxDSH migrates an existing legacy flat credentials document at startup; new documents should use the
version: 1andrefsformat directly. On POSIX systems, restrict the file to the current user, for example withchmod 600 "$DSH_HOME/.credentials.yaml"; do not record a real key in documentation, logs, or screenshots.Start DSH Web:
dsh --profile webOpen “Settings → Billing” to view the balance. Click “Refresh” to fetch it again. An initial failure shows the full error state; after a successful load, a failed refresh keeps the old balance and shows a non-blocking notice.


Enter the argument-free
/deepseek-billingcommand in a conversation and press Enter to confirm the query. Extra arguments return a localized usage message. In a new blank session, the result appears as a transient notice beside the input instead of entering the conversation history. The notice is cleared when the session becomes active, after one minute, or when navigating away; commands run while the session was blank do not later appear as history cards. When the Host has a savedzhorenpreference, the slash-menu description, input hint, labels, empty state, errors, and usage message follow that language and update after it changes. If a remote browser only has an in-process language setting, or the Host preference is unavailable, the menu description and input hint fall back to English and results fall back to an unlabeled “currency + amount”, a fixed English usage message, or a stable error code.
Configuration and Security
See Configuration and Security. In DSH configuration, timeoutMs must be a finite number from 1 through 120000 milliseconds, inclusive; fractional values are allowed. The upper limit prevents Node.js timer overflow. The Host bounds upstream requests by this value after credential resolution completes. The settings page separately limits connection waits to 125 seconds, so a stale value cannot cut requests short when the Host timeout is increased at runtime. Unknown server error codes display “Billing service is temporarily unavailable”.
The current plugin version is 0.3.1, targeting DSH 0.2.1-rc.5 while retaining compatibility with DSH 0.2.0-rc.2. The peer range is >=0.2.0-rc.0 <0.2.1-0 || >=0.2.1-rc.5 <0.2.2-0, with Node.js ^22.19.0 || >=24.0.0. Prerelease lines must be explicitly included; an upper bound of <0.3.0 alone does not admit newer prereleases. DSH 0.2.2 and above are not yet supported.
The balance route is registered through DSH Connection Fetch and inherits DSH Host/Origin trust checks and browser Cookie authentication; the plugin neither implements nor logs Cookies.
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.