Introduction

When running agents in DeepSeek Harness (hereinafter referred to as DSH), the connected vendors are often more than one: the official API, huoshan, hebox, tokenrhythm, etc. While persistent session logs inherently carry token accounting and provider/model source information, there is no default view capable of directly answering questions like “how much each vendor used during this period, what the cache hit rate is, and the approximate cost based on unit prices.”

The existing dsh-usage-stats plugin aggregates usage by workspace, but lacks the vendor dimension. The dsh-usage-vendor-stats introduced below fills this gap: it performs usage statistics with vendors as the primary dimension.

What is this?

dsh-usage-vendor-stats is a community usage statistics plugin for DSH, maintained by kirigayakazima, licensed under MIT, and currently at version 0.2.0. It aggregates API usage by “Vendor (Subscription / Official API) × KPI” and provides a GitHub-style calendar heatmap, trend line charts, and daily/monthly/hourly statistical dashboards.

Data does not require separate collection: when the plugin is activated, it automatically backfills all historical sessions, and subsequently monitors session events for incremental aggregation. Data is not lost after plugin uninstallation or restart.

Core Features

Vendor Dimension and KPI Cards

  • Auto-discovery of all used vendors (e.g., huoshan, hebox, deepseek-official, tokenrhythm, opencode), with the ability to manually mark the “Subscription / Official API” type and set aliases, persisted to the KV store at $DSH_HOME/storages.
  • KPI Cards: Total Tokens (Input / Cache Hit / Output / Reasoning breakdowns), Cache Hit Rate, Model Call Counts, Turn Counts, Session Counts, and Vendor Counts, accompanied by multi-colored Token composition bars.
  • 53-Week Heatmap: GitHub-style green theme where color intensity is based on daily model call counts; clicking a vendor chip filters the view, and hovering displays details by vendor/Token.
  • Trend Line Chart: Dual-axis for Tokens/Calls, defaulting to daily aggregation, with hourly aggregation when “Today” is selected.
  • Daily Details: Token/Cache/Output/Reasoning/Hit Rate/Turns for the last 30 days.
  • Monthly Summary: Aggregation of all historical data by month.

Tables, Drilling Down, and Export

  • Vendor KPI Table: Sorted by Total Tokens, including Hit Rate, Model Count, and Type Tags; clicking a row expands to show per-model consumption for that vendor.
  • Time Presets: Today / 7 Days / 14 Days / 30 Days / 90 Days / All.
  • Cost Estimation: Set a unit price (per million tokens) for each vendor; the table displays a column with the converted estimated costs.
  • CSV Export: Daily/Monthly/Vendor tables are all exportable.

Health and Performance Cards

Average TTFT (First Token Latency), Generation Speed (t/s), Peak Context, Request Error Rate, and Total Duration for Models/Tools, aggregated from DSH’s sessionStats projection.

Data Definitions

  • All data comes from DSH’s persistent session logs: assistant/message events carry usage (token accounting) and message.source.{provider,model} (vendor/model source).
  • Token statistics align with DSH definitions: inputTokens for non-cache hits, cacheReadTokens for cache hits, outputTokens for output, reasoningTokens for reasoning, and cacheWriteTokens for cache writes.
  • Cache Hit Rate = Hits / (Hits + Missed Input) × 100%

Installation and Activation

This is a standard DSH community plugin package (declaring a dsh.bundle manifest + web client component), installable directly from GitHub:

dsh plugin --profile web add "github:kirigayakazima/dsh-usage-vendor-stats"

After installation, simply refresh the page; no manual configuration changes or restart is required.

For local development requiring manual registration, create a symbolic link first, then modify the patch configuration:

  1. Place the plugin directory anywhere, and create a symbolic link to it under $DSH_HOME/profiles/node_modules/ (use junction for Windows):
New-Item -ItemType Junction -Path "$env:DSH_HOME\profiles\node_modules\dsh-usage-vendor-stats" -Target "<本目录绝对路径>"
  1. Add an insert entry in $DSH_HOME/profiles/web/cordis.patch.yml:
- insert:
    - id: usage-vendor-stats
      name: dsh-usage-vendor-stats

The user patch layer will be hot-reloaded; refresh the page to apply changes after saving.

Typical Usage

  1. Open “Settings” at the bottom of the sidebar to find the “API Usage Statistics” page, or click the “Usage Statistics” entry at the bottom of the sidebar to open the fullscreen panel.

  2. Heatmap color intensity represents daily call counts; clicking a vendor chip or table row allows filtering/drilling down.

  3. In “Vendor Management”, set aliases and types (Subscription / Official API) for each vendor, and optionally set a unit price (per million tokens) for cost estimation.

Following these steps, the dashboard will display the vendor KPI table and daily/monthly details based on the selected time range; clicking a vendor row allows further drilling down to per-model consumption.

Interface and Architecture

The Host side (lib/index.js) scans persistent session logs to aggregate usage and registers two data routes via the webServer service:

  • GET /api/usage-vendor-stats: Statistical snapshot (Vendor / Model / Day / Month / Hour / Summary)
  • POST /api/usage-vendor-stats/vendor: Set vendor alias, type, and unit price

The Client side (lib/client.js) is a browser bundle that registers the settings page (settings.section slot), the sidebar footer entry (sidebar.footer.action), and the fullscreen panel (shell.overlay).

The plugin has no third-party runtime dependencies: the Host side uses only the Cordis service, and the Client side uses only React provided by the module registry. Daily changes to lib/client.js take effect by refreshing the page; changes to the Host side require restarting DSH.

Use Cases and Considerations

Suitable for DSH users who connect to multiple vendors simultaneously and wish to distribute and verify usage and costs, as well as those focused on cache hit rates and response performance. Pre-use considerations:

  • The plugin runs with the permissions of the current DSH process; it is recommended to review the source code before installation to verify behavior, then decide whether to enable it; the license is MIT.
  • Data is read from persistent session logs, with historical sessions automatically backfilled when the plugin is activated; no manual import is required.
  • The estimated cost column is calculated based on the unit price per million tokens you input.

Summary

In summary: dsh-usage-vendor-stats aggregates usage data scattered across DSH session logs by vendor dimension into a dashboard that is filterable, exportable, and capable of cost estimation; it is ready to use immediately upon installation without configuration changes.

Directory Page: https://www.skillhub.cn/plugins/kirigayakazima/dsh-usage-vendor-stats
Source Code Repository: https://github.com/kirigayakazima/dsh-usage-vendor-stats

It should be noted that the SkillHub community directory is an independent site with no official affiliation to DeepSeek / Hypi.