Nixz0824/dsh-usage-stats-plus0

dsh-usage-stats-plus

DSH 用量与余额面板增强版:官方余额实时拉取、逐事件精确计价(官方峰谷价目)、余额差值全渠道消耗估算、Codex 风格 Token 活动时间轴。Fork 自 dsh-usage-stats(Ychris12138,MIT)。

包名
dsh-usage-stats-plus
版本
0.3.0
许可证
MIT
最近更新
2026年8月17日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Nixz0824/dsh-usage-stats-plus

dsh-usage-stats-plus

中文 · English

DSH「用量与余额」面板增强版 —— 官方余额实时拉取 · 逐事件精确计价 · 全渠道消耗估算 · Codex 风格活动时间轴。

Enhanced DSH usage & balance panel — live official balance, per-event pricing, all-channel spend estimates, and a Codex-style activity timeline.

Fork of Ychris12138/dsh-usage-stats (MIT), based on v0.2.0.

License DSH

Usage and balance panel / 用量与余额面板


中文

Fork 自 Ychris12138/dsh-usage-stats(MIT),在其 v0.2.0 基础上做了计价引擎重构UI 结构级重构

特性

  • 余额 = 官方实时值GET /user/balance 直接拉取,5 分钟缓存 + 手动刷新,无任何本地估算
  • 今日消耗(DSH 内)精确计价:从会话日志逐事件(每个用量样本带精确时间戳)按官方峰谷价目表计价,缓存写按未命中价计
  • 今日消耗(全渠道估):官方余额接口的每日快照差值估算,覆盖网页版 / App / 其它客户端的用量——唯一能对齐开放平台账单数字的口径(需有前一日快照,次日生效)
  • Codex 风格 Token 活动时间轴:滚动 12 个月,7 行 × 51–53 周列,quantile 分档着色,支持 每日 / 每周 / 累计 三视图
  • 黑白灰单色系:与 DeepSeek 官方鲸鱼 Logo 同源的墨色系统,明暗主题自适应
  • 无新增运行时依赖(纯 JS,免构建)

安装

dsh plugin --profile web add "link:"   # 本地源码

### 配置

在 profile 的 `cordis.patch.yml`(或本包 `cordis.patch.yml` 的 insert 条目)里覆盖:

```yaml
- insert:
    - id: usage-stats
      name: dsh-usage-stats-plus
      config:
        prices:
          "deepseek-v4-pro": { peak: { hit: 0.30, miss: 9.0, output: 27.0 }, offpeak: { hit: 0.15, miss: 4.5, output: 13.5 } }
          # "some-other-model": { hit: 2, miss: 4, output: 8 }   # 全天一口价
          # default: { hit: 0.1, miss: 1, output: 4 }