본문으로 건너뛰기
S

dsh-budget-bar

sxm0215/dsh-budget-bar

A balance and cost bar under the composer: balance, today spend, last-turn cost and cache hit rate collapsed into one line, with a seven-day chart, per-chat breakdown and daily detail on expand. Reads local DSH session usage plus the official balance endpoint; never goes through the model and costs zero tokens, and sends nothing anywhere except that one official request.

설치

dsh plugin --profile web add github:sxm0215/dsh-budget-bar

README

dsh-budget-bar

余额 / 花费看板,挂在 DSH 输入框下方一条。不经过模型,不烧 token。

它显示什么

折叠状态一条:余额 · 今日花费 · 上一轮花费 · 缓存命中率 · 距上次刷新 点开:七天柱状图、按会话拆分(哪个群/哪个会话花了多少)、按天的明细。

装

DSH 插件页 →「添加插件」→ 选这个包(或解压后的目录)。装完重启一次 DSH。

命令行:

dsh plugin --profile <你的 profile> add dsh-budget-bar

装好后配置里会多一条 dsh-budget-bar;输入框下方那条出现即成功。

数据从哪来

  1. 本地 ~/.dsh/sessions/ 里的会话 usage(zstd 分帧,增量解析)—— 算花费、算缓存命中
  2. DeepSeek 官方接口 GET /api/v0/users/get_user_summary —— 取余额与累计扣款 优先用宿主提供的 credentials 服务;拿不到才读 ~/.dsh/.credentials.yaml

除了上面那个官方接口,不发任何请求;不上传会话、不上传用量、不连第三方。

计价

lib/price.json 里是 deepseek-flash 的单价(含高峰/空闲两档、工作日窗口、节假日表)。 官方调价后只改这个文件,插件每次刷新会重读,不用重启。

常见问题

  • 余额显示 0 / 空:没找到可用凭据。确认是用官方账号登录的 DSH(不是 API key 登录)。
  • 花费偏高/偏低:先对 price.json 的单价与高峰期设置;周末和节假日算空闲价。
  • 面板不出现:客户端插件要重启一次才挂上,热更新有时只换一半。

관련 플러그인