D
@zoytown/dsh-billing
v0.1.2 · 1 天前发布
DeepSeek Harness (dsh) plugin for DeepSeek API account balance — a ctx.billing capability seam, a /balance command, and a sidebar balance indicator with a Settings page for the Web UI.
README
@zoytown/dsh-billing
English | 中文
@zoytown/dsh-billing 是一个用于查看 DeepSeek API 账户余额的 DeepSeek Harness(dsh)插件。它读取平台的 GET /user/balance 端点,并以三种方式呈现结果:侧边栏底部的余额胶囊、设置里的「余额」页、以及 /balance 命令。它不注册任何面向模型的工具,也不追加任何 session 事件,因此挂载它对会话零成本。
平台实际提供了什么
只有当前余额。没有用量或消费明细端点——/usage 与 /dashboard/billing/usage 均返回 404——所以本包报告的是还剩多少,而非花了多少。任何「本次会话花费」都只能是基于 token 数的本地估算,那是另一件事,刻意不在本包范围内。
json
{
"is_available": true,
"balance_infos": [
{ "currency": "CNY", "total_balance": "25.00", "granted_balance": "0.00", "topped_up_balance": "25.00" }
]
}
balance_infos 是数组——一个账户可能同时持有 CNY 和 USD——本包所有消费者都完整渲染,而不是只取第一项。
安装
sh
dsh plugin --profile web add @zoytown/dsh-billing
从 npm 安装拿到的是预
版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ✅ 兼容 | cordis patch ✅ |
dsh@0.1.0 | ✅ 兼容 | 标准 patch ✅ |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- @zoytown/dsh-billing
- Repo
- git+https://github.com/zoyluoblue/deepseek-harness-billing.git
- Engines
{"node":"^22.19.0 || >=24.0.0"}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale"],"platform":"web"}}