golitter/dsh-deepseek-billing
在DSH中查看DeepSeek API账户余额与计费信息
Project Overview项目介绍
dsh-deepseek-billing is a DeepSeek Harness plugin that adds a Billing page to the Web settings, showing DeepSeek account available, top-up, and gifted balances. It supports manual refresh, error states, retention of the last successful balance and update time, real-time Chinese/English switching, light/dark themes, and narrow-screen adaptation. The API key is read securely from the DSH credential store and never sent to the browser. A /deepseek-billing slash command queries balance inline; in blank sessions results show as ephemeral toasts that clear on activation or after one minute. The plugin does not implement usage history, trends, alerts, auto top-up, or key management. timeoutMs must be a finite number greater than 0 and not exceeding 120000.
dsh-deepseek-billing 是 DeepSeek Harness 的计费插件,在 Web 设置页添加“计费/Billing”页面,展示 DeepSeek 账户可用、充值和赠送余额,支持手动刷新、错误回退、保留最近成功值与更新时间,并提供中英文实时切换、明暗主题与窄屏适配。API Key 由 DSH 凭证库读取,不会暴露到浏览器。可在对话中用斜杠命令 /deepseek-billing 快速查询,空白会话中以临时提示显示,激活或1分钟后自动清除。插件不实现消费历史、趋势、告警、自动充值或密钥管理。timeoutMs 必须为大于0且不超过120000的有限值,避免定时器溢出。
请帮我了解并安装插件:【dsh-deepseek-billing】【https://github.com/golitter/dsh-deepseek-billing】
Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:golitter/dsh-deepseek-billing
把 golitter/dsh-deepseek-billing 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-deepseek-billing
简体中文 · English
功能概述
在 DeepSeek Harness 的 Web 设置页中增加“计费 / Billing”页面,提供:
- DeepSeek API 可用余额、充值余额和赠送余额展示
- 手动刷新及加载、空数据、错误状态;刷新失败时保留最近一次成功余额和更新时间
- 中文、英文实时切换
- 明暗主题与窄屏适配
- API Key 通过 DSH 凭证库安全读取,不会发送到浏览器
- 对话内斜杠命令
/deepseek-billing快速返回余额;新建空白会话保持当前页面并显示临时提示,提示在会话激活、1 分钟到期或切换离开时自动清除,空白阶段的查询记录不会在会话激活后重新出现
第一性原理
这个插件只解决一个最基本的问题:在不暴露 API Key 的前提下,让用户可靠地看到 DeepSeek 账户的真实余额。
因此,当前功能有意保持克制:宿主负责安全读取凭据并请求 DeepSeek 官方余额接口,客户端只展示接口返回的余额,并提供手动刷新和稳定的错误反馈。插件不实现消费历史、趋势图、用量预测、余额告警、自动充值或 API Key 管理等扩展能力;这些功能要么缺少可靠的数据来源,要么超出了“查询余额”这一核心职责。没有实现它们是基于第一性原理做出的范围选择,而不是用虚构数据填充界面。
安装与使用
安装插件:
dsh plugin --profile web add github:golitter/dsh-deepseek-billing在
$DSH_HOME/.credentials.yaml中配置 DeepSeek API Key:version: 1 refs: DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxxDSH 启动时会迁移已存在的旧扁平凭据文档;新文档请直接使用
version: 1和refs格式。POSIX 系统上应限制文件权限,例如chmod 600 "$DSH_HOME/.credentials.yaml";不要在文档、日志或截图中记录真实密钥。启动 DSH Web:
dsh --profile web打开“设置 → 计费 / Billing”查看余额;点击“刷新 / Refresh”可重新获取。首次请求失败会显示完整错误状态;已有余额后的刷新失败会保留旧余额,并在页面中显示非阻塞提示。


也可在对话中直接输入无参数命令
/deepseek-billing快速查看余额;在新建空白会话中,结果显示在输入框旁的临时提示中,不会进入对话记录页,并在会话激活、1 分钟到期或切换离开时自动清除;空白阶段执行过的余额命令不会在会话激活后重新显示为历史卡片。宿主已保存zh/en偏好时,斜杠菜单说明、标签、空态、错误和用法提示跟随语言并在切换后更新;远程浏览器仅有进程内语言或偏好不可用时,菜单说明回退英文,结果回退为不带标签的「币种 + 金额」、固定英文用法提示及稳定错误码。
配置与安全
详见 配置与安全。其中 timeoutMs 必须为大于 0 且不超过 120000 毫秒的有限数值,避免 Node.js 定时器溢出;设置页的等待超时会自动对齐该值(响应中附带 timeoutMs,客户端按其加余量对齐)。
MeteorNOX/DeepSeek-Balance-Whale-Widget
Han-1413141/dsh-cost-meter
zh667/TokenLedger
wssfk12138/dsh-damage-pulse
Ychris12138/dsh-usage-stats
Aisland-SJL/dsh-usage
yxxbc/dsh-balance-plugin
slywalker2006/dsh-passwords