dsh-billing-badge: DeepSeek Harness Billing Period and Balance Plugin

In the DeepSeek Harness Composer stats line, users typically need to navigate to another page to check the current billing period and account balance. The dsh-billing-badge plugin adds a native capsule control directly in the stats line to display the billing period status and countdown, and supports clicking to expand a panel for detailed balance information.

Plugin Positioning

This plugin is maintained by developer devacc8 and is released under the MIT license. As a client-side extension for the DeepSeek Harness Web GUI, it does not include specific cost or Token billing statistics; it only displays balance data returned by the official API.

Core Features

1. Stats-Line Capsule Display

The plugin renders a capsule control in the Composer stats line, immediately after the “Cache hit” statistic.

  • Billing period and color dot: Displays the current billing period (peak/off-peak). The peak period is shown with an amber dot, while other periods are displayed as half-price periods with a green dot.
  • Countdown: Displays the remaining time until the period switch.

2. Balance and Status Panel

Clicking the capsule opens a panel that displays the following information:

  • Period and time: Current period and the next switch time (Beijing time).
  • Account balance: Displays the total account balance and currency unit (determined by the API response, not forced to CNY).
  • Balance composition: When the account balance includes granted and topped-up amounts, the panel splits them into separate rows: “Granted (bonus)” and “Topped up (recharge)”.
  • Availability warning: If the balance is insufficient to support API calls, the panel displays a warning row.

3. Data and Security

  • API call: Uses the official GET /user/balance endpoint to fetch data.
  • Key handling: Resolves the API Key through DSH’s credentials seam and does not send it to the browser side.
  • Route restriction: The single route requires the request header x-dsh-billing-badge: 1 and rejects cross-origin Origin access.

Period Rules

The billing period switching logic is based on Beijing time:
* Peak period: Weekdays from 09:00 to 12:00 and from 14:00 to 18:00.
* Other periods: All day on weekends and other weekday periods are half-price.

Installation and Enablement

Add the plugin using the official plugin installation command:

dsh plugin --profile web add dsh-billing-badge

After installation, restart the dsh web process to apply the changes.

Typical Usage

In the Composer stats line, users will see text similar to the following:
2288M tok · Cache hit 99.8% · ● Off-peak · 2h13m

Clicking the ● dot opens a panel where the full balance composition and countdown can be viewed.

Notes

  • Version compatibility: Supports only DeepSeek Harness 0.1.5 and 0.1.6.
  • Feature scope: Does not involve cost accounting or Token quantity statistics; it only displays the account balance.
羽毛球分组比赛记分
小程序二维码

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

Xiaoye