dsh-cost-meter 1.8.5 → 1.8.7

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 dsh-cost-meter contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-cost-meter contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,11 +6,11 @@
6
6
 
7
7
  **Session cost tracking plugin for the DeepSeek Harness web GUI (bilingual UI)**
8
8
 
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 90+ model price 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)
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.5-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.7-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.5** aligns statistics with DSH's native theme, adds full-selection step shares and expandable turn inputs/tool calls, and captures native-search usage when the fetch transport emits no Undici diagnostics. See the [statistics guide](docs/billing-statistics.md#english) and [release notes](docs/release-notes/v1.8.5.md).
13
+ **v1.8.7** reads the official balance from a signed-in DSH Desktop account, expands provider pricing with separate OpenCode Zen/Go catalogs, follows the DSH language in automatic mode, and improves model-name matching while preserving unknown prices and historical amounts. See the [release notes](docs/release-notes/v1.8.7.md).
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
 
@@ -54,7 +54,7 @@ Desktop users: follow the [Desktop installation instructions](docs/install-troub
54
54
  | Peak/off-peak hours display | Settings / budget / today | Shows UTC peak hours 01:00–04:00 and 06:00–10:00 with the current tier; weekends and configured Chinese public holidays (Beijing dates) are off-peak all day, with separate labels; expanded view shows a period strip and countdown, collapsed view shows a vertical bar; independently toggleable |
55
55
  | Peak/off-peak switch popup alert | Global overlay | A full-width bracketed popup appears when the next tier switch is within the configured lead time (default 2 minutes, 1–30), with an alert-colored badge distinguishing entering peak vs off-peak; position selectable (**bottom-right / screen center**), alert type selectable (entering peak / entering off-peak / both), one alert per switch point; optionally **sends a browser (system) notification** (so you still get alerted when the page is backgrounded; requires granting notification permission); configured in the peak pricing panel in Settings, with a **one-click popup preview** (rendered by the real component — copy, position and notifications exactly as they will fire) |
56
56
  | Official price sync | Settings page | Fetches and parses the official pricing page, applies with one click; the **official price currency** is selectable (USD · English page / CNY · Chinese page) — CNY prices are booked at the display exchange rate and match the official CNY bill when displayed in CNY |
57
- | UI language | Settings → Display settings | Simplified Chinese / English / Follow browser (auto); switches instantly and auto-saves |
57
+ | UI language | Settings → Display settings | Simplified Chinese / English / Follow DSH (auto); switches instantly and auto-saves |
58
58
  | Hide official balance / hide today's cost | Settings → Display settings | Two independent toggles: when on, the matching UI blocks (sidebar balance row & panels / today's cost row, budget details, overview today card) **are not rendered at all**; token and call-count stats stay visible — safe for screen sharing and screenshots |
59
59
  | AI price sync | [prompt](docs/AI-PRICE-SYNC-PROMPT.en.md) | DeepSeek official sync; other providers use the verified official price catalog and manual configuration |
60
60
  | Model & Plan adaptation guide | [adaptation doc](docs/model-and-plan-adaptation.en.md) | Adaptation matrix for per-model billing and the Coding Plan vendors, the auto-matching mechanism and price sources ([中文](docs/model-and-plan-adaptation.md)) |
@@ -171,10 +171,10 @@ Connects to a local or LAN-deployed [CLIProxyAPI](https://github.com/router-for-
171
171
 
172
172
  The plugin UI (session badge, sidebar balance row & budget box, and the entire Settings page) supports **Simplified Chinese** and **English**:
173
173
 
174
- - Language options: **Simplified Chinese** / **English** / **Follow browser (auto)**;
175
- - Default is “Follow browser”: the browser language is auto-detected (`zh*` → Chinese, otherwise English), and the detected value is written back into the config so server-side messages (balance query, price sync, etc.) match the UI language;
174
+ - Language options: **Simplified Chinese** / **English** / **Follow DSH (auto)**;
175
+ - Default is “Follow DSH”: auto uses DSH’s active language and updates live, including the statistics screen and Settings sidebar label. Older hosts without the locale face use the saved DSH preference when available, then the browser language (`zh*` → Chinese, otherwise English). Auto stays `auto` in the saved config;
176
176
  - Switch it under **Settings → Cost → Display settings → Language** — the whole plugin UI updates instantly and auto-saves; the section label in the Settings sidebar switches too (费用 / Cost);
177
- - Server-generated notices (balance refresh, official price sync, config validation errors, …) are also output in the current language.
177
+ - An explicit Chinese/English plugin choice overrides DSH for both UI and server-generated notices. In auto mode, the Host reads DSH’s saved language preference; without an observable preference it retains the Chinese compatibility fallback. Browser/native-only provisional choices and different clients’ languages cannot be inferred by the Host, so notices may differ in those cases.
178
178
 
179
179
  ## Screenshots & walkthrough
180
180
 
@@ -320,22 +320,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
320
320
  dsh plugin --profile web add dsh-cost-meter
321
321
  ```
322
322
 
323
- **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.5`** — review the script before running):
323
+ **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.7`** — review the script before running):
324
324
 
325
325
  ```powershell
