DSH Usage Peak: Usage and Cost Dashboard

Introduction

When using DeepSeek Harness (DSH), two common pain points arise: you don’t know whether you’re currently in a peak-rate window, and it’s hard to quickly grasp today’s usage and spending. Relying entirely on the platform’s billing page often requires multiple navigations and refreshes, which is inefficient.

DSH is built on a “everything is a plugin” architecture, and plugins can access local session logs—this makes local-side statistics feasible. hseons/dsh-usage-peak is a local dashboard built on this principle. It parses DSH session logs and the Whale Ledger, and provides peak/off-peak status, cost breakdown, project & model statistics, budget alerts, and CSV export in the sidebar and settings page.

Plugin Overview & Maintainer

hseons/dsh-usage-peak is a usage-and-spending dashboard plugin installed in the DeepSeek Harness sidebar, developed and maintained by hseons. Its core value is giving users an at-a-glance, local view of whether the current window is peak or off-peak, how much they’ve spent today, how many tokens have been consumed, where the money went per project, and how many days of balance remain.

The plugin reads DSH session logs and the Whale Ledger entirely locally. It makes no network calls, reports nothing, and all calculations run in the browser.

Core Features

After installation, a usage capsule appears at the top of the sidebar icon list, showing peak/off-peak status, today’s spend, tokens, and the countdown to the next rate switch. Clicking the capsule opens the full panel. The capsule turns amber when remaining balance covers fewer than 7 days, and red when fewer than 3 days. The token segment in the capsule is omitted first to avoid squeezing the countdown.

Peak / Off-Peak Status

Displays the current window, a countdown to the next switch, and the unit prices for the current window (cache hit / full-price input / output). Peak hours are defined as 09:00–12:00 and 14:00–18:00 on weekdays (Beijing Time); all other times, weekends, and statutory holidays are off-peak. Make-up workdays (including weekends that are reclassified as working days) follow the weekday peak/off-peak windows. Coverage includes 2026–2027. The panel annotates the current basis (e.g., “Off-peak · Statutory holiday” / “Peak · Make-up workday”).

Today’s Summary

Today’s spend, request count, tokens, cache hit rate, peak-hour spend share, off-peak savings (how much you’d save by shifting those peak-hour calls to off-peak), cache savings (the extra cost those cache-hit tokens would have incurred at the miss rate, with a 7-day total shown in a hover tooltip), balance, and balance runway (balance ÷ 7-day average daily spend).

This Month & Last Week

Below the KPIs, a single row provides three decision-oriented numbers: month-to-date cumulative, end-of-month projection (linear extrapolation from the average of completed calendar days, excluding today), and week-over-week change. If data is insufficient before mid-month, the projection shows — instead of ¥0.

Today’s 24-Hour Distribution

An hourly spend bar chart with peak and off-peak hours in different colors and the current hour highlighted. Hover or focus a bar to see that hour’s spend, requests, tokens, and cache hit rate. Keyboard navigation: ← → / Home / End to browse, Esc to dismiss.

Narrow Sidebar Adaptation

When the sidebar narrows or the window shrinks, charts wrap automatically, the 24 bars compress, and the daily-trend date labels thin out based on available width; the price table groups by model, unit-price inputs wrap, and overly wide tables scroll horizontally.

Cost Breakdown

Three-segment proportion (cache hit / full-price input / output) so you can see at a glance where the money goes.

7 / 14 / 30-Day Trend

Toggle the window in the top-right corner. Stacked daily bars with zero-fill for missing dates keep the column count constant. Cross-reference peak-hour share to identify “which day was expensive.”

Per-Project & Drill-Down

Aggregated by the working directory (cwd) from session headers. Each project’s request count, tokens, spend, and share bar are listed in reverse order. The share denominator is always the total attributed spend across the entire window, so drilling into a single project shows its share of the full window—not 100%. Click a project to view only its summary, 24-hour chart, trend, and model breakdown; use “All projects” at the top to reset.

Configurable Alerts

Set balance alert thresholds in the panel (default 7 days), tight thresholds (default 3 days), and an optional daily budget. Alerts fire when daily spend exceeds the budget; “tight” fires at 120% of budget. Multiple alerts resolve to the highest severity. Configuration is stored in the current browser and stays in sync between the sidebar and the panel.

