dsh-go-money-meter
fl1213/dsh-go-money-meter
DeepSeek balance, current token prices and estimated spend for the dsh-go app — money only, no token statistics.
インストール
dsh plugin --profile web add github:fl1213/dsh-go-money-meterREADME
余额 · 单价(dsh-go-money-meter)
给 dsh-go 手机 App 原生界面用的插件:只看钱,不做 token 统计。
- 状态条(输入框上方一行,≤ 24 字):
余¥8.13 谷入1·出4 今¥2.86 - 「插件」页签 / 全部功能里的两个面板:
- 余额 · 单价:余额(充值 / 赠金拆开)、平台累计花费、当前模型、当前峰谷时段与切换倒计时、当前单价、本会话 / 今日 / 本月估算花费、缓存省下的钱、余额还能跑多少 token、本月预测;可切换状态条档位、低余额阈值和单价来源
- 价目表:deepseek-flash / deepseek-v4-pro 在谷时、峰时的缓存命中 / 输入未命中 / 输出单价
- 回合脚注:这一轮的估算花费,如
¥0.03
安装
dsh plugin --profile web add dsh-go-money-meter
装完按 App 提示重启引擎(或在 App 的「设置 → 引擎」里重启)。原生界面需要主机带 dsh-go 桥接:手机本机引擎自带;经 DSH Remote 连接时不显示。
数据与隐私
- 余额:本机 DeepSeek 平台登录(
$DSH_HOME/.credentials.yaml里的deepseek-account-platform/default),兜底用环境变量DEEPSEEK_API_KEY请求官方余额接口。只读,不落密钥。 - 平台累计:官方账号接口返回的累计消费,作为账单口径的参考;接口数据可能滞后几分钟。
- 花费:读本机会话日志里每条回复的 usage(输入 / 缓存读 / 缓存写 / 输出),按事件发生时刻的官方单价折算。同一个对话被 fork / 复制出来的日志按消息 id 去重,不会重复计。
- 账本只存 token 数与金额;不读对话正文、不保存消息内容、不发送任何内容到第三方。
数据文件在 $DSH_HOME/dsh-go/:dsh-go-money-meter.state.json、.settings.json、.ledger.json,可选的价格覆盖文件 .prices.json。卸载插件不会删除这些数据。
价格与口径
内置 DeepSeek 官方价(2026-11-23 核对,元 / 百万 tokens):
| 模型 | 缓存命中(谷/峰) | 输入未命中(谷/峰) | 输出(谷/峰) |
|---|---|---|---|
| deepseek-flash | 0.02 / 0.04 | 1 / 2 | 4 / 8 |
| deepseek-v4-pro | 0.15 / 0.30 | 4.5 / 9.0 | 13.5 / 27.0 |
- 峰时:北京时间工作日 9:00–12:00、14:00–18:00(不含法定节假日);其余时段(含周末、节假日)为谷时,谷价是峰价的一半。
- 缓存命中按命中价计;缓存写按命中价计;reasoning 已包含在输出里,不重复计。
- 「今日 / 本月 / 本会话」是估算:按本机会话日志回算,和官方实时账单可能有极小差异;「平台累计」是官方接口数字,但可能滞后几分钟。两者都以 DeepSeek 账单为准。
设置
面板里点选即生效,保存在 $DSH_HOME/dsh-go/dsh-go-money-meter.settings.json:
- 状态条档位:标准 / 精简 / 只看余额
- 低余额阈值:¥5 / ¥10 / ¥20(低于阈值状态条变色)
- 单价来源:内置价 / 自定义价
自定义价:在 $DSH_HOME/dsh-go/dsh-go-money-meter.prices.json 写和内置表同结构的 JSON,再把单价来源切到「自定义」。
已知限制
- 只支持 DeepSeek 官方账号的余额;其他供应商的余额接口还没做进 UI。
- 余额需要本机已登录 DeepSeek 平台账号(或提供
DEEPSEEK_API_KEY),否则面板只显示估算花费。 - 回合脚注只对插件加载之后发生的回合有数;历史回合不补。
- 官方调价后,内置价表需要更新(改
prices.json或等新版)。
兼容
- dsh-go App ≥ 1.0.9,DSH 引擎
0.2.1-rc.2到0.3.0之前;Node.js 22.19+ - 只在带 dsh-go 桥接的主机上出现原生界面;本机引擎自带桥接
卸载
dsh plugin --profile web remove dsh-go-money-meter
dsh-go-money-meter
A native dsh-go plugin about money only — no token statistics.
- Status strip above the composer (≤ 24 chars):
余¥8.13 谷入1·出4 今¥2.86(balance, current peak/off-peak token prices, today's estimated spend) - Two native panels under the plugin tab: balance / spend / current prices, and a full price list for
deepseek-flashanddeepseek-v4-pro - Per-turn footnote with this turn's estimated cost
Install
dsh plugin --profile web add dsh-go-money-meter
Restart the engine once after install (the App asks). Native surfaces need the dsh-go bridge, which the on-device engine ships with.
Data & privacy
- Balance: the local DeepSeek platform grant (
$DSH_HOME/.credentials.yaml), falling back toDEEPSEEK_API_KEY. Read-only; no secret is stored. - Platform total spend comes from the official account endpoint and may lag by a few minutes.
- Spend is recomputed from local session usage (
input / cacheRead / cacheWrite / output) at the official prices effective at each call, deduplicated by message id across forked session logs. - The ledger stores only token counts and amounts; no message content, no network upload.
Data lives under $DSH_HOME/dsh-go/ and survives uninstall.
Pricing
Official DeepSeek prices in CNY per 1M tokens (checked 2026-11-23):
| Model | cache hit (off/peak) | input miss (off/peak) | output (off/peak) |
|---|---|---|---|
| deepseek-flash | 0.02 / 0.04 | 1 / 2 | 4 / 8 |
| deepseek-v4-pro | 0.15 / 0.30 | 4.5 / 9.0 | 13.5 / 27.0 |
Peak hours are Beijing-time weekdays 09:00–12:00 and 14:00–18:00 excluding Chinese public holidays; everything else is off-peak at half price. Today / month / session figures are estimates; the platform total is the official billing number and may lag.
Compatibility
dsh-go App ≥ 1.0.9; DSH engine from 0.2.1-rc.2 up to (not including) 0.3.0; Node.js 22.19+. Native surfaces require the dsh-go bridge (included in the on-device engine).
License
MIT