326
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.5/install.ps1 | iex
326
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.7/install.ps1 | iex
327
327
  ```
328
328
 
329
329
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
330
330
 
331
331
  ```sh
332
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.5
332
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.7
333
333
  ```
334
334
 
335
335
  Without git, use the GitHub tag archive:
336
336
 
337
337
  ```sh
338
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.5.tar.gz
338
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.7.tar.gz
339
339
  ```
340
340
 
341
341
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
@@ -387,7 +387,7 @@ DSH `0.2.0-rc.1` passes packed installation, Web startup, shared-module checks,
387
387
 
388
388
  If Plugin Hub reports only `diagnostics: .../.plugin-manager/logs/operation-.../pnpm.log`, that line does not identify the failed package or command. Open the named `pnpm.log` and include the first actual error when reporting the failure; remove credentials and private paths before sharing it. Git URL and npm-name installation on DSH `0.2.0-rc.1` are covered by isolated Windows checks, but an individual machine's failure still requires its diagnostic log.
389
389
 
390
- Balance HTTP 401 in account-login mode: configure a dedicated Open Platform API key under **Settings → Cost → Account balance**. See [credential priority and storage](docs/balance-credentials.md).
390
+ Account-mode balance: in DSH Desktop a signed-in official account is read without any API key; if you still get HTTP 401, save a dedicated Open Platform key under **Settings → Cost → Account balance**. See [credential sources and priority](docs/balance-credentials.md).
391
391
 
392
392
  ### Update / Uninstall
393
393
 
package/README.zh-CN.md CHANGED
@@ -6,11 +6,11 @@
6
6
 
7
7
  **DeepSeek Harness 会话费用统计插件(界面中英双语)**
8
8
 
9
- 本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段;周末与中国法定假日全天按谷价,分别标注) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 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 用量一条横排显示,可开关)
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.5-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.7-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.5** 按 DSH 原生风格调整统计界面,增加全部调用的步骤占比,以及可展开的每轮输入、工具参数和结果;原生搜索新增不依赖 Undici 诊断事件的用量捕获。详见[计费统计说明](docs/billing-statistics.md#简体中文)及[更新说明](docs/release-notes/v1.8.5.md)。
13
+ **v1.8.7** 支持从 DSH Desktop 已登录账号读取官方余额,补齐多厂商价格并分离 OpenCode Zen/Go 目录,自动语言跟随 DSH,改进模型名识别并保留未知价格与历史金额。详见[更新说明](docs/release-notes/v1.8.7.md)。
14
14
 
15
15
  桌面端用户请按 [Desktop 安装说明](docs/install-troubleshooting.md#desktop-安装与更新),使用应用自带的 CLI 和 `desktop` Profile。
16
16
 
@@ -55,7 +55,7 @@
55
55
  | 峰谷计价时段显示 | 设置页 / 预算 / 今日费用 | 显示 UTC 峰时段 01:00–04:00、06:00–10:00 与当前档位;周末和已配置的中国法定假日(北京日期)全天按谷价计费并分别标注;展开态显示时段条与倒计时,收起态显示竖向条,可单独开关 |
56
56
  | 峰/谷切换弹窗提醒 | 全局浮层 | 距进入峰/谷时段不足设定提前量(默认 2 分钟,1-30 可配)时全屏色条徽标弹窗(提醒色区分进入峰/谷);弹窗位置可选**右下角 / 屏幕中心**,提醒类型可选(进入峰 / 进入谷 / 峰和谷),同一切换点只提醒一次;可选**同步发送浏览器(系统)通知**(页面最小化也能收到,需授权通知权限);设置页峰谷计价面板内配置,并可**一键预览弹窗效果**(真实组件渲染,文案/位置/通知与实际触发完全一致) |
57
57
  | 官方价格同步 | 设置页 | 抓取解析官方定价页,一键应用;可选**官方价格币种**(美元·英文官方页 / 人民币·中文官方页),人民币价按展示汇率折算入账、展示人民币时与官方账单一致 |
58
- | 界面语言 | 设置页 → 显示设置 | 简体中文 / English / 跟随浏览器(自动);切换即时生效并自动保存 |
58
+ | 界面语言 | 设置页 → 显示设置 | 简体中文 / English / 跟随 DSH(自动);切换即时生效并自动保存 |
59
59
  | 隐藏官方余额 / 隐藏今日消耗 | 设置页 → 显示设置 | 两个独立开关:开启后对应 UI 区块(侧边栏余额行与面板 / 今日费用行、预算明细、概览今日卡片等)**整体不再渲染**,token 与调用次数统计不受影响,共享屏幕/截图防泄露 |
60
60
  | AI 价格同步 | [提示词](docs/AI-PRICE-SYNC-PROMPT.md) | DeepSeek 官方同步;其他 provider 使用已核对的官方价格目录与手动配置 |
61
61
  | 模型与 Plan 适配说明 | [适配文档](docs/model-and-plan-adaptation.md) | 各厂商模型计费与各 Coding Plan 的适配矩阵、自动匹配机制与价格来源([English](docs/model-and-plan-adaptation.en.md)) |
@@ -170,10 +170,10 @@ CLIProxyAPI 网关来源卡片可勾选「只显示 Gemini 额度」,仅影响
170
170
 
171
171
  插件界面(会话徽章、侧边栏余额与预算图框、设置页全部文案)支持**简体中文**与**English**:
172
172
 
173
- - 语言可选 **简体中文** / **English** / **跟随浏览器(自动)**;
174
- - 默认「跟随浏览器」:自动探测浏览器语言(`zh*` → 中文,其余 → 英文),并把探测结果写回配置,服务端消息(余额查询、价格同步等)与界面语言保持一致;
173
+ - 语言可选 **简体中文** / **English** / **跟随 DSH(自动)**;
174
+ - 默认「跟随 DSH」:自动采用 DSH 当前语言,切换后即时更新统计页、设置导航等界面。旧宿主没有语言服务时,优先使用可读取的 DSH 已保存语言,再回退浏览器语言(`zh*` → 中文,其余 → 英文)。配置中的 `auto` 保持不变,不写回探测结果;
175
175
  - 在 **设置 → 费用 → 显示设置 → 界面语言** 中切换,切换后整个插件界面即时生效并自动保存;设置页左侧的分节标签也随之切换(费用 / Cost);
176
- - 服务端返回的提示(余额刷新、官方价格同步、配置校验错误等)同样按当前语言输出。
176
+ - 显式选择中文或英文时,插件界面和服务端提示都采用该选择。自动模式下,宿主读取 DSH 已保存语言;没有可观察的语言偏好时,保留中文兼容回退。仅存在于浏览器或原生初始化中的临时语言,以及不同客户端各自的语言,宿主无法推断,这些情况下提示可能与界面不同。
177
177
 
178
178
  ## 图文演示
179
179
 
@@ -320,22 +320,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
320
320
  dsh plugin --profile web add dsh-cost-meter
321
321
  ```
