Introduction

When developing agents in DeepSeek Harness (DSH), it is necessary to accurately track the real cost of each conversation turn and the remaining subscription resources. dsh-turn-cost is a Web plugin that directly displays in the DSH interface the cost of each conversation turn (CNY, official peak/off-peak pricing), the cache hit ratio, and real-time quota readings for subscription routes (such as Kimi’s 7-day weekly quota and Alibaba Token Plan).

Core Features

The plugin provides the following core capabilities:

  1. Route-aware display based on the actual route used in a conversation turn: separates official pay-as-you-go models from subscription routes, showing amount or quota information respectively.
  2. Displays official pay-as-you-go amounts (CNY, peak/off-peak pricing): calculated based on DeepSeek’s official pricing, supports peak/off-peak price tiers.
  3. Displays token and quota readings for subscription routes: for subscription-based models such as Kimi’s 7-day weekly quota and Alibaba Token Plan, shows remaining Tokens and quota ratio.
  4. Calculates cache hit ratio: displays the proportion of cached read tokens, used to evaluate the caching effect of long conversations.
  5. Session-level aggregation: summarizes consumption data for the entire session below the input box.
  6. Supports custom rate tables: allows users to override built-in official pricing.

Installation and Enabling

Install the plugin via npm:

dsh plugin --profile web add dsh-turn-cost

After installation, restart the DSH Web service and refresh the page to apply the changes.

Typical Usage

During use, pay attention to two areas in the interface:

  1. Below each reply: displays detailed data for that turn.
    For example: This turn ¥0.67 · 3.32M tokens · cached reads 100%
  2. Below the input box (same bar as the official statistics bar): displays cumulative data for the current session.
    For example: This session ¥15.42 · 32.80M tokens · cached reads 99%

For subscription routes (such as Kimi), the official real-time quota reading is additionally displayed below:
For example: This turn 123K tokens · 47 uses remaining in 7 days · balance ¥28.79

Configuration

If you need to customize the rate table, you can specify the path in the configuration file. The plugin reads the configuration item in dsh.profile.bundles to locate the rate file.

Notes

  1. Data security: reads local data only and does not access model API keys.
  2. Amount nature: amounts are estimated values calculated as usage reported by the provider × the rate table, and do not constitute official invoices.
  3. Subscription display: subscription routes show token and quota readings, without fabricating consumption percentages.
  4. Unpriced models: models not included in the rate table are displayed as unpriced.
  5. License: MIT license.

Summary

This plugin addresses DSH users’ needs for cost transparency and subscription quota visibility. By reading session logs locally and calculating, it provides developers with intuitive cost and resource monitoring.