dsh-usage
Manifest validDeepSeek Usage Panel — DSHWeb GUI Balance & Token Usage Dashboard
dsh-usage

DeepSeek 账户全量用量 —— 走 DeepSeek 平台官方用量接口,在 DSH Web GUI 直接查看余额与 Token 用量。
与其他 dsh 用量插件(从本机会话日志统计)不同,dsh-usage 读取的是 DeepSeek 平台账户级数据:能看到你账户的全部用量,包括 DSH 之外的调用(网页、手机 App、其他客户端)。所见即平台用量页(platform.deepseek.com/usage)的数据。
功能
| 功能 | 说明 |
|---|---|
| 余额 | 自动读取 DSH 凭证 DEEPSEEK_API_KEY,调用 api.deepseek.com/user/balance,显示总额/充值/赠送 |
| Token 用量(账户全量) | 调用平台官方 api/v0/usage/by_api_key/{amount,cost},显示缓存命中/未命中/输出 Token、费用 |
| 时间范围 | 24 小时 / 7 天 / 30 天 / 90 天切换,堆叠柱状图 + 明细表 |
| 模型工具 | 注册 deepseek_usage_query,模型可直接查询余额与用量 |
| 令牌持久化 | 保存到 ~/.dsh/dsh-usage-token,重启自动读取,无需每次重新获取 |
安装
# git 源一行安装(构建产物已入库,git 源不触发构建)
dsh plugin --profile web add "github:Huasecc/dsh-usage#main"
或手动:把仓库 clone 到任意目录,在 profiles/web/package.json 的
dependencies 加 "dsh-usage": "link:<路径>/dsh-usage",dsh.profile.bundles
加 "dsh-usage"。装完重启 web 生效。
安全说明:插件读取的是你自己这台机器的 DSH 凭证与你自己粘贴的平台令牌, 显示的是你自己的 DeepSeek 账户数据;分发包内不含任何密钥。
与同类插件的差异
| dsh-usage(本插件) | 日志聚合派(如 dsh-usage-stats) | |
|---|---|---|
| 数据来源 | DeepSeek 平台官方接口 | 本机 DSH 会话日志 |
| 覆盖范围 | 账户全量(含网页/手机/其他客户端) | 仅本机 DSH 产生的用量 |
| 令牌 | 需一次性粘贴平台令牌(已持久化) | 无需令牌 |
| 安装 | dsh plugin add git 源 | npx 安装器 |
一句话:想要账户真实花费看 dsh-usage;只看本机 DSH 消耗选日志聚合派。两者可以共存。
原理
platform.deepseek.com有 WAF,请求需浏览器头(UA/Accept/Origin/Referer)- 平台业务接口的 Bearer 令牌是网页控制台会话令牌(
localStorage的userToken), 不是sk-API Key(后者返回 40003 invalid token) - Host↔Client 通信走
webServerHTTP 路由/dsh-usage/api(POST JSON,action 分发)
令牌获取(首次)
- 浏览器登录 https://platform.deepseek.com/usage
- F12 → 控制台执行:
JSON.parse(localStorage.getItem('userToken')).value - 把输出粘贴到设置页「平台用量访问令牌」并保存
之后重启 DSH 自动读取;仅当令牌失效(平台登出/过期)时才需重新获取。
开发 / 打包
纯手写产物(lib/index.mjs + lib/client.js),无需构建步骤。
npm pack # 生成 dsh-usage.tgz(若发布到 npm 需先改名去 scope)
许可
MIT
Comments
Loading…
Similar plugins
by scientisbo
DeepSeek 用量 · 余额面板(DeepSeek Harness Web 客户端插件) | A clean DeepSeek usage & balance panel for DeepSeek Harness
★ 0
MIT
JavaScript
Aug 23, 2026
dsh plugin --profile web add dsh-deepseek-usageby licyer
DSH Web 模型余量与用量监控插件
★ 12
MIT
JavaScript
Oct 20, 2026
dsh plugin --profile web add dsh-token-monitorby kane-le
DeepSeek API 用量与余额查看插件(DSH Plugin)· /usage 命令实时查询余额并汇总本机 token 用量
★ 0
MIT
JavaScript
Aug 25, 2026
dsh plugin --profile web add dsh-deepseek-usageby WeiyangPro
一个用于DeepSeek Harness(DSH)的用量监测面板(目前仅支持DeepSeek官方模型)
★ 9
↓ 36/wk
MIT
JavaScript
Sep 17, 2026
dsh plugin --profile web add dsh-deepseek-usage-panelby ShawnKung
DSH Web 侧边栏余额与用量监控插件,支持 DeepSeek 官方 API 和 TeamoRouter。
★ 0
MIT
JavaScript
Sep 12, 2026
dsh plugin --profile web add @shawnkung/dsh-balance-monitorby hhy66
DSH 设置页插件:DeepSeek 账户余额与本机会话 token 消耗统计面板
★ 0
MIT
JavaScript
Aug 25, 2026
dsh plugin --profile web add dsh-balance-stats