DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Token Cost — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
T

dsh-token-cost

Token Cost

根据本地 pi-ai 目录价格显示当前会话的预估令牌成本;这不是计费金额。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:yoggu/dsh-token-cost#beaeb2f283964b36987e95b2d0bfb164d9e7563b
README兼容性版本

兼容性与来源证明

Token Cost 以 dsh-token-cost 发布,当前版本为 0.2.2。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/9/29

版本

0.2.2stable
2026/9/29
0.2.1stable
2026/9/28
0.2.0stable
2026/9/28

相关插件

正在加载相关插件…

最新版
0.2.2
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/10/7
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Client Ui Model Capabilities@linxin666/dsh-client-ui-model-capabilities为自定义 pi-ai 提供商声明每个模型的能力(图像输入和推理力度),可直接在 Models 设置卡片中编辑;写入官方 llm-pi-ai 设置命名空间,不更改 DSH 源代码。Codex Subscriptiondsh-codex-subscription通过 OAuth 在 DeepSeek Harness 中使用 ChatGPT 和 Codex 订阅,支持配额管理、安全重置、网页搜索、图像和快速模式Commandcode Provider@mars-sea/dsh-commandcode-provider适用于 Command Code 的非官方 DeepSeek Harness LLM 提供商插件,移植自 pi-commandcode-provider(MIT)。注册“commandcode”提供商路由,并在 Models 页面添加卡片和实时模型目录。

README

dsh-token-cost

Shows estimated cost for the current DSH Web session, never an invoice. DSH logs each Assistant settlement's provider route, model ID and disjoint input/output/cache-read/cache-write token counts. The Host projection folds that durable log and prices it using the physically resolved pi-ai catalog and calculateCost belonging to the shipped @deepseek-ai/dsh-llm-pi-ai adapter. It makes no paid inference, opens no HTTP endpoint, and needs no dsh-model-pricing service or account credentials.

Installation

Install the current source from the repository's existing default branch:

dsh plugin --profile web add 'https://github.com/yoggu/dsh-token-cost.git#master'

Or clone and link a checkout:

git clone https://github.com/yoggu/dsh-token-cost.git
cd dsh-token-cost
dsh plugin --profile web add "link:$(pwd)"

Keep linked checkouts in place while installed. Restart DSH after replacing an installed package version, then refresh the browser. Uninstall with dsh plugin --profile web remove dsh-token-cost; this removes the readout, not session logs or credentials.

The shipped llm-pi-ai adapter and its pi-ai dependency must be resolvable from the running Harness process. No process-wide search, cwd fallback, consumer-local pi-ai copy or arbitrary filesystem override is accepted; the old DSH_PI_AI_DATA override is no longer used. If owner resolution or catalog validation fails, settlements show unpriced, not free. The current implementation is tested with pi-ai 0.99.1, without changing the shipped adapter or its dependency.

Price mapping and provenance

  • Exact openrouter routes use the installed pi-ai openrouter catalog. Custom gateway aliases are not inferred.
  • Exact built-in openai-codex routes use openai-codex; displayed USD is an API-equivalent subscription estimate, not a ChatGPT subscription invoice.
  • Historical codex-business and codex-personal log routes retain legacy subscription estimates from today's shipped pi-ai openai-codex catalog after the old account adapter is removed. This is a lookup of old event IDs only, not new-route admission or attestation that the historical adapter used this exact version.
  • Exact deepseek-official routes use the deepseek catalog as an independent list-price estimate. Its Messages endpoint is not served by pi-ai and its billing parity is not attested by this plugin. An unknown model ID or gateway route stays unpriced.

For each valid entry, the Host report retains pi-ai package name, version, catalog-file SHA-256 digest, exact route binding label, and the number of contributing settlements; the Web tooltip only says “Estimated cost” (and “subscription” on subscription routes). The displayed cost is calculated using the currently installed catalog; the DSH log stores counts, not an original USD charge or historical price. If prices change after a pi-ai upgrade, intentionally increase the projection stateVersion and cold-replay events before claiming newly repriced history; a catalog revision alone does not invalidate checkpoints. This version supports pi-ai 0.99.1's typed chat:<model-id> catalog keys (as well as legacy bare keys), while looking up the bare model IDs recorded by DSH. Image/classifier entries are never used for chat pricing. It uses stateVersion: 6 to replay checkpoints from versions 1–5 and recover estimates previously skipped by the new catalog format. There is no catalog filesystem I/O in the fold.

calculateCost selects the applicable request-wide tier using uncached input plus cache reads and writes. Reasoning is already part of output. Incomplete/non-finite/negative prices and ambiguous duplicate model entries fail closed. DSH lacks the cacheWrite1h bucket; models with duration-specific write rates or Anthropic-protocol cache writes are unpriced when their accounting cannot be faithfully reconstructed. The readout dims estimates with partial coverage rather than interpreting unpriced calls as $0.

Limits: Explicit route IDs do not prove custom endpoint ownership or actual billing; profile owners must not repoint reviewed routes silently. The estimate doesn't include non-model charges. DeepSeek parity and historical subscription prices are specifically caveated.

Run npm test for the complete offline suite. MIT; see LICENSE.