DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-token-cost

d

dsh-token-cost

Manifest valid

Per-project LLM token usage and RMB cost in the DSH Web sidebar, split by input (cache miss), cache hit, and output with model price auto-pricing.

UI (client)hasBundlePatch

dsh-token-cost

A DSH plugin that shows per-project LLM token usage and converts tokens to RMB cost, split into:

  • 输入(未命中) — uncached input tokens
  • 命中 — cache-hit input tokens (cacheReadTokens)
  • 输出 — output tokens

Costs are calculated from the model's standard price table (CNY per 1M tokens). Unknown models are listed with their token counts but no cost, so you can add/override prices without touching code.

Features

  • Reads local DSH session logs (~/.dsh/sessions or $DSH_HOME/sessions).
  • Aggregates by project (the session cwd) and by model.
  • Adds a 💰 button to the DSH web sidebar footer; the panel shows project totals and expandable model-level breakdown.
  • Zero runtime npm dependencies: uses Node's built-in node:zlib Zstandard decoder.
  • Loopback-only HTTP API (/dsh-token-cost/*).

Install

Install the subdirectory dsh-token-cost, not the parent dsh plugin folder. The parent folder has no package.json, so installing it produces no sidebar button.

Use the absolute path (the path contains a space, so quote it):

dsh plugin --profile web add "file:/Users/dg/Documents/dsh plugin/dsh-token-cost"

Or, from inside this directory:

cd /Users/dg/Documents/dsh plugin/dsh-token-cost
dsh plugin --profile web add "file:$PWD"

If you previously installed the wrong folder, remove it first:

dsh plugin --profile web remove "dsh plugin"
dsh plugin --profile web add "file:/Users/dg/Documents/dsh plugin/dsh-token-cost"

Then restart dsh web and refresh the browser. A 💰 button appears at the bottom of the sidebar.

You can also use the included installer script:

./scripts/install.sh

How it works

The host plugin scans every session.jsonl.zstd / session.jsonl under the DSH sessions directory. It replays:

  • session.cwd → project
  • request/header → current model
  • assistant/chunk { type: 'usage' } and assistant/message.usage → input / cache-hit / output tokens

The same (turn, step) usage sample is de-duplicated (a later assistant/message replaces the earlier usage chunk), matching DSH's own token-meter accounting.

Price table

Built-in DeepSeek official RMB prices (元 / 1M tokens):

ModelInput (miss)Cache hitOutput
deepseek-chat / deepseek-v4-flash20.58
deepseek-reasoner / deepseek-v4-pro4116

You can override prices in the profile's cordis.patch.yml (a patch row replaces the whole config, so include every price you want to keep):

- id: token-cost
  config:
    prices:
      deepseek-chat:
        input: 2
        hit: 0.5
        output: 8
      deepseek-reasoner:
        input: 4
        hit: 1
        output: 16
      deepseek-v4-flash:
        input: 2
        hit: 0.5
        output: 8
      deepseek-v4-pro:
        input: 4
        hit: 1
        output: 16

API

  • GET /dsh-token-cost/api/stats — full per-project/per-model JSON
  • GET /dsh-token-cost/api/prices — active price table
  • GET /dsh-token-cost/healthz — liveness

License

MIT

Compatibility

DSH 0.1.7-rc.2: failedDSH 0.2.0-rc.1: failedDSH 0.2.0-rc.2: failed

Versions

Latest versionPublishedSize
0.1.0——
0.1.1——
0.1.2——
0.1.3——
0.1.4——
0.1.5——

Comments

Loading…

Similar plugins

dsh-cost-tracker

Per-model token cost tracking with configurable cache-hit/miss, output and peak-window pricing, a live session cost bar, and unconfigured-model flags.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 0

dsh plugin --profile web add dsh-cost-tracker

Per-turn and session-wide LLM cost metering: a dollar cost line under each message, a session cumulative total with hover breakdown, and an LLM+web price auto-refresh tool.

Tools & CapabilitiesTerminal & ClientsModels & ProvidersManifest valid

★ 0

dsh plugin --profile web add dsh-llm-cost

by LAwLi3tCoding

DSH API usage and cost ledger with per-pool reports and CNY/USD display

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 22, 2026

dsh plugin --profile web add dsh-api-ledger

by Angelyeye

Tracks DeepSeek Harness LLM token usage and cost (CNY, peak/off-peak pricing) with a settings dashboard, agent tools, HTTP API and persistent storage.

Tools & CapabilitiesDevelopment & InfrastructureTerminal & ClientsModels & ProvidersManifest valid

★ 1

MIT

JavaScript

Oct 24, 2026

dsh plugin --profile web add @angelyeye/dsh-cost-tracker

by Yvesgao

DSH 插件:回答前先预估 token 用量与 DeepSeek API 费用,回答后展示实际账单(Web 聊天内嵌行)

Tools & CapabilitiesManifest valid

★ 2

↓ 27/wk

MIT

JavaScript

Aug 30, 2026

dsh plugin --profile web add dsh-cost-estimate

by wojiao42

该仓库暂未提供项目说明。

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Oct 7, 2026

dsh plugin --profile web add dsh-token-cost