dsh-usage-panel: Pin the DeepSeek sidebar usage panel to the bottom of the left column.

Introduction

When developing agents or having daily conversations using DSH, there are often more than one official DeepSeek account, and you may also connect to new-api-style proxy stations. DSH itself does not display API usage: to confirm balance, how much was spent today, or whether the current time is peak or idle, one has to open each site’s backend, switch accounts, and flip through bills. Although the sidebar is always present, it lacks an intuitive usage indicator.

dsh-usage-panel handles exactly this: it embeds a panel at the bottom of the DSH left sidebar, rotating display of balances and daily consumption for official accounts (or manually entered keys) and various proxy stations; official sites are additionally marked with whether currently in peak or idle time. The plugin is maintained by InkiChang and falls under the client category.

What is this

dsh-usage-panel is a client plugin for DeepSeek Harness. It does not alter DSH itself, but appends a persistent panel at the bottom of the sidebar; the panel is located below bottom entries like “Memory” and above the account row (avatar and username), using an embedded layout rather than an overlay.

It solves three types of information queries: official account balance, new-api proxy station balance and daily/monthly consumption, and current pricing period (official peak is double idle, the panel marks “Peak / Idle”).

Core Features

Capability Description
Sidebar persistent block Embedded at the bottom of the sidebar, below bottom entries and above the account row, with width and left indent consistent with adjacent entries
Multi-site carousel Official accounts, multiple official keys, and multiple proxy stations can exist simultaneously, rotating at intervals
Does not block other entries The panel occupies its actual position in the sidebar; when other plugins add new bottom entries, they are arranged upwards, and the two do not overlap
Balance + Daily Consumption Two rows of numbers per site; when unconfigured or an error occurs, the reason and entry point are provided
Peak / Idle block Only displayed for official sites, color adapts to the theme
Hover overlay Balance and daily consumption; proxy stations additionally show monthly used and monthly start date; official sites additionally show peak/idle split
Manual refresh Click the time on the panel to refresh immediately
Settings overlay Add/remove sites, test connections, show toggle, refresh interval, all completed within the panel
Stores locally only Tokens and keys are saved in ~/.dsh/usage-panel/config.json, not sent externally

The core implementation method is: the plugin does not register with DSH’s plugin entry table, so it does not compete for position with entries like “Memory” or “Import Session”; it locates the account row at the bottom of the sidebar, inserts a transparent placeholder element before that row, the placeholder height equals the panel’s own height, and the host layout will move the content below the placeholder down, creating space for the panel, which is drawn in the placeholder area. When the host redraws the sidebar, the placeholder might be cleared, so the plugin checks every 900 milliseconds and restores it if missing.

This brings three direct consequences:

  • When other plugins add bottom entries, the panel position does not move, and they do not overlap.
  • Window resize, theme switching, or site carousel do not affect the docking position; the panel is always located above the account row.
  • The sidebar bottom height increases by approximately 56 pixels (equal to the panel height), and the visible number of rows in the session list decreases accordingly.

Installation and Enablement

The plugin is installed as a local directory bundle, not pulled by package name. First download this repository directory to your local machine, then use the plugin manager in a DSH session to install:

# Install local directory in DSH session (replace with your absolute path)
plugin_manager action=install_bundle target="C:\path\to\dsh-usage-panel"

After installing or uninstalling the plugin, you must fully exit and restart DSH once, otherwise the sidebar will not show the panel. This is because DSH reads the plugin manifest and registers backend entry points and frontend resources when the process starts; a running process will not rebuild this manifest after reinstallation, and simply refreshing the page (Ctrl+R) cannot load newly installed code. In testing, this manifests as frontend resources returning 404 and the sidebar position being empty.

The effective rules need to be remembered:

  • If the plugin is installed and only modifies client.js (the interface part), refreshing the page (Ctrl+R) will take effect.
  • If index.js (backend) is modified, or the plugin is reinstalled or uninstalled, you must fully exit and restart DSH.

Typical Usage

