Introduction

In the plugin client scenario of DSH, developers frequently need to check the account status, token statistics, and peak/off-peak costs for each call. Existing practices involve mounting account monitoring and per-call billing separately, which results in scattered entry points and potential duplicate entries.

Below, I introduce dsh-plugin-dosage. It consolidates multi-provider balance/account monitoring and peak/off-peak per-call billing into a sidebar Usage/Balance popover, reducing the need to switch between multiple entry points.

What is it

dsh-plugin-dosage is a DeepSeek Harness community plugin, maintained by qingfeng200410, and licensed under the MIT license.

Its purpose is to provide a sidebar entry in the DSH web profile to view multi-provider balance/account status, token statistics, and per-call costs calculated by peak/off-peak periods. The entry is the Usage/Balance popover at the bottom of the sidebar, rather than adding an extra tab.

This is a community plugin and has no official affiliation with DeepSeek.

Core Features

Below are the capabilities provided by the plugin, all centered around the concept of “one entry to view usage and cost”:

  • The entry is the Usage/Balance popover at the bottom of the sidebar, not an extra tab.
  • Supports multi-provider balance/account monitoring: DeepSeek, OpenRouter, Moonshot/Kimi, OpenCode Go, Z.ai, Kimi For Coding, MiniMax Coding Plan, and custom/New API/Sub2API monitors.
  • Token statistics include today/month/all-time tokens, cache hits, and hit rate.
  • Per-call costs are split by peak/off-peak periods; peak times are Beijing Time 09:00–12:00 and 14:00–18:00.
  • The Overview tab displays total spend, peak/off-peak splits, and per-model totals.
  • Monthly heatmap/calendar can be viewed by cost, call count, or tokens.
  • Call logs record the model, hit rate, finish reason, and peak/off-peak costs, and provide filtering for Today, 7 days, 30 days, and All.
  • Displays official DeepSeek unit prices for deepseek-v4-flash and deepseek-v4-pro.
  • Supports CSV, JSON, and PNG export, as well as merge-import by timestamp.
  • User-level data is stored in ~/.dsh/dsh-usage, ensuring that switching projects will not separate the data.
  • The token count in the sidebar footer refreshes every 5 seconds, even if the popover is closed.

Installation and Usage

Before installation, ensure you have the DSH web profile, dsh, and pnpm installed. Installation via npm is recommended.

First, run the following command to install the plugin to the web profile:

dsh plugin --profile web add dsh-plugin-dosage

If you wish to install via a GitHub tag, use the following command. The tag v0.1.0 is specified explicitly here:

dsh plugin --profile web add -w github:qingfeng200410/dsh-plugin-dosage#v0.1.0

If you already have a local tarball, you can install it directly:

dsh plugin --profile web add ./dsh-plugin-dosage-0.1.0.tgz

Run the following command to upgrade the plugin:

dsh plugin --profile web update dsh-plugin-dosage

Run the following command to uninstall:

dsh plugin --profile web remove dsh-plugin-dosage

After uninstallation, files under ~/.dsh/dsh-usage/ will be retained and will not be deleted automatically.

Note that you should not install this plugin together with dsh-usage-stats and dsh-usage-plugin to avoid duplicate entries or routing conflicts.

Typical Usage

The following steps can be followed immediately after installation.

  1. Click Usage/Balance at the bottom of the sidebar to open the unified usage/balance popover.
  2. View multi-provider balance/account status, as well as today/month/all-time tokens, cache hits, and hit rate.
  3. Go to the Overview tab to view total spend, peak/off-peak splits, and per-model totals.
  4. Go to the monthly heatmap to view history by cost, call count, or tokens; go to Call log to view the model, hit rate, finish reason, and peak/off-peak costs.
  5. For export or merging, use the CSV, JSON, and PNG export, as well as merge-import by timestamp.

If OpenRouter is configured, you need to use OPENROUTER_MANAGEMENT_KEY, not the inference key. You can set it in ~/.dsh/.credentials.yaml:

OPENROUTER_MANAGEMENT_KEY: <replace-with-your-own-key>

This is only to demonstrate the configuration location. Do not paste your real .credentials.yaml, API keys, or cookies into issues.

To add custom/New API/Sub2API monitors, add the corresponding configuration in ~/.dsh/profiles/web/cordis.patch.yml.

Data and Credential Boundaries

This plugin stores user-level data in ~/.dsh/dsh-usage, rather than writing into the current project directory. This ensures that when switching projects, the data is not separated by project.

Please note the following facts:

  • If DSH_HOME is set, relevant paths are relative to that directory.
  • Credentials are resolved on the host and are not sent to the browser.
  • OpenRouter requires OPENROUTER_MANAGEMENT_KEY, not the inference key.
  • Models without official pricing are counted as ¥0.
  • The call records file limit is 100,000 records.
  • After uninstallation, files under ~/.dsh/dsh-usage/ will still be retained.

Applicable Scenarios and Notes

Suitable for the following scenarios:

  • You use the DSH web profile and call models on multiple providers at the same time.
  • You need to check balance, token statistics, cache hits, peak/off-peak costs, and call logs in a single sidebar entry.
  • You need to export usage data or merge historical data by timestamp.

Please note before use:

  • This is a community plugin, not an official DeepSeek component.
  • The plugin runs with the permissions of the current dsh process; it is recommended to check the source code and license before installation.
  • Requires the DSH web profile, dsh, and pnpm.
  • Installation via npm is recommended.
  • Do not install dsh-usage-stats and dsh-usage-plugin together.
  • Do not paste .credentials.yaml, API keys, or cookies into issues.

Conclusion

The value of dsh-plugin-dosage lies in consolidating “account balance” and “per-call cost” into a single sidebar popover, reducing the need to switch back and forth between multiple entry points. It is suitable for centralized viewing of usage, cost, and multi-provider accounts within the DSH client.

To find it in the DSH community directory, search for the plugin name dsh-plugin-dosage. Source code:

https://github.com/qingfeng200410/dsh-plugin-dosage