dsh-usage-cost
by dino6021
DeepSeek Harness 插件:按会话逐轮 token 用量实时计算 DeepSeek API 成本,8/17 起自动切换峰谷计价。 服务端投影 usageTimeline(逐轮 token 桶 + 完成时间戳)+ 客户端四段成本读数。
DSH plugin: per-step timestamped DeepSeek API usage timeline + peak/off-peak cost readout
安装
dsh plugin --profile web add github:dino6021/dsh-usage-costGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
安装
dsh plugin --profile web add "github:Dino6021/dsh-usage-cost#main"
装完重启 web 并刷新页面,对话底部(统计行下方)即出现成本行。
官方 bundle 形态(
dsh.bundle.patch+dsh.client),构建产物已入库,git 源安装无需构建。
能力面
| 能力 | 说明 |
|---|---|
投影 usageTimeline |
服务端 session projection:逐条 assistant/message 的 token 桶(未命中 / 输出 / 缓存读 / 缓存写)+ 完成时间戳 |
槽 usage-cost |
conversation.composer.dock:四段成本读数(对话 / 工作区 / 今日 / 5小时) |
计价(DeepSeek V4 Pro,每百万 token,人民币)
| 时段 | 缓存命中 | 缓存未命中 | 输出 |
|---|---|---|---|
| 当前(8/17 前) | ¥0.025 | ¥3 | ¥6 |
| 8/17 起 · 空闲时段 | ¥0.15 | ¥4.5 | ¥13.5 |
| 8/17 起 · 高峰时段(北京时间 9–12、14–18) | ¥0.30 | ¥9 | ¥27 |
- 8/17 零点自动由平峰切为峰谷,逐轮按时间戳判峰谷;
- 无时间线(旧会话/投影缺失)时回退平峰价;
- 单价在
lib/client.js顶部常量(FLAT/PPO/PPO_START)可改。
核对与调整单价
单价集中定义在 lib/client.js 顶部,便于维护:
| 常量 | 含义 |
|---|---|
FLAT |
平峰价(8/17 前生效) |
PPO |
峰谷价(8/17 起生效;offPeak 空闲 / peak 高峰) |
PPO_START |
峰谷生效时刻(= 8/17 00:00 北京时间,epoch 毫秒) |
- 切换是自动的:
priceAt(ms)按每条样本的时间戳决定用平峰还是峰谷,无需改代码。 - 改价后生效:编辑
lib/client.js→ 重装(dsh plugin --profile web add "github:Dino6021/dsh-usage-cost#main")→ 刷新页面。 - 官方价为准:https://api-docs.deepseek.com/zh-cn/quick_start/pricing/ ;缓存写入价按「缓存未命中」价计(DeepSeek 未单列写入价,该桶实际常为 0)。
插件管理
已装插件用 plugin-registry 的薄控制台管理(浏览器面板):
dsh plugin --profile web add "github:vlln/plugin-registry#main&path:/packages/plugin/console"
原始 README: https://github.com/Dino6021/dsh-usage-cost/blob/main/README.md ↗
同类插件
查看全部 →
k8e
k8e.sh — 开源 Agentic AI 沙箱矩阵

hol-guard
开源AI代理防病毒:运行时拦截风险工具、秘密访问、提示注入、恶意软件包、MCP服务器、插件和技能。

anolisa
ANOLISA(Agentic Nexus Operating Layer & Interface System Architecture):具备运行时、安全性、可观测性和 Tokenless 响应压缩能力的 Agentic OS,可降低 Token 使用量与成本。

mobius
首个自我演进的开源 Agent OS:连接你的团队、AI agent、设备与算力

deepseek-harness-desktop
DeepSeek Harness Tauri 桌面版 | Only 5mb installer, zero environment setup. Windows / macOS / Linux.

open-managed-agents
开源Claude管理代理API实现和自托管Claude标签式代理运行时。即插即用;在Cloudflare Workers/Durable Objects或Node.js上运行。Apache 2.0。