After installation and restart, configure in the following order to start reading usage.

  1. After the usage panel appears at the bottom of the left column, click “Settings” on the panel (shows “Go to Settings” when unconfigured), or enter via Settings → Usage Panel.
  2. Configure official sites: The default “Data Source” is DSH Logged-in Account; if logged in, balance is displayed without needing to fill in a key. If you need to track a specific key separately, change the source to “Manual API Key” and fill in the key.
  3. Add proxy stations: Fill in the site address (e.g., https://<proxy domain>) and Access Token. Some sites also require filling in a numeric User ID (response header New-Api-User); after filling, data can be retrieved normally.
  4. Click “Test Connection” to confirm you can read the balance, then save.

In terms of data metrics, official site balance is taken from GET /user/balance, while daily consumption is estimated by local sampling: official sites only provide a balance interface without usage details; the plugin records changes in balance over time, estimating daily consumption as “first sample balance of the day - current balance”, and judging which consumption falls into peak or idle time based on the sampling moment. Therefore, periods when DSH is not running are not counted in statistics, and the plugin’s first day of use counts from the startup moment.

Proxy stations are read according to the new-api interface shape: balance comes from GET /api/user/self’s data.quota divided by the quota_per_unit provided by /api/status; daily/monthly used is attempted in priority order based on /api/data/self, /api/log/self/stat, and /api/log/self, stopping once found. “Monthly start date” displays the first day of the natural month.

Configuration items are concentrated in the settings overlay:

Configuration Location Description
Refresh interval Settings overlay Default 300 seconds, minimum 60 seconds
Which sites to show Settings overlay When disabled, the site does not participate in the carousel
Data source Official site card DSH Logged-in Account or Manual API Key
User ID Proxy station card Fill in when the site requires New-Api-User
Treat today as holiday Settings overlay Force today to be priced as idle time

Configuration files are ~/.dsh/usage-panel/config.json (sites and tokens) and ~/.dsh/usage-panel/samples.json (balance sampling, kept for 4 days).

Applicable Scenarios and Notes

Suitable for scenarios where you need to monitor official account and new-api proxy usage simultaneously while hoping to stay within the DSH interface. Adhering to the philosophy of “everything is a plugin”, such capabilities should have been filled by external plugins.

Pay attention to the following points before use:

  • The plugin runs with the permissions of the current DSH process; you should check the source code and license (this plugin is MIT) before installing.
  • Manually entered official API keys are an unverified path: Official sites currently only expose /user/balance to the outside, and there are no usable official keys on the local machine; this branch has not been tested; if you encounter problems, try changing back to the “Logged-in Account” source first for troubleshooting.
  • Official daily consumption is estimated by sampling, with accuracy equal to the refresh interval; consumption during periods when the plugin is not running will not be recorded.
  • Proxy stations only adapt to the new-api interface shape; when fields differ in other panels (e.g., different branches of one-api), you may need to modify the data retrieval function in index.js.
  • No cross-site aggregation: The sidebar rotates by site, and the overlay only displays the current site’s own numbers; balances and units of different sites cannot be added directly.
  • Embedding positioning is achieved by reading the existing DSH sidebar DOM structure and does not belong to an official interface; if the host changes the sidebar structure, the panel will appear to fall back to being stuck above the “Memory” entry, but other functions will work normally.
  • Regarding privacy, all requests are only sent to the sites filled in the settings and api.deepseek.com; there is no third-party statistical reporting; tokens are written only to the local configuration file, and the interface only shows the first three and last four digits.

Summary

dsh-usage-panel compresses multi-site DeepSeek usage into a persistent panel at the bottom of the sidebar: balance, daily consumption, and peak/idle periods can be seen directly, adding/removing sites and testing connections are completed within the panel, and changes will not compete for position with other sidebar entries. For users who simultaneously use official accounts and new-api proxy stations and want to minimize switching to the background, it is a directly usable addition.

Directory page: https://www.skillhub.cn/plugins/InkiChang/dsh-usage-panel
GitHub: https://github.com/InkiChang/dsh-usage-panel

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye