When using DeepSeek Harness, running multiple sessions or background tasks at the same time can make it easy to lose track of the current load. Without explicit UI indicators, it is difficult to see at a glance how many sessions are active or whether an API quota is about to run out. This plugin addresses that issue with a card in the bottom-right corner.
Plugin Overview¶
The plugin is named lovstudio/dsh-account-balance and is maintained by the user lovstudio. It is a composite row that, after installation in the DeepSeek Harness web interface, remains pinned to the bottom-right corner of the UI. The plugin aggregates the status of current sessions and background tasks, as well as quota bars for GLM and KIMI and balance information for OpenRouter and DeepSeek.
Core Features¶
-
Session and task status
Displays the number of current sessions and background tasks. The card shows either “Idle” or “N sessions · M tasks”. The status is polled every 3 seconds by callingctx.agents.list()andctx.jobs.list()to obtain an in-memory snapshot. -
Quota visualization
For GLM and KIMI, displays 5-hour and weekly quota bars. The quota bar color changes based on usage: green (<50%), orange (≥50%), red (≥80%). You can hover over the bar to view the exact usage amount, remaining amount, and reset countdown. -
Balance display
Displays the remaining balance for OpenRouter (USD) and DeepSeek (CNY). Balance data is polled through the Host API every 60 seconds and cached for 55 seconds. -
Host API exposure
The plugin exposes two interfaces through the Host API:accountBalance.status(): returns{ sessions, tasks }.accountBalance.quotas(): returns{ at, rows: { glm, kimi, or, ds } }.
Installation and Enabling¶
Before installation, ensure that your environment meets the following requirements:
* Node.js 22.19+ or 24+
* pnpm 11
Use the following command to install the plugin:
pnpm dsh plugin --profile web add -w github:lovstudio/dsh-account-balance#v0.1.3
After installation, restart the DSH Web UI to see the card in the bottom-right corner. The plugin is a composite row and persists across page restarts.
Typical Usage¶
View Directly in the UI¶
No configuration is required. The plugin automatically reads credentials from the credential service and displays the data. If a particular API Key is missing, the corresponding row displays “—”.
Retrieve Status via Host API¶
You can use the accountBalance.status() method to retrieve the current session and task snapshot:
const result = await accountBalance.status();
// result.data 为 { sessions: number, tasks: number }
Retrieve Quotas via Host API¶
Use accountBalance.quotas() to retrieve a quota snapshot for the four providers: GLM, KIMI, OpenRouter, and DeepSeek:
const result = await accountBalance.quotas();
// result.data 为 { at: string, rows: { glm, kimi, or, ds } }
Use Cases and Notes¶
Use cases:
* Users who need to continuously monitor the status of background tasks in DeepSeek Harness.
* Users who need a clear view of GLM/KIMI quota consumption to avoid overage fees.
* Developers who need to integrate balance and status data via APIs.
Notes:
* Permissions and visibility: The visibility of jobs.list() may be limited. Jobs not owned by the current session may not be counted in tasks statistics.
* No model calls: The plugin itself does not make any model calls, so it does not consume tokens or affect the KV Cache.
* Fault tolerance: If the API response shapes for GLM and KIMI change, the plugin displays no-data instead of crashing.
* Credential reads: The plugin reads credentials directly through ctx.credentials and does not send credentials externally.