Introduction

DeepSeek Harness (DSH) provides a localized client environment, suitable for interacting with and developing AI models. In the API invocation process, monitoring account balance and usage is a key aspect for controlling costs. The dsh-balance plugin directly integrates a balance display feature at the bottom of the DSH sidebar, allowing developers to view the current DeepSeek API account balance without frequently switching tabs.

Plugin Positioning

This plugin is maintained by developer shawnyhu and is released under the MIT open-source license. It is a client plugin, whose core value is to visualize usage information from the DeepSeek platform and integrate it into one side of the local development environment, reducing operational interruptions.

Core Features

  1. Sidebar Display: Displays a balance row at the bottom of the sidebar. In wide-column mode, it shows the specific amount (such as ¥110.00); when collapsed, it displays only an icon.
  2. Interactive Operations: Clicking the balance area refreshes the data immediately; double-clicking opens the DeepSeek platform usage page https://platform.deepseek.com/usage.
  3. Automatic Refresh: Automatically refreshes once after each conversation turn ends, and supports scheduled automatic refresh every 30 minutes.
  4. Security Mechanism: The API Key is fully retained in the local host process, and data is returned through local routing, so the browser side cannot access the Key.
  5. Configuration Inheritance: Automatically inherits the settings under “Model → DeepSeek” in DSH configuration. By default, it reads the environment variable DEEPSEEK_API_KEY, and the default API address is https://api.deepseek.com. The address can be overridden via the environment variable DEEPSEEK_BASE_URL.

Installation and Enablement

It is recommended to install the plugin using the official DSH CLI.

dsh plugin --profile web add <path-to-dsh-balance>

After installation, DeepSeek Harness must be restarted for the plugin to take effect (client modules scan the package manifest only at startup).

Typical Usage

The plugin works by default after installation and requires no additional configuration. If you need to customize the API Key or address, go to the “Settings → Model → DeepSeek” page to configure it.

The configuration items include:

  • apiKeyEnv: Defaults to DEEPSEEK_API_KEY, specifying the environment variable or credential reference to read.
  • baseURL: Defaults to https://api.deepseek.com, specifying the API root address.

After modifying the settings, there is no need to restart the application; the changes take effect at the next refresh. If no Key is configured, the sidebar will display “Key not configured”.

Notes

  1. Restart Requirement: Adding or removing plugins requires restarting DeepSeek Harness to take effect.
  2. Configuration Effectiveness: Changes to settings do not require a restart; the changes will appear after the next interface refresh.
  3. License: MIT License.

Summary

By embedding balance monitoring into the sidebar, dsh-balance lowers the barrier for checking API usage, making it suitable for developers who need frequent debugging or cost tracking. The plugin is fully open source and runs locally, ensuring the security of the Key. For more details, refer to the plugin directory or the GitHub repository.