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 Xc — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

dsh-token-usage-xc

Token Usage Xc

DSH web plugin: Token usage statistics for today and the last 7 days, broken down by model, with a header summary, cache hit rate, and 7-day trend chart.

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

npx -y @deepseek-ai/dsh plugin --profile web add dsh-token-usage-xc@0.2.24
READMECompatibilityVersions

Compatibility and provenance

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

DSH compatibility
*
Runtime surfaces
web
Release source
npm
Registry updated
9/10/2026

Versions

0.2.24stable
9/10/2026
0.2.23stable
9/8/2026
0.2.22stable
9/2/2026
Show 2 more versionsCollapse versions
0.2.17stable
9/1/2026
0.2.16stable
8/29/2026

Related plugins

Loading related plugins…

Latest
0.2.24
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
81 kB
Files
7
Surface
web
License
MIT
Source
npm
GitHub
★ 0
Weekly downloads
0
Last push
9/10/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

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-usage-xc

中文 | English

DSH Token 用量统计插件 —— 实时追踪今日与最近 7 日 Token 消耗,按模型分桶展示,提供缓存命中率分析和趋势图表。

✨ 核心特性

📊 今日 Token 用量

在设置页新增「今日 Token 用量」分区,实时展示:

  • 按模型统计:输入/输出/缓存读/缓存写 Token 数
  • 缓存命中率:cacheRead / (uncachedInput + cacheRead) × 100%
  • 请求次数:每个模型的 API 调用次数
  • 当日总计:所有模型的汇总数据

📈 7 日趋势图

  • 堆叠柱状图:按模型分色的 7 日用量趋势
  • 日期切换:查看任意历史日期数据
  • 模型筛选:可选择显示特定模型

🔔 顶栏徽标(可选)

  • 实时显示:会话顶栏显示今日总 Token
  • 点击展开:点击徽标查看明细
  • 紧凑格式:K/M/B 简化显示,悬停查看精确值
  • 移动端排布(≤1023px):顶栏一行依次为 汉堡 │ PTC 模式 │ 剩余表计 │ 用量徽标 │ 后台任务,徽标位于倒数第二、jobs 最右,与抽屉图标同一水平互不遮挡;≤380px 自动换行并保持视觉顺序
  • 移动端紧凑:隐藏「tok」后缀并收紧内边距,保证 390px 宽度下一行完整显示

💾 数据持久化

  • 按天落盘:~/.dsh/storages/dsh-token-usage-xc/<YYYY-MM-DD>.json
  • 重启不丢:重启后数据自动恢复
  • 自动清理:7 天自动清理旧数据
  • 启动回填:回填今天早于插件加载的用量

🔧 数据来源

来源说明
session/event监听 assistant/message 事件的 usage 字段
模型归属直接读取事件的 message.source.model
会话水位按 seq 去重,避免重复计数

为什么不自己解析 session.jsonl.zstd?
该文件是多 zstd 帧拼接,需要像持久化后端那样扫描帧边界逐帧解码。插件统一走 sessionQuery,避免重复实现这套复杂逻辑。

📦 安装

# 使用 DSH CLI
dsh plugin --profile web add dsh-token-usage-xc

# 或使用 npm
npm install dsh-token-usage-xc

安装后重启 DSH,在设置页可看到新增的「今日 Token 用量」分区。

⚙️ 配置

选项默认值说明
enabledtrue启用统计
refreshIntervalSec60前端刷新间隔(10-3600秒)
backfilltrue启动时回填今日用量
headerBadgefalse会话顶栏显示总 Token 徽标

🎮 使用

查看今日用量

  1. 打开 DSH 设置
  2. 找到「今日 Token 用量」分区
  3. 查看按模型分桶的明细数据

查看 7 日趋势

  1. 在用量面板点击「趋势」标签
  2. 查看堆叠柱状图
  3. 点击日期查看详情

启用顶栏徽标

  1. 在设置中打开「会话顶栏显示今日总 Token」
  2. 会话页顶栏将显示今日总量
  3. 点击徽标可快速查看明细

🔌 数据接口

提供 RPC 接口供其他插件调用:

// rpc.call("/api", "dsh-token-usage-xc/today", {})  → 物理路由 POST /api/dsh-token-usage-xc/today
// (0.2.24 起首选;dsh <0.1.5 或宿主带 profile 补丁时旧通道 rpc.call("/dsh-token-usage-xc","today") 亦在)
{
  available: boolean;
  date: string;           // 'YYYY-MM-DD'
  totalTokens: number;
  requests: number;
  models: {
    model: string;
    modelName: string | null;
    provider: string;
    uncachedInputTokens: number;
    outputTokens: number;
    cacheReadTokens: number;
    cacheWriteTokens: number;
    totalTokens: number;
    requests: number;
  }[];
}

// rpc.call("/api", "dsh-token-usage-xc/last7days", {})
// 返回最近 7 日的汇总数据

📐 统计口径

  • 总 Token = uncachedInput + cacheRead + cacheWrite + output
  • 缓存命中率 = cacheRead / (uncachedInput + cacheRead) × 100%
  • 仅计最终 usage:每个 assistant/message 恰好一条,天然无重复
  • 按事件时间归档:根据 event.time 归到 YYYY-MM-DD

📄 许可证

MIT

🔗 链接

  • GitHub
  • npm
  • 问题反馈