Introduction

Desktop developers using DeepSeek Harness (DSH) often need to frequently check account balance and today’s Token consumption while developing with the API. Opening a web page or the main interface to query this information adds operational overhead. The dsh-api-balance plugin displays API status in real time in a standalone native Windows window at the corner of the desktop, making it easy to monitor resource consumption while coding.

Plugin Overview

  • Plugin Name: dsh-api-balance
  • Maintainer: wwwwangpengggg
  • License: MIT
  • Core Value: Displays a topmost small floating window in the corner of the desktop in real time, showing the DeepSeek API account balance and the cumulative Tokens consumed today.

Core Features

  1. Desktop mini window: A borderless, semi-transparent topmost mini window appears in the corner of the desktop, supports high-DPI rendering, and remains clear at 125% / 150% scaling.
  2. Real-time data:
    • Displays DeepSeek API balance in real time.
    • Shows cumulative Tokens consumed today.
  3. Three-page display:
    • Page 1: Balance + cumulative Tokens consumed today (accumulated across multiple power-on/power-off cycles).
    • Page 2: Amount spent today (estimated based on balance reduction).
    • Page 3: Billing period (shows whether the current time is peak period or half-price discount period, plus a countdown to the switch).
  4. Interaction and customization:
    • Supports seven color schemes.
    • Supports custom background images (switch via right-click menu, no restart required).
    • Click the amount area to cycle through the three pages.
    • Supports minimizing to the system tray; minimizing the main window does not affect the mini window.

Installation and Activation

Prerequisites

  • Windows 10/11.
  • DSH Desktop installed.

Installation Steps

  1. Completely exit DSH Desktop: Before installation, fully terminate the DSH process (confirm in Task Manager that the DSH Desktop process has disappeared). Installing while DSH is running will cause an error due to the pnpm lock file.
  2. Run the installation command: Install the plugin into the profile used by Desktop.
dsh plugin --profile desktop add git+https://github.com/wwwwangpengggg/dsh-api-balance.git
  1. Restart DSH: After installation is complete, reopen DSH Desktop; the mini window will automatically appear in the corner of the screen.

Usage

  1. Toggle mini window: In any session, enter the /balance command to turn the mini window on or off.
  2. Tray actions: Double-click the tray icon, or right-click the tray icon and select “Show Balance Mini Window”.
  3. Right-click menu:
    • Refresh frequency: Supports three options: 30 seconds / 60 seconds / 5 minutes.
    • Page switching: You can directly view Page 1, Page 2, or Page 3 from the right-click menu.
    • Appearance settings: Select “Appearance” in the right-click menu to switch between seven color schemes or change the background image.
    • Turn off always on top: If you need to let other windows cover it, turn off always on top.
  4. Hide mini window: Clicking the × in the upper-right corner of the mini window does not quit the program; it collapses it to the system tray. To truly exit, select “Exit Mini Window” from the tray right-click menu.

Billing Period Description

Page 3 displays the current billing period, helping determine whether charges are calculated at peak price or half-price discount.

  • Starting time: The “today” of the billing period starts at 08:00, not at 00:00 of the natural day. Times before 08:00 are still counted as the previous period.
  • Peak and discount periods:
    • Peak period: Beijing Time, Monday to Friday 09:00-12:00 and 14:00-18:00 (excluding statutory holidays).
    • Discount period: All other times (including weekends, holidays, and lunch break 12:00-14:00).
  • Holiday determination: Holiday determination is based on UTC time. The plugin includes State Council statutory holiday data for 2026. If a year is not included in the data, it defaults to treating it as “not excluding holidays”; it is safer to display the peak price than to mistakenly report the discount price.

API Key Configuration

The mini window needs to read the DeepSeek API Key. It looks in the following order:

  1. Environment variable DEEPSEEK_API_KEY.
  2. The same key in the $DSH_HOME/.credentials.yaml file.

The key does not go through DSH IPC communication, and will not appear in any command line. The mini window process reads the file directly, which provides higher security. After configuring the key, click the “Refresh” button in the mini window to update the data.

Notes

  1. Today’s spending estimate: Because the DeepSeek API only provides a balance endpoint and not billing details, the amount spent today is estimated backward by the plugin from the reduction in balance. Top-up amounts are not counted in the spending calculation.
  2. Installation timing: Make sure to completely exit DSH before installation; otherwise an ERR_PNPM_EPERM error will occur.
  3. Manual installation: If your network environment cannot use pnpm, you can manually clone the repository, edit package.json, and create a junction link, but the official recommendation is to install via the command line.

Reference Resources