
pangzi499/dsh-balance-stats
30最近提交 2026年8月14日
dsh-balance-stats DSH 插件
在对话编辑器的停靠栏中显示余额、当前会话花费和总花费百分比三个关键数字。点击该栏可打开一个可滚动的详情卡片,展示余额构成、模型级花费、Token 用量和历史账单摘要。
如何安装 dsh-balance-stats DSH 插件
dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.git复制不会执行命令。安装 dsh-balance-stats DSH 插件前请核对仓库和版本。
dsh-balance-stats DSH 插件数据来源
dsh-balance-stats DSH 插件快照日期:2026年8月16日
discovered
dsh-balance-stats DSH 插件能做什么
- 读取官方 DeepSeek 余额 API,显示可用余额、充值余额和赠送余额。
- 通过编辑器作用域内的投影实时估算当前会话的花费。
- 在导入 JSON 发票后使用会计数据计算总花费百分比,否则回退到 Harness 本地估算。
- 提供详情卡片,展示今日、过去 7 天/30 天的花费、按模型的花费、Token 用量和更新时间。
- 支持从私有 get_all_invoice 端点导入 JSON 发票以获得准确的历史花费数据。
dsh-balance-stats DSH 插件适合哪些场景
- 在 DeepSeek Harness Web 中直接监控 API 余额和充值状态。
- 实时跟踪当前对话会话的费用。
- 分析跨模型和时间段的历史花费。
- 识别 Token 用量模式以进行容量规划。
dsh-balance-stats DSH 插件适合谁
- 希望管理 API 成本的 DeepSeek Harness Web 用户。
- 在 DeepSeek 上构建应用并需要成本可见性的开发者。
dsh-balance-stats DSH 插件的限制
- Harness 本地花费是估算值,并非官方 DeepSeek 发票。
- 历史发票摘要依赖于私有 get_all_invoice 响应格式,该格式可能发生变化。
- 发票摘要存储在浏览器本地存储中,不会跨浏览器或设备同步。
- 余额、发票和估算价格的货币必须一致。
- DSH 客户端插槽或投影 API 的上游变更可能需要更新插件。
dsh-balance-stats DSH 插件的仓库 README 摘录
以下文字摘自 dsh-balance-stats DSH 插件的上游仓库 pangzi499/dsh-balance-stats 的 README,版权归原作者,仅作引用。
**English** | [简体中文](README.zh-CN.md) `dsh-balance-stats` is a balance and usage statistics plugin for DeepSeek Harness Web. It displays three key figures in the `conversation.composer.dock` bar below the conversation composer: ```text Balance ¥40.22 | This session ¥0.15 | Total spent 42.5% ``` Click the bar to open an interactive, scrollable details card with balance composition, Harness local usage estimates, model-level spend, token usage, and historical billing summaries. ## Quick install Make sure Node.js `>=22.19.0` is installed and `pnpm --version` works, then run: ```sh npx @deepseek-ai/dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.git ``` Start or restart Harness Web, then hard-refresh the browser: ```sh npx @deepseek-ai/dsh web ``` ## Screenshots   > DeepSeek Harness is still in developer preview. The client APIs and mounting slot used by this plugin may change in upstream releases. ## Compatibility - Tested with DeepSeek Harness: `0.1.0-rc.6` - Node.js: `>=22.19.0` - pnpm:
阅读完整 README仓库许可: MIT
dsh-balance-stats DSH 插件常见问题
如何安装 dsh-balance-stats?
确保已安装 Node.js >=22.19.0 和 pnpm。运行 'npx @deepseek-ai/dsh plugin --profile web add https://github.com/pangzi499/dsh-balance-stats.git',然后重启 Harness Web 配置文件:'npx @deepseek-ai/dsh web',最后在浏览器中按 Command+Shift+R 强制刷新。
如何导入历史发票以获得准确的总花费?
登录 platform.deepseek.com,打开浏览器开发者工具,复制 'https://platform.deepseek.com/auth-api/v0/users/get_all_invoice' 的 JSON 响应。点击编辑器中的统计栏,在详情卡片顶部的字段中粘贴 JSON 并点击导入。仅统计成功付款的充值订单和有效的赠款订单。
我的 API 密钥或 DeepSeek 平台的 Cookie 会被泄露吗?
不会。插件从 Harness 凭据 'DEEPSEEK_API_KEY' 读取 API 密钥,且永远不会发送到浏览器。插件不会请求 get_all_invoice 或存储 Cookie。粘贴的发票 JSON 仅在内存中解析,导入后立即清除。
如何将插件更新到最新版本?
运行 'npx @deepseek-ai/dsh plugin --profile web update dsh-balance-stats' 可从 GitHub 默认分支更新。对于本地目录或 tarball 安装,请使用新路径再次运行 add 命令,然后重启 'dsh web'。
为什么总花费百分比与实际 DeepSeek 发票不一致?
插件基于 Harness 对话日志和模型价格进行本地估算,可能不包含在 Harness 之外进行的调用或已删除的日志。如需更准确的会计数据,请从平台的 get_all_invoice 端点导入 JSON 发票,以基于实际充值计算花费。