dsh-deepseek-balance: Always display DeepSeek API balance in the Harness session top bar

Foreword

When running long sessions in DeepSeek Harness (DSH), checking your official API balance often requires entering the settings page or opening a separate console. Because balance changes are not surfaced promptly, you may only discover insufficient quota during joint debugging or batch calls. The community plugin dsh-deepseek-balance (maintainer taoyiii112-creator) moves balance queries to the backend, pins the result to the top bar of every conversation, and bundles “fun customization” extensions such as Wallpaper Engine backgrounds and in-page desktop pets. This article covers its positioning, capabilities, and installation and usage.

What Is This

dsh-deepseek-balance is a DSH plugin for the official DeepSeek Harness Desktop. The current source and manifest version is 1.0.1 (MIT license). It securely reads the locally stored DEEPSEEK_API_KEY through the Harness backend, calls the DeepSeek official HTTPS balance API, and renders a compact balance capsule in the conversation.session.header.utilities slot on the frontend, so the balance is visible the moment you open a conversation—without relying on a separate panel in the settings page.

In the SkillHub catalog, the plugin is categorized as “fun customization”; the core is still API balance display and refresh, while wallpapers and desktop pets are optional appearance capabilities within the same plugin.

Core Features

Balance Display and Refresh

  • A persistent balance capsule in the top bar supports multi-currency summaries; hovering shows account status, recharge balance, gift balance, and the most recent refresh time.
  • Click to manually refresh; the auto-refresh interval is configurable between 30–300 seconds (default 60 seconds). Polling pauses when the page is hidden to reduce unnecessary requests.
  • When the balance decreases, a red small label next to the main capsule shows the exact deduction delta relative to the last successful query; starting from v0.4.5, it uses a dual-row reel animation of about 650ms. First load, request failures, key changes, unavailable accounts, or currency structure changes will not falsely report deductions.
  • On refresh failure, the main capsule only shows the failure status; the historical value is marked as “Last successful balance” in the details. Cases like 402, service unavailable, empty list, or all-zero uniformly show “No balance”.
  • A link to the DeepSeek recharge page appears next to the capsule only when the balance falls below the threshold configured in the gear settings, and it requires a user click—no automatic redirect.

API Key and Security Boundaries

  • On first use, click “Set Balance” in the top bar, paste the API Key into the wizard and save; no need to modify environment variables.
  • The key is stored via DSH’s local credential store, never entering the browser, logs, or the installer package; backend queries include timeout, response validation, and safe error mapping.

Desktop Pets and Local Media

  • Provides an offline transparent idle desktop pet: after the idle video ends, the original static image is shown for 15 seconds, then the idle video replays; on media failure or when the system “Reduce motion” is enabled, it falls back to a transparent PNG without additional balance requests.
  • The desktop pet can be dragged to the four edges of the viewport; its show/hide state and position are saved in the browser locally. Starting from v0.4.7, you can import transparent PNG/WebP/APNG or VP9 WebM without an audio track; in addition to the built-in schemes, up to 3 local user schemes are allowed, each with 5 base slots plus up to 5 custom slots.
  • Custom scenes can select trigger rules from events such as the integrated balance query, balance changes, desktop pet clicks, idle state, and local time; user scripts are not executed, and unverified chat events are not integrated.

Wallpaper Engine and Page Background

  • v1.0.1 continues support for Wallpaper Engine Image, Video, Scene, Web, Application: Image/Video use the verifiable project original image or original video; Scene prefers reading project.json, and can perform a restricted fallback when the manifest is abnormal and the root directory contains only a unique .pkg and preview.
  • Scene/Web/Application run in a Wallpaper Engine named window; the user authorizes capture on the local Chrome/Edge pairing page via the system window selector, and it is displayed via local WebRTC; the capture request sets cursor: 'never', but the browser may still show the system cursor. No modification to the official DeepSeek Desktop is needed.
  • A draggable settings panel of about 560px wide; the Wallpaper list, search, candidate selection, and application are performed on a separate page. When the page and the panel use the same precise background source, they share a single layer and maintain dynamic playback; the Wallpaper Engine Video chosen by the user is not affected by the system “Reduce motion” switch (balance rolling, desktop pets, and locally imported videos are affected by that switch).

The README notes: the five Wallpaper types have not yet been individually verified on real devices; for the 1.0.1 installer package, users need to confirm the actual running version themselves on the Desktop plugin page.

Installation and Activation

The plugin is packaged for the Web client platform (client.platform: web) and is installed by the official Desktop plugin manager into the standalone desktop profile, consistent with the embedded shared web app. Do not use --profile web to install into a different profile; CLI errors returned for --profile desktop are expected protection, not an indication of plugin incompatibility.

To install in Desktop:

  1. Open “Plugins” in the left sidebar and click “Add Plugin”.
  2. Enter the public repository address and install:
https://github.com/taoyiii112-creator/dsh-deepseek-balance
  1. After installation completes, select “Enable now”; if prompted to restart the Desktop, restart and enter any conversation to confirm the balance capsule appears in the top bar.

You can also download and install the ZIP from the GitHub Release v1.0.1, or download the source ZIP, extract it, and select the local plugin directory in “Add Plugin”. For more complete steps and failure troubleshooting, see the repository’s INSTALL.md and the v1.0.1 Desktop compatibility notes.

Typical Usage

Configuring the Balance

Click the gear next to the balance capsule → “Balance” → “Set DeepSeek API Key”, paste the Key and save. The auto-refresh interval is adjustable within 30–300 seconds; the balance threshold only controls whether the recharge link is shown.

Background and Wallpaper Engine

  • Local PNG/JPEG/WebP images and MP4/WebM videos are used as backgrounds as-is; images are identified by content signature, with a per-file limit of 64 MiB, 8192×8192 pixels (see the v0.5.7 notes).
  • Selecting Wallpaper Engine in the settings enters a separate wallpaper page, where you can filter locally downloaded wallpapers by name, Workshop ID, and type.
  • When applying Scene/Web/Application, follow the pairing page prompt to select the full DSH Balance Wallpaper Engine window name shown in the window selector, and click “Start Sharing”; for Application type, you also need to confirm trust in the settings each time you apply it.

Use Cases and Caveats

Who it is for: Users who use the DeepSeek official API daily in DSH Desktop, want to see the balance at a glance within a conversation, and want to manually recharge when the balance is low; if Wallpaper Engine is already installed locally or you want to customize the interface with local media/desktop pets, you can configure it within the same plugin without looking for a separate pure-theme plugin.

Runtime and trust: The plugin runs under the permissions of the current DSH process, accessing local credentials, local web services (including Wallpaper directory probing), and screen/window capture under user authorization. Before installation, you should read the source repository and the MIT license, and assess yourself whether your environment meets the requirements. The plugin depends on DSH providing webServer, credentials, the React client module loader, and the top bar slot; the README records that it was checked against Desktop 0.1.7-rc.2, but actual compatibility depends on your local DSH version.

Ecosystem note: DSH embraces “everything is a plugin”; SkillHub is a community catalog site, with no official affiliation to DeepSeek / High-Flyer, and is not an official app store.

Conclusion

After following the above steps, you can see the DeepSeek official API balance persistently in the top bar of Harness conversations, and open the gear to manage the Key, refresh interval, threshold, desktop pets, and wallpapers as needed. Catalog page: taoyiii112-creator/dsh-deepseek-balance; source and documentation: GitHub.

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

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

Xiaoye