返回目录

dsh-ui-usage-billing

编辑精选维护状态: 活跃

kenz1117/dsh-ui-usage-billing

用量计费看板:侧边栏成本指标、基于会话日志的真实用量聚合与多提供商价格目录。

前往 GitHub项目主页
$ npm install @kenz1117/dsh-ui-usage-billing

33

星标

5

Fork

TypeScript

语言

MIT

许可证

2026-08-16

创建于

2026-09-04

最近推送

原生 DeepSeek Harness 计费插件——从会话日志聚合真实用量,生成带实时多厂商定价的费用仪表盘,支持订阅/余额对账与成本归因分析。

DSH 适配

原生运行时

作者声明

安全审计

未审计

最后核验

2026-09-05

许可证

MIT

01它能帮你完成什么?

  • See exactly how much every DeepSeek Harness model run costs, in one dashboard

    A sidebar cost card plus a six-zone billing dashboard (overview / tokens / usage / trends / rates / settings) aggregating real usage from persisted session logs, priced against live multi-vendor rates

    DeepSeek Harness users who want per-run, per-model cost visibility instead of a raw token count

  • Close the loop on subscriptions, balances, relay quotas and ledger reconciliation

    Subscription-plan quotas, multi-provider balances, relay quotas, declared endpoints and official-vs-local ledger reconciliation across providers

    Heavy multi-provider DSH users who need to track plan quotas, balances and cross-check their billing

  • Explain where the cost actually goes, beyond the total

    Input cache-hit/miss buckets (incl. reasoning), official vs third-party buckets, per-workspace/session/relay drilldown, per-round cost-spike attribution, and a per-model performance panel (TTFT mean / P50 / P90, tokens/s)

    Engineers optimizing DSH spend who want cost attribution and latency-per-model insights

02如何接入 DeepSeek Harness?

前置条件

  • A running DeepSeek Harness host that auto-discovers the plugin via `dsh.client` / `cordis.patch.yml`.
  • Host `sessionPersistence` enabled — without it the plugin falls back to a local stats file (`~/.dsh-usage-stats.json`) and only estimates usage.

安装步骤

  1. 01

    Add the plugin to the host’s `cordis.patch.yml`: insert id `ui-usage-billing` with name `@kenz1117/dsh-ui-usage-billing`.

  2. 02

    Or run `npm install @kenz1117/dsh-ui-usage-billing` in the host project, then start the host — a billing entry appears above Settings with no extra config.

    $ npm install @kenz1117/dsh-ui-usage-billing

验证接入成功

作者未说明

03DSH 适配与能力边界

DSH 适配原生运行时

Native DSH plugin discovered via the host’s `dsh.client` / `cordis.patch.yml`; adds a billing dashboard surface and loopback-only HTTP APIs on top of the host’s `sessionPersistence` and credential seam.

  • Real-time usage aggregation

    persisted session logs (via the host’s sessionPersistence)cost metrics — this month / today / estimated / heatmap / trends — priced in CNY against live multi-vendor rates

    writes a persistent usage ledger at `~/.dsh/.dsh-usage-ledger.json`
  • Billing dashboard UI

    aggregated stats JSON from the serversidebar trigger card + six-zone full-screen dashboard (overview / tokens / usage / trends / rates / settings)

  • Subscription, balance & relay closed loop

    official / subscription / relay balance APIs (via credential seam)subscription quotas, multi-provider balances, relay quotas, declared endpoints, and official-vs-local ledger reconciliation

    reads multi-provider balance / pricing APIs over the networkwrites the `~/.dsh` ledger
  • Cost attribution & performance analytics

    per-session / per-round cost and latency datainput cache-hit/miss buckets, official vs third-party buckets, per-round cost-spike attribution, and a per-model latency panel (TTFT mean / P50 / P90, tokens/s)

04适合谁?何时不该用?

适合

  • DeepSeek Harness users who want per-run, per-model cost visibility instead of a raw token count
  • Heavy multi-provider DSH users who need to track plan quotas, balances and cross-check their billing
  • Engineers optimizing DSH spend who want cost attribution and latency-per-model insights

