DeepSeek Harness plugin

dsh-plugin-dosage

DeepSeek Harness plugin: one sidebar Usage/Balance popover combining multi-provider accounts with peak/off-peak per-call billing.

Jump to install

Source facts

Repository
qingfeng200410/dsh-plugin-dosage
Latest update
Aug 20, 2026
Category
Models & Providers
GitHub stars
2
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/qingfeng200410/dsh-plugin-dosage
Plugin: dsh-plugin-dosage
Author: qingfeng200410

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.mdSource · read only
README language

<div align="center">

dsh-plugin-dosage

English · 简体中文

GitHub · npm · MIT

A DeepSeek Harness plugin: one sidebar entry for multi-provider balances and peak/off-peak cost.

!License !npm !Node

</div>

This plugin combines dsh-usage-stats account monitoring with dsh-usage-plugin per-call billing, then puts both behind a single sidebar popover. There is no extra tab next to Conversation / Trace.

Screenshots

Overview

![Overview](./docs/assets/overview.png)

Usage

![Usage](./docs/assets/usage.png)

What you get

Click Usage/Balance at the bottom of the sidebar. The popover has five tabs:

TabWhat it shows
Usage & BalanceCurrent provider balance or Token Plan, today / month / all-time tokens, cache hits, today's cost, last 14 days
OverviewTotal spend, peak vs off-peak split, per-model totals
UsageMonthly heatmap (cost, call count, or tokens); click a day for detail
Call logEach call's model, hit rate, finish reason, and peak/off-peak cost; Today / 7 days / 30 days / All
PricesOfficial DeepSeek unit prices for deepseek-v4-flash and deepseek-v4-pro, stacked vertically; the table is not editable

The call log and the 14-day list read the same session logs. The sidebar footer token count refreshes every 5 seconds even when the popover is closed. While the popover is open, today's cost and the current provider balance also refresh every 5 seconds. The only usage entry is the sidebar footer.

Peak hours are 09:00–12:00 and 14:00–18:00 Beijing time. Models without an official price are counted as ¥0.

Install

Needs the DeepSeek Harness web profile, plus dsh and pnpm. npm is the recommended install.

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

From GitHub (pin a tag; do not use dsh plugin update on a Git ref):

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

Restart a running dsh web and hard-refresh the browser. Usage/Balance appears in the sidebar footer.

For another profile, replace web. Local tarball:

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

Upgrade

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

If you installed from Git, add the latest tag instead:

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

Uninstall

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

Restart after uninstall. Files under ~/.dsh/dsh-usage/ are kept.

Do not install both

This package already includes those two plugins. Installing them together gives you two sidebar buttons or colliding routes:

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

Also delete leftover name: dsh-usage-stats or @feiyang666/... rows in ~/.dsh/profiles/web/cordis.patch.yml.

Accounts and credentials

The plugin uses providers already configured in Harness. Credentials are resolved on the host and never sent to the browser. DeepSeek uses the same DEEPSEEK_API_KEY as Settings → Models.

ProviderModeDefault credential
DeepSeekBalanceprovider apiKeyEnv
OpenRouterBalanceOPENROUTER_MANAGEMENT_KEY (not the inference key)
Moonshot / Kimi APIBalanceprovider apiKeyEnv
OpenCode GoSubscriptionOPENCODE_GO_API_KEY or local auth.json
Z.aiSubscriptionZAI_API_KEY
Kimi For CodingSubscriptionKIMI_API_KEY
MiniMax Coding PlanSubscriptionMINIMAX_API_KEY
New API / Sub2API / customSee monitors belowcredential ref

Providers without a public account API still get token stats. The account card says “unsupported” instead of inventing a balance.

Put New API, Sub2API, or declarative monitors on this plugin's Cordis config. Do not also mount dsh-usage-stats:

# ~/.dsh/profiles/web/cordis.patch.yml
- insert:
    - id: plugin-dosage
      name: 'dsh-plugin-dosage'
      config:
        monitors:
          relay-a:          # must be a real Harness provider id
            adapter: new-api

Full adapter and security notes: dsh-usage-stats.

Data

All user-level; nothing is written into the current project:

FilePath
Call records~/.dsh/dsh-usage/usage-records.json (cap 100,000)
Price config~/.dsh/dsh-usage/pricing.json
Default export~/.dsh/dsh-usage/{csv,json,images}/
Token fold cache~/.dsh/storages/usage-stats-cache.json
Boot log~/.dsh/dsh-usage/dsh-usage-boot.log

If DSH_HOME is set, paths are relative to that directory. The panel can export CSV / JSON / PNG and merge-import by timestamp.

FAQ

SymptomFix
Two Usage/Balance buttonsRemove standalone dsh-usage-stats and its patch row
No sidebar entry after installRestart dsh web and hard-refresh; confirm the package is listed for the web profile
Unexpected end of JSON inputMissing Cordis inject. Reinstall with dsh plugin add above; do not hand-edit a truncated row
OpenRouter shows not configuredSet OPENROUTER_MANAGEMENT_KEY in ~/.dsh/.credentials.yaml
dsh plugin cannot find pnpmnpm install -g pnpm or corepack enable

Do not paste .credentials.yaml, API keys, or cookies into issues.

Acknowledgements

This plugin combines and builds on two MIT projects:

ProjectAuthorLicenseUsed for
dsh-usage-statsYchris12138 and contributorsMITMulti-provider accounts, token aggregation, loopback APIs, sidebar Usage/Balance entry
dsh-usage-pluginfeiyang-devMITPeak/off-peak billing, overview / usage / call log / prices, CSV/JSON/PNG export, POST /usage/api
DeepSeek HarnessDeepSeekMITHost and Cordis plugin runtime

On top of those, this repo mainly did the following integration, UI work, and extras:

  • Both feature sets live in one sidebar Usage/Balance popover (five tabs); the extra tab next to Conversation / Trace is gone, and so is the Settings usage section
  • Overview / Usage / Call log / Prices were redesigned: a single total with a peak/off-peak bar, empty calendar days stay unfilled, a shorter call-log table, and stacked price cards
  • The account tab adds cache hits, hit rate, and today's cost; its monthly heatmap was removed (the calendar stays on Usage) and the heatmap gained a by token mode
  • The call log uses the same session logs as the last-14-days list, instead of only stream snippets the plugin captured itself
  • The sidebar footer token count refreshes every 5 seconds even when closed; while the popover is open, today's cost / the current provider balance also refresh every 5 seconds; click outside to close; height is locked to the Usage tab
  • Records live at user-level ~/.dsh/dsh-usage/ so switching projects does not split the data; the official price table is fixed (not editable); models without an official price are ¥0; model names are shown as requested

Full terms: [LICENSE](./LICENSE) and [NOTICE](./NOTICE). DeepSeek is a trademark of DeepSeek. This is a community plugin and is not affiliated with DeepSeek.

Contributing

Issues and pull requests are welcome — UI tweaks, bug fixes, and new features all help.

This is my first public open-source project. The docs, code, and UX will have rough edges; please bear with them. If something is broken, or you believe any part infringes your rights and should be taken down, open an issue. I will look into it and remove or fix the material as soon as I can.

License

[MIT](./LICENSE)