NIRVANA-APOC/dsh-api-cost ↗★ 1

dsh-api-cost

Lightweight DeepSeek cost projections: exact peak/off-peak estimates, durable checkpoint recovery and correctly attributed delegation/team spend. 适合需要估算会话API费用、区分高峰与低谷费率并核算委派及团队支出的用户。

Package
dsh-api-cost
Compatibility
Unverified
Cordis peer range
~4.0.4
Version
2.0.0
License
MIT
Last updated
Oct 8, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:NIRVANA-APOC/dsh-api-cost

Usage

The pill

Beside the shipped session-stats pills, the cost pill shows this session's estimated spend and the period in force (peak / off-peak spelled out in words, never colour alone). It reads the host projection directly, so it repaints when a settlement lands — not on a timer. A Partial marker appears whenever any contributing session is unpriced, truncated or unreadable.

Off-peakPeak
The pill in the off-peak tier: this session's cost in CNY with the tier written as the word 谷, in the neutral colourThe same figure during peak hours: the tier reads 峰 and the capsule switches to the warning colour

The panel

Clicking the pill (or pressing Enter on it) opens a trigger-anchored dialog: totals, the this-session / other-session split, the peak / off-peak split, the priced-call count, coverage, the team roster when the scope is a team, current rates, a rate-card notes row when the published card carries a caveat that affects this scope, the countdown to the next period change, and a Refresh button that re-reads the scope instead of replaying logs. Token buckets and the per-model breakdown are deliberately not on the panel; they stay available through /cost, session_cost and detail=full.

The detail panel for one session: total in CNY and USD, this-session and other-session split, partial coverage naming the unknown-model reason, session and priced-call counts, the peak and off-peak split, the period with a countdown, the rates in force, and the Refresh button

Scopes

ScopeMeaning
auto (default)The verified team when the session is a team member, otherwise its delegation tree.
selfThis session only.
treeThis session plus every durable subagent descendant.
teamThe whole team: lead, members and their descendants. Refused when membership cannot be verified.

A team scope names every member's own money under Team roster, with the Lead marked ★:

The detail panel for a Team scope: the total with the requesting seat's own share, complete coverage across seven sessions, and the roster with the Lead marked ★ and one money figure per member

Command and tool

SurfaceBehaviour
/cost [sessionId] [auto|self|tree|team]Prints the same summary the pill shows, including coverage warnings.
session_costLets the assistant read a session's estimate; defaults to the calling session.

Configuration

In the profile patch:

- id: dsh-api-cost
  name: 'dsh-api-cost'
  config:
    defaultScope: auto          # auto | self | tree | team
    tool: true                  # register session_cost
    command: true               # register /cost
    holidays:                   # extend or correct the bundled Chinese calendar
      '2027':
        holidays: ['2027-01-01', ['2027-02-05', '2027-02-11']]
        makeupWorkdays: ['2027-02-20']

Changing holidays changes the projection's fold identity, so stale checkpoints are discarded and rebuilt instead of being mixed with new money.