token-usage-counter
Persistent provider-reported token usage totals with per-session, per-model, and daily activity statistics.
持久化 provider 上报的 Token 用量统计,支持按会话、按模型和按日活跃度查看。
How to install
dsh plugin add dsh-token-usage-counter About
Token 用量统计插件 为 DeepSeek Harness 提供持久、准确的 Token 用量统计。插件读取 provider 上报的真实用量,区分输入(未命中)、输入(命中)、缓存写入和输出,并提供 累计统计、今日数据、热力图、分模型统计以及 /tokens 命令。 功能 | 能力 | 说明 | | --- | --- | | **精确分桶** | 输入(未命中)、输入(命中)、缓存写入和输出保持独立。 | | **持久化累计** | 数据写入 Harness 的 usage-stats settings 命名空间,重启不会归零。 | | **多维统计** | 支持全局、会话、Provider / 模型三个维度。 | | **今日数据** | 单独展示当前本地日的 Token 用量和调用次数。 | | **动态热力图** | 根据容器宽度在 12–52 周之间调整,避免右侧留下大片空白。 | | **悬停详情** | 悬停或键盘聚焦热力图单元格,查看日期、总 Token 和调用次数。 | | **安全提交** | 只在成功消息确认后提交 usage-only chunk,避免失败请求和重试重复计数。 | | **交互命令** | 挂载 commands 服务时提供 /tokens,随时查看累计摘要。 | 安装 推荐安装已经发布到 npm 的 DSH Bundle。下面的命令会…
Recommendation signals
Meta
- License
- MIT
- Language
- TypeScript
- GitHub stars
- 1
- mo. downloads
- 1.4K
- Last push
- 2026-09-15
- Created
- 2026-08-16
Basic safety check
- Findings
- None
- Sources
- curated:awesome-dsh-plugin.com, curated:awesome-dsh-plugin/awesome-dsh-plugin
- Topics
- ai-developer-tools, cordis, deepseek, deepseek-harness, developer-tools, dsh-plugin, heatmap, llm, llm-observability, prompt-cache, token-analytics, token-counter, token-usage, typescript, usage-statistics
Related plugins
TokenLedger
zh667/TokenLedger
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
dsh-context
bowenliang123/dsh-context
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
dsh-usage-statistics-panel
HaoyueQin/dsh-usage-statistics-panel
Usage statistics settings panel: 26-week activity heatmap, daily token trend with a cache hit-rate curve, per-model donut and breakdown, time-range filters, summary cards, one-time historical backfill and lossless rebuild.
dsh-all-usage
ParticleLight/dsh-all-usage
Analyze usage across models, providers, workspaces, and time ranges — including custom start/end dates over the full retained history — with live cache-hit visibility and separate model and provider breakdowns. Includes hourly single-day trends, daily cross-day trends, a 53-week GitHub-style heatmap, usage streaks, model and workspace Token-share donut charts with Token, cost, and percentage details, independent combinable filters, cache-efficiency trends, DeepSeek account balance, workspace aliases, CSV export, and a durable ledger that preserves successfully flushed usage after session deletion — and after a workspace is deleted, where its recorded usage is summed into one Deleted row — and rebuilds incrementally — on restart, unchanged sessions are applied from the ledger without re-reading their logs (a per-session log revision is the change signal), and only changed/new events are folded. The workspace registry is kept fresh automatically through the DSH domain/changed probe: only added/removed workspaces are reprocessed incrementally, unchanged workspaces reuse their computed aggregates and ledger with zero rescan, and usage is strictly limited to DSH-registered workspaces (unregistered cwds are ignored). After a scan, lightweight revision status fetches full history only when the Host/data state changes and exposes non-sensitive sync health (revision reuse, rereads, ledger recovery, and failures). Token accounting is explicit: input is fresh (cache read/write and reasoning are separate buckets) and zero-usage replays never overwrite recorded usage. Chinese uses local time, English uses UTC; API access is loopback-only.