322
322
 
323
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.5`**,建议先下载审阅再运行):
323
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.7`**,建议先下载审阅再运行):
324
324
 
325
325
  ```powershell
326
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.5/install.ps1 | iex
326
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.7/install.ps1 | iex
327
327
  ```
328
328
 
329
329
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
330
330
 
331
331
  ```sh
332
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.5
332
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.7
333
333
  ```
334
334
 
335
335
  没有 git 时可用 GitHub tag 打包直链:
336
336
 
337
337
  ```sh
338
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.5.tar.gz
338
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.7.tar.gz
339
339
  ```
340
340
 
341
341
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
@@ -387,7 +387,7 @@ DSH `0.2.0-rc.1` 已通过安装包安装、Web 启动、模块复用、合成
387
387
 
388
388
  如果插件市场仅显示 `diagnostics: .../.plugin-manager/logs/operation-.../pnpm.log`,这行信息无法指出失败的包或命令。请打开所指的 `pnpm.log`,反馈其中第一条实际错误;分享前删去凭据及私人路径。DSH `0.2.0-rc.1` 的 Git 地址和 npm 包名安装已在隔离 Windows 环境通过;特定机器上的失败仍需要该机器的诊断日志。
389
389
 
390
- 账号模式下余额返回 HTTP 401:请在「设置 → 费用 → 官方账户余额」保存独立的开放平台 API Key。凭据优先级和存储说明见[余额专用凭据](docs/balance-credentials.md)。
390
+ 账号模式余额:DSH 桌面版登录官方账号后无需 API Key,插件直接读取账号钱包;若仍报 HTTP 401,请在「设置 → 费用 → 官方账户余额」保存独立的开放平台 API Key。凭据来源、优先级和存储说明见[余额凭据来源](docs/balance-credentials.md)。
391
391
 
