DeepSHPlugins
dsh-balance-tide 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-balance-tide

安全與運維JavaScriptMIT

輸入框下方顯示 DeepSeek 賬戶餘額與本會話花費,餘額前帶峰/谷價格徽章(北京時間)與距切換倒計時,懸停看兩檔單價明細與使用建議。

8 StarshuanyuLv 更新時間 2026-08-22
訪問 GitHub 倉庫
dsh-balance-tide 專案預覽

專案介紹

中文

輸入框下方顯示 DeepSeek 賬戶餘額與本會話花費,餘額前帶峰/谷價格徽章(北京時間)與距切換倒計時,懸停看兩檔單價明細與使用建議。

English

DeepSeek account balance and session cost under the composer, with a live peak/off-peak pricing badge (Beijing time), a countdown to the next pricing switch, hover price tables, and usage advice.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
huanyuLv
倉庫
huanyuLv/dsh-balance-tide
GitHub Stars
8
Forks
2
開發語言
JavaScript
許可證
MIT
最近推送
2026-08-22
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

76/ 100
維護活躍
87
文件與實用資訊
100
生態關注度
36
安裝便捷訊號
80
專案宣告訊號
100

近 20 天仍在更新;README 含完整安裝與使用說明。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:huanyuLv/dsh-balance-tide

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-balance-tide

English | 简体中文

dsh-plugin license version

DeepSeek Harness (DSH) Web plugin: account balance + peak/off-peak pricing tide indicator.

A live readout row under the composer:

[standard] peak pricing starts in 2d 5h | Balance ¥28.78 | ~¥0.42 this session | ?

Once peak/off-peak pricing takes effect (2026-08-17), the badge and countdown follow Beijing time in real time:

[off-peak] peak in 2h 15m | Balance ¥28.78 | ~¥0.42 this session | ?   ← off-peak hours
[peak] off-peak in 1h 30m | Balance ¥28.78 | ~¥0.42 this session | ?   ← peak hours

Features

  • Pricing badge: standard (before 2026-08-17) / peak / off-peak, judged live in Beijing time
  • Countdown: time remaining until the next pricing switch, ticking every second — plan your usage ahead
  • Balance: live balance from the official /user/balance endpoint (granted / topped-up split)
  • Session cost: estimated at current-period prices (reuses sessionProjections; same-turn/step samples replace rather than double-count)
  • Hover details: full price tables for the current and the next period, the peak/off-peak gap (peak = off-peak × 2), peak windows, and usage advice
  • ? icon: opens the official pricing page <https://api-docs.deepseek.com/zh-cn/quick_start/pricing/>
  • Zero config: reuses DEEPSEEK_API_KEY from DSH credentials — no key in the repo, ever
  • i18n: UI follows the interface language (中文 / English)

Peak/off-peak schedule (Beijing time)

Per the official pricing page (2026-08 edition, last verified 2026-08-15):

  • From 2026-08-17 00:00, peak/off-peak pricing applies; before that, current flat prices
  • Peak windows: 09:00–12:00 and 14:00–18:00; all other hours are off-peak
  • Off-peak = half of peak
Model (per 1M tokens)Flat (hit / miss / output)Off-peakPeak
deepseek-v4-flash0.02 / 1 / 20.05 / 1.5 / 4.50.10 / 3.0 / 9.0
deepseek-v4-pro0.025 / 3 / 60.15 / 4.5 / 13.50.30 / 9.0 / 27.0

Install

From npm (recommended)

dsh plugin --profile web add dsh-balance-tide

From the Git URL

dsh plugin --profile web add https://github.com/huanyuLv/dsh-balance-tide

From a local directory

dsh plugin --profile web add file:/path/to/dsh-balance-tide

Restart dsh web to take effect. Requires pnpm (npm i -g pnpm).

Configuration (in $DSH_HOME/profiles/web/cordis.patch.yml)

- id: dsh-balance-tide
  config:
    refreshIntervalMs: 300000   # how often the host polls the balance API
    clientPollIntervalMs: 30000 # how often the browser re-reads the cache
    currency: CNY
    allowedHosts: []            # register your domain here if you front dsh with a reverse proxy

When the official prices or the schedule change, override them in config — no need to wait for a plugin release:

- id: dsh-balance-tide
  config:
    tideCutoff: '2026-08-17T00:00:00+08:00'   # when peak/off-peak pricing starts
    peakWindows:                              # peak hours (Beijing time, [start, end))
      - { start: 9, end: 12 }
      - { start: 14, end: 18 }
    tidePrices:                               # per-tier prices (per 1M tokens)
      flat:
        deepseek-v4-flash: { cacheHit: 0.02, cacheMiss: 1, output: 2 }
      peak:
        deepseek-v4-flash: { cacheHit: 0.1, cacheMiss: 3, output: 9 }
      offpeak:
        deepseek-v4-flash: { cacheHit: 0.05, cacheMiss: 1.5, output: 4.5 }

peakWindows: [] means there are no peak hours at all — use it if the tiered pricing is ever withdrawn.

Security

  • Credentials: prefer DEEPSEEK_API_KEY from DSH credentials. The apiKey config

option is an escape hatch only — it lands in a config file in plaintext, so avoid it. baseUrl must be https; plaintext http is rejected outright (it would put the key on the wire).

  • Balance endpoint: /query-tide serves your account balance, so readers are checked.

The Host must be localhost, an IP literal, or a domain registered in allowedHosts (this blocks DNS rebinding); any request carrying an Origin must be same-origin (this blocks arbitrary web pages from reading your balance). Rejected reads get a 403.

  • Error reporting: the server sends only a small set of error codes to the browser;

raw exception text goes to the log, so a custom baseUrl never leaks to the frontend.

Known limitations

  • Costs are estimates computed at current-period prices; the official invoice is authoritative.
  • For multi-currency accounts the readout row shows the first currency only; the rest appear in the tooltip.
  • deepseek-chat / deepseek-reasoner are no longer listed on the official pricing page —

the static entries in prices are a fallback, not a verified quote.

Development

npm install
npm test

Compatibility

  • DeepSeek Harness 0.1.0-rc.6+ (web profile)
  • Node.js 20 / 22 / 24 (covered by CI)
  • Cross-platform: pure JavaScript + standard browser CSS, no native modules
  • License: MIT

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案