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费用、区分高峰与低谷费率并核算委派及团队支出的用户。
Other repositories with this package name
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:NIRVANA-APOC/dsh-api-costREADME
Read the full README ↗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-peak | Peak |
|---|---|
![]() | ![]() |
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.

Scopes
| Scope | Meaning |
|---|---|
auto (default) | The verified team when the session is a team member, otherwise its delegation tree. |
self | This session only. |
tree | This session plus every durable subagent descendant. |
team | The 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 ★:

Command and tool
| Surface | Behaviour |
|---|---|
/cost [sessionId] [auto|self|tree|team] | Prints the same summary the pill shows, including coverage warnings. |
session_cost | Lets 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.

