OffPeak
Manifest valid★ 3A cost management Agent plugin for DeepSeek V4‑Flash / V4‑Pro during peak price surge periods. Automatically displays a popup alert during peak hours when billing rates increase, supports immediate execution / scheduled dispatch, the scheduling panel automatically blocks high-price time slots, filters out expired times, and automatically replays user commands when the scheduled time arrives, avoiding losses from cross-period price surges.
OffPeak · dsh-offpeak
Peak-hour price guard for DeepSeek API tidal pricing
Intercept your message before it's sent during peak hours — schedule it to run when it's cheaper.
Read this in 中文
Why
DeepSeek moved to peak/off-peak (tidal) API pricing effective 2026-08-17 (Beijing time):
| Period | Hours (Beijing) | Output price vs. before |
|---|---|---|
| Peak | 09:00–12:00, 14:00–18:00 | up to 4.5× |
| Off-peak | everything else | half of peak |
New per-million-token rates (¥):
| Model | Item | Peak | Off-peak |
|---|---|---|---|
| V4 Flash | input (cache miss) | 3 | 1.5 |
| output | 9 | 4.5 | |
| input (cache hit) | 0.1 | 0.05 | |
| V4 Pro | input (cache miss) | 9 | 4.5 |
| output | 27 | 13.5 | |
| input (cache hit) | 0.3 | 0.15 |
If you mostly run long tasks with DeepSeek V4 Flash, sending them at 10:00 costs 3× more than sending them at 19:00. OffPeak makes sure you notice that before you press send — not after.
What it does
While your current model is DeepSeek V4 Flash / Pro and the Beijing clock is inside a peak window, pressing Enter (or clicking send) in the composer intercepts the message before it is sent. The text stays in the input box and a dialog appears:
- Current price card — peak vs. off-peak per-million-token rates for the model in use
- Continue — sends the message now, through the normal composer path (draft clearing, queue, notices all intact)
- Schedule — opens a time wheel with only off-peak hours (0–8, 18–23); past times are removed, and after 23:00 the wheel rolls into the next day's 0–8; minutes run 00–59. The command text and time are recorded, and the local server automatically submits the command to the original session when the time arrives — no browser needed at that moment
- Don't remind me today — no more popups until the next Beijing midnight
- ✕ — close without sending; the draft stays in the input box
Running commands are never interrupted: if a task crosses into a peak window mid-execution, nothing pops up — the reminder appears on your next command inside peak hours.
Install
Requires the web profile (dsh web).
dsh plugin --profile web add dsh-offpeak
Manual install (no pnpm needed):
-
Copy the package into the shared plugin directory:
- Windows:
%USERPROFILE%\.dsh\profiles\node_modules\dsh-offpeak - macOS / Linux:
~/.dsh/profiles/node_modules/dsh-offpeak
- Windows:
-
Append to
$DSH_HOME/profiles/web/cordis.patch.yml:- insert: - id: offpeak name: 'dsh-offpeak' config: effectiveFrom: '2026-08-17' debug: false -
Restart
dsh web.
The plugin is dormant before
effectiveFrom(2026-08-17 — the day tidal pricing starts). Set it to today's date to try it out sooner.
How it works
peak hours (Beijing 09:00–12:00 / 14:00–18:00), model = V4 Flash/Pro
│
user presses Enter / clicks send ──► composer intercepts (client-side)
│ message stays in the input box
▼
┌─ dialog ─────────────────────────┐
│ prices · command preview │
│ [Continue] [Schedule] │
│ ☐ Don't remind me today │
└──────────────────────────────────┘
│ │
Continue Schedule
│ │
▼ ▼
native composer submit POST /ds-offpeak/schedule
(message sent normally) { text, atMs, sessionId }
draft cleared
│
server timer fires at atMs
▼
session.prompt → original session
(works with the browser closed)
- The interception is client-side: a capture-phase listener watches Enter on the composer textarea and clicks on the send button, checking a locally-computed Beijing clock plus the latest server state (peak windows, model, "don't remind today").
- IME-safe: Enter during Chinese/Japanese composition (
isComposing) is never intercepted. - Server-side fallback: if a message reaches the host through a non-intercepted path during peak, the session-event listener raises a non-blocking reminder instead.
- Peak/off-peak judgment uses
Asia/Shanghaiwall-clock time regardless of the machine's timezone.
Configuration
| Key | Default | Meaning |
|---|---|---|
effectiveFrom | "2026-08-17" | Tidal-pricing start date (Beijing); plugin is dormant before it |
debug | false | Bypass effectiveFrom; enables /ds-offpeak/debug-remind |
peakWindows | 09:00–12:00, 14:00–18:00 | Peak windows in minutes ({ start, end }), overridable |
profile | auto (web) | Profile that owns the state file |
Routes
| Method | Path | Purpose |
|---|---|---|
| GET | /ds-offpeak/state | Status: peak? model, price table, pending reminder, wheel options, tasks |
| POST | /ds-offpeak/ack | Acknowledge a fallback reminder |
| POST | /ds-offpeak/dismiss | Don't remind today |
| POST | /ds-offpeak/schedule | { text, atMs, sessionId } — record a scheduled execution |
| POST | /ds-offpeak/cancel | { id } — cancel a task |
| POST | /ds-offpeak/execute | { id } — run a task immediately |
| POST | /ds-offpeak/debug-remind | Simulate a peak command (debug only) |
All writes accept same-origin POSTs only. State and tasks persist in $DSH_HOME/profiles/<profile>/offpeak.json.
Security & privacy
- Interception happens locally in the browser; a message is never sent anywhere except through the normal composer path when you choose Continue.
- Scheduled commands are stored locally and re-submitted to the same session by the local server.
- Prices are hardcoded from the official announcement; no network calls, no telemetry.
FAQ
Why does the hour wheel skip 12–14? 12:00–14:00 is technically off-peak, but it sits between the two peak windows. OffPeak plays it safe and only offers clearly-safe hours (0–8, 18–23).
Does it block subagent / queued messages? No — only the composer's own send gesture is intercepted.
What if I close the dialog? Nothing is sent; the draft stays in the input box.
Multiple tabs? Each tab intercepts independently; "don't remind today" is server-side and shared.
Development
src/index.js server half — peak detection, fallback reminder, scheduler, persistence
client/client.js browser half — interception, dialog, time wheel (zero-dependency DOM)
node --check src/index.js && node --check client/client.js
License
MIT © christophersmith2737
Compatibility
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.0.0-stage | — | — |
| 3.1.6 | — | — |
| 3.1.7 | — | — |
| 3.2.0 | — | — |
| 3.3.0 | — | — |
| 3.3.2 | — | — |
| 3.3.1 | — | — |
| 3.3.3 | — | — |
| 3.3.4 | — | — |
| 3.3.5 | — | — |
| 3.3.6 | — | — |
| 3.3.7 | — | — |
| 3.3.8 | — | — |
Comments
Loading…
Similar plugins
by CNyaotian-Lunar
DSH 插件:按 DeepSeek 峰谷分时计价,在高峰时段给 token 花销踩刹车(拦大任务 / 压缩输出上限 / 让模型少说废话),并提供一键放行口令
★ 0
MIT
JavaScript
Sep 25, 2026
dsh plugin --profile web add dsh-peak-gateby f20880479-lab
DeepSeek Harness 峰谷计费插件:高峰时段发送前确认(可勾选本次高峰段内不再提示),支持将消息排队到空闲时段(半价)自动发送;可拖拽悬浮队列窗口、调整发送顺序与时间。
★ 3
↓ 38/wk
MIT
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-peak-gateDeepSeek Harness plugin: real-time API cost with peak / off-peak rates — a composer pill, /cost, a session_cost tool and a JSON snapshot, with subagent and agent-team spend rolled in.
★ 1
MIT
TypeScript
dsh plugin --profile web add dsh-api-costby oxgbl
⏱️ DeepSeek 价格区间计时工具 | DeepSeek Harness 插件:侧边栏高峰/空闲定价徽标 + 距半价倒计时 + 点击详情面板 + /price 命令
★ 3
JavaScript
Sep 5, 2026
dsh plugin --profile web add dsh-deepseek-priceDeepSeek 峰谷价感知的任务执行器:平价时段跑 flash 任务批,峰价前挂定时任务推迟到下一个平价时段执行。
★ 0
MIT
JavaScript
dsh plugin --profile web add dsh-peak-runnerby GoldenShit233
错峰任务队列插件:高峰/任何时刻收到任务先确认细节并自动入队,空闲时段自动执行;右上角可拖拽悬浮面板(DeepSeek Harness web plugin)
★ 0
JavaScript
Aug 17, 2026
dsh plugin --profile web add offpeak-panel