Introduction¶
When running long sessions in DeepSeek Harness (DSH), token counts rise and costs accumulate. However, the interface often only provides usage projections rather than the “actual session cost calculated according to official rules,” nor does it display the DeepSeek account balance next to the input box. Manually calculating costs against the pricing page is prone to errors, especially when crossing peak and off-peak periods—the official standard is that off-peak prices are half of peak prices, and pricing windows are divided by Beijing time working days 9:00–12:00 and 14:00–18:00, with separate rules for holidays.
dsh-peak-usage (GitHub repo name dsh-plugin-usage, npm package name dsh-peak-usage) is an independent third-party client plugin published by maintainer Mirfakk, targeting the DSH web profile. Once installed, a real-time readout line appears below the conversation input box (in the conversation.composer.dock slot), for example:
Peak | Session Cost ¥0.1043 | tokens 100.0k↑ / 4.5k↓ | Cache Hit 88% | Balance ¥18.32
This corresponds to: current peak/off-peak time period, session cost, session token usage (including cache hit ratio), and DeepSeek account balance. Costs are calculated based on DeepSeek’s official peak/off-peak time-of-use pricing. It performs request-by-request folding and billing on session logs by determining the time period using each sample’s event.time, rather than using “current period unit price × total tokens.” The balance is read via the official GET /user/balance endpoint. The API Key is resolved only within the host process via ctx.credentials.resolve('DEEPSEEK_API_KEY') and does not leave the host.
The plugin has no affiliation with or endorsement from DeepSeek officials or the author of the community desktop client DeepSeek-Harness-Desktop. Directory page: SkillHub, Source code: GitHub.
What is this¶
- Positioning: A quota panel plugin for the DSH web profile (Category: Client).
- Maintainer: Mirfakk.
- Version (package.json): 1.1.0, MIT License.
- Verified Environment (README statement): Official
@deepseek-ai/dsh0.1.1-rc.2; Community packaged desktop client DSH Desktop 0.2.18. The harness is still a-rcpre-release, and the plugin relies on some internal conventions; adaptation may be required after upgrading the harness.
Zero npm dependencies, zero build steps; lib/client.js is the final artifact for the browser side. Installation essentially involves copying files and writing a Cordis patch.
Core Features¶
Interface Readout¶
The browser side subscribes to the framework projection tokenUsage and requests the summary route registered by the host (default /plugin/dsh-peak-usage/summary) via same-origin requests when usage changes. Combined with a 15s keep-alive fallback, it renders a status line in the input box dock.
Peak/Off-peak Time-of-use Pricing¶
Built-in official price list (README verified on 2026-09-21, sourced from DeepSeek Pricing Documentation). Billing works immediately upon installation without needing to manually copy unit prices. Supports model aliases (e.g., mapping the harness default name deepseek-v4-flash to deepseek-flash in the price list). Hovering over the amount displays the peak/off-peak breakdown.
Legal holidays must be manually entered in the configuration under pricing.schedule.holidays (an array of YYYY-MM-DD); if empty by default, holidays are billed according to regular working day rules, and regular accounting is unaffected.
Balance Refresh¶
Three-layer mechanism: Background keep-alive based on pollIntervalMs (default 15s); Trigger refresh with ?fresh=1 when the token projection changes; After a forced refresh, a supplementary refresh occurs after settleDelayMs (default 3s). The host side throttles via minRefreshIntervalMs (default 3s) to avoid frequent calls to the official balance API. The response includes fetchedAt / ageMs; if not updated for too long, a ? appears next to the balance; on failure, the last successful reading is retained, and the reason is explained in a tooltip.
Configuration and Disabling Pricing¶
Adjust the dsh-peak-usage section in $DSH_HOME/profiles/web/cordis.patch.yml. The Web profile disables HMR, so restart the DSH process and refresh the page after changing configuration. Set pricing.enabled to false to display only tokens and balance without calculating amounts. Other common items include credentialsRef, baseURL, various pricing.* refresh and price list override fields; see the “Configuration” section in the repository README for details.
Installation and Activation¶
The npm package name is dsh-peak-usage (different from the GitHub repo name dsh-plugin-usage; dsh-plugin-usage on npm is already taken by another plugin).
Plugin Market (Recommended)¶
DSH Desktop can open the cordis.run market in Settings → Plugins and search for dsh-peak-usage to install.
Command line equivalent:
dsh plugin web add dsh-peak-usage
Install from File (Sideload)¶
A .tgz file must be generated (the desktop client does not accept .zip). Run the following in the repository root directory:
bash pack.sh
After obtaining dist/dsh-peak-usage-<version>.tgz, use “Install from file” within the application and pass the absolute path to the tgz.
Manual Installation to DSH User Directory¶
The plugin only modifies $DSH_HOME (Environment Variable → macOS Desktop ~/Library/Application Support/com.yeagoo.dsh-desktop/harness → Command Line ~/.dsh), and does not modify the application body. After obtaining the source code, run the following in the repository root directory:
bash install.sh
The script will copy the package into the profile’s node_modules, write to cordis.patch.yml, and perform static self-checks. After completion, restart DSH Desktop (or the web process) and refresh the page; optionally, run bash verify.sh inside the repository to perform an online self-check (requires cloning the full repository; test scripts are not published with the npm package).
Typical Usage¶
- After installation, restart, and refresh, open any session. The peak/off-peak label, session cost, tokens, and balance will appear below the input box.
- If you need to bill holidays like National Day as “all-day off-peak,” add holidays to
cordis.patch.yml, for example:
pricing:
schedule:
holidays: ['2026-10-01', '2026-10-02', '2026-10-03', '2026-10-04',
'2026-10-05', '2026-10-06', '2026-10-07']
-
If you only care about usage and balance and do not need amounts, set
pricing.enabledtofalse. -
The maintainer suggests running
npm test(97 offline assertions) andbash verify.shin a cloned repository after changing the harness version to ensure internal conventions have not changed.
Use Cases and Notes¶
Who it is for: Developers who long-term develop or debug agents in the DSH web interface, need to check session costs against official peak/off-peak rules, and want to keep an eye on the DeepSeek balance. Theoretically usable in any environment capable of running dsh web; the README explicitly states the development and verification paths include DSH Desktop 0.2.18.
Permissions and Security: The plugin runs with the permissions of the current dsh process and uses the configured API Key to request api.deepseek.com. Read the Source Code and LICENSE before installation to ensure it meets your security policy. The community directory SkillHub has no official affiliation with DeepSeek / High-Flyer and is not an official app store.
Compatibility: Relies on internal harness conventions such as Session.events, usage event shapes, and the conversation.composer.dock slot; the README lists a sensitivity table. If readings are abnormal after a harness upgrade, troubleshoot against the repository tests and verify.sh.
Conclusion¶
dsh-peak-usage condenses official peak/off-peak pricing, request-by-request session folding, and balance fetching into a single line of readout below the input box, reducing the cost of manual calculation against the pricing page. Refer to the repository README for installation or configuration details.
- Directory Page: https://www.skillhub.cn/plugins/Mirfakk/dsh-plugin-usage
- GitHub: https://github.com/Mirfakk/dsh-plugin-usage