Foreword

When running agents with DeepSeek Harness (DSH), model calls occur continuously, but the Web UI does not default to summarizing token consumption and costs. To check how much a particular conversation cost, whether peak hours are more expensive, or what the remaining account balance is, you often have to sift through logs or keep your own accounting.

Below, we introduce the community plugin dsh-usage-plugin (GitHub: feiyang-dev/dsh-usage-plugin). It adds “Usage & Consumption” and “Balance Inquiry” panels to the DSH Web interface, automatically recording tokens and cache hits for each model call, billing according to DeepSeek’s peak and off-peak prices, and supporting export and local persistence.

What Is This

dsh-usage-plugin is a usage and consumption statistics plugin within the DeepSeek Harness ecosystem, maintained by feiyang-dev, and categorized as a client-side plugin in the SkillHub directory. Its npm package name is @feiyang666/dsh-usage-plugin, it uses the MIT license, and requires Node.js >= 18.

The plugin is published as a Host + Client integrated npm package: the Node-side Cordis plugin handles recording, billing, balance inquiries, and exports; the browser-side panel communicates with the host via /usage/api. After installation, two tabs—“Usage & Consumption” and “Balance Inquiry”—will appear in the Web UI after the “Conversations” and “Traces” tabs.

Core Features

Usage & Consumption

Each model call records token usage and cache hit information, including input miss, cache hit, cache write, output, reasoning, and end reason. Costs are calculated based on DeepSeek’s official peak/off-peak/base prices:

  • Weekday peak hours: Beijing time 9:00–12:00 and 14:00–18:00.
  • Starting from 2026-08-23, weekends are billed at off-peak rates all day.

Model names are taken from the actual request parameters; non-DeepSeek models are displayed as-is, and consumption for models without official pricing is recorded as 0.

The overview page provides a “By Model” summary table and a “By API Provider × Model” detailed table, with a total cost summary at the bottom. It supports date filtering: today, last 7 days, last 30 days, all, and custom date ranges.

Usage Calendar & Cache Hit List

The usage calendar displays a daily usage heatmap by month, color-coded by consumption or call count; hovering shows a breakdown of peak/off-peak consumption, and clicking a day reveals detailed call information.

The cache hit list is sorted in reverse chronological order, supports quick filtering and custom date ranges, and the summary row distinguishes between peak consumption, off-peak consumption, and total costs. The list is rendered with pagination, 100 items per page.

Price Table

The panel includes DeepSeek’s official API price table, covering deepseek-v4-flash, deepseek-v4-flash-vision-exp, and deepseek-v4-pro. Peak and off-peak prices are displayed separately, can be edited within the panel and persisted to pricing.json, and can be reset to defaults with one click.

Balance Inquiry

Uses the currently configured DEEPSEEK_API_KEY to query the DeepSeek account balance. You need to configure the same API Key in Settings → Models as used for conversations.

Export & Import

Supports exporting records to CSV, JSON, or a PNG long image (sorted by newest first, up to 2000 records; exceeding this will prompt a warning; PNG includes separate columns for peak/off-peak consumption). You can specify the export location via the native directory selector, and the containing directory opens automatically after export.

Supports selecting JSON or CSV files for merged imports, with time-based deduplication.

Persistence & Cross-Platform

Starting from v1.9.2, records are stored in a fixed, dedicated data directory that persists across workspace switches. The default path varies by platform; for example, on Windows it is %LOCALAPPDATA%\dsh-usage-plugin\dsh-usage\usage-records.json. It can also be specified via the environment variable DSH_USAGE_DATA_DIR. The record limit is 100,000.

The plugin supports Windows, macOS, and Linux. Path handling uses node:path, and directory selection and “open containing directory” calls use each system’s native methods.

Installation & Enabling

The DSH ecosystem follows the “everything is a plugin” philosophy; SkillHub (https://www.skillhub.cn) is an independent community plugin directory, with no official affiliation with DeepSeek / High-Flyer.

Install DeepSeek Harness Desktop, open it, and go to “Install Plugins” → Recommended Plugins → Usage & Consumption Plugin → One-Click Install. After completion, click “Restart Service Now”.

Method 2: Command Line Installation

Prerequisite: DSH and pnpm are installed.

npm install -g @deepseek-ai/dsh
npm install -g pnpm

Run the installation command:

dsh plugin --profile web add @feiyang666/dsh-usage-plugin

You can also install to another profile, such as headless:

dsh plugin --profile headless add @feiyang666/dsh-usage-plugin

After installation, restart the dsh web service. This command uses pnpm to install the package to ~/.dsh/profiles/web and automatically wires it up based on the cordis.patch.yml in the package, without needing to manually edit configuration files.

Note: Starting from 2026-08-16, the npm package name changed from @feiyang666/deepseekharnessdesktop to @feiyang666/dsh-usage-plugin. The old package name is no longer maintained; use the new name for installation and upgrades.

Typical Usage

After completing the installation steps above and restarting the service, refresh http://127.0.0.1:3080 and confirm the “Usage & Consumption” and “Balance Inquiry” tabs appear at the top.

  1. Send a conversation message, open the “Usage & Consumption” panel, and view the token and cost record for this call.
  2. Switch the date range on the overview page to compare consumption across different time periods.
  3. Switch to the “Usage Calendar” sub-tab and click a day to view details.
  4. In the “Balance Inquiry” tab, click “Check Balance” to confirm the account balance (requires prior configuration of DEEPSEEK_API_KEY).
  5. In the export area, select a format (CSV / JSON / PNG), specify a directory, and export the records.

The “Usage & Consumption” panel includes four sub-tabs: Overview / Usage Calendar / Cache Hit List / Price Table.

Uninstall command:

dsh plugin --profile web remove @feiyang666/dsh-usage-plugin

Use Cases & Notes

Who it’s for:

  • Those who run agents long-term on DSH and need to track token consumption and costs.
  • Users of DeepSeek API peak/off-peak billing who want to distinguish costs between peak and off-peak hours.
  • Those who need to export usage records for archival or external analysis.

Notes:

  • The plugin runs with the permissions of the current dsh process, reading/writing local data directories and calling the DeepSeek API for balance inquiries. Before installation, review the GitHub source code and MIT license to ensure it meets your security requirements.
  • Balance inquiry requires network access to api.deepseek.com; domestic networks may need proxy configuration.
  • Consumption for models without official pricing is recorded as 0; costs for non-DeepSeek models are for reference only and do not represent actual billing.

Links

  • SkillHub directory page: https://www.skillhub.cn/plugins/feiyang-dev/dsh-usage-plugin
  • GitHub repository: https://github.com/feiyang-dev/dsh-usage-plugin
  • npm package: https://www.npmjs.com/package/@feiyang666/dsh-usage-plugin

dsh-usage-plugin aggregates tokens, cache hits, and peak/off-peak costs for each model call into a single panel, along with export and balance inquiry features, making it suitable for DSH users who need to monitor usage and control costs long-term.