Preface

When using the DeepSeek API on the DeepSeek Harness (dsh) web interface, the common issue isn’t about whether there is token statistics, but what is missing after the statistics: estimating the cost of the current session, checking remaining balance, seeing if today is approaching the budget, identifying which model used the most resources, and verifying if the actual charges in the official bill match up.

Below is an introduction to a community plugin for dsh web: fancr-code/dsh-plugin-usage-meter. It integrates usage data, costs, balance, budget alerts, and official billing into a button-style usage bar located below the input box, making it suitable for developers who run DeepSeek tasks in Harness for extended periods.

What is it

dsh-plugin-usage-meter is a pure web plugin with an MIT license, maintained by the community. It is mounted via the official dsh profile mechanism, does not modify the dsh source code, and reverts cleanly upon uninstallation.

Verified documentation indicates a size of approximately 0.6MB, with no Electron, no standalone process, no telemetry, and no third-party runtime dependencies. It is not a standalone application but a frontend plugin embedded within dsh web.

Core Features

The plugin provides a button-style usage bar below the input box that expands into a panel upon clicking. The verified main capabilities are as follows:

  • Real-time display of current session token usage, with costs estimated by the official list price; displays account balance after configuring the API Key.
  • Displays bar charts for daily and last 7 days stacked by model, as well as model cost distribution.
  • Supports peak/valley pricing, supports CNY/USD dual-currency official quotes, and does not perform currency conversion.
  • Optional integration with official billing: reads daily bills from platform.deepseek.com and displays actual official charges.
  • Historical costs are calculated based on the effective range of the list price; supports automatic recognition of official price adjustments.
  • Budget alerts: shows daily budget progress; displays yellow when exceeding 80% and red when over budget.
  • Context pressure warnings: three levels (30%, 50%, 85%), and supports one-click /compact.
  • Displays consumption tiers and generates a Liangzu Sharing Card, exportable as PNG via canvas.
  • Check for updates and one-click update within the panel.
  • Cross-session ledger local persistence.

Installation and Activation

First, ensure that DeepSeek Harness is installed locally and that dsh web starts normally. The plugin’s environment requirements are node >=22, and peerDependencies requires react ^18.2.0.

Install from npm:

dsh plugin --profile web add dsh-plugin-usage-meter

After installation, restart dsh web and refresh the page. The appearance of a button-style usage bar below the input box indicates that it is active.

You can also install from GitHub:

dsh plugin --profile web add github:fancr-code/dsh-plugin-usage-meter

Or clone and install locally:

git clone https://github.com/fancr-code/dsh-plugin-usage-meter.git
dsh plugin --profile web add ./dsh-plugin-usage-meter

The plugin comes with dsh.bundle.patch, and dsh plugin automatically registers it into the profile’s bundle layer; no need to manually edit cordis.patch.yml.

Verify the mount status:

dsh --profile web --dump-config

Confirm that usage-meter appears in the output.

Uninstall:

dsh plugin --profile web remove dsh-plugin-usage-meter

Then restart dsh web.

Typical Usage

Basic Display

Without additional configuration, the plugin can provide most features except balance: session token usage, list price cost estimation, daily and last 7 days bar charts, budget alerts, context pressure alerts, check for updates, etc.

Balance queries require a DeepSeek API Key, usually the DEEPSEEK_API_KEY written on the Web “Model” page.

Configuration File

Edit the usage-meter section of $DSH_HOME/settings.yaml. The verified configurable items include currency, budget, and pricing, which can be written in a similar format:

usage-meter:
  currency: USD
  budget: 50
  # pricing: can override the unit price of a specific model

Field meanings are as follows:

  • currency: Billing currency, can be CNY or USD.
  • budget: Daily budget amount; setting to 0 or omitting it disables budget alerts.
  • pricing: Used to override the unit price of a specific model.

Priority is: settings.yaml override > official effective range/real-time > built-in snapshot; the built-in snapshot (2026-08-17) serves as a fallback.

Official Billing

Official billing is an optional feature. After integration, the panel can display the daily bills from platform.deepseek.com and the actual official charges.

Method 1: Auto-import userToken from the local browser. Requires the local browser to remain logged in to platform.deepseek.com. You can disable auto-import using the environment variable:

USAGE_METER_AUTO_PLATFORM_TOKEN=0

Method 2: Write DEEPSEEK_PLATFORM_TOKEN to $DSH_HOME/.credentials.yaml:

DEEPSEEK_PLATFORM_TOKEN: <userToken>

If the platform token expires and the platform returns 40002 or 40003, the plugin will fall back to list price estimation and automatically retry or re-scan after a 30-minute cooldown.

Peak/Valley and Historical Pricing

The official peak rules are: UTC 01:00–04:00, 06:00–10:00 (Beijing Time 09:00–12:00, 14:00–18:00), and only Monday to Friday. The peak price is 2x the idle price.

Historical costs are calculated based on the effective range of the list price. The plugin identifies official price adjustments; usage before and after adjustments is estimated using the list price in effect at that time.

Applicable Scenarios and Notes

This plugin is suitable for the following scenarios: continuously using the DeepSeek API in dsh web, requiring real-time viewing of session costs, account balance, daily budget, and model cost distribution, and being willing to integrate with the official bill to verify actual charges.

It is recommended to confirm the following points before use:

  • The license is MIT, and the source code can be checked on GitHub.
  • The plugin runs with the current dsh process permissions; you should check the source code and license before installing.
  • The ledger location is $DSH_HOME/usage-meter/ledger.json, which stores only token buckets, model names, and snapshots of the list price effective range, and does not contain conversation content.
  • Ledger writing uses 2s debounce and atomic write (temp file + rename), and performs automatic cleanup.
  • Without an API Key, the balance query is unavailable, but other features remain usable.
  • Without an official bill token, the billing function is unavailable, and the plugin falls back to list price estimation.

This article is based on verified materials; the “Known Limitations” and “Data and Privacy” sections in the README provided in the materials are incomplete, so this article does not expand on these unprovided contents.

Conclusion

The value of dsh-plugin-usage-meter lies in extending the usage information in dsh web from simple token statistics to cost estimation, balance, budget, model distribution, official billing, and context pressure alerts. It is lightweight, uninstallable, and configurable, making it suitable for placement in a daily development environment to monitor DeepSeek API consumption over the long term.

GitHub: https://github.com/fancr-code/dsh-plugin-usage-meter. The directory page does not provide a verifiable URL; if installing from the community directory, you can search by the plugin name dsh-plugin-usage-meter.