When developing or debugging in the DeepSeek Harness (DSH) Web UI, it is important to know the API cost of the current session, the entire project, and the account balance. The omdsh-usage plugin provides this information in the session header for Chat and Work modes and in the corner of the frame for Code mode, making it easy to quickly monitor consumption.

Core Features

The plugin adds three-digit consumption badges to the interface to display the current API spending.

  • Location Display: In Chat and Work modes, the badges are displayed in the session header, next to the mode chip. In Code mode, since there is no header, the badges are displayed in the corner of the frame.
  • Data Scope: Displays the consumption of the current session, the total consumption of the current project, and the account balance.
  • Detailed Information: Hover over a badge to view a detailed token breakdown (including cache hit/miss, output, peak/off-peak rates) and cost calculation.
  • Technical Implementation: The plugin provides an omdshUsage projection unit for counting tokens by model. It also provides a GET /omdsh-usage/summary endpoint. Price calculations are performed on the host side, and the browser only receives formatted numbers.

Configuration

The plugin provides a set of configurable parameters to control the displayed currency, rates, off-peak discount, and low-balance threshold.

  • Configuration Entry: Configuration can be performed through “Settings -> Plugins -> Plugin hub -> Usage” in the DSH interface, or directly written in cordis.yml.
  • Configuration Items:
    • currency: Currency unit, such as CNY or USD.
    • rates: Defines rate tables for different models in the format <cache hit>/<cache miss>/<output>, with prices per million tokens at peak. Supports a default fallback row.
    • offPeakDiscount: Off-peak discount ratio, for example 0.5 means off-peak prices are half of peak prices.
    • lowBalance: When the balance falls below this threshold, all icons turn red.
    • apiKeyEnv: Name of the environment variable containing the API key for balance retrieval, default DEEPSEEK_API_KEY.
    • baseURL: API endpoint for balance queries.

Technical Details and Notes

  • Dependencies: The plugin depends on the omdsh-sidepanel plugin to provide Files and Terminal UI context.
  • Off-Peak Windows: The off-peak discount time windows are hard-coded to 09:00-12:00 and 14:00-18:00 Beijing Time.
  • Caching Mechanism: The account balance is cached once per minute.
  • Runtime Environment: The plugin requires Node.js version ^22.19.0 or >=24.0.0.
  • Rate Validation: When writing cordis.yml, each rate row must consist of three non-negative numbers; otherwise it will be rejected.

Summary

The omdsh-usage plugin uses projection units and API endpoints to surface DeepSeek Harness API consumption in prominent parts of the interface, helping developers monitor costs in real time. It supports custom rates and off-peak discounts, and price calculations are performed on the host side.