跳到正文

deepforce/dsh-balance

30最近提交 2026年8月15日

dsh-balance DSH 插件

本插件集成两个部分:`/balance` 斜杠命令可在会话中打印完整的余额明细(充值、赠送、总计);Web GUI 作曲家坞区域显示紧凑的余额行,包含悬停详情、充值链接、刷新按钮和预估会话花费。插件还提供每日花费柱状图,数据来自历史会话。所有 API 调用在主机端完成,API 密钥不会离开主机或出现在日志中。

如何安装 dsh-balance DSH 插件

dsh plugin --profile web add github:deepforce/dsh-balance

复制不会执行命令。安装 dsh-balance DSH 插件前请核对仓库和版本。

dsh-balance DSH 插件数据来源

dsh-balance DSH 插件快照日期:2026年8月16日

discovered

dsh-balance DSH 插件能做什么

  • `/balance` 斜杠命令在会话中显示每种货币的总余额、充值余额和赠送余额。
  • Web GUI 显示 `Balance: ¥…`,悬停可查看充值/赠送拆分、点击充值链接、手动刷新按钮以及预估会话花费。
  • 每日花费图:悬停 N 天汇总显示 SVG 柱状图,包含每日花费、请求数和 token 数。
  • 会话花费预估利用 DeepSeek 公布的每百万 token 价格(高峰/非高峰,模型可配置)计算当前会话累计 token 的花费。
  • 显示文本跟随 DSH 活动语言(中文/英文),双语支持。

dsh-balance DSH 插件适合哪些场景

  • 在不离开聊天界面的情况下快速查看 DeepSeek 账户余额。
  • 通过交互式柱状图监控每日花费趋势,追踪使用量变化。
  • 在发送消息前预估对话花费,参考 Session ≈ ¥… 数值。
  • 一键刷新余额,无需手动重新获取。
  • 直接从插件链接跳转到 DeepSeek 充值页面。

dsh-balance DSH 插件适合谁

  • 需要管理 DeepSeek API 账户余额的 DeepSeek Harness 用户。
  • 希望在工作流环境中直接关注 API 成本的开发者与高级用户。

dsh-balance DSH 插件的限制

  • 仅适用于 DeepSeek API,需要有效的 DeepSeek API 密钥(通过环境变量或凭据服务设置)。
  • 会话花费预估为近似值:使用固定模型(`estimateModel`)且忽略缓存写入 token 的费用,实际计费可能不同。
  • 仅在 DeepSeek Harness 0.1.0-rc.6(web 配置,Windows 11)上测试;不保证与更新版本兼容。
  • 每日花费图依赖持久化的会话历史;如果清除了会话,历史数据可能丢失。

dsh-balance DSH 插件的仓库 README 摘录

以下文字摘自 dsh-balance DSH 插件的上游仓库 deepforce/dsh-balance 的 README,版权归原作者,仅作引用。

English | [中文](README.zh.md) A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin that adds a `/balance` slash command and a composer-dock balance readout to the web GUI, querying the DeepSeek account balance live. It calls DeepSeek's official [Get User Balance](https://api-docs.deepseek.com/api/get-user-balance/) endpoint and returns the total, topped-up, and granted balance per currency. The API key is resolved through the credential seam (`ctx.credentials`) or the environment on every call — it is never written into configuration, into the returned text, or into the browser. ## Features - `/balance` — human slash command that prints the full balance breakdown in the session. - **Web GUI readout** — the conversation stats area (below the cache-hit figure) shows a compact `Balance: ¥…` line with hover details (topped-up / granted), a **Top up** link to the DeepSeek platform top-up page, a manual refresh button, and an estimated **Session ≈ ¥…** spend figure (hover shows the token buckets × unit prices). The readout copy is bilingual and follows the active dsh language (Chinese / English). The browser fetches the host's `/dsh-balance` route; th

阅读完整 README仓库许可: MIT

dsh-balance DSH 插件常见问题

如何安装 dsh-balance?

推荐使用命令:`dsh plugin --profile web add github:deepforce/dsh-balance`。安装后重启 `dsh web`,确保客户端插件表加载新条目。也可以使用 `--patch` 覆盖方式,通过 YAML 文件配置,详见 README。

如何使用 /balance 命令?

在会话输入框(即发送消息的地方)输入 `/balance` 并发送。插件会返回 DeepSeek 账户余额明细,包括总余额、充值余额和赠送余额(以人民币显示)。输出会显示在聊天会话中。

Web GUI 中的余额显示在哪里?

余额显示在作曲家坞区域(即缓存命中数据下方的会话统计区)。显示为紧凑的一行,如 `Balance: ¥110.00 ⟳`。悬停可查看充值/赠送拆分,点击刷新按钮(⟳)可更新余额。显示文本跟随 DSH 活动语言,支持中英文。

如何配置 dsh-balance 的 API 密钥?

插件首先通过 DSH 凭据服务解析 API 密钥,若未找到则回退到 `apiKeyEnv` 指定的环境变量(默认为 `DEEPSEEK_API_KEY`)。在启动 DSH 前设置环境变量 `DEEPSEEK_API_KEY` 为你的 DeepSeek API 密钥。密钥不会被硬编码、打印或发送到浏览器。

每日花费图显示什么?如何查看?

每日花费图显示最近 `usageDays` 天(默认 7 天)的预估花费柱状图。将鼠标悬停在 GUI 中的 `Last {days}d ≈ ¥…` 汇总上,会弹出一个带标题的 SVG 柱状图。每根柱子上悬停可查看日期、金额、请求数和 token 数。移开鼠标即可关闭。