Global Wallet Perspective

Balance, balance runway, and daily budget are always calculated across all projects, so filtering to a low-spend project won’t falsely suggest ample balance.

Per-Model

Requests, tokens, and spend for Flash and Pro separately. Only models whose name contains deepseek are classified under DeepSeek pricing. Third-party models that borrow the “flash”/”pro” label—such as gemini-2.5-flash or gpt-5-pro—are not counted in Flash/Pro; they appear in a separate row labeled “Other · Estimated at Flash rate” with an ≈ prefix and a hover tooltip explaining the basis.

CSV Export

Both daily and project data can be exported (UTF-8 with BOM, opens correctly in Excel without garbled characters; cells are sanitized against formula injection).

Price Table

The row for the current rate window is highlighted to make billing easy to explain. Below, you can edit Flash / Pro unit prices for cache hit, input, and output (off-peak / peak). After saving, all amounts and CSV output are immediately recalculated at the new rates. Prices are stored in the current browser only, with a one-click reset to defaults.

Pricing by Request Start Time

A single response in the session log may span a rate-switch boundary. Peak/off-peak is determined by the timestamp of the first streaming chunk, not the response completion time.

Incremental Scanning

Parse results are cached per file at ~/.dsh/cache/dsh-usage-peak/index.json. File changes are detected via mtime + size; unchanged files are not re-decompressed. On this machine, 148 session files cold-start in ~2.3 s; a warm index hit takes ~8 ms. If the index is missing, corrupt, or fails to write, it silently falls back to full re-parsing—data is never lost. Rows older than 35 days are pruned, and the index file itself is capped at 20 MB.

Self-Diagnosis Command

npm run doctor (or node index.js --doctor --json) prints the session directory, counts of files parsed / reused / failed / pruned this run, index size and source, model distribution, ledger status, and holiday coverage—helping you distinguish “genuinely no spend” from “logs weren’t read at all.”

Installation & Enablement

Run the following command in your terminal to install:

dsh plugin add dsh-usage-peak

You can also search for dsh-usage-peak in the DSH plugin marketplace to install, or open the marketplace page directly.

After installation:

  • The usage capsule appears at the top of the sidebar icon list;
  • Go to Settings → Usage Dashboard to open the full panel.

Typical Usage

Click the usage capsule in the sidebar to see whether you’re currently in a peak window and how long until the next rate switch. If the balance runway drops below 7 days, the capsule turns amber; below 3 days, it turns red.

Open the Usage Dashboard in Settings to view detailed metrics such as today’s spend, tokens, and cache hit rate. In the Projects tab, statistics are aggregated by working directory—click a project to drill down into its usage and spend.

In the Trend tab, switch between 7/14/30-day windows and view daily stacked bar charts of spend changes. In the Models tab, compare Flash and Pro usage, as well as third-party models estimated at the Flash rate.

In the Price Table tab, edit Flash / Pro unit prices for cache hit, input, and output (off-peak / peak). After saving, all amounts and CSV output are recalculated immediately at the new rates.

Use Cases & Caveats

Ideal for developers, team leads, and users who need fine-grained cost management across peak/off-peak windows.

The plugin runs with the current dsh process permissions, reads local session logs and the Whale Ledger, makes no network calls, and reports nothing. Review the source code and license (MIT) before installing.

The plugin depends on DSH’s internal session log format (session.v4.jsonl.zstd and assistant/message.data.usage). If DSH changes the format, a follow-up update is required; when data can’t be read, the panel displays an empty state rather than an error.

The daily budget is an estimate based on local session logs using Beijing Time “today” total spend and does not reflect the platform’s real-time billing. Alert configurations and custom prices are stored in the current browser only and are not synced across devices.

The Whale Ledger only starts recording from 2026-11-02; if the ledger is lagging, the displayed balance may be higher than the actual balance. The panel will show a notice but will not auto-correct it.

Conclusion

DSH Usage Peak parses session logs and the Whale Ledger locally, providing a complete dashboard for peak/off-peak pricing, usage statistics, project drill-down, budget alerts, and CSV export—well suited for users who need granular control over DeepSeek API costs.

Plugin directory: https://www.skillhub.cn/plugins/hseons/dsh-usage-peak
GitHub: https://github.com/hseons/dsh-usage-peak

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye