DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-model-usage

P

dsh-model-usage

Manifest valid★ 1

DSH Web 插件:模型供应商额度与用量(DeepSeek / GLM Coding Plan / OpenRouter / Kimi Coding + 自定义适配器)

UI (client)hasBundlePatch

dsh-model-usage

npm license

DeepSeek Harness(DSH)Web UI 插件:实时显示模型供应商的额度与用量。

  • 侧边栏底部:当前供应商的额度/余额卡片,点击打开全部供应商弹窗(Codex 式)
  • 官方 Logo:DeepSeek / GLM(Z.ai) / Kimi / OpenRouter / MiniMax / OpenCode / OpenAI / Anthropic / Gemini / xAI / Qwen / Mistral / Groq / GitHub Copilot 等 25+
  • 设置 → 模型用量:KPI、趋势图、供应商/模型聚合、请求日志、CSV 导出
  • 设置 → 模型:页面底部显示各供应商额度
  • 版本检查:设置 → 模型用量 右上角「检查更新」(对比 npm 最新版,可复制更新命令)
  • 只用真实数据:额度来自服务商接口,用量来自本机会话日志(逐 token 一致),不做金额估算

侧边栏额度卡片

模型用量弹窗

统计面板

请求日志

安装

要求 DSH >= 0.2.0-rc.2 < 0.3.0。

# CLI
dsh plugin --profile web add @ponydev/dsh-model-usage

# 或在 Web「插件」页搜索安装

安装后重启宿主(launchctl kickstart -k gui/$(id -u)/local.deepseek-harness.web)并刷新页面。

本地开发:

dsh plugin --profile web add link:/path/to/dsh-model-usage

供应商支持(完整矩阵见 docs/providers.md)

供应商数据接口凭据引用
DeepSeek APIapi.deepseek.com/user/balanceDEEPSEEK_API_KEY
DeepSeek 账号Host deepseekAccount 服务(登录态)—
GLM Coding Plan(国内 / 国际)open.bigmodel.cn / api.z.ai 额度接口(5 小时 / 每周 / 每月 MCP 工具次数)ZAI_CODING_CN_API_KEY / ZAI_API_KEY
OpenRouteropenrouter.ai/api/v1/credits(兜底 /api/v1/key)OPENROUTER_API_KEY
Kimi Coding Planapi.kimi.com/coding/v1/usagesKIMI_CODING_API_KEY / KIMI_API_KEY / MOONSHOT_API_KEY
Moonshot / Kimi 平台api.moonshot.{ai,cn}/v1/users/me/balanceMOONSHOT_API_KEY / MOONSHOT_CN_API_KEY
MiniMax Token Planapi.minimax.io / api.minimaxi.com /v1/token_plan/remainsMINIMAX_API_KEY / MINIMAX_CN_API_KEY
OpenCode Goopencode.ai/zen/go/v1/usageOPENCODE_API_KEY
Xiaomi MiMoplatform.xiaomimimo.com/api/v1/balanceXIAOMI_API_KEY
GitHub Copilotapi.github.com/copilot_internal/userGITHUB_TOKEN
其他任意供应商customQuota 配置(URL + JSON 路径映射)自定义 keyRef

customQuota 示例(余额式):

config:
  customQuota:
    mycoder:
      url: https://api.example.com/quota
      auth: bearer                 # bearer | raw | x-api-key | none
      keyRef: MYCODER_API_KEY
      balance:
        path: data.balance
        currency: CNY

窗口式:

config:
  customQuota:
    mycoder:
      url: https://api.example.com/quota
      windows:
        - key: rolling
          label: 5h
          usedPath: data.used
          limitPath: data.limit
          resetAtPath: data.resetAt   # ms | s | iso
          resetAtUnit: ms

配置

cordis.patch.yml 中 model-usage 行的 config:

键默认说明
refreshSeconds60额度刷新间隔(秒)
footertrue是否显示侧边栏底部入口
credentials{}按路由覆盖凭据引用,如 { "deepseek-official": "MY_DEEPSEEK_KEY" }
glm{}GLM 组织/项目/套餐类型:organization / project / planType
customQuota{}通用额度适配器(见上)

数据口径

  • 用量:assistant/message 事件中的服务商回传 usage(input / cacheRead / cacheWrite / output),与本机会话日志逐 token 一致
  • 额度/余额:服务商接口返回的真实值(DeepSeek 余额、GLM 5h/周剩余、Kimi 周/滚动窗口、OpenRouter credits)
  • 真实消耗观测:每次刷新比对余额/套餐额度变动,得到当日实际支出(余额下降)与充值(余额上升,分开记录不冲抵)
  • 不做金额估算:订阅套餐按套餐额度计费而不是按 API 逐次扣费,任何估算都会误导
  • 统计范围:本机、安装后写入会话日志的调用;旁路调用(标题生成/压缩摘要)与其他设备不计
  • 账本文件:$DSH_HOME/model-usage/ledger.json(按日聚合,保留 120 天;首次启动回填近 30 天)

安全

  • API Key 只在 Host 内存中解析使用,不进入浏览器,任何 RPC 响应都不包含密钥
  • 只请求写死的白名单接口域名;客户端不能指定 URL
  • 账本只存用量聚合(token 数、窗口百分比),不含对话内容
  • 错误信息脱敏(sk-* / Bearer * 会被打码)

开发与发布

# 本地渲染台(离线验证 UI,不依赖宿主)
open test-render.html

# 发版(自动发布到 npm + GitHub Release)
npm version patch && git push --follow-tags

License

MIT

Comments

Loading…

From the same category

awesome-dsh-plugin

by awesome-dsh-plugin

A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表

Development & Infrastructure

★ 20.2k

CC0-1.0

Python

Oct 23, 2026

Index only — not installable

by 0xsline

DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.

Development & Infrastructure

★ 1.2k

CC0-1.0

Python

Oct 16, 2026

Index only — not installable

by pax-beehive

Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub

Development & Infrastructure

★ 277

MIT

TypeScript

Oct 20, 2026

Index only — not installable

by xiajiajun516

DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.

Development & InfrastructureManifest valid

★ 227

MIT

TypeScript

Oct 22, 2026

dsh plugin --profile web add dsh-config-manager

by yjh051108

推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。

Development & InfrastructureManifest valid

★ 166

TypeScript

Oct 16, 2026

dsh plugin --profile web add @dsh-external/dsh-super-injector

by jigjoy-ai

A CLI that turns a goal into a pull request - and a sandbox for testing concurrent AI coding agents on the Mozaik runtime.

Development & Infrastructure

★ 125

MIT

TypeScript

Oct 22, 2026

Index only — not installable