The DSH philosophy is “everything is a plugin.” In multi-channel API development, real-time monitoring of balances and usage is an essential requirement. Below is dsh-balance-monitor, a plugin that displays balances and usage in the DSH Web sidebar.

What It Is

This plugin is maintained by ShawnKung and addresses the cumbersome management of multi-channel API accounts. It allows you to view the balance and Token usage details of selected channels directly in the DSH Web sidebar, supports DeepSeek Official API and TeamoRouter, and features automatic refresh and theme adaptation.

Install and Enable

Before installing, ensure that DSH is installed (version >= 0.1.7-rc.1) and that dsh web is running. The environment must support Node.js >= 20.

Use the official npm package to install the latest version:

dsh plugin --profile web add @shawnkung/dsh-balance-monitor@latest
dsh plugin --profile web list

After installation, restart the DSH Web process and perform a hard refresh in your browser (macOS: Cmd+Shift+R; Windows/Linux: Ctrl+Shift+R) to load the plugin.

Core Features

  1. Sidebar Display
    Between “New Session” or workspaces, the sidebar displays a balance overview of the selected channels.

  2. Details Popup
    Click the sidebar entry, and a popup displays detailed data for each channel, including consumption amount, request count, and Token usage.

  3. Automatic Refresh
    Supports automatically refreshing the corresponding channel after a session ends, as well as manually clicking the refresh button. The plugin checks for the latest npm version and prompts for an update at startup.

  4. Theme Adaptation
    Supports light, dark, and following the system theme.

  5. Channel Support
    Supported channels include: DeepSeek Official API, Kimi Official API, Zhipu GLM, and TeamoRouter.

Configuration

Go to “Plugins” in the DSH sidebar and open the @shawnkung/dsh-balance-monitor configuration:

  1. Sidebar Channels
    By default, only DeepSeek is displayed. Multiple channels can be selected, up to 3 at most.

  2. Balance Decimal Places
    Use the slider to control display precision. By default, 2 decimal places are retained. Options include no decimal places, 1 to 6 decimal places, or exact precision.

  3. API Key Credential References
    Configure the Key source for each channel. By default, it references environment variables. For example:

    • DeepSeek: DEEPSEEK_API_KEY
    • Kimi: KIMI_API_KEY
    • Zhipu GLM: ZAI_API_KEY
    • TeamoRouter: TEAMO_API_KEY
  4. TeamoRouter Statistics Days
    Configure the statistics interval range. Supports 2 to 90 days.

Dependencies and Compatibility

  • DSH Version: >= 0.1.7-rc.1 < 0.2.0
  • Node.js Version: >= 20
  • Profile: Web only
  • License: MIT

Security Notes

API Keys are only resolved and written through DSH’s credentials service. Plaintext Keys are not sent to the browser. The plugin runs under DSH process permissions and reads only necessary configuration files.