
TheTianzz/dsh-billing
71Last commit Aug 14, 2026
dsh-billing DSH plugin
This plugin adds a persistent dual-capsule display in the chat session header, showing your account balance (in CNY) and the current session cost. It also provides slash commands `/balance` and `/cost`, and a tool `deepseek_billing` for querying via natural language.
How to install the dsh-billing DSH plugin
dsh plugin --profile web add ./deepseek-billingCopying does not run this command. Review the repository and version before installing the dsh-billing DSH plugin.
dsh-billing DSH plugin data source
dsh-billing DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-billing DSH plugin can do
- Shows balance and session cost as two capsules next to the conversation title, clickable to refresh.
- Hover over capsules for detailed breakdown: balance (recharge/gift/USD), cost (per-model token and fee).
- Slash commands `/balance` and `/cost` for quick queries in chat.
- Tool `deepseek_billing` allows the model to answer balance/cost questions on demand.
- Event-driven updates: refreshes on turn end, every 10 steps, session switch, tab visibility change, or manual click.
- Automatic price sync from DeepSeek official pricing page every 12 hours, with fallback to built-in defaults.
Where the dsh-billing DSH plugin fits
- Monitor your DeepSeek API spending without leaving the chat interface.
- Track session costs during long conversations to avoid surprises.
- Quickly check remaining balance before starting a resource-intensive task.
- Use the tool to let the AI assistant tell you your balance or cost in natural language.
- Budget modeling with custom pricing configurations (peak/off-peak, per-model overrides).
Who the dsh-billing DSH plugin is for
- DeepSeek API users who want real-time cost visibility within the DSH web interface.
- Developers and power users who manage multiple sessions and need per-session cost tracking.
dsh-billing DSH plugin limitations
- Only works with the DSH web platform (requires browser client bundle).
- Costs are estimates; actual billing may differ from DeepSeek's official invoice.
- Requires DeepSeek API key configured as `DEEPSEEK_API_KEY` in the Web model settings.
- Dependent on DeepSeek's official pricing page; if parsing fails, may fallback to outdated defaults.
dsh-billing DSH plugin: from the repository README
Quoted from the TheTianzz/dsh-billing README, the upstream source of the dsh-billing DSH plugin. Copyright remains with the original authors.
DeepSeek Harness 插件:**账户余额** + **会话费用**(人民币),带 Web UI 悬浮显示。 ## 功能 | 入口 | 用法 | 说明 | | --- | --- | --- | | UI 会话头部双胶囊 | 无需操作,常驻显示 | **余额 + 本会话费用** 并排显示在会话标题旁;点击任一胶囊立即刷新两个 | | 悬停明细 | 鼠标悬停 | 余额胶囊:充值/赠金/美元;费用胶囊:按模型的 token 与费用拆分 | | 斜杠命令 `/balance` | 聊天框输入 `/balance` | 查询账户余额(人民币优先,附美元) | | 斜杠命令 `/cost` | 聊天框输入 `/cost` | 当前会话费用明细 | | 工具 `deepseek_billing` | 直接问模型"余额多少/花了多少钱" | query = `balance` / `cost` / `both` | ## 结构 - `host.js` — 宿主插件:命令 + 工具 + `/billing/{balance,cost}` RPC 通道(供浏览器胶囊轮询) - `client.js` — 浏览器 bundle(`__ModuleLoader__` 工厂格式,仅依赖平台共享的 react,无构建步骤) - `conversation.session.header.actions` 槽位(负数 order = 静态会话上下文)→ 余额 + 会话费用双胶囊 - `package.json` — 声明 `dsh.bundle`(空 patch)+ `dsh.client`(web 平台) - `cordis.patch.yml` — 空层;本插件由 profile 的 `cordis.patch.yml` 插入行激活 ## 安装(一条命令) 组合包自带激活层(`cordis.patch.yml`),安装后自动生效,无需手改任何配置: ```sh # 从本地目录安装 dsh plugin --profile web add ./deepseek-billing # 或从打包产物安装(跨机器分发推荐) dsh plugin --profile web add ./dsh-billing-0.2.0.tgz # 或从 npm / git 安装(发布后) dsh plugin --profile web add dsh-billing dsh plugin --profile web add github:you/dsh-billing ``` 安装后**重启 `dsh web`**,再刷新浏览器页面(F5)使新 boot graph 生效。 宿主侧 API key 使用 `DEEPSEEK_API_KEY` 凭据引用(在 Web 模型设置页
Read the full READMERepository license: MIT
dsh-billing DSH plugin questions
How do I install the billing plugin?
Run `dsh plugin --profile web add dsh-billing` (or the local path/tgz). After installation, restart `dsh web` and refresh the browser page (F5). The plugin requires a DeepSeek API key saved in the Web model settings as `DEEPSEEK_API_KEY`.
Why are the cost numbers not matching my DeepSeek invoice?
The plugin calculates costs based on token usage reported by the provider and built-in pricing. It is an estimate. Actual billing may differ due to rounding, promo credits, or plan differences. Always refer to DeepSeek's official billing for final charges.
Can I customize the pricing for my own models?
Yes. You can override per-model pricing in the plugin config using `config.pricing`. The priority is: explicit config > official online sync > built-in defaults. You can also set peak/off-peak schedules for different times of day.
Does the plugin work on mobile or desktop only?
It works on any modern browser that supports the DSH web client. Both mobile and desktop are supported, as long as the DSH web platform is running.
How often does the balance/cost refresh?
Refreshes are event-driven: on turn end, every 10 steps, session switch, tab visibility change, or manual click on the capsules. There is no background polling, so zero requests when idle.