CN-Leo/dsh-deepseek-balance ↗★ 2
dsh-deepseek-balance
Real-time DeepSeek account balance display in the DSH web UI, via the official /user/balance API. API key is resolved from the DEEPSEEK_API_KEY credential. 适合使用官方API,并需要按模型和高峰时段统计会话消费的用户。
같은 패키지 이름의 다른 저장소
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CN-Leo/dsh-deepseek-balance配置(必需)
插件通过 credentials 服务解析 DEEPSEEK_API_KEY,按以下顺序查找(任选其一):
-
环境变量
DEEPSEEK_API_KEY -
$DSH_HOME/.credentials.yaml:DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxx
配置后无需重启插件:每次请求都会重新解析凭据。
使用
- 余额条显示在会话输入框下方:
● DeepSeek 余额 ¥71.33 | 本会话 ¥4.85- 绿点 = 正常,黄点 = 加载中,红点 = 获取失败
- 「本会话消费」按会话实际使用的模型分模型计价(从会话日志逐次提取每个模型调用的 token 用量),仅 deepseek-v4-flash / deepseek-v4-pro 套用官网价格,自动区分高峰/空闲时段(北京时间 9:00-12:00、14:00-18:00 为高峰,其余空闲),每 15 秒与余额一同刷新
- 悬停(hover)余额条可查看完整明细:
- 各币种余额:总额 / 赠送 / 充值 / 账户可用状态
- 本次会话按模型分列的 token 用量:输入(未命中/命中/写入)、输出
- 当前时段、本次会话消费金额
- 说明:非 DeepSeek 模型(如第三方 "…-pro")不套用 DeepSeek 价格表、不计入消费金额;缓存写入按缓存未命中输入价计(官方价格表仅区分命中/未命中)