AI Agent Hub
Back to plugins
🖥️

dsh-usage-cost

Client Updated 2026.08.24

Run the following command in DeepSeek Harness:

dsh plugin install lhh666-6/dsh-usage-cost

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install lhh666-6/dsh-usage-cost in your terminal to install the plugin (source at https://github.com/lhh666-6/dsh-usage-cost); after restarting or switching profiles once, the usage pill appears in the status bar the moment a conversation starts.

About this plugin

Watching code stream into your editor and then hunting through a billing dashboard to figure out how many tokens that session actually cost — if that small pang of anxiety sounds familiar, dsh-usage-cost was built for you. The moment a conversation starts, a compact pill in the status bar begins ticking in real time: model name, input and output token counts, and running session cost, all at a glance. During streaming the numbers scroll live with a tilde mark flagging estimates; once the response finishes, authoritative usage figures returned by DeepSeek silently replace the estimates for an exact final record.

Under the hood the plugin works in three layers. While tokens stream, a local gpt-tokenizer estimates counts with throttled updates every 50 chunks or 100 ms. When the request completes, DeepSeek-prompt_tokens, completion_tokens, prompt_cache_hit_tokens, and prompt_cache_miss_tokens calibrate the numbers to their exact values. Cost is then computed against a configurable price table (defaults: deepseek-chat 0.5 / 2 / 8 and deepseek-reasoner 1 / 4 / 16 CNY per million tokens), and daily, monthly, and per-model accumulators are persisted locally so they survive restarts. Clicking the pill opens a detail panel with tokens/s, latency, cache-hit ratio, and data status (estimating / calibrated / incomplete).

Everything is computed and stored on your machine; nothing is sent anywhere. The plugin only observes session events and provider usage payloads — it injects no instructions, tools, or request fields visible to the model. If you call DeepSeek frequently, juggle multiple sessions, or simply want to keep an eye on API spend without leaving your editor, this is a drop-in, zero-config companion that starts working the instant your first token streams in.

Use Cases

  • Monitor real-time token consumption and cost during streaming conversations
  • Review daily and monthly API spend to stay within budget
  • Track per-session usage in isolation when running multiple conversations

Best For

  • Developers who call the DeepSeek API frequently
  • Individuals and teams tracking LLM usage costs
  • Privacy-conscious users who prefer local-only data persistence