Introduction

When debugging model calls in DSH, a single response might be backed by multiple model requests, and the fees might also be broken down into cache hits, cache misses, and output tokens. If you only wait for the DeepSeek bill to verify, it is hard to determine the actual cost of a specific round of conversation.

dsh-session-cost solves this visibility issue: it displays the current session’s accumulated API fee on the right side of the session title bar in DSH Web/Desktop, and displays the fee for that specific round at the bottom of each completed reply.

What is this

F1shn/dsh-session-cost is a pure DeepSeek Harness plugin, maintained by F1shn, licensed under MIT.

It displays the current session’s accumulated API fee in RMB, and shows the fee for each completed round of replies at the bottom of each reply. The plugin implementation does not require filling in an API Key, nor does it require modifying configuration or manually enabling the plugin.

Core Features

The following introduces confirmed capabilities:

  • Displays the current session’s accumulated API fee in RMB.
  • Displays the fee for that specific round of replies at the bottom of each reply.
  • Distinguishes between cache hits, cache misses, and output tokens.
  • Applies peak/off-peak pricing based on request time.
  • Supports recalculating old sessions from the complete session log.
  • Pure plugin implementation; interface changes disappear immediately after uninstallation.
  • The single reply cost summarizes all model steps within that round.
  • When streaming usage and final usage belong to the same step, the final value replaces the streaming value, avoiding double billing.

Old sessions will also have their costs recalculated from the complete session log when opened.

Pricing Basis

The built-in RMB off-peak unit prices are as follows, in units of per million tokens:

Model Cache Hit Input Cache Miss Input Output
DeepSeek-V4-Flash ¥0.05 ¥1.5 ¥4.5
DeepSeek-V4-Pro ¥0.15 ¥4.5 ¥13.5

New prices take effect from 2026-08-17 00:00 (Beijing Time); previous calls are still calculated at the old price. Calls made during 09:00–12:00 and 14:00–18:00 (Beijing Time) at the new prices are calculated at peak prices, which are 2 times the off-peak prices.

Cache hit and miss tokens are directly taken from the usage in the DeepSeek response; the DSH adapter has split them into mutually exclusive counts, so the plugin does not double count.

Official Pricing Page:

https://api-docs.deepseek.com/zh-cn/quick_start/pricing

Installation and Enabling

After installation, simply restart DSH Web/Desktop; no API Key filling, configuration modification, or manual plugin enabling is required.

When dsh CLI is installed, execute:

dsh plugin --profile web add github:F1shn/dsh-session-cost

If running the CLI via the DeepSeek Harness source code, execute in the project root directory:

pnpm dsh plugin --profile web add github:F1shn/dsh-session-cost

When installing from source, first clone to the local plugin directory:

git clone https://github.com/F1shn/dsh-session-cost.git ./plugins/dsh-session-cost

Then install using the local path:

pnpm dsh plugin --profile web add ./plugins/dsh-session-cost

Typical Usage

After the above steps, you can view costs as follows:

  1. Install the plugin and restart DSH Web/Desktop.
  2. Initiate or open a DeepSeek session.
  3. View the current session’s accumulated API fee on the right side of the session title bar.
  4. View the fee for that round of replies at the bottom of each completed reply.
  5. When opening an old session, the cost is recalculated from the complete session log.

Uninstallation

When dsh CLI is installed, execute:

dsh plugin --profile web remove dsh-session-cost

When running the CLI via the DeepSeek Harness source code, execute:

pnpm dsh plugin --profile web remove dsh-session-cost

After uninstalling, restart DSH, and the accumulated fee in the title bar and the reply fees will disappear simultaneously.

Applicable Scenarios and Notes

Suitable for debugging DeepSeek model calls in DSH Web/Desktop and wanting to quickly see the current session and per-round reply costs.

Note the following scopes:

  • The amount only covers model calls that write to the current session log and include usage.
  • Other sessions, other clients, failed requests that do not return usage, and background calls not attributed to the current session log will not be counted.
  • Final billing is subject to the DeepSeek account bill.
  • The plugin runs with the permissions of the current dsh process; please check the source code and MIT license before installing.

How to Get

  • GitHub: https://github.com/F1shn/dsh-session-cost
  • Directory Page: Refers to the entry with the same name in the current DSH plugins directory.