Introduction

DeepSeek Harness (DSH) is a client tool based on a plugin architecture. When using the DeepSeek API, developers often face two pain points: first, not knowing how many tokens and how much money the current session has consumed; second, the risk of accidental actions during peak hours (official peak pricing at 2× the off-peak rate) causing a sudden cost spike. dsh-token-rush is a floating widget in the upper-left corner of the DSH Web GUI conversation page that displays the current session’s cumulative tokens, the estimated cost based on official unit prices, and the account balance. During peak hours, the widget automatically turns orange-red to indicate that the current period is subject to higher billing.

Core Features

This plugin mainly provides the following capabilities:

  • Upper-Left Floating Widget: Located in the upper-left corner of the conversation page, approximately 216px wide, default position (12, 56), without obscuring primary information.
  • Real-Time Statistics: Pushed in real time through DSH’s tokenUsage projection; displays cumulative total tokens (including input/output/cache buckets).
  • Estimated Cost: Calculated based on the official DeepSeek pricing table (by model and peak/off-peak prices); the UI displays an “≈” annotation.
  • Account Balance: Proxies the DeepSeek GET /user/balance endpoint; data is cached for 60 seconds.
  • Peak Color Change: During peak hours (default: Monday to Friday 09:00–12:00 and 14:00–18:00 Beijing Time), the entire widget turns orange-red; during other periods it follows the DSH theme.
  • Opacity Fade: Opacity is 0% when no conversation has been started, then smoothly fades over 0.8 seconds to semi-transparent after a conversation begins.
  • Free Dragging: Drag from anywhere on the widget; the position is remembered automatically. Double-click to reset to the default position.

Installation and Activation

The installation command is as follows:

dsh plugin --profile web add link:E:\万物暂存\AI缓存工作区\dsh-token-rush

After installation, you must restart the dsh web process (refreshing the page alone does not take effect); the floating widget will then appear in the upper-left area.

Usage

  • View Status: After restarting dsh web, the widget displays the current session’s total tokens, estimated cost, and account balance.
  • Move the Widget: Drag from anywhere on the widget; the position is saved automatically.
  • Reset Position: Double-click anywhere on the widget to return to the default position (12, 56).
  • Peak Indication: During peak hours, the widget’s background color changes to orange-red.

Configuration

Configuration items are read from the dsh web startup environment variables:

  • DSH_HUD_PEAK_WINDOWS: Peak hour definitions, e.g., "9-12,14-18" or "8-10 20-23" (half-open interval [start, end)), default is 9-12,14-18.
  • DSH_HUD_PEAK_TZ: Time zone used for peak-hour determination (IANA name), default is Asia/Shanghai.
  • DSH_HUD_PEAK_HOLIDAYS: Statutory holidays (priced as off-peak for the whole day), e.g., "2027-01-01,2027-02-05..2027-02-11". If left empty or unparseable, the built-in 2026 list is used.
  • DEEPSEEK_BASE_URL: Override for the DeepSeek API address, default is https://api.deepseek.com.

Pricing Methodology and Data Sources

  • Total Tokens: Taken from the DSH session’s tokenUsage projection (uncachedInputTokens / cacheReadTokens / cacheWriteTokens / outputTokens).
  • Estimated Cost: Token counts multiplied by the official pricing table. Prices are matched by model (e.g., deepseek-flash or deepseek-v4-pro); if the model is unknown, it falls back to Flash pricing. Peak price = Off-Peak price × 2.
  • Account Balance: Obtained by proxying the GET /user/balance endpoint through the host.

Official DeepSeek pricing (unit: CNY / million tokens, verified as of 2026-10):

Model Input (cache hit) Off-Peak Input (cache hit) Peak Input (cache miss) Off-Peak Input (cache miss) Peak Output Off-Peak Output Peak
deepseek-flash 0.02 0.04 1 2 4 8
deepseek-v4-pro 0.15 0.3 4.5 9 13.5 27

Notes

  • Cost Is an Estimate: Actual charges are based on the DeepSeek bill. If a session spans the boundary between peak and off-peak periods, the portion crossing the boundary is calculated using the price of the current period.
  • Holiday Limitation: The built-in statutory holiday list only covers 2026. For other years, configure them manually via DSH_HUD_PEAK_HOLIDAYS; otherwise, holidays falling on weekdays may be counted as peak hours.
  • Balance Query Scope: Only compatible with the official DeepSeek API (including custom baseURL endpoints). When using other LLM providers, the balance field displays “Balance unavailable”.

Conclusion

dsh-token-rush addresses token usage and billing anxiety through visualization, making it suitable for DSH users who need fine-grained control of API costs. Please verify the source code and license before installation.