Introduction¶
DeepSeek officially adopts time-of-day pricing for its API: weekdays in Beijing Time have specific peak hours, while the rest are off-peak (half price). If you run long conversations in DeepSeek Harness (DSH), it is difficult to determine “in the moment” which pricing tier applies simply by relying on billing statements or documentation. It is also hard to keep the current session’s token usage and the calculated cost visible in the same view.
The following introduces the community plugin dsh-peak-clock: it displays the peak/off-peak status, countdown timer, current session usage, estimated costs based on official unit prices, and today’s total consumption aggregated by local calendar date at the header of the DSH Web UI session. The plugin is published by maintainer 1134478268-dev and categorized as a “Networking Tool” in the SkillHub directory. Regarding implementation, it makes no external network requests; the peak/off-peak logic and pricing calculations are all performed locally.
What is this¶
dsh-peak-clock is a DSH plugin for the DeepSeek Harness Web UI (npm package name dsh-peak-clock, version 1.0.2 in current materials, MIT License). It does not change how you make calls; instead, it adds a readable badge to the top of the interface and exposes a same-origin, read-only HTTP interface for other plugins or scripts to query the same data.
Core Features¶
Peak/Off-Peak Periods and Countdown¶
The determination is based on Beijing Time (consistent with official billing standards). The rules are as follows:
- Monday to Friday (excluding Chinese statutory holidays):
09:00-12:00and14:00-18:00are Peak periods; all other times are Off-Peak (including the12:00-14:00lunch break, evenings, and early mornings). - Weekends and Chinese statutory holidays are Off-Peak. Materials indicate that the 2026 statutory holiday schedule is built-in, and makeup workdays (weekends adjusted for holidays) are treated as Off-Peak (consistent with official statements).
- The badge displays a countdown to the next peak/off-peak switch; hovering over it reveals local time vs. Beijing Time (side-by-side when time zones differ), today’s statistical criteria, and pricing source links.
Interface text switches between Chinese and English based on the DSH client language; peak/off-peak rules are always calculated in Beijing Time, while the display layer adapts to local time zones and UTC offsets (including Daylight Saving Time).
Usage and Cost Estimation¶
- Current Conversation: Total token count and estimated cost (CNY) converted based on official time-of-day pricing, refreshing approximately every 15 seconds.
- Today’s Consumption: Calculated from 0:00 in the local time zone, aggregated across sessions (only counting calls occurring on the current day).
- Pricing based on Time of Call: If a single conversation spans peak and off-peak periods, or switches models midway, costs are calculated separately based on the peak/off-peak tier and model unit price at the exact time of each call, rather than using a single price for the entire session.
The models and unit prices (CNY / million tokens) used for calculation come from the DeepSeek official pricing page and are fixed with the plugin version (no real-time remote price fetching), facilitating replay of historical sessions at the rates applicable at that time:
| Model | Off-Peak Hit/Miss/Output | Peak Hit/Miss/Output |
|---|---|---|
deepseek-flash (DeepSeek-V4.1-Flash) |
0.02 / 1 / 4 | 0.04 / 2 / 8 |
deepseek-v4-pro |
0.15 / 4.5 / 13.5 | 0.3 / 9 / 27 |
Materials note: Usage for the same (turn, step) is a cumulative snapshot, only the last one is counted; cache writes are billed as miss input; amounts are estimates, excluding account-level discounts or bonus credits. Actual billing is subject to DeepSeek invoices. Source: https://api-docs.deepseek.com/zh-cn/quick_start/pricing/.
Runtime Characteristics¶
- Zero runtime dependencies; no external network requests; no credential reading.
- Provides a same-origin, read-only,
GET/HEADHTTP API (see below).
Interface example (from README):
Off-Peak: ❤️ 【 Current Period: Off-Peak 】 · Current Session ⭐ 33.28M token ⭐ · Est. Cost ¥1.92 · Today's Cost ¥3.46 ❤️
Peak: ❤️ 【 Current Period: Peak 】 · Current Session ⭐ 12.5k token ⭐ · Est. Cost ¥0.42 · Today's Cost ¥3.46 ❤️
Installation and Activation¶
In the DSH ecosystem, plugins are usually installed via dsh plugin add; the following commands are from the repository README. Do not construct installation commands not present in the documentation.
# Method 1: Install from npm (Recommended)
dsh plugin add dsh-peak-clock
# Method 2: Install from local tarball
dsh plugin add ./dsh-peak-clock-<version>.tgz
Manual method: Extract the package to the profile’s node_modules/dsh-peak-clock/ and add "dsh-peak-clock" to the dsh.profile.bundles array in that profile’s package.json.
After installation, refresh the web interface (e.g., Ctrl+Shift+R) to see the badge in the session header. package.json requires Node >= 22.
Maintenance Note (from README): The host side is an ESM module (lib/host.js), requiring a DSH restart after an update; the browser side (lib/client.js) only needs a page refresh. The statutory holiday table in lib/host.js and lib/client.js needs to be updated annually according to the State Council’s arrangements; otherwise, holidays falling on weekdays may be conservatively treated as regular workdays.
Typical Usage¶
Viewing in Web UI¶
Just converse normally; the badge updates tokens and estimated costs with the current session and reflects real-time peak/off-peak status. For details, hover over the badge to view time zone comparisons, switch times, and billing explanations.
Querying via Read-Only API¶
Other plugins or scripts can call the following endpoints within the same origin:
| Endpoint | Function |
|---|---|
GET /peak-clock/v1/now |
Current period (peak / idle), reason, Beijing Time and Local Time, time zone, next switch time, etc. |
GET /peak-clock/v1/session[?id=<sessionId>] |
Token buckets and estimated costs for the specified or most recently active session, plus today’s cross-session total; if no id is provided, takes the most recently active session. |
Sample response fragment for GET /peak-clock/v1/now:
{
"period": "idle",
"reason": "holiday",
"holiday": "National Day",
"beijingTime": "2026-10-04 04:26",
"localTime": "2026-10-04 04:26",
"systemZone": "Asia/Shanghai",
"nextChangeAt": 1791421200000,
"nextPeriod": "peak",
"peakWindows": ["09:00-12:00", "14:00-18:00"],
"holidayTableYear": 2026
}
reason can be window (within peak window), off-window (lunch break, evening, or early morning), weekend, or holiday.
Sample session usage (README excerpt):
{
"ok": true,
"session": {
"sessionId": "session-xxxx",
"model": "deepseek-flash",
"tokens": { "input": 118547, "output": 285513, "cacheRead": 32871040, "total": 33275100 },
"cost": 1.91802,
"currency": "CNY"
},
"today": { "cost": 3.4567, "currency": "CNY", "calls": 42, "sessions": 3 }
}
Use Cases and Notes¶
Who it is for: Developers who use DeepSeek models in the DSH Web UI daily, wish to schedule batch calls or long conversations against official peak/off-peak rules, and need a quick view of tokens and estimated costs in CNY within the interface.
Pre-installation Advice: DSH plugins run under the permissions of the current dsh process. Before installing, you should review the repository source code and MIT License to ensure the behavior complies with your environment policies. This plugin states that it does not access credentials or make external network connections; see the repository TRANSPARENCY.md for transparent details.
Ecosystem Context: DSH adopts an “everything is a plugin” extension approach; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / Hikvision (Huan). This article describes the community-maintained dsh-peak-clock, not an official app store entry.
Conclusion¶
dsh-peak-clock consolidates DeepSeek’s official peak/off-peak rules, session tokens, and estimated costs based on time-of-day pricing into the DSH session header. It is supplemented by a read-only API to facilitate manual viewing or programmatic reuse of the same set of figures.
- Directory Page: https://www.skillhub.cn/plugins/1134478268-dev/dsh-peak-clock
- Source Code & Documentation: https://github.com/1134478268-dev/dsh-peak-clock