DeepSeek Harness 用量页签:展示 DeepSeek 账户余额、官方峰谷时段价格、动态倒计时、平台用量页入口和本地余额告警灯。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Hann428/dsh-hann-usage-dashboard
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
DeepSeek usage and billing panel for DeepSeek Harness Desktop and Web.
It adds a compact Usage tab to the conversation view. The tab shows the DeepSeek account balance, current official peak/off-peak pricing, the next price-window countdown, and a direct link to the DeepSeek platform usage page.
Quick install from GitHub
In the desktop app's Add plugin dialog, enter the full repository URL:
https://github.com/Hann428/dsh-hann-usage-dashboard
The following command installs into the Web profile:
dsh plugin --profile web add github:Hann428/dsh-hann-usage-dashboard
Restart dsh web, then open any conversation and select the Usage tab.
For the desktop app, restart the app after installation. Use this GitHub repository as the install source. To pin this version with the CLI, append #v0.0.6 to the GitHub spec.
Upgrade from the old name
Version 0.0.3 renames the repository, package, client module, and Usage tab registration from dsh-usage-dashboard to dsh-hann-usage-dashboard. Uninstall the old plugin in the same Harness profile before installing this version, then restart Harness. Keeping both versions enabled creates duplicate Usage tabs and balance tools.
On the same browser origin, saved warning thresholds are copied from the old storage key when the new key is absent. Moving from the Web app to the desktop app may use a different origin, so enter those settings again if needed. API keys remain in Harness credentials and are not copied by this migration.
Requirements:
- DeepSeek Harness Desktop or Web with plugin support and the conversation view slot.
- A configured
DEEPSEEK_API_KEYcredential in Harness Settings -> Models. - Network access to
https://api.deepseek.comand DeepSeek's official pricing docs.
中文简述:这是一个 DeepSeek Harness 用量面板插件,会在会话页添加“用量”标签页,展示账户余额、官方峰谷价格、切换倒计时、平台用量页入口,并提供可本地保存的余额告警灯设置。
Features
- Account balance from DeepSeek's official
GET /user/balanceendpoint. - Official RMB prices for
deepseek-flashanddeepseek-v4-profrom the DeepSeek price table. - Peak pricing on non-holiday weekdays from 09:00–12:00 and 14:00–18:00 Beijing time. Weekends and Chinese statutory holidays are off-peak.
- The label, price and countdown switch together while the panel is open.
- Compact balance indicator in the conversation header on supported Harness versions. Green indicates an available balance, orange indicates the balance is below an enabled threshold, and a dim indicator means both warning checks are disabled or the balance is unavailable.
- Inline warning threshold switches and inputs for amount and percentage. Values are saved in browser localStorage and update the indicator immediately.
- Host-side API-key handling: the browser receives only the query result, never the key.
- Optional
dev_usage_balancetool for agents to inspect balance and pricing data.
Configuration
The plugin uses the standard DEEPSEEK_API_KEY credential reference by default.
- id: dsh-hann-usage-dashboard
name: dsh-hann-usage-dashboard
config:
keyRef: DEEPSEEK_API_KEY
baseURL: https://api.deepseek.com
platformUsageURL: https://platform.deepseek.com/usage
timeoutMs: 10000
healthCurrency: CNY
alertBalance: 50
alertBalancePercent: 20
balancePercentBase: 100
Configure the key in Harness Settings -> Models. The plugin reads the credential through the Harness credentials service.
alertBalance and alertBalancePercent are optional default warning thresholds. The Usage panel also exposes inline amount and percentage fields. Those browser-local values override the displayed indicator immediately. Set either threshold to 0 or leave the panel field blank to disable that check. balancePercentBase is the user-defined amount treated as 100% for percentage checks.
Notes
- Version 0.0.5 follows Harness light/dark theme colors and adds an actionable authentication error, including the credential source without exposing its value.
HTTP_401means DeepSeek rejected the key used for the balance request. UpdateDEEPSEEK_API_KEYin Harness Settings -> Models, then refresh Usage. An inherited environment key takes priority over the saved key; update that environment value and restart Harness if the source isenv. Keys for third-party gateways do not authenticate against DeepSeek's official balance endpoint.- DeepSeek's platform page login is separate from Harness. The "open usage page" link may require a browser login.
- Both tiers are fetched from DeepSeek's official docs when you open or refresh the Usage panel.
- The bundled holiday calendar covers 2026 statutory dates and 2027 holiday dates, using the national holiday rules. During weekday peak hours on additional days off, or in a year without a bundled calendar, the panel shows both rates and marks the period as unconfirmed.
- DeepSeek's 2026-09-10 pricing docs list
deepseek-flashas the recommended Flash model name. The olddeepseek-v4-flashanddeepseek-v4-flash-vision-expnames are routed to DeepSeek-V4.1-Flash during the documented transition window. - If the docs page cannot be reached or parsed, the balance still renders and the price row reports the pricing error.
Development
pnpm install
pnpm run typecheck
pnpm run build:client
node scripts/check-rename.mjs
node scripts/check-authentication.mjs
node scripts/check-pricing.mjs
Check host imports against an installed desktop profile, without legacy dependency aliases:
node scripts/check-installed-import.mjs "$env:USERPROFILE\.dsh\profiles\desktop"
The built lib/ files are committed so GitHub-source installs can run without a local build step.
链接
同类插件
bowenliang123/dsh-context★ 5607
DSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
Han-1413141/dsh-cost-meter★ 771
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
wssfk12138/dsh-damage-pulse★ 292
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
zh667/TokenLedger★ 207
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
Ychris12138/dsh-usage-stats★ 192
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
PolinniZhong/dsh-personal-center★ 114
DeepSeek Harness 个人中心:跨会话用量统计(按供应商/模型分别统计,自动读取已配置模型)、按模型成本估算、全局自定义指令、数据驱动的桌面宠物(位图/矢量皮肤)与会话状态概览,纯本地离线运行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。