dsh-token-usage
Run the following command in DeepSeek Harness:
dsh plugin install Nigel211/dsh-token-usage
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install Nigel211/dsh-token-usage in your terminal to install; the source code is available at https://github.com/Nigel211/dsh-token-usage. After installation, restart the dsh web service to access the Token Usage panel from Settings.
About this plugin
Developers who call DeepSeek or other model APIs through DSH day in and day out often lack a lightweight built-in way to answer simple questions: how many tokens did I consume, where exactly is the cost, which model accounts for the most spend, and how much balance is left on my accounts. dsh-token-usage fills that gap with zero third-party dependencies, deriving every number directly from DSH's persistent session logs and back-filling history automatically after a restart—no extra deployment or data migration required.
Three pillars define the plugin's core capabilities. First, granular usage aggregation: input, output, cache-hit, and reasoning tokens are break down by model, by session, and across time windows (today, last 7/14/30 days). Second, cost estimation: a built-in DeepSeek official RMB price table with peak/off-peak tiered pricing (Beijing time), with entries fully editable and persisted; unknown models can be priced on the fly and immediately included in totals. Third, multi-platform balance queries: template-based lookups for DeepSeek, OpenRouter, SiliconFlow, New-API, and more, auto-enumerated per configured model route, with a keep-last-good cache and a one-click recharge link for the official DeepSeek platform.
For visualization, the plugin ships a full dashboard inside DSH Settings: a four-curve dual-axis usage trend chart, a monthly calendar activity heat-map, a model-share donut chart with hover-linked highlighting, and three detail tables (by model, by session, recent calls). A compact always-on readout below the input box shows current-session tokens and today's cost at a glance. All charts are hand-rolled SVG with no charting library overhead.
It is ideal for individual developers watching their API spend and for teams that need to attribute cost by model, monitor balances across providers, and stay ahead of quota limits. No extra configuration is needed—once installed, the Token Usage panel is ready in DSH Settings.
Use Cases
- Tracking token consumption and cost breakdown when calling DeepSeek APIs daily
- Decomposing spend by model and monitoring balances across multi-provider routes
- Auditing API expenses with exported records and time-window trend analysis
Best For
- Solo developers using DeepSeek within the DSH environment
- Small teams managing mixed-model API costs
- Ops or full-stack engineers who monitor API balances and top up promptly
Related Plugins
A security red-team prompt plugin for DeepSeek-V4 that uses code-formal mapping and zero-trigger system prompts to enable unconditional output, intended for authorized testing and research only.
Adds an Auto approval mode on the official workspace-write sandbox, classifying semantic risks, asking when ambiguous, and denying destructive operations.
Undo/rollback system for DSH: config & plugin snapshots, one-click undo/redo/restore, message-level revert, secret masking, safe mode, and offline WebUI/GUI/CLI rescue tools for when DSH won't start.
Packages all 87 SKILL.md files from upstream reverse-skill as a DeepSeek Harness plugin that auto-registers them for authorized reverse engineering, penetration testing, and security research.