dsh-deepseek-balance
A DeepSeek Harness plugin that shows your live DeepSeek API account balance as a frame-wide badge in the top-right corner of the web GUI.
English | 中文
What it does
- Host half: registers
GET /dsh-deepseek-balance, reads DEEPSEEK_API_KEY from the harness credentials seam (falling back to the environment variable), and returns GET https://api.deepseek.com/user/balance.
- Browser half: registers a pill into the
shell.overlay seat, polls on a configurable interval (default 60s), and refreshes immediately when clicked.
The API key never reaches the browser; it is resolved in the host process per request.
Install
dsh plugin --profile web add dsh-deepseek-balance
Then restart your web profile and refresh the page. The badge appears in the top-right corner:
- green dot — balance available
- amber dot — funds exhausted
- gray dot — loading
- red dot — request failed (hover for the reason)
Click the pill to refresh immediately (hover shows the granted/topped-up split).
Configure
The key is the same one the harness already uses for the model. Set it once in Settings → Models (the credentials seam), or export it:
export DEEPSEEK_API_KEY=sk-...
Optional overrides in the bundle row (config:):
config:
refreshIntervalMs: 30000 # poll interval in ms (default 60000)
baseUrl: 'https://api.deepseek.com'
Build from source
pnpm install
pnpm build
pnpm build emits lib/index.js (host half) and lib/client.js (browser half).
License
MIT