DeepSeek Harness plugin

dsh-quota-meter

DSH web plugin: show the DeepSeek API key's remaining balance, estimate usable tokens per model (peak/off-peak pricing + measured cache-hit ratio), and chart the real cost of every turn.

Jump to install

Source facts

Repository
huolianJiao/dsh-quota-meter
Latest update
Aug 14, 2026
Category
Usage & Billing
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/huolianJiao/dsh-quota-meter
Plugin: dsh-quota-meter
Author: huolianJiao

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-quota-meter

DSH Web 插件:在侧边栏底部实时显示 DeepSeek API 剩余额度,并按「当前模型 × 低峰/高峰计价」估算可用 token 数,附每轮实际花费图。

功能

  • 余额徽章:收缩侧边栏时是带状态圆点的图标;展开时显示「余额 · 估算 token · 时段」一行。
  • 详情面板:总余额 / 赠送余额 / 充值余额、可用状态、按模型 × 低峰/高峰的混合估算缓存区间(0%–100% 命中边界,当前时段高亮)。
  • 实测用量:缓存命中率、输入/输出占比、每轮实际花费柱状图(按每轮自己的时间戳计价,悬浮显示明细)。
  • 可视化配置:设置页直接编辑计价表、高峰时段、回退占比等,保存即生效,无需重启。
  • 安全:API key 只在本地 host 进程解析,绝不下发浏览器;余额接口仅回环地址可访问。

安装

> Requires dsh ≥ 0.1.0-rc.6 and a configured DeepSeek API key.

# Install from GitHub (recommended)
dsh plugin --profile web add github:huolianJiao/dsh-quota-meter

# Or install from a local checkout
dsh plugin --profile web add link:./dsh-quota-meter

装好后重启 web profile(重新执行 dsh web),刷新页面即可。

配置 API Key

插件默认读取凭据引用 DEEPSEEK_API_KEY(可在设置页切换)。任选其一:

  • 环境变量:DEEPSEEK_API_KEY=sk-...
  • 或写入 DSH 凭据文件 $DSH_HOME/.credentials.yaml
DEEPSEEK_API_KEY: sk-...

配置

  • 设置页(推荐):Settings → 「DS API 计费 / DS API Billing」,可视化编辑计价表、高峰时段、回退占比等,保存立即生效。
  • 补丁文件(固化默认值):在 profile 的 cordis.patch.yml 按 id 覆盖,重启生效:
- id: dsh-quota-meter
  config:
    apiKeyEnv: DEEPSEEK_API_KEY
    baseURL: https://api.deepseek.com
    pollIntervalMs: 60000
    summaryModel: deepseek-v4-pro
    peakWindows:
      - { start: "09:00", end: "12:00" }   # 北京时间,[start, end)
      - { start: "14:00", end: "18:00" }
    pricing:                                # 元 / 百万 token
      - model: deepseek-v4-flash
        offPeak: { input: 1.5, cacheHit: 0.05, output: 4.5 }
        peak:    { input: 3.0, cacheHit: 0.10, output: 9.0 }
      - model: deepseek-v4-pro
        offPeak: { input: 4.5, cacheHit: 0.15, output: 13.5 }
        peak:    { input: 9.0, cacheHit: 0.30, output: 27.0 }

开发

零构建,改完即用:

  • lib/client.js(浏览器端):刷新页面即可生效;
  • lib/index.js(host 端):重启 web profile 生效。
npm test   # 运行 smoke 测试

License

[MIT](./LICENSE)