Introduction

DeepSeek Harness (DSH) uses a plugin architecture. When developing or debugging with the Web profile, checking API balances frequently is necessary. Manually refreshing the page is inefficient and unintuitive. The dsh-balance plugin solves this problem by embedding the balance directly in the sidebar, providing real-time balance monitoring.

Plugin Overview

dsh-balance is a DeepSeek Harness Web plugin that displays the DeepSeek API balance at the bottom of the sidebar. Maintained by eka3os, it solves the need to monitor the remaining DeepSeek API quota in real time during development.

Core Features

  1. Balance Display: Displays CNY and USD balances together near the settings area of the sidebar.
  2. Official API: Reads balance data through the official DeepSeek API endpoint.
  3. Secure Design: The API key is used only on the server side; the browser only receives normalized balance values.
  4. Automatic Refresh: Refreshes the balance every 60 seconds to keep the data up to date.
  5. Status Feedback: Displays -- when loading, when no balance is available, or when the request fails.
  6. Installation Method: Supports installing directly from the GitHub repository.

Installation and Activation

Before installation, ensure DeepSeek Harness is installed locally with a version no lower than 0.1.0-rc.7, and that the web profile is enabled.

  1. Run the installation command:
dsh plugin --profile web add github:eka3os/dsh-balance
  1. After installation, restart the Web profile to load the plugin:
dsh web

The dsh plugin command installs the package into the specified profile and automatically activates it according to the configuration declared by the plugin.

Typical Usage

The plugin uses DEEPSEEK_API_KEY as the credential reference. You need to configure this key in advance.

Method 1: Configure via Environment Variable (Single Run)

Pass the key via an environment variable when starting DSH Web:

DEEPSEEK_API_KEY=sk-your-key dsh web

Method 2: Configure via Local Credentials File

Write the API key into DSH’s local credentials file:

# 文件路径为 $DSH_HOME/.credentials.yaml
DEEPSEEK_API_KEY: sk-your-key

After configuration, a balance display area will appear at the bottom of the sidebar.

Applicable Scenarios and Notes

  1. Version Requirement: Requires DeepSeek Harness >=0.1.0-rc.7. The plugin version is 0.1.0.
  2. Profile Limitation: This plugin works only with the web profile.
  3. Security Recommendation: Do not commit the API key or credentials file to a Git repository.
  4. Distribution Channel: This plugin is distributed only via GitHub and is not published to npm.
  5. Source Review: Before installing community plugins, it is recommended to review the source code and license (MIT) in its GitHub repository (https://github.com/eka3os/dsh-balance).

Conclusion

By providing an intuitive balance view in the sidebar, the dsh-balance plugin simplifies the development and debugging workflow. For developers who need to monitor API resources frequently, it is a practical and secure choice.