Introduction

DeepSeek Harness (DSH) is a tool for developing and testing DeepSeek models. When interacting through the Web UI or building agents, developers often need to monitor API call cost, balance, and current token usage in real time. The default statistics line usually displays only basic data and does not intuitively reflect the session’s “burn rate” or account balance.

The deepseek-cost-usage-status-plugin introduced below is a plugin designed specifically for the DSH Web UI. It adds a colored status line below the conversation input area to display real-time cost, usage, balance, and current model information.

Plugin Positioning

This is a packaged Cordis plugin maintained by developer Zenjibad. As part of the DeepSeek Harness ecosystem, it can run in the Web UI without complex configuration. It primarily addresses the lack of intuitive cost monitoring during development.

Core Features

The plugin provides the following features:

  1. Peak/off-peak period indicator

    • Automatically determines whether the current time is a peak period based on the official Beijing Time billing windows (09:00–12:00, 14:00–18:00).
    • Idle/off-peak periods are shown in green, and peak periods are shown in red.
    • The clock displays local time, but the billing logic is based on Beijing Time.
  2. Session cost

    • Accumulates token usage in real time from the llm/stream pipeline.
    • Calculates cost using the official CNY pricing table and automatically applies the 50% off-peak discount.
    • Automatically converts the cost based on the account currency (usually USD), ensuring the cost and balance units match.
  3. Burn rate

    • Calculates the average cost per minute for the current session (cost / elapsed minutes), using the same unit as the displayed currency.
  4. Account balance

    • Polls the DeepSeek /user/balance endpoint every 60 seconds to fetch the balance.
    • If the API key is unavailable or the network request fails, the balance is shown as —, but other features remain unaffected.
  5. Current model and reasoning configuration

    • Displays the name of the model currently in use (such as deepseek-v4-flash) and the reasoning intensity settings.
  6. Style consistency

    • The font size and colors match DSH’s built-in statistics line, so it visually appears as part of the same component.

Installation and Activation

The plugin requires DSH version 0.1.0-rc.6 or later, and Web UI must be enabled.

  1. Use the official CLI to install the plugin:
    dsh plugin --profile web add deepseek-cost-usage-status-plugin
Alternatively, install it from a local directory:
    dsh plugin --profile web add ./deepseek-cost-usage-status-plugin
  1. After installation, restart DSH.

  2. After restarting, the plugin renders a new status line at the conversation.composer.dock location, alongside the existing statistics line.

Configuration

The plugin can be fine-tuned through a configuration file, typically using cordis.patch.yml:

deepseek-cost-usage-status-plugin:
  config:
    fallbackFxRate: 7.2   # 当实时汇率获取失败时,使用的固定汇率(CNY per 1 USD)
    fxRefreshMs: 3600000  # 实时汇率刷新间隔(默认 1 小时,最小 60 秒)
Configuration Default Description
fallbackFxRate Not set The conversion ratio from CNY to the display currency used when real-time exchange rate fetching fails
fxRefreshMs 3600000 The interval for refreshing the real-time exchange rate, in milliseconds. A value of 60,000 or higher is recommended

Notes

  • Environment dependency: The DeepSeek provider must already be configured, and the API key must be stored in the ~/.dsh/.credentials.yaml file as DEEPSEEK_API_KEY. Without this key, the balance cannot be read, but session cost and burn rate are still calculated correctly.
  • Calculation logic: The base unit for cost and burn rate is CNY, and the value is then converted according to the account currency.
  • Permissions and security: When calling the balance endpoint, the plugin passes the API key through a curl command-line header. This is a technical limitation of the current reading method. The plugin itself does not save or log the key.
  • License: The plugin is released under the MIT License.

Conclusion

For developers who need precise control over DeepSeek API costs, this additional status line provides more intuitive feedback than the default statistics. It aggregates cost, balance, and current model information into a single line, making it easy to quickly assess session spending and account status.