DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Token Usage — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

@wycto/dsh-token-usage

Token Usage

Token Usage Logging and Statistics Dashboard: Records all DSH LLM API calls, supports second-level time-range queries, multidimensional filtering, grouped statistics, and CSV export

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:wycto/dsh-token-usage#c52495a82c98ad9cff18c9b623233e7f8d2ccb82
READMECompatibilityVersions
Token 用量统计面板侧边栏入口

Compatibility and provenance

Token Usage is published as @wycto/dsh-token-usage and currently resolves to version 0.1.14. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
9/20/2026

Versions

0.1.14stable
8/21/2026
0.1.13stable
8/18/2026
0.1.12stable
8/18/2026
Show 12 more versionsCollapse versions
0.1.11stable
8/18/2026
0.1.10stable
8/17/2026
0.1.9stable
8/17/2026
0.1.8stable
8/17/2026
0.1.7stable
8/17/2026
0.1.6stable
8/17/2026
0.1.5stable
8/17/2026
0.1.4stable
8/17/2026
0.1.3stable
8/17/2026
0.1.2stable
8/17/2026
0.1.1stable
8/17/2026
0.1.0stable
8/17/2026

Related plugins

Loading related plugins…

Latest
0.1.14
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 4
Weekly downloads
71
Last push
8/20/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in models-usage.

Usage@linxin666/dsh-usageUsage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with a dedicated pet bubble for the current providerWhale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinUsage Stats@ychris12138/dsh-usage-statsToken usage heatmap, provider balances, and subscription quotas for the dsh web GUICodex Connectdsh-codex-connectChatGPT OAuth and Codex models for DeepSeek Harness.

README

dsh-token-usage — DSH Token 用量记录与统计插件

记录 DeepSeek Harness 中所有 LLM API 调用(模型请求),提供单窗口全屏统计面板。 支持秒级时间范围查询、多维度筛选、会话 ID 筛选、排序、状态码与调用详情、分组统计表与 CSV 导出。

界面截图

Token 用量统计面板

Token 用量统计面板:汇总卡片、多维度筛选、状态码与调用明细

侧边栏入口

侧边栏底部"Token 用量"入口按钮

功能特性

  • 醒目入口:侧边栏底部蓝色渐变大按钮 "Token 用量",一键打开全屏面板。
  • 秒级时间查询:起止 datetime-local(精确到秒)过滤调用记录。
  • 默认不限制时间:打开面板默认时间不选、显示全部记录(不再默认"当天");筛选条件自动暂存(localStorage),下次打开恢复上次条件;点【重置】清空全部条件回到显示全部。
  • 提供商/模型下拉去重合并:选项 = 现有配置(settings.yaml 的 llm-pi-ai.providers)∪ 历史记录,无记录时仍可选现有提供商,已删除的提供商/模型因有记录仍可选中。
  • 多维度筛选:会话 ID / 模型提供商 / 模型 / 状态 / 推理强度 下拉筛选。
  • 排序:明细表全部 15 列点击表头可排序(时间/会话ID/提供商/模型/输入/缓存/命中%/输出/推理/总额/金额/金额(¥)/强度/状态/耗时),升降序切换。默认按时间倒序(最新在前)。
  • 金额双币显示:明细表与统计表金额均为 USD + 人民币两列;定价表以官方人民币刊例为基准(支持 DeepSeek-V4 峰谷两档),人民币按汇率换算(默认 7.2,可用 settings.yaml 的 token-usage.usdCnyRate 覆盖),CSV 导出含 costCny 列。
  • 会话 ID:明细表显示会话 ID(缩略),点击任意会话 ID 即按该会话筛选。
  • 状态码 + 详情:状态列显示 HTTP 状态码(200 成功 / 400 / 401 / 429 / 500 等,来自 turn/end 错误),状态下方【查看详情】弹窗展示完整信息(含会话 ID、错误信息、错误码、各 Token 桶、金额、耗时、Turn/Step 等)。
  • 统计表:按 provider / model / status / effort 分组汇总(调用数、各 Token、命中率、金额、耗时)。
  • CSV 导出:按当前筛选导出全字段明细。

数据来源

插件不侵入模型调用链路,只读取 DSH 会话日志(session/event 事件 + 历史扫描), 从以下会话事件中提取每次模型调用的完整信息:

