DeepSeek account balance and per-session cost card in the sidebar foot.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Jolly-J/dsh-deepseek-billing
GitHub-sourced plugins run build scripts on your machine at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
给 DeepSeek Harness(DSH)网页版装一个余额小卡片:在左侧边栏底部实时显示你的 DeepSeek 账户余额,以及当前会话花了多少钱。
效果图
| 图 1 | 图 2 |
|---|---|
卡片长这样:
- 一行摘要:绿点状态 ·
余额:¥xx.xx元·会话:¥x.xxx· 刷新按钮 · 箭头; - 点一下展开:显示充值/赠送余额、输入/输出 token、缓存命中率、本会话费用;
- 点卡片外面自动收起;数字变化时是滚动动画;切换会话自动跟着变;
- 侧边栏收起(窄栏)时自动隐藏,不挡东西;
- 每 60 秒自动刷新一次。
安装
方式一(最简):一条命令
dsh plugin --profile web add https://github.com/Jolly-J/dsh-deepseek-billing.git
装完重启 dsh web 即可(插件会自动作为 profile 层加入组合;lib/ 产物已随仓库提交,无需本地构建)。
方式二:让 AI 帮你装
你不会装也没关系。把本仓库地址发给你的 DSH 智能体,对它说一句:
帮我把这个插件装到我的 DSH 里:<仓库地址>
你的智能体照着下面 6 步做完,重启 dsh web 就好了:
- 把本仓库放到 DSH 项目的
packages/extensions/dsh-deepseek-billing; - 在
packages/bundle/web-app/cordis.patch.yml里加一行:- id: ui-deepseek-billing name: 'dsh-deepseek-billing' - 在
packages/bundle/web-app/package.json的dependencies里加:"dsh-deepseek-billing": "workspace:^" - 在根目录
tsconfig.client.json的references里加{ "path": "./packages/extensions/dsh-deepseek-billing" }; - 运行
pnpm install,然后构建:pnpm --filter dsh-deepseek-billing bundle; - 重启
dsh web。
要求:DSH 项目本身能正常构建,
pnpm版本 11.7.0(和 DSH 的packageManager一致)。
数据从哪来
- 余额:直接调用 DeepSeek 官方余额接口,用的就是你模型正在用的同一把 API Key,不用另外配置;
- 花了多少钱:读取 DSH 自己记录的每次模型调用用量,按 DeepSeek 官方价格表计算(含缓存命中和 2026-08-17 起的峰谷价),本会话累计。
密钥安全(重要,请花一分钟读)
插件不存、不偷、不外传你的 API Key:
- 它只是向 DSH 要"模型正在用的那把钥匙"(
DEEPSEEK_API_KEY),临时拿来调一次官方余额接口,用完即弃; - 密钥只短暂出现在本机插件进程内存里(以环境变量方式传给一次
curl,不出现在命令行参数中); - 不会写进磁盘/日志/缓存,不会出现在网页接口返回里,不会发给 DeepSeek 以外的地方;
- 仓库代码里没有任何密钥,只有环境变量的名字
DEEPSEEK_API_KEY。
已知的两个通用风险(不是本插件独有):同机器的同权限进程理论上能读到 curl 进程的环境变量;局域网里能访问你 DSH 网页端口的人可以看到你的余额数字(看不到密钥)。介意的话请在部署层给 /billing/status 加访问限制。
已知限制
- 费用只算当前会话,子代理会话暂未汇总;
- 价格表内置在代码里,官方调价后需要更新插件版本(官方没有价格查询接口);
- 文案目前是中文。
License
Links
More in this category
zhu1090093659/dsh-web-ui★ 1766
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 829
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 705
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
huiliyi37/dsh-tianshu-tui★ 131
A terminal UI (TUI) for DeepSeek Harness.
omdsh-dev/dsh-at-file★ 117
Codex-style `@file` mentions: search workspace files in the composer and attach their contents to prompts.
Nagi-ovo/dsh-visualize★ 79
In-conversation generative UI: the model renders interactive HTML cards into the chat stream, with streaming preview and sandboxed rendering.