Preface¶
The plugin mechanism of DSH is well-suited for packaging UI capabilities such as cost viewing, quota display, and export into independent packages. For developers who use multiple models, providers, or relay stations over the long term, manually recording tokens and balances can easily lead to inconsistent accounting standards.
dsh-ui-usage-billing is a DeepSeek Harness plugin maintained by kenz1117. It is installed via the npm package @kenz1117/dsh-ui-usage-billing and is licensed under MIT. The plugin provides a cost metrics entry point in the sidebar and a full-screen dashboard that aggregates real usage from persistent session logs, then estimates costs based on a multi-vendor catalog.
Below, we introduce its features, installation process, and edge cases to be aware of.
What This Is¶
In one sentence: a usage and billing dashboard for DSH. According to the documentation, it is a pure UI surface—it does not register tools, does not inject system prompts, and does not write model-visible events to session logs.
The current package.json marks the version as 1.0.15 with an MIT license. The engines requirement is:
node ^22.19.0 || >=24.0.0
Core Features¶
Sidebar and Dashboard¶
After starting the host, a billing entry point appears above the sidebar settings. When opened, it displays a full-screen dashboard with the following sections:
- Overview
- Trends
- Details
- Statistics
- Pricing
- Settings
The server aggregates real usage from persistent session logs in real time; an empty snapshot is shown before data arrives.
Cost Estimation and Custom Pricing¶
The plugin estimates costs based on real-time multi-vendor official prices and supports peak/off-peak billing:
- Weekday peak hours ×2
- Weekends priced at off-peak rates all day
Custom pricing is available for models not listed or with variable prices, where you can fill in:
- Miss
- Cache hit
- Output
USD and off-peak prices are optional.
Costs for unpriced models are calculated as 0, with a prompt below the Hero indicating that N models are not included in pricing.
Subscriptions, Balances, and Reconciliation¶
The subscription and balance features listed in the documentation include:
- Recognition and display of subscription plan quotas, including
Kimi/Z.ai/OpenCode Go/MiniMax/OpenRouter/ Xiaomi / Volcano Engine, etc. - Multi-vendor balance queries:
DeepSeek/Kimi/ StepFun / SiliconFlow /xAI/ ZhipuGLM/ Tencent CloudTokenHub - Relay station balance and rolling quota recognition, grouped by normalizing
originbased on providerbaseURL - Declared endpoints
declaredEndpoints - Balance difference reconciliation
reconcilePath
Usage Details and Export¶
The details and export features listed in the documentation include:
- Cost spike attribution: a bar chart of costs per round for the last 40 rounds, with red markers for values exceeding 2x
- Session details
- Monthly / yearly calendar heatmap
- Performance metrics:
TTFTmean /P50/P90,tokens/s, total latency mean Tokenstatistics: input (cache miss) / input (cache hit) / output, includingreasoningtokens- Daily / per-session / per-site
CSVexport - Full
JSONexport
CSV export prefixes cells starting with = / + / - / @ with a single quote, and escapes commas / quotes / newlines / carriage returns.
Internationalization and Offline Capabilities¶
The foundational features listed in the documentation include:
- Multi-language: Chinese / English
- Dual currency:
¥/≈$toggle - Offline and self-contained: no chart libraries, no external CDNs, pure design tokens
Security and Privacy¶
The security boundaries listed in the documentation include:
- All HTTP endpoints enforce loopback access
- Write operations additionally verify
Originloopback andContent-Type application/json - Privacy bottom line: pure UI surface, does not register tools, does not inject system prompts, and does not write model-visible events to session logs
Installation and Activation¶
First, check the host version and dependencies, then install the npm package, and finally start the host.
According to the documentation, the compatibility baseline is DSH 0.1.2-alpha.1; for older hosts from 0.1.0-rc.8 to 0.1.1-rc.2, it is recommended to stay on v1.0.11. The peerDependencies list in the documentation is truncated, so it is advisable to rely on the current dependencies of both the host and the package before installation.
- Install the npm package:
npm install @kenz1117/dsh-ui-usage-billing
- Add the following to the host’s
cordis.patch.yml:
- insert:
- id: ui-usage-billing
name: '@kenz1117/dsh-ui-usage-billing'
-
After starting the host, the billing entry point appears above the sidebar settings.
-
When
sessionPersistenceis available, real usage is aggregated automatically.
Typical Usage¶
Start the host first, then enter the dashboard from the sidebar. Below are some examples from the documentation:
- For models not listed or with variable pricing: use custom pricing, filling in miss, cache hit, and output, with optional
USDand off-peak prices. - Tencent Cloud
TokenHub: fill in credentials as<SecretId>:<SecretKey>. MiniMaxfor domestic developers: useminimax-token-plan-cn, automatically connecting tohttps://api.minimaxi.com.- Export: export
CSVby day / by session / by site, or export fullJSON.
Applicable Scenarios and Notes¶
It is suitable for the following situations:
- You use DSH and need to view usage and costs across multiple providers and sessions in a single interface.
- You need to simultaneously view subscription quotas, multi-vendor balances, relay station quotas, declared endpoints, and balance difference reconciliation.
- You need to export
CSV/JSONfor subsequent verification or archiving.
Things to note before use:
- The plugin runs with the current dsh process permissions. Check the source code and license before installation; the current license is MIT.
- Real usage aggregation depends on
sessionPersistence; the documentation states that real usage is aggregated automatically whensessionPersistenceis available. - Cost estimation is an estimate: calculated based on real-time multi-vendor official prices; unpriced models are counted as 0, with a prompt below the Hero indicating the number of unlisted models without pricing.
- The
peerDependencieslist in the documentation is truncated and cannot be used to confirm the full dependency set. - All HTTP endpoints enforce loopback access, and write operations additionally verify
Originloopback andContent-Type application/json.
Summary¶
dsh-ui-usage-billing provides a client-side cost viewing layer for DSH: a sidebar entry point, full-screen dashboard, real usage aggregation, multi-vendor price estimation, subscription balances, and export. Its boundaries are also clear: it does not register tools, does not inject system prompts, and does not write model-visible events.
GitHub: https://github.com/kenz1117/dsh-ui-usage-billing
Catalog page provided in the documentation: https://www.skillhub.cn/plugins/kenz1117/dsh-ui-usage-billing