AI Agent Hub
Back to plugins
🖥️

dsh-token-usage-cost

Client Updated 2026.09.05

Run the following command in DeepSeek Harness:

dsh plugin install arthur20150522/dsh-token-usage-cost

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

Run dsh plugin install arthur20150522/dsh-token-usage-cost inside DeepSeek Harness to install this plugin; the source repository is available at https://github.com/arthur20150522/dsh-token-usage-cost .

About this plugin

When you are juggling multiple models and frequent tool calls inside DSH (DeepSeek Harness), token spend tends to accumulate silently with almost no visual billing feedback in the Web UI. dsh-token-usage-cost puts the bill in plain sight: after every turn, a persistent cost chip in the action bar shows input/output tokens, the per-turn amount, and a short model name, while a session-cumulative line above the prompt bar tracks the running total for the entire conversation. The plugin is purely presentational-it never injects data into model context and does not alter DSH's native token statistics.

Pricing data requires no manual maintenance. The plugin concurrently fetches from several authoritative sources (LiteLLM community table, OpenRouter, models.dev), auto-detects each format, and merges the results into a price table of over 9,600 entries cached on disk with a 7-day TTL. Hit the reconciliation button and it enumerates every model you have configured in DSH, matches them against the price table, writes confirmed mappings back into modelMap, and lists any misses for you to add overrides. A three-tier resolution order (manual overrides, modelMap, exact or suffix table key) ensures private or brand-new models are never left unpriced.

For realistic enterprise billing, the plugin supports configurable IANA-timezone time bands, each with a base multiplier, per-model multipliers, and direct per-model unit-price overrides, including cross-midnight windows such as 22:00 to 06:00 the next day. Every model invocation is attributed to its historical timestamp and actual source model, so mid-turn model switches and post-tool-call re-invocations are each priced independently rather than recalculated with whatever model is currently selected. Currency defaults to CNY with an adjustable FX rate or switches to USD instantly, and all config changes take effect immediately without a restart.

Ideal for DSH users running multi-model workloads, tracking per-turn and per-session costs, or operating under tiered and time-based enterprise pricing. Zero-dependency pure JavaScript, MIT-licensed, with client-side edits effective on the next page refresh.

Use Cases

  • Check per-turn and session-level costs after a multi-model conversation
  • Accurately attribute each call under enterprise peak/off-peak pricing rules
  • Auto-reconcile a newly released model against the price table and write mappings back in one click

Best For

  • Developers orchestrating multi-model workloads in DSH
  • Data and ops teams that need ongoing token-cost visibility
  • AI platform operators governed by tiered or time-based enterprise pricing