字段来源说明
时间事件 timeUnix epoch ms,秒级精确
模型提供商request/header.config.provider路由名(如 ocx)
模型request/header.config.model模型 id
apikey配置 apiKeyEnv仅存掩码(安全,见下)
输入 Tokenassistant/message.usage.inputTokens未命中缓存输入
输出 Tokenusage.outputTokens含推理 token
缓存命中量usage.cacheReadTokens
缓存写入量usage.cacheWriteTokens
推理 Tokenusage.reasoningTokens
缓存命中率计算cacheRead/(input+cacheRead)
消耗金额内置定价表估算(人民币/1M)含 DeepSeek-V4 峰谷两档、可配置覆盖
推理强度config.reasoningEffort
状态turn/end.reason.kindcompleted/error/aborted/...
状态码turn/end.reason.error.status真实 HTTP 码(如 400/401/429),无则映射 200/403/499/500
错误信息/码turn/end.reason.error.message/code详情弹窗展示
会话 ID事件所属 session id可点击筛选、详情展示
耗时step/start → assistant/messagellmMs

安装

方式一:npm 包(推荐,已发布)

dsh plugin --profile <profile名> add @wycto/dsh-token-usage

安装后重启 DSH(dsh --profile <profile名>),侧边栏底部出现蓝色"Token 用量"按钮。

方式二:本地开发体验

  1. 将 lib/index.js(Host)与 client/index.js(Client web)放入 src/。
  2. cordis.patch.yml 插入插件行(name/id 用带 scope 的包名 @wycto/dsh-token-usage)。
  3. pnpm dsh web --patch ./dsh-token-usage/cordis.patch.yml

发布与更新

详见 PUBLISH.md:打包为带 dsh.bundle manifest 的 npm 组合包。

操作命令
登录 npmnpm adduser
首次发布npm publish
升小版本(0.1.0 → 0.1.1,修复)npm version patch && npm publish
升中版本(0.1.1 → 0.2.0,新功能)npm version minor && npm publish
升大版本(0.2.0 → 1.0.0)npm version major && npm publish

npm version 会自动修改 package.json 版本号并打 git tag(如 v0.1.0), 推送 tag 用 git push --tags。包名 scope @wycto/ 与 npm 账号一致,可直接发布。

  • npm 包主页:https://www.npmjs.com/package/@wycto/dsh-token-usage
  • 源码仓库:https://github.com/wycto/dsh-token-usage

安全

  • apikey 永不落明文:仅展示掩码(sk-***abcd)。DSH 凭据本来也只在 .credentials.yaml / 环境变量,插件不复制密钥。
  • 记录为本地内存索引,进程重启后自动从会话日志重建(数据源即 DSH 自身持久化日志)。

金额与定价

金额为估算:内置常见模型单价表(人民币元 / 百万 tokens 为基准),未知模型用 fallback 单价。

峰谷定价:DeepSeek-V4 官方已实行峰谷计费(2026-08-17 生效), 高峰时段为每日 9:00–14:00(按插件运行机器本地时间判断),价格为空闲时段的 2 倍。内置 v4-flash / v4-pro 两档:

模型时段输入(缓存未命中)输出输入(缓存命中)
deepseek-v4-flash空闲1.54.50.05
deepseek-v4-flash高峰3.09.00.10
deepseek-v4-pro空闲4.513.50.15
deepseek-v4-pro高峰9.027.00.30

官方价格可能变动:改价无需升级插件,插件每天自动从官网获取最新定价(解析 HTML 表格提取价格), 获取失败时回退内置默认值;也可在 settings.yaml 手动覆盖任意条目,重启后生效:

token-usage:
  usdCnyRate: 7.2              # USD↔CNY 汇率(默认 7.2)
  pricingUrl: 'https://api-docs.deepseek.com/zh-cn/quick_start/pricing'  # 官网定价页(可自定义)
  pricingFetchIntervalHours: 24 # 自动获取间隔(小时,默认 24)
  pricing:                       # 可选:手动覆盖/新增条目(优先级高于自动获取)
    deepseek-v4-flash:
      input: 1.5           # 元/百万 tokens(空闲时段)
      output: 4.5
      cacheRead: 0.05
      cacheWrite: 0        # DeepSeek 官方不收取缓存写入
      peak:                # 可选:高峰时段(本地时间 start<=h<end)
        start: 9
        end: 14
        input: 3.0
        output: 9.0
        cacheRead: 0.10
        cacheWrite: 0
    '*':                   # 可选:覆盖未知模型的 fallback 单价
      input: 2.16
      output: 6.48
      cacheRead: 0.43
      cacheWrite: 4.32

已知边界

  • 金额为估算:内置常见模型单价表;未知模型用 fallback 单价(见上,可配置覆盖)。
  • 失败调用(无 assistant/message)不产生 token 记录;状态列反映 turn 结局。
  • 本机为 OCX 网关时 usage 字段可能缺失,此时 token 数显示 0。