The core architecture of DeepSeek Harness (DSH) is based on plugin extensions. In scenarios involving multiple models or multiple providers, real-time visibility into current API calls and token consumption is essential for cost control and troubleshooting. The dsh-api-usage-monitor plugin aims to provide DSH with unified usage observability. It does not rely on a specific LLM provider but generically reads the API currently in use.
Positioning and Features¶
This is a permanent DeepSeek Harness (DSH) plugin (bundle). It can present current usage and per-conversation usage on the settings page and can scan session logs to read historical usage. It remains effective after a restart.
Core Features¶
The plugin provides the following capabilities:
- Real-time current API monitoring: Monitors the connected model provider and model name.
- Current usage: Displays cumulative token usage, supports grouping by API/model, and refreshes automatically every 2 seconds.
- Per-conversation usage: Aggregates call counts, token usage, and the APIs used by session (
sessionId). - Historical records: Supports scanning usage records in persisted session logs to read usage from before the plugin started.
- Settings page presentation: Registers an independent page in the DSH settings panel to display data.
Installation Steps¶
This plugin is installed via the dsh plugin command and needs to be registered in the configuration file.
- Run the installation command:
dsh plugin --profile web add github:DrFaithinT/dsh-api-usage-monitor
- Edit
$DSH_HOME/profiles/web/package.jsonby adding"dsh-api-usage-monitor"to thedsh.profile.bundlesarray:
{
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-api-usage-monitor"
]
}
}
}
- Restart the DSH Web process:
dsh web
- Verify: Open the Settings → API Usage page to view the data.
Typical Usage¶
The plugin supports quick actions via @ mentions in conversations or detailed views through the settings page. Common operations include:
- View data: Ask about the currently tracked token count.
- Adjust refresh: Change the settings page refresh interval from 2 seconds to 5 seconds.
- View history: Add usage statistics grouped by day.
- Version management: Roll back to the previous version.
Notes¶
- Data storage: All data is stored only in plugin memory and is not written to disk or uploaded.
- Persistence: The permanent version of the plugin remains effective after restart; the v1 dynamic mount version disappears after restart.
- Communication method: Host and Client communicate only over same-origin HTTP JSON and do not rely on Typert RPC.
- License: MIT License.
Summary¶
dsh-api-usage-monitor provides DSH users with a lightweight API usage observability solution. Through the settings page and historical log scanning, it can meet various needs ranging from real-time monitoring to historical review.