DeepSeek Harness 插件

bobcat848/dsh-calculator

Star 数 ★ 4 分类 用量与计费 收录于 2026-08-14

右侧面板展示 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-request event counts one call. Local web_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 官方无任何关联,价格与余额为接口实时数据,费用为估算。

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。