DeepSeek Harness plugin

dsh-session-cost-f1shn

DeepSeek Harness plugin that prices the current session from provider-reported token usage

Jump to install

Source facts

Repository
F1shn/dsh-session-cost
Latest update
Aug 17, 2026
Category
Memory
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/F1shn/dsh-session-cost
Plugin: dsh-session-cost-f1shn
Author: F1shn

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

DSH Session Cost

一个纯 DeepSeek Harness 插件,在会话标题栏右侧显示当前会话累计 API 费用, 并在每条已完成回复底部的悬浮信息行中显示该轮回复费用。

功能

  • 以人民币显示当前会话累计 API 费用
  • 在每条回复底部显示该轮回复费用
  • 区分缓存命中、缓存未命中和输出 token
  • 按请求时间应用高峰/非高峰价格
  • 支持从完整 session log 重新计算旧会话
  • 纯插件实现;卸载后界面改动立即失效

插件从 DSH 持久化 session log 折叠 request/header、assistant usage 和 compaction/summary usage。流式 usage 与最终 usage 属于同一步时按最终值替换, 不会重复计费。旧会话打开后也会从完整日志重新计算。

单次回复费用会汇总该轮内的全部模型步骤(包括工具调用前后的多步推理),与同一行的 “用时 / 首 token / tok/s”保持一致的 turn 口径。该指标通过 conversation.chat.assistant-actions 插件槽注册;移除插件后,标题栏累计费用和 回复费用会同时消失,不需要修改或回滚 DSH 核心前端。

当前内置经 2026-08-17 DeepSeek 实际 usage 账单验证的人民币非高峰单价 (每百万 token):

模型缓存命中输入缓存未命中输入输出
DeepSeek-V4-Flash¥0.05¥1.5¥4.5
DeepSeek-V4-Pro¥0.15¥4.5¥13.5

新价格从北京时间 2026-08-17 00:00 起生效;此前调用仍按旧价计算。北京时间 09:00–12:00、14:00–18:00 的新价格调用按高峰价格(非高峰价的 2 倍)计算。 缓存命中和未命中 token 直接采用 DeepSeek 响应中的 usage;DSH 适配器已将两者 拆成互斥计数,插件不会重复计算。

官方定价页:https://api-docs.deepseek.com/zh-cn/quick_start/pricing

金额仅覆盖写入当前会话日志且带 usage 的模型调用。其他会话、其他客户端、 未返回 usage 的失败请求,以及没有归属到当前 session log 的后台调用不会计入; 最终扣费以 DeepSeek 账户账单为准。

安装

直接安装(推荐)

已安装 dsh CLI 的用户只需执行:

dsh plugin --profile web add github:F1shn/dsh-session-cost

如果通过 DeepSeek Harness 源码运行 CLI,则在项目根目录执行:

pnpm dsh plugin --profile web add github:F1shn/dsh-session-cost

安装完成后重启 DSH Web/Desktop 即可,无需填写 API Key、修改配置或手动启用插件。

从源码安装

git clone https://github.com/F1shn/dsh-session-cost.git ./plugins/dsh-session-cost
pnpm dsh plugin --profile web add ./plugins/dsh-session-cost

卸载

已安装 dsh CLI:

dsh plugin --profile web remove dsh-session-cost

通过源码运行 CLI:

pnpm dsh plugin --profile web remove dsh-session-cost

卸载后重启 DSH,标题栏累计费用和回复费用会同时消失。