跳到正文

Ghost011118/dsh-balance-meter

151最近提交 2026年8月14日

dsh-balance-meter DSH 插件

dsh-balance-meter 插件在 composer dock 中添加一个芯片,显示您的 DeepSeek 账户余额和当前会话的预估成本。它通过查询官方 Get User Balance 端点获取余额,并根据 token 使用量和官方定价计算花费。每6小时自动获取最新定价页面以应对价格变化。

如何安装 dsh-balance-meter DSH 插件

dsh plugin --profile web add https://github.com/Ghost011118/dsh-balance-meter

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

dsh-balance-meter DSH 插件数据来源

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

discovered

dsh-balance-meter DSH 插件能做什么

  • 从 DeepSeek API 实时显示账户余额。
  • 根据 token 使用量和官方定价估算当前会话成本。
  • 按模型定价:自动从会话请求头中检测 flash 或 pro。
  • 每6小时自动获取官方定价页面,保持最新。
  • 当高峰时段定价生效时,自动应用北京时间 09:00-12:00 / 14:00-18:00 的高峰时段。
  • 点击芯片查看按货币的余额明细和按桶的成本明细。
  • 错误状态下可强制刷新。

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

  • 在 DSH 网页界面中直接监控 DeepSeek 账户余额。
  • 实时跟踪会话的预估成本,管理 API 支出。
  • 识别当前使用的模型(flash 或 pro)及其成本影响。
  • 验证 2026-08-17 高峰/非高峰定价更新后的价格。
  • 通过查看按货币和按桶的成本明细,排查成本差异。

dsh-balance-meter DSH 插件适合谁

  • 希望关注 API 余额的 DeepSeek Harness 用户。
  • 使用 DSH 构建应用并需要成本可见性的开发者。

dsh-balance-meter DSH 插件的限制

  • 需要 DeepSeek Harness 0.1.0-rc.6 或更新版本(web 配置)。
  • 需要在 DSH 凭据中存储 DeepSeek API 密钥(DEEPSEEK_API_KEY)。
  • 默认每30秒更新一次余额(可配置)。
  • 成本估算依赖官方定价页面;如果无法获取,则使用内置预设价格。

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

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

English | [中文](README.zh.md) DeepSeek account balance and session-cost readout for the DeepSeek Harness (DSH) Web GUI. - Live account balance (queries the official Get User Balance endpoint) - Current session estimated spend (token usage x official pricing) - Per-model pricing: reads the model actually driving each session from its request header (flash vs pro), so the cost tracks the model you used instead of a fixed default - Auto-fetches the official pricing page every 6h, so price changes and the 2026-08-17 peak/off-peak pricing rollout never require a plugin update - Peak-hour band (Beijing 09:00-12:00 / 14:00-18:00) applied automatically once the peak pricing goes live ## Features The composer dock shows a chip with the account total balance and the current session's estimated cost: ``` Balance CNY 4.16 · This session CNY 2.57 ``` Clicking the chip reveals the per-currency balance breakdown (granted + top-up) and the per-bucket cost breakdown (input / cache read / output). Clicking while an error is shown forces an immediate refresh. ## Requirements - DeepSeek Harness `0.1.0-rc.6` or newer (web profile) - A DeepSeek API key stored through the DSH credentials s

阅读完整 README仓库许可: BSD-3-Clause

dsh-balance-meter DSH 插件常见问题

如何安装 dsh-balance-meter?

您可以通过 git URL 安装插件:运行命令 dsh plugin --profile web add https://github.com/Ghost011118/dsh-balance-meter。或者克隆仓库到本地,然后运行 dsh plugin --profile web add link:$(pwd)/dsh-balance-meter。安装后请重启 dsh web 服务并刷新页面,即可看到余额芯片。

为什么余额显示“不可用”?

“不可用”状态通常表示获取余额时出现问题,例如 API 密钥缺失或无效、网络问题或临时错误。插件会在每次轮询(默认每30秒)时自动重试,一旦底层条件恢复,余额显示就会自动恢复。如果问题持续,请检查 DSH 凭据文件(~/.dsh/.credentials.yaml)中是否正确设置了 DEEPSEEK_API_KEY,并确保 provider 路由工作正常。

余额多久更新一次?

默认情况下,余额每30秒查询一次。您可以通过在插件组合配置中设置 refreshIntervalSeconds 选项来自定义此间隔。最小允许值为30秒,但您可以增加它以减少 API 调用。

可以强制指定模型来计算成本吗?

可以。在插件配置中,将 model 选项设置为 'flash' 或 'pro' 即可强制使用固定的预设值。默认情况下 model 为 'auto',会从每个会话的请求头中自动检测模型。显式设置模型后,将忽略自动检测,对所有会话使用该预设。

如果官方定价页面无法获取会怎样?

如果定价页面无法访问,插件会使用内置预设值:flash 定价为输入 0.02 CNY/1M、缓存读取 1 CNY/1M、输出 2 CNY/1M。这些预设值会一直使用直到下一次成功获取。您也可以在组合配置中直接覆盖成本值。