Introduction

DeepSeek’s official pricing strategy differentiates rates by time periods: Monday to Friday 9:00–12:00 and 14:00–18:00 are peak periods, while the remaining times are off-peak periods. In the DeepSeek Harness (DSH) web interface, without helper tools, developers find it difficult to intuitively see which pricing period is currently in effect and what the real-time cost of a session is. The dsh-peak-pricing plugin adds a line of information at the bottom of the Composer, directly displaying the currently effective pricing period, remaining duration (in seconds), and cumulative session cost, helping developers adjust their work plans according to cost pacing.

Plugin Overview

This is a DeepSeek Harness web plugin maintained by Oliver0804 under the MIT License. It addresses the lack of real-time cost monitoring and pricing-period indicators in the web interface, while also supporting fixed-rate display for models from other vendors.

Core Features

  1. Show pricing period and countdown: Determines in real time whether the current period is peak or off-peak and displays a countdown.
  2. Real-time session cost estimation: Based on token usage at each step, accumulates costs according to the rate in effect at that time.
  3. Hover to view trends: Hover over (or keyboard-focus) the line to view the cache-hit-rate trend chart and detailed rate buckets.
  4. Multi-vendor support: Besides DeepSeek, it supports fixed-rate models from other vendors such as z-ai/glm-5.3-flash.

Installation and Enablement

Before installing, ensure that Node.js >= 20 is installed. The plugin is loaded through DSH’s plugin system.

  1. Install the plugin:
    Run the following command in the terminal:
    dsh plugin --profile web add dsh-peak-pricing
After installation is complete, restart `dsh web` and the new line will appear in the interface.
  1. Verify installation:
    Confirm that the plugin configuration is active:
    dsh --profile web --dump-config | grep peak-pricing
  1. Remove the plugin:
    If you need to uninstall it, run:
    dsh plugin --profile web remove dsh-peak-pricing
  1. Local development installation:
    If you need to debug or install a specific version, pack it first:
    npm pack
    dsh plugin --profile web add "file:$PWD/dsh-peak-pricing-<version>.tgz"

Pricing Logic and Data

Time Periods and Rates

DeepSeek’s peak periods are Monday to Friday 9:00–12:00 and 14:00–18:00 (Beijing Time); weekends and holidays are off-peak periods. The plugin calculates using the UTC +8 timezone to ensure consistent display across browsers.

Cost Calculation Method

Cost calculation uses incremental accumulation rather than simply recalculating based on the ending rate:
1. Each time a new tokenUsage projection is obtained, take the difference with the previous value.
2. The token quantity in the difference is billed according to the real-time rate at the time of retrieval.
3. On the first read of a session, because there is no previous data, it is billed in a single charge based on the current rate.

Data Storage

The total runtime cost is stored in localStorage using the session ID as the key, so data is not lost after a page refresh. If the model is not in the pricing table, the plugin still displays the pricing period and countdown, but not the cost.

Cache-Hit Handling

According to the official pricing logic:
- cacheReadTokens is counted at the cache-hit input rate.
- uncachedInputTokens and cacheWriteTokens are counted at the cache-miss input rate.

Compatibility and Limitations

Ecosystem Compatibility

This plugin is compatible with the dsh-live-stats plugin. Because dsh-live-stats merges statistics rows into a single line, this plugin injects a small amount of styling to allow the pricing line to wrap onto its own line, preventing it from being squeezed.

Local Source Code Modifications

The pricing table is located in the plugin’s src/pricing.ts file. If you need to reflect DeepSeek’s new official pricing, just modify this constant and rebuild. This file contains pure logic only and does not depend on React or the DOM.

Summary

dsh-peak-pricing is a practical tool focused on cost control, integrated into the DeepSeek Harness web interface as a plugin. It not only lets you see the current rate at a glance while working, but also helps assess caching effectiveness through trend charts. For developers who frequently call APIs, it is an effective way to monitor cost pacing.