ShallBay/dsh-token-stats ↗★ 1

@shallbay/dsh-token-stats

Harness-wide token usage dashboard: aggregates billed token usage across all sessions (uncached input / cache read / cache write / output) with peak/off-peak CNY cost estimation, served at /token-stats with live refresh at /api/token-stats/refresh. The client half adds a 'Token 用量' entry above Settings in the sidebar; it opens a new browser tab on the Web and an in-app popup window on the Desktop. 聚合统计所有会话的Token消耗并估算人民币成本,适合需要监控API开销的用户。

パッケージ
@shallbay/dsh-token-stats
互換性
未検証
バージョン
1.2.2
ライセンス
MIT
最終更新
2026/10/22

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ShallBay/dsh-token-stats

ドキュメント

README 全文を読む ↗

使用

侧边栏底部(设置上方)「Token 用量」:

  • Web 端:新标签页打开 /token-stats。
  • 桌面端:应用内弹窗(iframe 覆盖层),Esc 关闭。
  • 弹窗 / 嵌入模式(?embed=1 或位于 iframe 中):紧凑头部、更小内边距,统计卡片 repeat(auto-fit, minmax(156px, 1fr)) 自动重排(5→4→3→2→1 列),趋势图高度 clamp(190px, 30vh, 300px);宽度 ≥ 1180px 时「用量概览」与「使用趋势」并排。

看板每 60 秒自动轮询刷新,同时保留手动刷新按钮;价格表按「供应商 / 模型」列出三项指标 (缓存命中 / 缓存未命中 / 输出)的高峰与低谷单价,可按模型修改并本地持久化。