harness-accountant: DeepSeek Balance and Usage Monitoring Plugin

Introduction

When developing with DeepSeek, keeping track of account balance and billing tiers (Peak/Off-Peak) in real-time is crucial for cost control. Existing methods often require manual checks or reliance on third-party tools. The harness-accountant plugin aims to solve this pain point by integrating real-time monitoring directly into the DSH Web GUI.

Plugin Positioning

This is a lightweight plugin designed to monitor DeepSeek token balances and usage, while indicating whether the current hour falls under peak or off-peak billing.

Core Features

The plugin primarily offers the following capabilities:

  1. Real-time Balance Monitoring: Fetches the current account balance via polling the API.
  2. Usage Statistics: Provides usage statistics for 1 day, 7 days, and 1 month, along with daily consumption details.
  3. Peak/Off-Peak Indication: Displays whether the current hour is billed at peak or off-peak rates, distinguished by color (Yellow for Peak, Green for Off-Peak).
  4. Visualization: Displays a current consumption card in the DSH sidebar and provides detailed analytics in the settings panel.

How It Works

The plugin operates through the following mechanisms:

  • Data Acquisition: Polls the DeepSeek GET /user/balance API every minute (default) to retrieve the balance.
  • Local Ledger: Reading results are written to a local file $DSH_HOME/harness-accountant/ledger.json, serving as a daily ledger.
  • Precision Handling: To avoid floating-point calculation errors, all amounts are parsed as signed integer micro-units (1 unit = 1e-6 currency units) and are formatted only at the edge for output.
  • Peak Determination: The peak hour determination logic is executed client-side (browser), based on the UTC clock compared against the billing schedule published by DeepSeek. Peak hours are UTC 01:00 - 04:00 and 06:00 - 10:00 (Monday to Friday); all other times are off-peak (including weekends).

Usage Limitations

Please note the following facts before using:

  • Language Support: Only supports the English interface; multi-language support is not available.
  • Currency Handling: Supports both USD and CNY, but does not support exchange rate conversion. Switching currencies will discard accumulated daily statistics.
  • Clock Dependency: Peak hour determination relies entirely on the browser’s current system clock, not server-side calculation.

Installation & Access

Since the installation command is not explicitly provided in the documentation, it is recommended to obtain the plugin source code or install it via the following channels:

  • Directory Page: https://www.skillhub.cn/plugins/its0din-ai/harness-accountant
  • GitHub Repository: https://github.com/its0din-ai/harness-accountant

This plugin is released under the MIT License.

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

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

Xiaoye