392
392
  ### 更新 / 卸载
393
393
 
@@ -0,0 +1,62 @@
1
+ # 2026-10 模型价格目录与渠道选择 / Model pricing and routes
2
+
3
+ 核对日期 / Checked: 2026-10-03
4
+
5
+ ## 中文
6
+
7
+ 本次针对 #224 补齐 GPT-6 Sol/Luna、GPT-6.1 Sol、Gemini 3.8 Flash、Claude Fable 5.1、Opus 5.5 等模型,并按公开价格页面扩充其他模型。内置第三方目录包含 271 个「厂商 / 模型」条目、179 个不同模型 ID(含官方别名和历史快照 ID);其中 269 条有可执行价格,2 条明确未核价。DeepSeek 主表单独保留。OpenRouter 仍在启动、手动同步及每小时从公开目录补充本渠道模型,静态目录的数量不是在线目录的上限。
8
+
9
+ ### 先选渠道,再选模型
10
+
11
+ - `openai`、`anthropic`、`google`、`xai`、`mistral`、`z-ai` 使用各自直接 API 的价格。已知厂商不会自动套用另一厂商的模型价
12
+ - `opencode-zen` 是本次明确区分的 **Zen 按量渠道**,覆盖核对当天端点表全部 83 个模型
13
+ - `opencode-go` 使用 **Go 订阅参考价**,覆盖全部 30 个模型;这些价格用于额度和等值费用估算,不代表每次请求额外扣款
14
+ - 为兼容本项目历史宿主配置,`zen` / `opencode` 仍按 Go 别名处理;用户在原渠道手写的价格条目及显式映射优先。按量 Zen 请选择 `opencode-zen` 的价格条目,不要依靠历史别名猜测。这是价格渠道键,不会创建宿主推理 Provider;宿主仍使用历史名字时,可显式映射到 `opencode-zen:<模型 ID>`,并把该宿主模型的 Plan/API 分类指定为 API。模型级 Plan/API 覆盖仍优先于自动分类
15
+ - 缺失渠道的旧宿主兼容推断只保留旧 Go 模型集合,并且要求该模型仍在 Go 渠道表中。新增目录条目不会仅因同名就把 API 消费变成订阅
16
+ - `openrouter` 使用完整模型 ID 精确匹配。`:free` / `:online` 等变体、其他路由及本地模型不会借用其价格
17
+
18
+ 例如 Gemini 3.8 Flash 的直接 Google 促销价是输入 $0.75 / 输出 $3.75,Zen 是 $1.50 / $7.50,每百万 token。Zen 的 DeepSeek Pro 为固定 $1.74 / $3.48;Go 的 Pro 为自己的峰谷参考价;均不能复用直接 DeepSeek 的当前 Flash 路由价。
19
+
20
+ 自动匹配允许唯一的大小写、标点和日期装饰别名,以及与实际厂商一致的已知前缀,如 `openai/gpt-6.1-sol`、`anthropic/claude-opus-5.5`。不同版本、未知变体、多个候选或错误厂商前缀保持未定价。`exact` 模式要求价格表中存储的完整 ID。
21
+
22
+ ### 单位、缓存和上下文
23
+
24
+ - 新条目使用 **USD / 1M tokens**。Go 的 USD 参考价不受直接 API 的 CNY 主表设置影响
25
+ - GPT-6 / GPT-5.6 的输入、缓存读、缓存写和输出分别计价。超过 272,000 个完整输入 token(含缓存读写)时,整次请求切换长上下文档;不能用日 / 会话聚合 token 猜每次请求的档位
26
+ - xAI 直接 API 从 **200,000 个输入 token 起**进入长档;Zen 的相应表为 **超过 200,000**。两者分别保存
27
+ - Claude 使用已公布的 5 分钟缓存写价;1 小时写入是不同费率,但宿主通用写缓存桶无法区分 TTL,详情已记在各模型注释中。需要 1 小时缓存准确费用时,应核对供应商账单或明确配置该场景价格
28
+ - Gemini 的缓存存储价格按 **token·小时**计算,未当作每请求的缓存写 token 价格。音频、图像生成、搜索 / 工具固定费用、批处理、特殊服务档及地区附加费不纳入通用文本 token 估算,相关条目保留适用范围说明
29
+ - Go 的 DeepSeek 峰谷使用其公开的 **UTC 周一至周五 01:00–04:00、06:00–10:00**窗口;周末为谷价,不套用直接 DeepSeek 的北京法定假日规则。关闭峰谷时仍使用基础参考价
30
+
31
+ ### 升级与边界
32
+
33
+ 一次性升级只添加真正新增的 ID,并更新与旧内置行完整匹配的未改动价格。手写价格、缓存 TTL 扩展字段、显式未定价条目、手动映射及已取消挂载的旧模型均保留;升级后取消挂载的新模型也不会在重启时复活。
34
+
35
+ 本次迁移不修改已记录的历史金额。当前快照和优惠不能用来替换没有历史价格依据的旧支出。Google 3.6 / 3.7 / 3.8 Flash 当前优惠截至 2026-12-31,官方已公布之后翻倍;到期后须更新价格快照或自行核对价格,当前条目的注释已明确标记优惠期限。
36
+
37
+ `openai:gpt-5.5-pro` 的短 / 长档价格已公布,但直接 API 文档没有明确完整的上下文计数和等号边界,本次保守标为未核价并保留已公布金额说明。NVIDIA 未公布 token 价格的旧条目也继续未核价。没有可靠价格的模型不是免费模型,可以手动配置已确认的本渠道价格。
38
+
39
+ ## English
40
+
41
+ The third-party catalog now contains 271 provider/model entries and 179 distinct model IDs, including official aliases and dated snapshots: 269 executable prices and 2 explicitly unpriced entries. The separate DeepSeek table remains intact. OpenRouter continues its existing public-directory refresh at startup, on manual sync and hourly.
42
+
43
+ Use direct vendor IDs for their own API prices, `opencode-zen` for all 83 published Zen PAYG endpoints, and `opencode-go` for all 30 published Go subscription-reference endpoints. Historical host IDs `zen` / `opencode` retain their Go meaning; manually entered prices and explicit mappings win. These are pricing keys, not newly registered inference providers. If a PAYG host uses a historical name, explicitly map its model to `opencode-zen:<model ID>` and set that host model’s Plan/API class to API. A model-level Plan/API override remains authoritative. Catalog growth does not infer new subscription usage from a bare model name.
44
+
45
+ Prices are USD per million tokens. Cache reads/writes and per-request context tiers are separate. OpenAI thresholds count complete input, including cached tokens; xAI's direct 200K boundary is inclusive while Zen's is exclusive. Claude generic cache writes use the published 5-minute tier; 1-hour TTL, Gemini cache storage charged per token-hour, modality-specific prices, tool fees and special processing tiers need separate accounting. Go's DeepSeek tiers use its UTC weekday schedule, not direct DeepSeek's Beijing holiday calendar.
46
+
47
+ The one-time upgrade preserves custom prices, supported TTL fields, explicit unpriced rows, mappings and previously unmounted IDs. It never changes recorded historical spend. Google Flash promotions expire after 2026-12-31; update the snapshot or verify the supplier's prices before using it after expiry. Direct GPT-5.5 Pro remains explicitly unpriced because its exact context-counting/boundary rule is unresolved; published short/long prices are retained as notes.
48
+
49
+ ## Primary sources / 一手来源
50
+
51
+ - [OpenAI Standard API prices](https://developers.openai.com/api/docs/pricing) and individual model pages linked by each row
52
+ - [Anthropic pricing](https://platform.claude.com/docs/en/about-claude/pricing) and official model-ID documentation
53
+ - [Google Gemini Developer API prices](https://ai.google.dev/gemini-api/docs/pricing?hl=en)
54
+ - [xAI API prices](https://docs.x.ai/developers/pricing)
55
+ - [Mistral API prices](https://docs.mistral.ai/inference/pricing) and per-model alias pages
56
+ - [Z.ai API prices](https://docs.z.ai/guides/overview/pricing)
57
+ - [OpenCode Zen](https://opencode.ai/docs/zen), [OpenCode Go](https://opencode.ai/docs/go)
58
+ - [OpenRouter public model directory](https://openrouter.ai/api/v1/models)
59
+
60
+ Every new source-backed row includes `sourceUrl` and `checkedAt`. [`provider-pricing.json`](provider-pricing.json) is generated from executable code. Run `node test/check-opencode-catalog.mjs` to compare the complete current Zen/Go public endpoint and price tables, including free rows, cache writes, context tiers and peak/off-peak rows. This read-only check uses no account credentials or paid inference calls.
61
+
62
+ Captured primary endpoint/price rows are checked offline in the full regression suite: [`opencode-pricing-2026-10-03.json`](../test/fixtures/opencode-pricing-2026-10-03.json). The standalone checker can also reread the live primary pages.