dsh-calculator
DeepSeek Harness 网页插件:侧边栏中显示 DeepSeek API 花费(按会话/所有会话)和账户余额。仅 deepseek-official 路由计入费用;第三方模型报告为未计费。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:bobcat848/dsh-calculator说明文档
阅读完整 README ↗dsh-calculator
A DeepSeek Harness (DSH) web plugin that shows your DeepSeek API spend and account balance in the right-hand aside panel of the DSH web GUI.
- 当前会话费用 — the cost of the session you are looking at (per model)
- 全部会话累计 — total spend across all sessions (per model)
- 账户余额 — live balance from the DeepSeek API (
GET /user/balance) - 第三方模型不计费 — only
deepseek-officialroutes are billed; any other provider/model is listed as unbilled - 峰谷计价 — after 2026-08-17 the plugin automatically prices events by the Beijing peak/off-peak schedule (peak 09:00–12:00 & 14:00–18:00, off-peak = half price); before that date it uses the current flat rates
安装
DSH is a Cordis application. The plugin has a host half (event accounting +
balance fetching) and a browser half (aside panel). Install it into the web
profile:
一条命令在线安装(推荐,无需克隆仓库)
直接在你的机器上执行(脚本会从 GitHub 下载插件文件并完成安装):
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/bobcat848/dsh-calculator/main/install.sh | bash
# Windows PowerShell
irm https://raw.githubusercontent.com/bobcat848/dsh-calculator/main/install.ps1 | iex
本地克隆安装
或者克隆仓库后运行脚本(安装脚本会自动识别本地模式,从仓库内复制文件):
git clone https://github.com/bobcat848/dsh-calculator.git
cd dsh-calculator
# macOS / Linux
bash install.sh
# Windows PowerShell
.\install.ps1
两种方式等价:都会把插件装进
~/.dsh/profiles/node_modules/dsh-calculator 并在
~/.dsh/profiles/web/cordis.patch.yml 追加 loader 行(幂等:重复执行安全,
已有行不会重复添加)。
手动安装
# 1. copy the package into the profile's hoisted node_modules
mkdir -p ~/.dsh/profiles/node_modules/dsh-calculator
cp -r lib package.json ~/.dsh/profiles/node_modules/dsh-calculator/
# 2. append the loader row to the web profile patch (once)
# edit ~/.dsh/profiles/web/cordis.patch.yml and add:
# - insert:
# - id: dsh-calculator
# name: 'dsh-calculator'
# config: {}
重启生效
Plugins are discovered at boot, so restart DSH web after installing:
dsh web --port 3080
Open http://127.0.0.1:3080, expand the right-hand aside rail, and you should
see the DeepSeek API 费用 panel.
配置
The plugin needs no configuration beyond your DeepSeek API key, which DSH already stores through its credentials service (the Models page writes it to as , or you can export it in the launching environment). The balance feature reads that same credential.