Introduction

When running agents in DSH, model calls are often scattered across official direct connections, relay APIs, plan pools, and other sources. It is difficult to judge the actual cost of the day just by looking at token counts. luxueliu-usage-command is a DeepSeek Harness plugin that provides the DSH command /usage, reads call records from the local LiteLLM gateway ledger file, and outputs a daily cost card broken down by model × hour.

Below is an introduction to its positioning, installation method, commands, configuration, and applicable boundaries.

Plugin Positioning

luxueliu-usage-command is open-sourced by luxueliu with an MIT license.

Its core capabilities are:

  • Provide the DSH command /usage to display the local API pricing card.
  • Data source is the local LiteLLM gateway ledger file gateway_usage.jsonl.
  • Cover pricing for three types of paid models: Official Direct Connection, Relay/Proxy, and Plan-based Billing Pool.
  • Automatic adaptation of timezone/currency: Chinese users see ¥ + Beijing Time, US users see $ + Eastern Time, Hong Kong/Taiwan users see NT$ / HK$.
  • Support extending model prices and aliases via dsModels, usdModels, planModels, and aliases in cordis config.
  • Unknown models without defined pricing fall back to a default, listing only tokens, not included in today’s billing.

The plugin requires Node.js 22.18+ and a DeepSeek Harness Web profile.

Core Features

Generate Daily Cost Card

The plugin outputs the daily ¥ consumption card broken down by model × hour. You can view today, yesterday, a specific month-day, or a full summary.

Covering Three Types of Paid Models

The plugin prices three types of models separately:

  1. Official Direct Connection.
  2. Relay/Proxy.
  3. Plan-based Billing Pool.

For limit-based models within a plan, such as Alibaba Bailian Token Plan, ClinePass, etc., the plugin excludes them and only prices non-free models within the paid pool.

Split Pricing by Cache Hit

The plugin supports split pricing based on cache hits/misses, using fields like prompt_cache_hit_tokens, prompt_cache_miss_tokens, etc.

Timezone and Currency Adaptation

Chinese users see ¥ and Beijing Time; US users see $ and Eastern Time; Hong Kong/Taiwan users can use NT$ / HK$.

DeepSeek peak-valley pricing is determined by Beijing Time, with a default exchange rate of 7.2 (USD→CNY).

Installation and Activation

First, confirm your local environment meets the requirements: Node.js 22.18+, and a DeepSeek Harness Web profile exists.

Next, install using the GitHub repository:

dsh plugin --profile web add github:luxueliu/luxueliu-usage-command

After installation, restart DSH, then enter in the chat:

/usage

The plugin runs with the permissions of the current dsh process. You should check the source code and MIT license before installing.

Typical Usage

Below are reproducible command examples.

View today:

/usage today

You can also enter directly:

/usage

View yesterday:

/usage yesterday

View a specific month-day (this year):

/usage 08-20

View all, aggregated only by model, without hourly breakdown:

/usage all

Configuration

The plugin comes with a default cordis.patch.yml configuration. To modify the ledger file path, currency, timezone, exchange rate, etc., override the following configuration in the profile’s cordis.patch.yml:

- insert:
    - id: luxueliu-usage-command
      name: luxueliu-usage-command
      config:
        gatewayLog: "D:/your/path/gateway_usage.jsonl"
        currency: "CNY"
        timezone: "Asia/Shanghai"
        cnyPerUsd: 7.2
        showRateLegend: true
        tailBytes: 0
        debugLog: false

You can also set the environment variable LUXELIU_USAGE_GATEWAY_LOG to point to the ledger file.

To extend gateway model prices, add the following in cordis.patch.yml:

- insert:
    - id: luxueliu-usage-command
      name: luxueliu-usage-command
      config:
        dsModels:
          "my-official-model": { hit: 0.2, miss: 2.0, out: 6.0, peakHours: [9,10,11,14,15,16,17] }
        usdModels:
          "my-relay-model": { hit: 0.5, miss: 2.0, out: 8.0, note: "我的中转商" }
        planModels:
          - "my-plan-model"
        aliases:
          "my-relay-model-v2": "my-relay-model"

Where:

  • dsModels is for Official Direct Connection models, where peak hours can be configured.
  • usdModels is for Relay/Proxy models.
  • planModels is for Plan Pool models.
  • aliases is used to map old model names/aliases from the gateway ledger to local aliases.

Pricing Scope

  • Prices are sourced from official published rates; the reference notes the online verification date as August 2026.
  • DeepSeek peak-valley pricing is determined by Beijing Time, with a default exchange rate of 7.2 (USD→CNY).
  • Supports split pricing by cache hit/miss, using fields like prompt_cache_hit_tokens, prompt_cache_miss_tokens, etc.
  • Unknown models without defined pricing fall back to a default, listing only tokens, not included in today’s billing.
  • The reference notes that Google Gemini Vertex cache price in×0.25 is pending verification.

If model prices are adjusted, you need to synchronize updates to this plugin and the usage-price-report skill.

Applicable Scenarios and Notes

Suitable for those using a LiteLLM gateway to connect multiple model sources and wish to view costs on a daily and hourly basis.

Please note:

  • The plugin only counts calls within the gateway ledger file, including usage from Codex and other items routed through the gateway.
  • Not Ledgered: Cursor editor direct connections, DeepSeek official direct connections (DSH harness official channels, etc., bypasses).
  • Usage from DeepSeek official direct connections (without passing through the local gateway) is not included in this ledger; official bills will be higher than the amount shown by this plugin.
  • The plugin runs with the permissions of the current dsh process; check source code and license before installing.

Links

GitHub Repository:

https://github.com/luxueliu/luxueliu-usage-command

The directory page URL was not found in the verified references, so the directory link is not attached.