dsh-session-cost
Per-turn and whole-session DeepSeek API cost estimates for DeepSeek Harness Web.
geecraft23
@geecraft23
⬇ 1
★ 0
main
安装
dsh plugin --profile web add github:geecraft23/dsh-session-cost
需要可复现安装时,可在仓库后追加 #commit 固定提交。
Per-turn and whole-session DeepSeek API cost estimates for DeepSeek Harness Web.
该插件未提供要点说明,请参考仓库 README。
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/geecraft23/dsh-session-cost |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-09-11 |
| 收录日期 | 2026-09-19 |
| 分类 | 工具与能力 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# DSH Session Cost
English | [简体中文](README.zh-CN.md)
`@geecraft23/dsh-session-cost` adds estimated DeepSeek API cost to DeepSeek Harness Web. Every completed model Turn shows its own cost, and the composer footer shows the estimate for the complete durable Session. Open a Turn cost to inspect uncached input, cache-read input, optional cache-write input, output, model route, and price-book id.
The plugin uses the same compact typography, spacing, colors, disclosure behavior, dark theme, and responsive rules as Harness Chat. It does not alter prompts, model requests, cache behavior, or Session data.
## Install
Requires Node.js `^22.19.0` or `>=24.0.0` and DeepSeek Harness `0.1.2-alpha.5` or newer.
```sh
dsh plugin --profile web add @geecraft23/dsh-session-cost@0.1.2
dsh web
```
On Harness versions with the dedicated Turn-metric and trailing-statistic slots, the values appear exactly after Turn usage and at the end of the native Session statistics line. On `0.1.2-alpha.5`, the compatibility presentation keeps the Turn cost in the action row and adds the Session total as the next footer statistic.
Use your existing Harness installation for upgrades. Version 0.1.2 supports both legacy chunk events and compact Assistant settlements used by current Harness, including failed or retried attempts. Restart Web after upgrading the Bundle.
The development type baseline remains `0.1.2-alpha.4` for older-host compatibility; release integration is also checked with the installed `0.1.5-rc.1` host (Session format 3).
Remove the Bundle and restart Web:
```sh
dsh plugin --profile web remove @geecraft23/dsh-session-cost
```
## Price calculation
The included Bundle selects `deepseek-cny-2026-09-10`, an immutable snapshot containing both historical and current official tariffs. Each request uses its logged start time, not the date you open the conversation. Rates are currency units per one million tokens.
| Model | Period | Cache read | Uncached input | Output |
| --- | --- | ---: | ---: | ---: |
| `deepseek-flash` (V4.1 Flash) | Off-peak / peak | ¥0.02 / ¥0.04 | ¥1.00 / ¥2.00 | ¥4.00 / ¥8.00 |
| V4 Flash / Vision before the September 10 switch | Off-peak / peak | ¥0.05 / ¥0.10 | ¥1.50 / ¥3.00 | ¥4.50 / ¥9.00 |
| V4 Pro before the September 14 switch | Off-peak / peak | ¥0.15 / ¥0.30 | ¥4.50 / ¥9.00 | ¥13.50 / ¥27.00 |
Peak periods are 09:00–12:00 and 14:00–18:00 Beijing time, Monday through Friday. Every other minute is off-peak. The price book starts at 2026-08-17 00:00 Beijing time; the Vision rule starts conservatively at 2026-08-22 00:00 Beijing time.
- From **September 10, 2026 at 12:00 Beijing time**, `deepseek-flash`, `deepseek-v4-flash`, and `deepseek-v4-flash-vision-exp` use V4.1 Flash prices. Earlier requests to the old names retain V4 prices.
- From **September 14, 2026 at 12:00 Beijing time**, `deepseek-v4-pro` also uses V4.1 Flash prices under the announced temporary redirect. Earlier Pro requests retain Pro prices. The eventual V4.1 Pro launch will require another price-book update.
- A conversation spanning either switch sums the individually priced attempts. An attempt crossing a boundary is estimated using its logged start time; the provider's billing clock may differ.
One request attempt is calculated without intermediate rounding:
```text
amount = (uncached_tokens × uncached_rate
+ cache_read_tokens × cache_read_rate
+ cache_write_tokens × cache_write_rate
+ output_tokens × output_rate) / 1,000,000
```
Reasoning tokens are already included in provider output tokens and are never charged twice. The implementation accumulates integer fixed-point amounts and rounds only for display. If a required usage bucket, model route, or matching tariff is missing, the affected Turn and Session total are shown as unavailable instead of inventing a price.
Official sources: [CNY prices](https://api-docs.deepseek.com/zh-cn/quick_start/pricing/), [USD prices](https://api-docs.deepseek.com/quick_start/pricing/), [V4.1 Flash and tariff switch announcement](https://api-docs.deepseek.com/news/news260910/), [V4 price announcement](https://api-docs.deepseek.com/news/news260813/), and [Vision launch announcement](https://api-docs.deepseek.com/news/news260821/).
## Currency and custom tariffs
`deepseek-usd-2026-09-10` uses the official USD tariff, independently of currency conversion: V4.1 Flash cache reads cost $0.003 / $0.006, uncached input $0.15 / $0.30, and output $0.60 / $1.20 per million tokens (off-peak / peak). It preserves historical USD tariffs and the same dated redirects.
The original `deepseek-cny-2026-08-17` and `deepseek-usd-2026-08-17` snapshots remain unchanged for explicitly pinned configurations. If your Profile overrides `priceBook`, change that override to the September book to adopt the update; custom tariffs remain caller-owned. Gateways, resellers, and discounts should use explicit custom rules. See the exported `Config` type for validated fields.
## Limitations
- This is a list-price estimate, not an invoice. Provider-side discounts, taxes, credits, hidden retries, billing-time rounding, paid tools, and external services are outside the estimate.
- The built-in books price the `deepseek-official` route. Redirecting that route to a gateway does not prove the public tariff applies.
- Auxiliary title generation and child Sessions are separate Sessions; open them to see their own estimates.
- Built-in price books are immutable snapshots. A future DeepSeek price change requires a new price-book id.
## Development
```sh
pnpm install
pnpm run check
pnpm pack --dry-run
```
The npm package is a DSH Bundle: `cordis.patch.yml` inserts the Host plugin, while the `dsh.client` manifest loads its Web presentation.
## License
[MIT](LICENSE)
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。