Model or dataset
Han-1413141/dsh-cost-meter avatar
Han-1413141/dsh-cost-meter

dsh-cost-meter: session and Coding Plan cost tracking for DeepSeek Harness

DeepSeek Harness session cost meter plugin: session/daily cost, budget, history, OpenCode Go quota, official & custom-provider balance, Codex-like token heatmap, peak/off-peak pricing with pre-switch popup & system-notification alerts, official price sync, 90+ model pricing catalog, Coding Plan quota queries (7 vendors), bilingual zh/en UI

312 stars30 forksJavaScriptMIT

At a glance

What is it?
dsh-cost-meter is a DeepSeek Harness plugin that totals session and daily spend, queries Coding Plan quotas across nine vendors, and warns before peak pricing starts. It is a good fit if you already run DSH; otherwise it has nothing to attach to.
Who is it for?
Adopt dsh-cost-meter if you already run DeepSeek Harness and pay per token across several providers, particularly if you hold Coding Plan subscriptions whose quota you cannot see from inside the editor. Do not adopt it for a non-DSH client, and do not expect it to meter traffic outside DSH.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 18, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What dsh-cost-meter solves, and for whom

DeepSeek Harness (DSH) is the host application; dsh-cost-meter is a plugin that runs inside it. The problem it addresses is that token spend in an agent session is invisible while the session is running. You see the conversation, not the bill. The plugin puts a running cost figure under the input area or in the session title bar, a daily total in the sidebar, and a budget frame with a used percentage. The README describes the position of each of these as configurable.

The second problem is subscription quota. If you pay for a Coding Plan rather than per token, the constraint is not money but the size and reset time of a rolling window. The plugin queries quota for nine vendors according to the README: Anthropic, Z.ai, MiniMax, Kimi, OpenRouter, SiliconFlow, CommandCode, SCNet and Volcano Ark. Each vendor has its own enable switch, credentials, display position and refresh interval.

The intended user is someone running DSH with a mix of pay-per-token API calls and one or more subscriptions, who wants both kinds of limit visible in the same place. If you use a different client, or you never look at cost, the plugin has nothing to attach to.

The ledger, the price table and the matching rules

Everything rests on a local ledger. The plugin records each call with its input, cached and output token counts and its cost, and keeps history by day with a configurable retention period (180 days by default). History is what feeds the daily and cumulative totals, the per-model breakdown and the 26-week token heatmap in the settings page.

Pricing is per model, with separate off-peak and peak entries. The price table supports input and output shorthand, and cached-token prices are filled in automatically. A built-in catalog covers more than 90 models, and unknown model ids are matched against it by normalisation: case, spaces, hyphens, dots and parenthetical suffixes are ignored, so a request name that contains a catalog model name will hit. Under routing providers the lookup widens across the whole catalog. Matching can be turned off so that only exact ids count, and a model that still misses can be pointed at a billing entry by hand.

Two details matter here. First, the ledger is local, so a reinstall without the retained data starts from zero unless the import path runs. Second, the README states that on first start after installation or upgrade the plugin replays the host's full session logs to import conversations that predate the plugin, rebuilding whole missing days and adding only unknown sessions to existing days. That operation is described as idempotent and as not duplicating live billing. It is also the step most likely to surprise you, because the imported amounts are reconstructed at the historical prices in effect at each event time.

Installing dsh-cost-meter and reading your first session cost

The package is published on npm as dsh-cost-meter, and the repository also ships install.ps1 for Windows. The package declares its DSH compatibility range in package.json, listing individual DSH releases as compatible or unknown, so check that your host version appears there before installing. The plugin is ESM ("type": "module") and exposes a client entry for the web platform, which is what the sidebar and settings UI are built on.

bash
npm install dsh-cost-meter

After installation, restart DSH. According to the README, the first start after install or upgrade automatically replays the host's session logs to import pre-installation history. On that first entry into an updated panel the plugin shows a guide prompt, and the README says the user decides whether to keep the simplified sidebar layout.

json
{
  "enabled": true,
  "display": "sidebar"
}

The snippet above is the shape the README gives for a custom provider balance entry: an enabled flag and a display position. The same section documents an extract rule with four forms (a numeric constant, a dot-path string, add/subtract across paths, and divide by a divisor). The README notes that divide suits endpoints that report an integer quota, giving 1 USD = 500000 quota as the NewApi convention. Non-loopback hosts must use https; plain http is accepted only for 127.0.0.1, localhost or [::1].

The quickest first check is the session cost line under the input area. Send one message and confirm the figure moves. Then open the settings page and look at the price table entry for the model you just used. If the model id did not match, the call will have been recorded without a price, and that is the failure you want to catch on day one rather than at the end of the month.

Peak and off-peak pricing, and the alert before the switch

The plugin treats pricing as time-dependent. The README states that UTC 01:00 to 04:00 and 06:00 to 10:00 are peak windows, and that from 2026-08-23 weekends are billed at off-peak rates all day, displayed as a weekend all-off-peak label. The settings page, the budget frame and the daily cost line all show the current tier, with a countdown in the expanded view and a vertical peak/off-peak bar in the collapsed rail view.

