DSH Plugin dsh-monitor: Monitor Daily Token Usage and Peak/Off-Peak Costs for DeepSeek Sessions

Preface

After integrating DeepSeek sessions in DSH, a common need is to see exactly how many Tokens were consumed today, approximately how much it costs under peak/off-peak pricing, and whether the current period is off-peak. dsh-monitor is a native DSH plugin that accumulates data directly on DSH’s internal event stream — no browser extension required, and it doesn’t go through the page’s network layer.

The DSH ecosystem emphasizes “everything is a plugin,” and the community directory is an independent site with no official affiliation to DeepSeek / High-Flyer. This article only covers capabilities and integration steps that have been verified in available sources.

What This Is

dsh-monitor is a native DSH plugin positioned as a “real-time API usage monitor with peak/off-peak price indicator floating panel.”

The plugin repository path is iambbp/dsh-monitor, licensed under MIT.

The core problem it solves: directly display today’s real Token consumption, costs calculated according to DeepSeek’s official peak/off-peak pricing, peak/off-peak status, interaction count, average consumption, and quota progress within the DSH session interface, while also providing a data API and persistent records.

Core Features

Listed by capability:

  • Real-time accumulation of real Token consumption across all of today’s sessions, including input, cache hits, and output.
  • Calculates today’s cost based on DeepSeek’s official peak/off-peak pricing, with automatic half-price during off-peak periods.
  • Counts today’s interaction count via turn/start events.
  • Displays today’s average Token count per interaction.
  • Shows peak/off-peak status indicator and real-time Beijing time.
  • Shows a progress bar for today’s cost vs. quota limit.
  • Displays peak/off-peak legend and official period descriptions.
  • One-click copy of today’s usage text report to clipboard.
  • Supports immediate refresh, with automatic polling every 2 seconds by default.
  • The floating panel can be dragged, collapsed into a small pill, or hidden.
  • Data persists to ~/.dsh/dsh-monitor.json, with history retained for 90 days.
  • Provides a GET /api/dsh-monitor data API.

All these features revolve around “today’s cumulative totals”: Token count, cost, interaction count, and average consumption all apply to the current statistical day, with historical data retained for 90 days.

Installation and Enablement

No single official installation command was found in verified sources. The following describes the integration method based on the multi-step manual configuration provided in the sources. First, prepare the plugin source code and place it in the profile directory, for example at ~/.dsh/profiles/web/dsh-monitor.

  1. Add the plugin reference to the dependencies in ~/.dsh/profiles/web/package.json:
{
  "dependencies": {
    "dsh-monitor": "file:./dsh-monitor"
  }
}

This step allows the profile to load the local plugin directory via the file: link.

  1. Append the loading entry to ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
  - id: dsh-monitor
    name: 'dsh-monitor'
    config:
      quotaLimit: 10

Here, quotaLimit sets today’s quota upper limit, with a default value of 10 yuan.

Note: The bundles array should only contain bundle assembly packages. Do not add individual plugins to bundles, otherwise DSH startup will hang.

  1. Install dependencies in the profile directory and sync the local plugin link:
cd ~/.dsh/profiles/web
corepack pnpm install
  1. Restart DSH, for example by running:
dsh web
  1. Verify that it’s enabled. After starting DSH, open:
http://127.0.0.1:3080/

Press F5 to refresh the page. If a floating panel appears in the top-right corner, the page side has loaded successfully. You can also visit:

http://127.0.0.1:3080/api/dsh-monitor

This endpoint should return JSON data.

If you modify lib/index.js later, you must re-run:

corepack pnpm install

Then restart DSH to sync the link and startup logic.

Typical Usage

Here are common operations after installation.

  1. After starting DSH, press F5 to refresh the page — the floating panel appears in the top-right corner.
  2. Drag the panel title bar to move it anywhere.
  3. Click on the right side of the title bar to collapse the panel into a small pill.
  4. Click the close button to hide the panel; the state is remembered in localStorage.
  5. Click “Copy Report” to copy today’s usage text report to the clipboard.
  6. Click “Refresh” to immediately re-fetch data; by default, automatic polling occurs every 2 seconds.

Copying the report is useful when you need to paste today’s consumption details when explaining to others; collapsing and hiding the panel is useful for long-term use to avoid blocking the page.

Data and API

Plugin data comes from DSH’s internal event system — no browser extension required, and it doesn’t go through the page’s network layer.

The frontend floating panel fetches data via GET /api/dsh-monitor, and this endpoint can also be used by other tools.

The persistence file is:

~/.dsh/dsh-monitor.json

Historical data is retained for 90 days, with anything beyond that automatically trimmed.

Use Cases and Notes

Suitable for:

  • People using DeepSeek sessions in DSH who need to check today’s Token usage and costs.
  • People who want to determine current billing status based on peak/off-peak periods.
  • People who need to copy today’s usage report to the clipboard.
  • Developers who need to call GET /api/dsh-monitor to retrieve JSON data.

Notes before installation:

  • The plugin runs with the current dsh process’s permissions; you should review the source code and license.
  • The license is MIT.
  • Verified sources do not provide a single official installation command; this article only lists the multi-step manual configuration.
  • bundles should only contain bundle assembly packages, not individual plugins.
  • After modifying lib/index.js, run corepack pnpm install and restart DSH.

Conclusion

The value of dsh-monitor is placing today’s Token usage, peak/off-peak costs, and interaction count for DeepSeek sessions directly within the DSH page for easy viewing, while providing persistence files and a JSON API for further use.

Related links:

  • GitHub: https://github.com/iambbp/dsh-monitor
  • Directory page: https://www.skillhub.cn/plugins/iambbp/dsh-monitor
羽毛球分组比赛记分
小程序二维码

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

Xiaoye