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.

Stats Panel — DSH Plugin for DeepSeek Harness
← Plugins
S

@linxin666/dsh-stats-panel

Stats Panel

Token usage statistics for DeepSeek Harness: per-channel usage, balances and plan quotas for mainstream providers, cost estimates in CNY — a full-page conversation view tab.

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

npx -y @deepseek-ai/dsh plugin --profile web add github:zhang-jiazhi/dsh-stats-panel#8ee4fdd1d9a81b07eaa0230169a8c9f82ac642ef
READMECompatibilityVersions

Compatibility and provenance

Stats Panel is published as @linxin666/dsh-stats-panel and currently resolves to version 0.5.0. 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.5.0stable
9/20/2026
0.4.0stable
8/31/2026
0.3.0stable
8/30/2026

Related plugins

Loading related plugins…

Latest
0.5.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
Apache-2.0
Source
github
GitHub
★ 1
Weekly downloads
0
Last push
9/20/2026
View source ↗
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
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

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 the current session provider's today usage on the sidebar entryWhale 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 使用统计(dsh-stats-panel)

DeepSeek Harness (DSH) 的 Token 用量统计面板:模型用量、Token 消耗、缓存命中率、按渠道统计、渠道余额/套餐余量、费用估算(人民币)。以会话顶部独立 Tab 页呈现(「Token 统计」,与 对话 / 轨迹 / 上下文 / 记忆 并列),按 NewAPI / Sub2API 统计看板风格设计的全宽仪表盘。