The more interesting part is the pre-switch alert. When a tier change is less than a configurable lead time away (2 minutes by default, adjustable from 1 to 30), a full-screen badge popup appears. Position can be bottom-right or screen centre, and the alert type can be set to entering peak, entering off-peak, or both. Each switch point alerts once. A browser system notification can be sent alongside, which the README says works when the page is minimised and requires notification permission. The settings panel includes a preview that renders the real component so the text and position match the live trigger.

This is a scheduling aid, not a cost control. It tells you that a price boundary is close; it does not queue or defer anything. If your workload is not time-flexible, the popup is noise you can switch off, and the tier display alone is enough.

Where the numbers stop being trustworthy

The clearest limitation is scope. The README states that the Token Plan usage statistics count only calls made inside dsh. Any usage of the same subscription from a browser, a CLI, or another editor is invisible to the estimate, so the per-1%-of-quota and full-window token figures are lower bounds rather than account totals. The estimation method is documented as sampling differences or conversion from current usage, and the project's own panel documentation labels the precision accordingly. Treat those two columns as an indicator of burn rate, not as a billing record.

The second boundary is credentials and endpoints. Quota queries need vendor credentials, and the README notes that a missing credential or an absent subscription produces a neutral message rather than an error. Volcano Ark requires AK/SK control-plane HMAC signing with ArkReadOnlyAccess and BillingCenterReadOnlyAccess. MiniMax changed its default query host to www.minimax.cn in v1.7.28 and now allows a saved HTTPS query domain; the README says that once you specify a domain manually, only that domain is queried. That is a sensible default, but it means a vendor host migration can silently stop a quota source until you update the setting.

Third, the currency model has edges. The custom-provider extract rules support a unit of CREDITS for non-monetary counters. The README is explicit that dollar spend is not converted into credits, that no inferred daily credit consumption is shown for such an endpoint, and that the global currency budget does not apply to it. If you mix a credits endpoint with a currency budget, the progress bar will not reconcile them for you.

Alternatives and the difference in approach

The natural comparison is a provider gateway such as LiteLLM. A gateway sits between your client and the model APIs, so it sees every request from every tool and can enforce spend limits centrally. dsh-cost-meter does the opposite: it lives inside one client and reads the host's session logs. The gateway gives you coverage and control; the plugin gives you per-session attribution, subscription quota lookups and peak-pricing awareness without routing your traffic through another service. If you need a hard cap that applies across all your tools, a gateway is the right layer and this plugin is not a substitute for it. If you want to know what this session cost and how much of your Kimi weekly window is left, a gateway will not tell you that without extra configuration.

The README itself points to a related plugin, dsh-workbuddy-connect, whose local status route returns aggregated credits and can be used as a custom balance source without copying credentials. That is a complement rather than a competitor: it exposes a number, and dsh-cost-meter displays it.

A third option is doing nothing and reading the vendor console. That is free and always accurate, but it is retrospective. The plugin's value is that the figure is on screen while you are still deciding whether to send another message.

Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-09-16, the same day as the v1.7.28 release. The three most recent releases, v1.7.26 through v1.7.28, landed on 2026-09-15 and 2026-09-16 and each addressed a vendor integration: Alibaba Qwen CLI quota and gateway credits, source-host compatibility and session recovery, and the MiniMax domain change. The cadence is therefore tied to vendor API changes, which is the main upgrade cost. When a provider moves a host or changes a quota shape, the plugin needs a release, and until then that source reports nothing useful.

The licence is MIT, which permits commercial use, modification and redistribution provided the copyright notice and permission notice are retained. That is a permissive licence, not a statement about the data the plugin handles: it stores credentials for quota queries and keeps a local ledger of your usage. Those are your operational concerns, and the README does not describe an encryption or access-control model for the stored configuration. Nothing here is legal advice; if you deploy this inside a company, check how the credential storage interacts with your own policies.

One upgrade behaviour is worth knowing before you plan a version bump. The README states that a manually specified MiniMax query domain is preserved across plugin updates, and that the first start after an upgrade replays session logs to import history. Both reduce the cost of upgrading, but the replay means a version bump is not a no-op on a large session history.

Editorial conclusion

Adopt dsh-cost-meter if you already run DeepSeek Harness and pay per token across several providers, particularly if you hold Coding Plan subscriptions whose quota you cannot see from inside the editor. Do not adopt it for a non-DSH client, and do not expect it to meter traffic outside DSH. Before relying on the numbers, verify that your model ids resolve to the right price entries, and confirm the currency and endpoint of each quota source against your vendor console.

Frequently asked questions

What is the full meaning of DSH?

In this project DSH stands for DeepSeek Harness, the host application that dsh-cost-meter is a plugin for. The package declares its compatibility against DSH versions in package.json.

How do I install dsh-cost-meter?

It is published on npm as dsh-cost-meter, and the repository also includes install.ps1 for Windows. Check the dsh compatibility list in package.json against your host version before installing, then restart DSH.

Does dsh-cost-meter count usage outside DeepSeek Harness?

No. The README states that Token Plan usage statistics only count calls made inside dsh, so usage of the same subscription from a browser or another editor is not included in the estimates.

Which Coding Plan vendors can dsh-cost-meter query?

The README lists Anthropic, Z.ai, MiniMax, Kimi, OpenRouter, SiliconFlow, CommandCode, SCNet and Volcano Ark, each with its own enable switch, credentials, display position and refresh interval. Volcano Ark requires AK/SK control-plane signing.

Official sources

  1. Han-1413141/dsh-cost-meter on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Community notes

Community notes