dshbase

Plugin directory / Knowledge / DeepSeek-Harness-billing-plugin

DeepSeek-Harness-billing-plugin

Verified · install-tested on dsh WilliamLIiii

✓ Actively maintained Pure TypeScript

View on GitHub ↗ ← Back to plugin directory

9Stars
0Forks
0Open issues
TypeScriptLanguage
2026-08-14Last push
Cross-platformPlatform

What it does

DeepSeek Harness billing plugin: account balance + per-model remaining-task estimator with a session-header badge

✅
Our take
Works — verified, early-stage project

DeepSeek Harness billing plugin: account balance + per-model remaining-task estimator with a session-header badge It installs cleanly and boots without issues in our testing. It's early-stage but functional.

“Verified” means our automated CI actually ran dsh plugin add in a clean profile and it booted — nothing more. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

README

DeepSeek Harness 计费插件

一个 DeepSeek Harness 插件,在 Web 会话头部直接显示你的 DeepSeek 账户余额,以及大概还能跑多少个任务。

余额是 GET /user/balance 的真实数字;「还能跑多少任务」是估算值,不是计费承诺。

显示什么

  • 会话头部徽标 —— 剩余余额(剩余额度:¥X)加上「按当前模型预计还能跑多少任务」。
  • 详情面板 —— 每个模型一行:还能跑多少任务,或「暂无消耗记录」/「按消耗能跑不足 1 个任务,该充钱了」。
  • 刷新 —— 按需重新拉取余额并重新折叠用量。

显示样式

image

包结构

包 侧 作用
packages/llm-billing —— @deepseek-ai/dsh-llm-billing 主机端 负责 /user/balance 传输、跨会话的每模型 token 折叠、峰/谷计价表。对外暴露 billing Remote(getBalance、getEstimate)。
packages/ui-billing —— @deepseek-ai/dsh-client-ui-billing 浏览器端 自己挂载 billing Remote,并贡献会话头部徽标。

前置条件

  • DeepSeek Harness(dsh)—— 插件运行在 dsh profile 内。
  • 一个 DeepSeek API key —— 余额从 DeepSeek API 读取,所以每个用户都需要自己的 key。

安装

把两个包装进 profile、接进组合、再配好 key。

1. 安装包

dsh plugin --profile web add @deepseek-ai/dsh-llm-billing @deepseek-ai/dsh-client-ui-billing

这两个包位于本仓库的 packages/ 工作区内;需要先把它们发布到 npm
(@deepseek-ai 或你自己的 scope),dsh plugin add 才能从 registry 解析。

2. 接进组合

编辑 ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: llm-billing
      name: '@deepseek-ai/dsh-llm-billing'
    - id: ui-billing
      name: '@deepseek-ai/dsh-client-ui-billing'

3. 配置你的 DeepSeek API key

二选一:在网页「模型」页填入(会把 DEEPSEEK_API_KEY 写入 ~/.dsh/.credentials.yaml),或导出环境变量:

export DEEPSEEK_API_KEY=sk-...

4. 重启

dsh web

配置

两个包都有合理默认值,下面都是可选的。

主机端(llm-billing)

字段 默认 含义
apiKeyEnv DEEPSEEK_API_KEY 每次调用时解析的凭据引用(环境变量)名。
baseURL $DEEPSEEK_BASE_URL,其次 https://api.deepseek.com 端点基础地址;会追加 /user/balance。
models V4 Flash + V4 Pro 展示用的模型行,按展示顺序。
billing.peakHours 09:00–12:00、14:00–18:00(北京) 高峰时段窗口;其余时段为低谷。
billing.models 官方 V4 费率 每个模型的峰/谷单价行(cacheHitInput、cacheMissInput、output,单位:元/百万 token)。

估算是怎么算的

  • 1 个任务 = 1 次会话。 所有可达会话(在线 + 已持久化)按会话 id 去重后各折叠一次。
  • 每个模型累计三个计费 token 桶:缓存命中输入、未命中输入(未缓存输入 + 缓存写入)、输出(含推理)。
  • 每模型的「平均每次会话消耗」按当前峰/谷时段单价折算,得到平均每任务费用。
  • 还能跑多少 = floor(人民币余额 ÷ 平均每任务费用)。没有历史、没有费率行、或非人民币余额的模型不给出估算。

计费按 DeepSeek 8 月 17 日实行的费率(北京时间峰/谷时段)。

已知限制

  • 仅人民币 —— 估算读取人民币余额行;非人民币余额不给出估算。
  • 按需折叠 —— 每次调用都重新折叠用量,成本随会话数量和日志体积增长。
  • 是估算,不是承诺 —— 它用历史平均消耗去换算余额;实际计费以服务商为准。

许可证

MIT

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install DeepSeek-Harness-billing-plugin for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:WilliamLIiii/DeepSeek-Harness-billing-plugin

Headless (CLI) profile:

dsh plugin --profile headless add github:WilliamLIiii/DeepSeek-Harness-billing-plugin

Test report

Verified: L1 install + L2 load + L3 runtime from GitHub source on dsh 0.1.0-rc.6.

When to use it

Give the agent a memory, a knowledge base, or a retrieval layer so it stops forgetting context between sessions.

Who it's for

Users running long projects who want the agent to remember decisions, docs, and preferences without re-explaining.

For developers — extending it

The memory/retrieval backend is the seam — plug a new store, tune what gets distilled, or add citation and audit trails.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Knowledge

Browse all 7797 plugins →