Introduction

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, and its plugin ecosystem is independent of DeepSeek officially or High-Flyer Group. When developing or interacting with DSH, managing both DeepSeek and OpenRouter accounts simultaneously can lead to frequent manual balance checks, interrupting the workflow. This plugin aims to solve this pain point by providing a persistent dual-account balance chip in the conversation header of the Web interface.

What It Is

This is the client plugin dsh-account-balance, maintained by the developer 305037991x-pixel. It injects a card into the conversation header to display both DeepSeek and OpenRouter balances simultaneously. The plugin runs on the host side, does not depend on a specific version of the DSH core package, and supports automatic refreshing every 3 minutes.

Core Features

  1. Dual-source display: A single chip displays both DeepSeek and OpenRouter balances. The OpenRouter balance is calculated as credit - used.
  2. Detailed view: Hovering the mouse over the chip shows a tooltip with two sections:
    • DeepSeek: total balance, credit, and bonus.
    • OpenRouter: available balance, credit, and used.
  3. Fault tolerance: If one data source fails (for example, an OpenRouter API call fails), only that source displays an error marker, without affecting the display of the other source.
  4. Automatic refresh: Supports automatic refreshing every 3 minutes and provides a manual refresh button (refreshes both accounts).
  5. Smart caching: Balance data and timers use a module-level shared cache. Switching sessions does not trigger duplicate requests.
  6. Security: API keys are stored only in the host environment (.credentials.yaml or environment variables) and are never exposed to the browser.

Installation and Enablement

Install the plugin via the command line:

dsh plugin --profile web add github:305037991x-pixel/dsh-account-balance

After installation, restart the dsh web service and perform a hard refresh to load the new plugin:

  1. Stop the currently running dsh web.
  2. Restart dsh web.
  3. Press Ctrl + Shift + R in the browser page to hard refresh.

If you are developing this plugin locally, you can use the install-into-dsh.ps1 script included in the package to register the local source code directory with link:. After modifying the source code, simply restart to make changes take effect; no reinstall is required.

Typical Usage

The plugin relies on the credential service provided by the host. Configure the following keys in $DSH_HOME/.credentials.yaml to display the corresponding balances (if missing, they are not displayed):

DEEPSEEK_API_KEY: sk-xxx
OPENROUTER1_API_KEY: sk-or-v1-xxx

After configuration, the balance chip will automatically appear in the conversation header.

Compatibility and Notes

  1. Decoupled from core version: All @deepseek-ai/dsh-* core packages are declared as optional peerDependencies (range >=0.1.0-rc.6 <0.2.0). The plugin does not bundle copies of core packages; at runtime, it directly uses the core package running on the host.
  2. Interface dependencies:
    • Host side (lib/index.js): Depends only on credentialRef from dsh-credentials and launchEnvironmentOf from dsh-launch-environment.
    • Browser side (lib/client.js): Dependencies are provided by the host client module registry through dsh.client.inject.
  3. Version-locking warning: Do not add core packages to dependencies and pin specific versions. If added, an old copy of the core package will appear inside the plugin directory. After the host upgrades its core version, this old package will shadow the host’s new package, causing the plugin load to fail with failed to import.
  4. License: MIT.

Summary

dsh-account-balance is a lightweight, non-invasive dual-account balance monitoring tool. Using DSH’s plugin mechanism, it provides a convenient balance lookup entry for the Web interface without modifying host core code. It is suitable for developers who need to manage both DeepSeek and OpenRouter balances.