功能

  • 总览卡片:总调用次数、总 Token、今日消耗(按 stats-panel.dayBoundary 日历分桶,默认主机本地时区)、缓存命中率、估算费用(人民币)
  • 渠道统计:按渠道(provider)聚合调用次数与 Token 消耗 —— 自动识别 DeepSeek 官方、OpenCode Go、MiMo、OpenAI、Anthropic、Kimi、硅基流动、阶跃星辰、OpenRouter、Novita 等
  • 渠道余额 / 套餐余量:
    • 自动查询(余额类):DeepSeek 官方(/user/balance)、Kimi 月之暗面(/v1/users/me/balance)、硅基流动(/v1/user/info)、阶跃星辰(/v1/accounts)、OpenRouter(/api/v1/credits)、Novita AI(/v3/user/balance)
    • 自动查询(用量类):OpenCode Go(/zen/go/v1/usage,滚动/7天/30天配额)、OpenAI(/v1/usage,5小时/7天/30天用量)、Anthropic(/v1/organizations/usage/costs,同上)
    • 通用兜底 ①:NewAPI / one-api 系中转(AgentRouter 等),走 /dashboard/billing/* 计费模拟端点;key 为无限额度令牌时(hard_limit_usd=1e8 哨兵)改查控制台用户余额 /api/user/self——会话 Cookie 存 ~/.dsh/stats-panel/<provider>-cookie.txt(附 new-api-user=<uid>),或访问令牌凭据 <XXX>_ACCESS_TOKEN
    • 通用兜底 ②:Sub2API 系网关(mdkj.lol 等),走 /v1/usage 用 sk key 自查钱包余额、今日用量与累计成本
    • MiMo Token Plan:自动查询平台控制台(platform.xiaomimimo.com/api/v1/tokenPlan/usage,需登录 Cookie);未配置 Cookie 时回退为手动填写(存 localStorage)
  • 模型统计:各模型调用/输入/输出/缓存/总 Token/费用
  • 可视化:每日/每周/每月 Token 堆叠柱状图(输入/输出/缓存)、模型占比环形图、最近调用记录
  • 费用估算:可编辑的模型价格表(人民币,元/1M tokens),内置本机全部模型的官方牌价(DeepSeek V4 / GPT-5.6 / Claude Opus 5 / GLM-5.3 / Kimi K2.7 / MiMo 等),用户修改优先
  • 看板式数据流:切回标签页先用会话内缓存秒开再后台校验;页面可见时每 60 秒静默轮询(无新数据不重渲染、不闪加载态),后台标签页不轮询;余额自动探测客户端限流 2 分钟(服务端缓存 60 秒 + 并发去重 + 渠道并行探测),手动刷新不受限
  • 数据留存:明细累计到 DSH_STATS_COMPACT_MAX_RECORDS(默认 10000 条,环境变量可调)即整体折叠为精确聚合并与已有内容合并写入 ~/.dsh/stats-panel/archive.json 并原子写回 cutoff 之后的 retained 明细——压缩在启动时与 summary 请求路径都会触发,长期不重启的 host 明细也不会无限增长;不保存、不读取已折叠的单条历史明细,统计数字不受影响;「调用记录」分页显示未折叠的 retained 明细及之后新增的调用。archive.json 是压缩前历史的唯一载体,请勿删除;backfill-state.json 按持久化 session revision 记录已扫描版本,未变化的非 live 会话可跳过,旧 state、revision 不可用或明细日志缩短时会安全全量重扫

安装

方式一:本地安装(开发)

cd ~/.dsh/local-plugins
git clone https://github.com/zhang-jiazhi/dsh-stats-panel.git
cd dsh-stats-panel && pnpm install --frozen-lockfile
# 仓库已包含预构建 lib/,无需本地构建
pnpm run typecheck
pnpm test

从源码重建 client bundle 需要 DSH 源码仓库中的官方 packages/client/tsdown.client.ts 工厂;普通安装直接使用仓库内预构建的 lib/ 产物。

方式二:作为 profile 依赖

在 ~/.dsh/profiles/web/package.json 的 dependencies 添加:

"@linxin666/dsh-stats-panel": "<git 或 npm 地址>"

并加入 dsh.profile.bundles 列表,重启 dsh web 即可。

使用

  1. 打开 DSH Web UI,进入任意会话
  2. 点击会话顶部的 Token 统计 Tab(与 对话 / 轨迹 / 上下文 / 记忆 并列)
  3. 查看总览 KPI、消耗趋势、模型占比、渠道余量,以及「模型统计 / 渠道统计 / 模型价格 / 调用记录」分页明细

渠道余额/余量自动从各平台官方 API 查询(需要你在 DSH 中配置对应渠道的 API Key,读取自 ~/.dsh/.credentials.yaml 或环境变量);查询失败或无公开 API 的渠道会显示错误/待配置,可手动填写。

MiMo Token Plan 自动查询需要平台登录 Cookie(platform.xiaomimimo.com)。配置方式二选一:

  • 把登录后的 Cookie 请求头内容保存到 ~/.dsh/stats-panel/mimo-cookie.txt(权限建议 600)
  • 或设置环境变量 MIMO_PLATFORM_COOKIE

Cookie 过期后重新登录平台并更新该文件即可。

支持渠道与查询方式

渠道类型查询 API币种
DeepSeek 官方余额api.deepseek.com/user/balanceCNY
Kimi 月之暗面余额api.moonshot.cn/v1/users/me/balanceCNY
硅基流动余额api.siliconflow.cn/v1/user/infoCNY
阶跃星辰 StepFun余额api.stepfun.com/v1/accountsCNY
OpenRouter余额openrouter.ai/api/v1/creditsUSD
Novita AI余额api.novita.ai/v3/user/balanceUSD
OpenCode Go套餐配额opencode.ai/zen/go/v1/usage滚动/7天/30天
OpenAI用量(5h/7d/30d)api.openai.com/v1/usage—
Anthropic用量(5h/7d/30d)api.anthropic.com/v1/organizations/usage/costs—
MiMo Token Plan套餐用量platform.xiaomimimo.com/api/v1/tokenPlan/usage(需登录 Cookie)—

OpenAI / Anthropic 用量接口需要组织级(admin)API Key,普通项目 Key 可能返回 403。 渠道自动发现:读取 ~/.dsh/settings.yaml 的 llm-pi-ai.providers,按 baseURL 匹配查询方式;llm-deepseek 段只有模型目录/重试策略,不参与发现;deepseek-official 仅当 DEEPSEEK_API_KEY 凭据可解析时自动加入探测列表。凭据通过 DSH credentials 服务按 apiKeyEnv 解析。

计价

  • 内置默认价格表覆盖本机实际用到的全部模型(人民币 元/1M tokens,美元模型按 ≈7.1 汇率折算),2026-08-29 查询:
    • DeepSeek V4 Flash/Pro 及变体:官方峰谷价,内置取高峰口径(api-docs.deepseek.com;高峰 = 周一至五 9-12/14-18 时,空闲减半;缓存写免费)
    • GPT-5.6 Sol / Luna:OpenAI Standard 短上下文价(developers.openai.com,Sol 为 2026-11-21 前促销价;含官方缓存读/缓存写价)
    • Claude Opus 5:$5/$25(anthropic.com;缓存读 0.1×、缓存写 1.25× 输入价)
    • GLM-5.3-Flash:智谱定价页 0.002 元/千 tokens(bigmodel.cn;缓存读按输入价 10% 估算)
    • Kimi K2.7 Code:输入 6.5 / 输出 27 / 缓存命中 1.3(platform.kimi.com)
    • 套餐内模型(MiMo Token Plan)与免费模型(ox-alpha-free 等)计 0
  • 价格表存 localStorage;用户编辑过的模型以用户为准,缺失模型自动用内置默认价补齐
  • 中转站实际扣费可能低于牌价(如 Sub2API 折扣),估算值会偏高;按需修改「模型价格」

开发

仓库已包含预构建产物(lib/),安装后开箱即用,无需构建。

如需从源码重建:

pnpm run typecheck
pnpm test
DSH_CLIENT_BUNDLE_FACTORY=/absolute/path/to/packages/client/tsdown.client.ts pnpm run build

build 先生成类型中间产物,再用 DSH 官方 clientBundle 工厂生成 node half 和 __ModuleLoader__ client bundle。DSH_CLIENT_BUNDLE_FACTORY 可传绝对路径,或传相对插件目录的路径。没有 DSH 源码环境时:pnpm run build:host 可从源码重建 host 半区(lib/index.js),client 半区仍使用仓库预构建产物。

数据持久化于 ~/.dsh/stats-panel/records.jsonl(按 sessionId+seq 去重,跨重启安全);archive.json 保存已压缩历史,backfill-state.json 保存已扫描的持久化 revision。

常见问题

  • OpenAI / Anthropic 的用量查不到? 这两个平台的用量接口需要组织级(管理员)API Key,普通项目 Key 会返回 403(页面显示查询失败)。
  • MiMo Token Plan 没有自动余量? 请确认已配置平台 Cookie(~/.dsh/stats-panel/mimo-cookie.txt 或环境变量 MIMO_PLATFORM_COOKIE),且 Cookie 未过期;未配置或失效时会回退为手动填写。
  • 费用为什么和实际账单不一致? 费用按你配置的价格表估算;套餐渠道(OpenCode Go / MiMo / OpenAI / Anthropic)建议将模型价格设为 0,避免与套餐额度重复计费。
  • 换机器后价格配置丢失? 价格表存于浏览器 localStorage;如需迁移可在「模型价格」编辑后导出。
  • 数据存在哪里? 用量数据存 ~/.dsh/stats-panel/records.jsonl(按 sessionId+seq 去重)。
  • 「今日消耗」按哪个时区? 默认主机本地时区,跨零点即归零;如需 UTC 口径,在 ~/.dsh/settings.yaml 配置 stats-panel.dayBoundary: utc(也可写 +08:00 或分钟数,如 480)。切换日历只影响分桶展示,明细与总量不变;已折叠到 archive.json 的历史段无法回溯重切,趋势卡下方会显示相应说明。

贡献

欢迎提交 PR:

  • 新增渠道适配器:见 docs/CHANNELS.md
  • 余额连通性验证:node scripts/verify-balances.mjs

License

Apache-2.0