Preface¶
After connecting to multiple models simultaneously, it becomes difficult to answer a specific question: how many tokens were consumed this hour, by this model, by this provider. Logging into each console only shows the total amount. Connecting to platforms like Langfuse or Helicone requires changing code and requests to leave the network. Writing scripts to parse logs yourself lacks an interface and makes drilling down difficult. The dsh-api-usage-dashboard introduced below takes a different path: the plugin directly reads Harness’s own session logs. Once installed, a usage panel appears in the left sidebar without needing an interface, API keys, or network requests. It is maintained by LENS-Views and categorized under the client category in the community plugin directory.
What is it¶
dsh-api-usage-dashboard is a DeepSeek Harness (DSH) plugin. After installation, a bar chart icon appears in the sidebar. Clicking it opens the Model API Usage Dashboard: call counts and token numbers per provider, per model, and per hour. The data source is Harness’s session logs. New providers added later will automatically appear in the chart upon their first call without the need for additional registration. The package name is dsh-api-usage-dashboard. As of writing, the version is 1.0.2, MIT licensed, with zero runtime dependencies, and requires Node >= 20. Credits include LENS-Views and DSH Agent (deepseek-flash), the latter signed as plain text.
Core Features¶
The following capabilities are all from implemented items in the README:
- 24-hour bar chart: Fixed 00:00–23:00 full scale. Hours without calls retain empty slots, so the graph won’t distort due to “only a few hours in a day.”
- Daily drilling down: Date picker with quick tags for the last 7 days.
- Hover: Displays dashed guide lines and tooltips (time range / tokens / request count); click to pin the bar for comparison.
- Toggle: One-click switch between Tokens / Request Count. The Y-axis automatically rounds (1/2/5×10ⁿ) and includes grid lines.
- Color coding: Each provider and model has a fixed color; colors span cards, mini charts, and detail tables; tokens use blue, requests use amber.
- Mini charts: A 24-hour mini bar chart for each model, making it easy to see which is consuming tokens.
- Detail table: Provider summary plus model details, including calls, input, cache, output, total, and share.
- Theme: Follows the host theme, bilingual (Chinese/English), and auto-refreshes every 60 seconds.
Installation & Activation¶
The installation method provided in the README is using install_bundle in DSH’s plugin manager, not directly entering the package name in the command line:
# In DeepSeek Harness's plugin manager, select install_bundle
dsh-api-usage-dashboard
- Open the DSH Plugin Manager and select install_bundle
- Enter the package name
dsh-api-usage-dashboard(published to npm), or point to a local directory - Click the bar chart icon in the sidebar to complete
The first opening scans all session logs. The reference in the README is about 1–2 seconds for 23 sessions. Afterwards, it uses cache, resulting in basically instant loading.
When not using npm, the README provides two other entries: copy the repository locally and install via directory path, or fill github:LENS-Views/dsh-api-usage-dashboard directly in install_bundle. The repository is public and has no build steps.
Configuration¶
The three items in the cordis.patch.yml config all have default values and are usable without changes:
- insert:
- id: api-usage-dashboard
name: 'dsh-api-usage-dashboard'
config:
cacheTtlMs: 20000 # Scan result cache (ms), 0 = rescan every time
maxSessions: 0 # Scan only the latest N sessions, 0 = all
scanConcurrency: 4 # Number of concurrent session reads (1–8)
After changing host code, use the plugin manager to toggle the api-usage-dashboard line once to enable hot reload; change browser code and refresh the page.
Metrics Definition¶
| Metric | Meaning |
|---|---|
| Call Count | Number of model call records recorded in the session, including non-conversational calls like compressed summaries |
| Input Tokens | Inputs that missed the cache (inputTokens) |
| Cache Tokens | Inputs that hit the prompt cache (cacheReadTokens) |
| Output Tokens | Model generation (outputTokens) |
| Total Tokens | totalTokens = Input + Cache + Output |
Rows are separated by model under the same provider; different providers are counted separately even if the model names are the same.
Privacy Boundaries¶
- Only reads session logs from local
~/.dsh/sessions - Does not read or forward any API keys
- Does not make requests to any external services
- Only registers a
127.0.0.1route; non-local requests get 403 directly
Applicability & Caveats¶
Suitable for people already running multiple models in DSH and want to see hourly usage by provider and model. It counts actual calls made by Harness; requests bypassing Harness won’t appear in the chart; this is also the premise for it “not calculating wrongly.”
Two points to note. First, the plugin runs under the current DSH process identity and can read the entire ~/.dsh/sessions. Before installation, check the source code and license to confirm this data scope meets expectations. Second, the README explicitly states there is no monetary amount (¥) field yet; it requires the unit price of each provider to fill it. However, self-built gateways usually don’t publish public prices, so this column is currently missing.
Conclusion¶
Its value lies in zero configuration: directly reading existing session logs for aggregation instead of maintaining parallel counters, avoiding drift from the host. Directory page and source code:
- Directory page: https://www.skillhub.cn/plugins/LENS-Views/dsh-api-usage-dashboard
- GitHub: https://github.com/LENS-Views/dsh-api-usage-dashboard