不适合

  • Declared permission level is `high`: reads persisted session logs (files), calls multi-provider balance / pricing APIs (network), reads `apiKeyEnv` via the credential seam, and writes the `~/.dsh` ledger — but it does NOT execute shell commands.
  • Update channel is `user-reviewed`: because the plugin has file / network / credential capabilities, DSH STORE requires local manual confirmation on every install; review the repo, pin a Commit, and lifecycle scripts before installing.
  • Preview line (npm latest/alpha, 1.0.x) targets DSH 0.1.2 series; stable line (npm stable, 1.1.x) targets older hosts 0.1.0-rc.8 ~ 0.1.1-rc.2. Requires Node.js ^22.19.0 || >=24.0.0.

05兼容性、维护与安全提示

  • Declared permission level is `high`: reads persisted session logs (files), calls multi-provider balance / pricing APIs (network), reads `apiKeyEnv` via the credential seam, and writes the `~/.dsh` ledger — but it does NOT execute shell commands.
  • Update channel is `user-reviewed`: because the plugin has file / network / credential capabilities, DSH STORE requires local manual confirmation on every install; review the repo, pin a Commit, and lifecycle scripts before installing.
  • Preview line (npm latest/alpha, 1.0.x) targets DSH 0.1.2 series; stable line (npm stable, 1.1.x) targets older hosts 0.1.0-rc.8 ~ 0.1.1-rc.2. Requires Node.js ^22.19.0 || >=24.0.0.
2026-08-162026-09-04v1.1.7

MIT · actively maintained (latest release v1.1.7, 2026-09-04)

06常见问题

如何把 dsh-ui-usage-billing 安装到 DeepSeek Harness?

在宿主的 `cordis.patch.yml` 中加入 insert id `ui-usage-billing`、name `@kenz1117/dsh-ui-usage-billing`,或运行 `npm install @kenz1117/dsh-ui-usage-billing`。启动宿主后,侧边栏设置上方即出现计费入口;无需额外配置,`sessionPersistence` 可用时自动聚合真实用量。

费用数据从哪来,会用假样本吗?

服务端从持久化会话日志实时聚合,按实时多厂商官方价估算;数据到达前显示全零空快照,绝不展示伪造样本。

它能追踪哪些厂商的余额与订阅?

它追踪订阅套餐额度、多厂商余额(DeepSeek、Kimi、阶跃星辰、硅基流动、xAI、智谱 GLM、腾讯云 TokenHub 等)、中转站额度、声明端点与官方/本地账本对账,形成可交叉验证的计费闭环。

插件需要高权限吗,怎么更新?

声明权限等级为 `high`(读取会话日志、访问余额/定价 API、经凭据 seam 读取 `apiKeyEnv`、写入 `~/.dsh` 账本),但不含命令执行/Shell;更新通道为 `user-reviewed`,DSH STORE 每次安装都需本机人工确认。

支持哪些 DeepSeek Harness 版本?

预览线(npm latest/alpha,1.0.x)适配 DSH 0.1.2 系;稳定线(npm stable,1.1.x)适配旧宿主 0.1.0-rc.8 ~ 0.1.1-rc.2,并要求 Node.js ^22.19.0 || >=24.0.0。

08数据与来源

  • 作者声明github.comf47e6ca4ba2a…

    本包为独立 npm 包,发布后即可被其他 DeepSeek Harness 宿主安装。

  • 作者声明github.comf47e6ca4ba2a…

    启动宿主后,侧边栏设置上方即出现计费入口。无需额外配置;`sessionPersistence` 可用时自动聚合真实用量。

页面基于项目公开文档、仓库元数据和 DSH Plugins 的结构化解析生成;最后核验于 2026-09-05。发现错误?提交更正。

🏆

最佳 DeepSeek Harness 插件

从全目录挑出的 12 个值得优先安装的插件,覆盖各个分类。

DSH Plugins 是独立的 DeepSeek Harness 插件市场,与 DeepSeek 官方无关,也不代表官方背书。第三方插件未经安全审计,安装前请审查源码。

每周获取最新的 DeepSeek Harness 插件,绝不滥发。