Skip to content

nonewind/dsh-spend

52Last commit Aug 15, 2026

dsh-spend DSH plugin

This plugin adds a floating widget to the bottom-right corner of the DSH Web UI, showing real-time token usage, multi-dimensional statistics, and estimated costs. It automatically recognizes subscription-based (Code) and pay-as-you-go (Token) billing plans from a built-in knowledge base of 17 providers and 131 models. The panel includes four tabs: Overview, Today, Performance, and Call Details, with workspace filtering and data export.

How to install the dsh-spend DSH plugin

dsh plugin --profile web add dsh-spend

Copying does not run this command. Review the repository and version before installing the dsh-spend DSH plugin.

dsh-spend DSH plugin data source

dsh-spend DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-spend DSH plugin can do

  • Floating capsule showing estimated cost and total tokens, with hover preview and click-to-expand detail panel
  • Overview tab with KPI bar, monthly projection, cache hit rate, budget alerts, plan usage (auto-detected Code/Token), 72-hour time-series chart, GitHub-style activity heatmap, top providers/models, and 31-day trend
  • Today tab with hourly token and cost breakdown for the current day
  • Performance tab with per-model TTFT (mean/P50/P90), generation speed (tokens/s), total latency, and hourly TTFT/speed curves
  • Call Details tab with session×model breakdown, per-working-directory stats, per-session stats, recent calls (with anomaly markers), billing rate table, and CSV/JSON export
  • Auto-detects billing plans (Code vs Token) for 17 providers including DeepSeek, OpenAI, Anthropic, Google, xAI, and more, with built-in pricing data (verified 2026-08-14)

Where the dsh-spend DSH plugin fits

  • Monitor real-time token consumption and estimated costs across multiple AI providers
  • Analyze model performance metrics such as TTFT and tokens per second
  • Review call details per session, model, or working directory for cost attribution
  • Track budget usage with alerts when spending exceeds 80% or 100% of monthly budget

Who the dsh-spend DSH plugin is for

  • Developers using DeepSeek Harness to orchestrate AI agents and workflows
  • Teams or individuals who need to manage and optimize API spending across multiple providers

dsh-spend DSH plugin limitations

  • Only counts calls that include provider usage data (consistent with harness token-meter projection)
  • Cost estimates are not bills; actual charges may differ from calculated values
  • Log decoding failures are counted as decodeErrors and shown in the footer
  • Requires DSH host environment with web profile and proper session persistence

dsh-spend DSH plugin: from the repository README

Quoted from the nonewind/dsh-spend README, the upstream source of the dsh-spend DSH plugin. Copyright remains with the original authors.

> Token usage & cost monitor for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — floating widget with multi-dimensional stats, time-series charts, auto-detected billing plans (Code/Token) and estimated spend. > > dsh 用量与计费仪表盘:token 调用量、按模型 / 供应商 / 时间统计、预计费用,自动识别订阅制(Code)与按量(Token)计费计划。 简体中文 | [English](README.en.md) 在 dsh Web UI 右下角显示一个**悬浮用量窗口**,查看 **token 调用量、多维度统计与预计计费金额**。 交互方式: - **悬浮胶囊**(右下角):始终显示预计费用与总 Token; - **hover**:浮现摘要预览(费用、Token、输入 / 输出 / 缓存读、调用次数、**今日小计**); - **点击**:展开详情面板,四个标签页;面板顶部有**工作区筛选**下拉(按项目限定全部统计口径,支持逐级下钻子目录): - **总览**(仪表盘,参考主流用量面板的 KPI + 趋势布局):**统计栏**(预计花费(月)+ 构成、**当月预计**(本月按量外推)、按 token 估算、总 Token、调用、会话、**平均 / 次**、**缓存命中率**、**月预算**(可选配置,超 80% 胶囊变黄、超 100% 变红)、**活跃天数 / 连续使用**)+ **计划用量**(自动识别 Code/Token 计划、档位、额度使用与剩余)+ 72 小时时间曲线 + **活跃热力图**(近 52 周,GitHub 风格,颜色深度 = 当日 Token 量,悬停看 Token / 费用 / 调用)+ **费用 Top 提供商 / Top 模型**(各 6 行)+ 近 31 天趋势; - **今日**:当天的调用数、Token 与费用小结 + **今日逐小时**的 Token / 费用图表; - **性能**:每个模型的**首字延时(TTFT)均值 / P50 / P90、生成速度(tokens/s)、总延迟均值**,以及按小时的 TTFT / 速度曲线; - **调用明细**:**每个会话 × 模型**的调用次数、token 与费用明细 + **按工作目录统计**(各项目会话数 / 模型数 / 调用 / 费用)+ **按会话统计** + **最近调用**(**费用远超均值的异常调用标红点**)+ **计费单价表**,可在**独立窗口**中打开(随主窗口自

Read the full READMERepository license: MIT

dsh-spend DSH plugin questions

How do I install dsh-spend?

Run `dsh plugin --profile web add dsh-spend` in your terminal. This will install the plugin and mount it into your web profile. After installation, restart the DSH web server with `dsh web` to apply the changes. You can also install from source using `dsh plugin --profile web add github:nonewind/dsh-spend`.

Does dsh-spend support custom pricing?

Yes, you can override pricing by adding a `pricing` section under the `usage-stats` config in `~/.dsh/profiles/web/cordis.patch.yml`. The plugin uses a built-in knowledge base of 17 providers and 131 models (verified 2026-08-14), but any user-defined pricing will override auto-detection. You can also set `defaultPricing` for unknown models.

Can I export data from the panel?

Yes, the Call Details tab supports exporting data in CSV and JSON formats. You can also open the details in a separate window that auto-refreshes with the main window. The export includes session×model breakdown, per-working-directory stats, and recent call details.

How often does the widget refresh?

By default, the floating widget refreshes every 30 seconds. You can change this interval by setting `refreshSeconds` in the plugin config (minimum 5 seconds). The refresh interval is also tunable server-side via the host configuration, so you don't need to modify the page code.

Which providers and billing plans are supported?

The plugin supports 17 providers including DeepSeek, OpenAI, Anthropic, Google, xAI, Mistral, Moonshot, Zhipu, Alibaba, MiniMax, OpenRouter, and others. It automatically detects whether your plan is subscription-based (Code plans like OpenCode Go, OpenAI Codex, GitHub Copilot, Claude Code, Google AI Pro) or pay-as-you-go (Token plans). For each provider, it uses the official pricing table as of August 2026.