右侧面板展示 DeepSeek API 费用(当前会话 + 全部会话累计)与账户余额,内置官方计价与峰谷计价支持。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:bobcat848/dsh-calculator
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
DeepSeek Harness plugin (desktop 0.2.x): shows your DeepSeek API spend and account balance in a top-right overlay card, with a live pill in the conversation header (left of the session-log button).
- 当前会话费用 — per-model token spend of the session you are looking at
- 当天全部会话累计 — today's total across all sessions (local timezone)
- 胶囊实时费用 — collapsed pill shows today's spend live
- 账户余额 — live balance from the DeepSeek API (
GET /user/balance) - 网页搜索计费 — DeepSeek Search API calls bill ¥5 / 1000 successful
requests (¥0.005 each) from 2026-11-01 00:00 Beijing time; each
web/deepseek-search-llm-requestevent counts one call. Localweb_fetch(HTTP provider) is free and not counted. - 峰谷计价 — peak 09:00–12:00 & 14:00–18:00 Mon–Fri Beijing; weekends off-peak all day since 2026-08-23
- 中英文界面 — follows the browser language (
zh/en)
Install (desktop)
bash install.sh
The installer copies the package to ~/.dsh/vendor/dsh-calculator, adds it as
a file: dependency of the desktop profile, activates it as a profile
bundle, and links it with the app's bundled pnpm. Restart DeepSeek Harness
after installing; the pill appears in the conversation header and the card
opens below the header.
Manual install: put the package in ~/.dsh/vendor/dsh-calculator, then in
~/.dsh/profiles/desktop/package.json set
"dependencies": { "dsh-calculator": "file:../../vendor/dsh-calculator" } and
add "dsh-calculator" to dsh.profile.bundles, then run
pnpm install in that profile.
Pricing
CNY per 1M tokens (official DeepSeek rates, api-docs.deepseek.com 2026-10-19):
| 模型 | 缓存命中输入(高峰/半价) | 缓存未命中输入(高峰/半价) | 输出(高峰/半价) |
|---|---|---|---|
| deepseek-flash / deepseek-v4.1-flash(2026-10-17 起) | ¥0.04 / ¥0.02 | ¥2.0 / ¥1.0 | ¥8.0 / ¥4.0 |
| deepseek-v4-flash / vision-exp(2026-10-17 前) | ¥0.10 / ¥0.05 | ¥3.0 / ¥1.5 | ¥9.0 / ¥4.5 |
| deepseek-v4-pro | ¥0.30 / ¥0.15 | ¥9.0 / ¥4.5 | ¥27.0 / ¥13.5 |
- 2026-08-17 之前的会话事件按当时费率计费;2026-09-10 12:00 起 flash 系列按 V2 价(peak = 2x off-peak);2026-10-17 起 V4.1-Flash 新价(上表首行)
- Search/Fetch API:¥5 / 1000 次成功请求,2026-11-01 00:00(北京)起计费;
web_fetch走本地 HTTP,不计费 - 计价按 每个事件发生时的时段(高峰/空闲)与价目版本分桶计算,不同时段 的 token 不会混算
- 费用为估算值,与官方账单可能存在差异
数据来源
- 费用:host 半订阅会话事件(
assistant/message的usage+message.source),按(provider, model, period, 价格版本)记账;fork 子会话按message.id去重 - 搜索:
web/deepseek-search-llm-request事件计数 - 余额:
GET https://api.deepseek.com/user/balance(30 秒缓存)
卸载
rm -rf ~/.dsh/vendor/dsh-calculator
# 并从 ~/.dsh/profiles/desktop/package.json 移除 dsh-calculator 依赖与 bundle
# 然后在该 profile 目录运行 pnpm install
免责声明
本项目与 DeepSeek 官方无任何关联,价格与余额为接口实时数据,费用为估算。
链接
同类插件
bowenliang123/dsh-context★ 4963
DSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
Han-1413141/dsh-cost-meter★ 675
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
wssfk12138/dsh-damage-pulse★ 290
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
zh667/TokenLedger★ 204
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
Ychris12138/dsh-usage-stats★ 188
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
Mt-Youya/dsh-plugins#sessions-insight★ 126
按工作目录浏览 Claude Code、DSH 和 Codex 会话日志,查看每轮上下文构成、token 用量、压缩点和费用估算。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。