When using DeepSeek Harness for model inference or development, tracking token consumption for an API key on a monthly basis is a common requirement. Existing approaches either rely on cloud-based statistics or provide limited statistical dimensions. The following is an introduction to a sidebar monthly token statistics plugin focused on local data.
What It Is¶
This is a DeepSeek Harness plugin that displays the token usage of a specified API key for a calendar month in the sidebar. It is maintained by greyhackintoch-dev, uses the MIT license, reads local data only, and automatically resets the counter at 00:00 on the 1st of each month.
Core Features¶
This plugin mainly addresses the need for “local monthly statistics”. Its capabilities are as follows:
- Sidebar display: Displays the calendar-month token usage of the API key above the Settings item. Clicking the row shows details, including the contribution from each source (DSH home, opencode, Pen, WorkBuddy).
- Multi-source statistics: Supports aggregating usage from DSH home, opencode, Pen, and WorkBuddy.
- Local-only and reset: Reads local data only and does not send network requests. The counter resets at 00:00 on the 1st of each month.
- Cross-device aggregation: Supports configuring
trackKeysto aggregate usage of the same key across different machines into a single number.
Installation and Activation¶
The plugin must be installed from the command line. After installation, dsh web must be restarted for it to take effect.
dsh plugin --profile web add github:greyhackintoch-dev/dsh-month-tokens
Typical Usage¶
After installation, a Token statistics row appears in the sidebar. If you want to change from “machine-based counting” to “key-based counting”—that is, aggregate usage of the same key across multiple devices—you need to configure trackKeys. After configuration, usage of the same key on different devices is merged based on the key fingerprint.
Use Cases and Caveats¶
- Web Profile only: The plugin supports only the
webbrowser shell and does not support the official DSH Desktop app. Third-party desktop clients that wrap the Web profile can use it normally. - Does not track web-search: The web-search path sends requests directly to the provider and does not record them, so the plugin cannot track usage for this path.
- Counts are a lower bound: Because it relies on local records, the plugin counts only the portion it can read—that is, a “lower bound” rather than the “total”. Calls that do not leave local records (such as scripts or unrecorded IDEs) are not counted.
- Restart required: After running the installation command, the plugin writes to the configuration file, but the
dsh webinterface must be manually restarted to see the effect.
Summary¶
This plugin provides a practical solution for local monthly statistics and can clearly display the usage of each component. For details or source code, refer to the relevant directory page or GitHub repository.