dsh-cost-meter 1.8.15 → 1.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00; weekends and Chinese public holidays are off-peak all day, with separate labels) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 170+ model-ID catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / Volcano Ark / Qwen / Xiaomi MiMo) plan/API dual-track billing (subscription quota vs pay-as-you-go money separated, per-1% & full-window token/equivalent-cost estimates with daily/weekly/monthly curves) · · quota strip above the input box (budget / Go / coding-plan usage in one row, toggleable)
10
10
 
11
- [![version](https://img.shields.io/badge/version-1.8.15-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.17-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.15** keeps conversation Cost details below the Desktop title bar and inside narrow windows. Automatic refresh preserves existing content and expanded turns while fetching new usage. See the [release notes](docs/release-notes/v1.8.15.md).
13
+ **v1.8.17** adds OpenRouter prices to the model picker: hover a model to see input, output and cache rates, context length and the last update time in DSH's native tooltip. Prices refresh every minute while the menu is open and visible, without an API key or model usage charges. The searchable price browser remains in Settings → Cost → Prices. See the [guide](docs/openrouter-prices.md#english).
14
14
 
15
15
  Desktop users: follow the [Desktop installation instructions](docs/install-troubleshooting.md#desktop-安装与更新) for the application's own CLI and `desktop` Profile.
16
16
 
@@ -32,6 +32,7 @@ If startup reports **Ledger is busy** and the cost widgets are missing, see [led
32
32
 
33
33
  | Feature | Location | Description |
34
34
  |---|---|---|
35
+ | OpenRouter model prices | Model picker / Settings → Cost → Prices | Hover a model for token rates and update time, or search the full catalog in Settings; automatic foreground refresh, price-change markers in the table and official model links. No API key or inference charges. [Guide](docs/openrouter-prices.md#english) |
35
36
  | Cost statistics | Below the conversation input / title bar / Settings → Cost → Cost statistics | Day, week, month, all retained and custom periods; API/Plan split, trends, model/conversation rankings and per-call costs. [Guide](docs/billing-statistics.md#english); statistics requires DSH’s asynchronous module loader |
36
37
  | Per-model cost card | Sidebar / composer dock (optional) | Disabled by default; inline Top-N, Other totals, shares and optional tokens, Today / Last 90 days, remembered expansion and a Top-1 chip. See the [guide](docs/model-cost-card.md#english) |
37
38
  | Per-conversation cost | Below the composer / session title bar | Live accumulated cost + input/cache/output tokens; the composer footer shows cache hit rate before Input (cache reads / all input, including cache writes); position configurable; Display settings can show only amounts below the composer, with the full line retained on hover |
@@ -322,22 +323,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
322
323
  dsh plugin --profile web add dsh-cost-meter
323
324
  ```
324
325
 
325
- **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.8.15`** — review the script before running):
326
+ **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.8.17`** — review the script before running):
326
327
 
327
328
  ```powershell
328
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.15/install.ps1 | iex
329
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.17/install.ps1 | iex
329
330
  ```
330
331
 
331
332
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
332
333
 
333
334
  ```sh
334
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.15
335
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.17
335
336
  ```
336
337
 
337
338
  Without git, use the GitHub tag archive:
338
339
 
339
340
  ```sh
340
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.15.tar.gz
341
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.17.tar.gz
341
342
  ```
342
343
 
343
344
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
package/README.zh-CN.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段;周末与中国法定假日全天按谷价,分别标注) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / 火山方舟 / 千问 / 小米 MiMo 十一家,含 Volcano Ark AK/SK 签名与 MiMo 控制台 Cookie 查询) · Plan/API 双轨计费(订阅额度与按量金额分离统计,每 1% 额度与满窗的 token/等值金额估算及日/周/月曲线) · 输入框上方额度横条(预算/Go/Coding Plan 用量一条横排显示,可开关)
10
10
 
11
- [![version](https://img.shields.io/badge/version-1.8.15-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.17-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.15** 修复费用明细弹窗遮挡桌面端标题栏及窄窗口横向溢出;自动刷新时保留已有内容和展开的轮次,并同步新用量。详见[更新说明](docs/release-notes/v1.8.15.md)。
13
+ **v1.8.17** 支持在模型选择菜单中悬停 OpenRouter 模型,通过 DSH 原生提示查看输入、输出、缓存单价、上下文长度和更新时间。菜单在前台打开时每分钟刷新,无需 API Key,不产生模型使用费用;设置 → 费用 → 价格中的搜索面板继续保留。详见[使用说明](docs/openrouter-prices.md#中文)。
14
14
 
15
15
  桌面端用户请按 [Desktop 安装说明](docs/install-troubleshooting.md#desktop-安装与更新),使用应用自带的 CLI 和 `desktop` Profile。
16
16
 
@@ -32,6 +32,7 @@
32
32
 
33
33
  | 功能 | 位置 | 说明 |
34
34
  |---|---|---|
35
+ | OpenRouter 模型价格 | 模型选择菜单 / 设置 → 费用 → 价格 | 悬停模型查看单价与更新时间,也可在设置中搜索完整目录;前台自动刷新,价格表标记价格变动并提供官方模型链接。无需 API Key,不产生模型使用费用。[说明](docs/openrouter-prices.md#中文) |
35
36
  | 计费统计与明细 | 会话输入框下方 / 标题栏 / 设置 → 费用 → 计费统计 | 输入、输出、缓存、推理费用;按轮次、模型、搜索和压缩统计;日、周、月及全部记录。[说明](docs/billing-statistics.md#简体中文) |
36
37
  | 按模型花费卡片 | 侧栏 / 右下角 dock(可配) | 默认关闭;就地展开 Top-N、其它汇总、占比和可选 Token;支持今日 / 近 90 天、展开记忆及 Top-1 角标,见[使用说明](docs/model-cost-card.md) |
37
38
  | 本会话费用 | 输入区下方 / 会话标题栏 | 实时累计费用 + 输入/缓存/输出 token;输入区下方在“输入”前显示缓存命中率(缓存读取 / 含缓存写入的全部输入),位置可配;显示页可开启输入区下方只显示金额,完整费用行保留在悬停提示中 |
@@ -322,22 +323,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
322
323
  dsh plugin --profile web add dsh-cost-meter
323
324
  ```
324
325
 
325
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.15`**,建议先下载审阅再运行):
326
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.17`**,建议先下载审阅再运行):
326
327
 
327
328
  ```powershell
328
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.15/install.ps1 | iex
329
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.17/install.ps1 | iex
329
330
  ```
330
331
 
331
332
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
332
333
 
333
334
  ```sh
334
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.15
335
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.17
335
336
  ```
336
337
 
337
338
  没有 git 时可用 GitHub tag 打包直链:
338
339
 
339
340
  ```sh
340
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.15.tar.gz
341
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.17.tar.gz
341
342
  ```
342
343
 
343
344
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
@@ -0,0 +1,33 @@
1
+ # OpenRouter model prices / 模型价格
2
+
3
+ ## English
4
+
5
+ Open the model picker beside the message input and hover an **OpenRouter** model. Its existing DSH tooltip shows input, output, cache-read and cache-write prices, context length and the last successful update time. Prices load when model rows appear and refresh every minute while the menu and browser are visible; hovering or returning to the foreground also checks for an update, subject to a 15-second cooldown. Closing the menu stops price requests. No settings visit is required.
6
+
7
+ The tooltip matches the host provider and exact model ID, keeping paid and `:free` variants separate. Models missing from the public catalog show an unavailable message; ambiguous host labels are left unchanged. Failed refreshes retain the previous prices and timestamp with a failure notice. The tooltip keeps DSH's native appearance and model selection behavior and follows the plugin language. Unloading the plugin restores the original tooltip.
8
+
9
+ Open **Settings → Cost → Prices → OpenRouter model prices** before choosing a model. Search by name or full model ID (for example, `flash`), sort by input or output price, and follow a model link to its OpenRouter page.
10
+
11
+ The panel shows public input, output, cache-read and cache-write prices in **USD per million tokens**, plus context length. `$0` is a published zero rate; `—` means that the catalog did not provide the field. Paid models and `:free` variants are separate rows. Automatic routing entries with negative placeholder prices are omitted.
12
+
13
+ Opening the Prices tab fetches the public catalog. While the tab and browser are visible, it refreshes every minute; returning to the foreground also refreshes. **Refresh prices** requests an update immediately, with a shared 15-second cache to limit duplicate requests across windows. The timestamp shows the last successful fetch. A failed request preserves the previous prices and timestamp and displays an error. **Price changed** marks token-rate changes since the previous successful refresh while this panel is open.
14
+
15
+ This lookup only sends an unauthenticated `GET` to [OpenRouter's public models endpoint](https://openrouter.ai/api/v1/models). It requires no API key, sends no model inference requests and incurs no model usage charges. Browsing does not change configured billing rates, credentials or the historical ledger. The existing background billing-price synchronization remains separate.
16
+
17
+ The catalog is a reference, not a binding quote for the next request. Provider routing, price tiers, promotions and additional image/search/request fees can affect the actual bill. Open the model's official page for those details. The UI uses the existing DSH theme variables and controls, supports Chinese and English, and requires the host's asynchronous module loader (also used by Cost statistics).
18
+
19
+ ## 中文
20
+
21
+ 打开输入框旁的模型选择菜单,悬停 **OpenRouter** 模型,DSH 原有提示中会显示输入、输出、缓存读取和缓存写入单价、上下文长度以及最近成功更新时间。模型列表出现时查询价格,菜单与浏览器处于前台时每分钟刷新;悬停模型或返回前台也会检查更新,两次请求至少间隔 15 秒。关闭菜单后停止价格请求,无需先进入设置。
22
+
23
+ 提示根据宿主提供商和完整模型 ID 匹配,付费模型与 `:free` 版本分别取价。公开目录中没有的模型明确显示价格不可用;宿主名称有歧义时保留原提示。刷新失败时保留旧价格和时间,并标记失败。提示沿用 DSH 原生外观和模型选择行为,跟随插件语言,卸载插件后恢复原提示。
24
+
25
+ 选择模型前,打开 **设置 → 费用 → 价格 → OpenRouter 模型价格**。可以按模型名或完整模型 ID 搜索,例如 `flash`,按输入价或输出价排序,并点击模型名称查看 OpenRouter 官方页面。
26
+
27
+ 面板显示输入、输出、缓存读取和缓存写入价格,单位为 **美元 / 百万 tokens**,同时列出上下文长度。`$0` 表示目录中的价格为零,`—` 表示目录没有提供该字段。付费模型与 `:free` 版本分别列出;负数占位价格的自动路由条目不显示。
28
+
29
+ 打开价格标签页时查询公开目录,面板与浏览器处于前台时每分钟刷新一次,返回前台时也会刷新。点击 **刷新价格** 可立即请求更新;多个窗口共享 15 秒缓存,避免重复请求。更新时间始终对应最近一次成功查询。查询失败时保留旧价格和原时间,并显示错误。面板打开期间,相比上次成功刷新发生变化的 token 单价标记为 **价格已变动**。
30
+
31
+ 查询仅对 [OpenRouter 公开模型接口](https://openrouter.ai/api/v1/models) 发送不带凭据的 `GET` 请求,无需 API Key,不发送模型推理请求,不产生模型使用费用。浏览价格不会修改计费单价配置、凭据或历史账本。原有后台计费价格同步继续独立运行。
32
+
33
+ 目录价格是参考价,具体路由、价格阶梯、优惠以及图片、搜索、请求等附加费用以 OpenRouter 为准,可点击模型查看详情。界面沿用 DSH 主题变量和控件,支持中英文;需要宿主支持异步模块加载,与费用统计页要求一致。