Back to directory

dsh-token-metrics

In a curated listMaintenance: Active

hugoyee75-cmyk/dsh-token-metrics

Inspect token usage, costs, provider balances, quotas, and budgets from a DSH sidebar page.

View on GitHub
$ dsh plugin add dsh-token-metrics

21

stars

2

forks

JavaScript

Language

MIT

License

2026-10-19

Created

2026-11-13

Last push

MIT-licensed DSH plugin (JavaScript, zero runtime dependencies) for token usage, cost estimates, provider balances, quotas and budget alerts.

DSH integration

Native runtime

Author-claimed

Safety audit

Unaudited

Last verified

2026-11-10

License

MIT

01What can it help you accomplish?

  • See how many tokens DeepSeek Harness actually burns, per model, provider, project and subagent

    A sidebar statistics page with today / last 7 days / all-time totals, a trend chart, a share donut and a detail table

    DSH users who pay per token and want to know where the spend goes

  • Turn raw token counts into money, with peak/off-peak pricing and budgets

    Per-model cost estimates from the LiteLLM price list, USD / CNY switching, day and month budgets with used percentages

    Individuals and teams that need a spend ceiling rather than a surprise bill

  • Keep an eye on provider balances and subscription quotas without opening each console

    A model-access tab with balances, quota windows and reset countdowns, plus eight kinds of alerts pushed to the bottom-right corner

    Users juggling several relay stations and official platforms

02How to install into DeepSeek Harness

Prerequisites

  • DSH with the plugin manager available (the Add plugin search box or plugin_manager)
  • Node.js ^22.19 || >=24 per the package badge

Installation steps

  1. 01

    Search for `dsh-token-metrics` in DSH's Add plugin box, or run `plugin_manager install_bundle dsh-token-metrics`

  2. 02

    Alternatively install straight from GitHub: `plugin_manager install_bundle github:hugoyee75-cmyk/dsh-token-metrics`

  3. 03

    Restart DSH (or hot reload); the Token usage icon appears in the sidebar and the first open back-scans existing session logs

Verify the integration

Not specified by the author

03DSH integration and capability boundaries

DSH integrationNative runtime

A DSH bundle installed through the plugin manager or the Add plugin search box; it adds a sidebar page, host HTTP routes and a right-corner notification stream inside the DSH host process.

  • Usage statistics page

    DSH's own session logs→totals for input / output / cacheRead / reasoning / total / calls / cache hit rate / average first-token latency, plus a trend chart and a detail table

    stores its data in $DSH_HOME/token-metrics/usage.json
  • Cost estimation

    per-call token usage plus the LiteLLM public price list→per-model cost in USD or CNY, with peak / off-peak pricing for DeepSeek and a manual price entry for unpriced models

  • Provider balance and quota probes

    your configured provider keys and base URLs→balances for Sub2API / new-api / one-api gateways and 11 official platforms; quota windows and reset countdowns for subscription plans

    only quota queries send requests, and only to the subscription sites you configured (auto sampling can be disabled with quotaSampleMs: 0)
  • Corner notifications over SSE

    balance, quota, query failure, new version, peak/off-peak and budget events→eight alert types pushed to the bottom-right corner with server-side cooldown, on-disk state and client memory de-duplication

    alert state is written to $DSH_HOME/token-metrics/alerts.json

04Who is it for? When not to use it?

Good for

  • DSH users who pay per token and want to know where the spend goes
  • Individuals and teams that need a spend ceiling rather than a surprise bill
  • Users juggling several relay stations and official platforms

Not for

  • Hot reload depends on Cordis internal APIs; a DSH or Node upgrade can break it, and restarting DSH is the fallback.

05Compatibility, maintenance and safety notes

  • Everything is computed from DSH's session logs, which the README calls the only authoritative source; local numbers will not match official billing because the two count differently.
  • Hot reload depends on Cordis internal APIs; a DSH or Node upgrade can break it, and restarting DSH is the fallback.
  • The plugin stores no keys; keys stay with DSH's credential service and only a reference name (apiKeyEnv) is written, with apiKey / token / secret-like fields filtered out.
  • History cannot be attributed retroactively: the session log has no accountId / userId / keyId, so usage recorded before switching accounts is counted as unknown.
2026-10-192026-11-07v0.4.0

MIT · latest release v0.4.0 (2026-11-07); zero runtime dependencies, no build step

06Frequently asked questions

How do I install dsh-token-metrics?

Type `dsh-token-metrics` into DSH's Add plugin search box, or run `plugin_manager install_bundle dsh-token-metrics`. To install from GitHub instead, use `plugin_manager install_bundle github:hugoyee75-cmyk/dsh-token-metrics`.

Does it upload my usage data anywhere?

No. The README says data comes from DSH's own session logs, and that only subscription quota queries send requests — to the subscription sites you configured — with auto sampling switchable off via quotaSampleMs: 0.

Where is the data stored, and will I lose history on upgrade?

In `$DSH_HOME/token-metrics/usage.json`. The README stresses that when data consistency is in doubt the plugin keeps existing data, marks it for rebuild and re-scans from the session logs instead of wiping history.

Why don't the numbers match my official bill?

Local statistics are computed from session logs while the official bill counts actual billing; the README says to treat the official bill as authoritative and the local numbers as a trend view.

Do I need to install dependencies or build it?

No. The README lists zero runtime dependencies, no build step and no npm install.

08Data and sources

  • Author-claimedgithub.com000c21c4e591…

    一个 DSH 插件:把经过 DeepSeek Harness 的每一次模型调用都记下来,在侧边栏给你一个 Token 用量统计页,顺带管好成本与供应商余额。

  • Author-claimedgithub.com000c21c4e591…

    plugin_manager install_bundle dsh-token-metrics

This page is generated from the project’s public documentation, repository metadata and a structured parse of DSH Plugins; last verified on 2026-11-10. Found an error? Submit a correction.

🏆

Best DeepSeek Harness Plugins

Twelve plugins worth installing first — picked from the whole catalog, across every category.

DSH Plugins is an independent community directory of DeepSeek Harness plugins. Not affiliated with or endorsed by DeepSeek. Third-party plugins are not security-audited — review the source before installing.

New DeepSeek Harness plugins, weekly. No spam.