@chenlongapps/opencode-token-usage 0.5.0 → 0.5.2

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
@@ -39,7 +39,7 @@ Use it to see how many tokens a session and its subagents consume, how full the
39
39
  Requires **OpenCode 2** and **Node.js 22+**. See [Compatibility](#compatibility) for verified host versions and the OpenTUI engine caveat.
40
40
 
41
41
  ```bash
42
- opencode plugin add @chenlongapps/opencode-token-usage
42
+ opencode plugin add @chenlongapps/opencode-token-usage@latest
43
43
  ```
44
44
 
45
45
  Restart OpenCode after installation.
@@ -61,7 +61,9 @@ Instead of the command above, add the package to your project's `opencode.json`
61
61
  ```json
62
62
  {
63
63
  "$schema": "https://opencode.ai/config.json",
64
- "plugins": ["@chenlongapps/opencode-token-usage"]
64
+ "plugins": [
65
+ "@chenlongapps/opencode-token-usage@latest"
66
+ ]
65
67
  }
66
68
  ```
67
69
 
@@ -114,7 +116,7 @@ Costs follow the sidebar's pricing and `partial`/unavailable/free conventions. I
114
116
  | `Steps` | Assistant message count across the session tree, including subagents; follows OpenCode's own stats definition, so compaction and user messages are not steps |
115
117
  | `Est. Cost` | Estimated cost across the tree, pricing each assistant and compaction call with its actual model |
116
118
  | `Run Time` | The viewed session's cumulative native per-turn response duration; while running, includes a display-only estimate of the current turn's elapsed time marked with `~`; never adds child-session durations |
117
- | `TPS` | Provider-reported average throughput for `Output + Reasoning` across the tree. While streaming, a valid recent observable text, reasoning-summary and tool-input estimate (UTF-8 bytes / 4) takes precedence and is marked with `~`. It requires at least 20 estimated tokens accumulated in that response, three merged batches in the current window and a span of at least 500 ms, excluding pre-first-token waiting. APIs such as OpenAI Responses do not expose complete hidden reasoning tokens in real time, so live values cannot represent hidden reasoning throughput. Completion restores provider-reported throughput without `~` |
119
+ | `TPS` | Provider-reported average throughput for `Output + Reasoning` across the tree. While streaming, a valid estimate from delivered text, reasoning summaries and tool input (UTF-8 bytes / 4) takes precedence and is marked with `~`. A fast window is preferred, with a longer fallback for sparse delivery. Completion restores historical throughput without `~` |
118
120
  | `TTFT` | Average time to first token across measurable assistant steps in the tree, preferring OpenCode's native first-token timestamp |
119
121
 
120
122
  #### Behavior
@@ -132,7 +134,9 @@ Costs follow the sidebar's pricing and `partial`/unavailable/free conventions. I
132
134
  - `Est. Cost` prices each message with its recorded model. Complete non-zero OpenCode prices take precedence. A verified Free SKU contributes the estimate at its paid counterpart's rate when that rate covers the call; By Model labels this `Free usage reference`, not a charge. Otherwise keep valid zero rates (except reviewed billing exceptions). Fallbacks replace the whole schedule without mixing rates or filling in missing categories.
133
135
  - The offline snapshot is generated from [models.dev](https://models.dev/catalog.json) using verified LAB/model identities. It keeps one schedule per model or billing SKU: official non-zero prices first, then OpenRouter, Vercel AI Gateway, Amazon Bedrock and LLM Gateway in order, then the lowest other non-zero base Input + Output rate, and finally explicit zero prices. Reviewed overrides replace entire schedules. Free references are exact SKU links to existing rates, not duplicated quotes or guesses based on a suffix. No prices are downloaded or compared across providers at runtime.
134
136
  - Confirmed free usage displays `$0.00`; positive estimates below `$0.001` display `<$0.001`, estimates through and including `$0.01` use three decimal places, and larger estimates use two. Unavailable prices display `—`; known subtotals with unpriced messages are marked `partial`. The snapshot excludes gateway markups, regional premiums, unlisted discounts, non-text billing, tool fees, and taxes, so Est. Cost is not a provider bill. See [price sources and limitations](docs/pricing.md).
135
- - Live `TPS` uses a ~2s sliding window and batches deliveries within 100 ms. It starts calculating and displaying only when all three conditions hold: that response has accumulated at least 20 estimated tokens (80 UTF-8 bytes), the current window contains at least three merged batches, and those batches span at least 500 ms. The first batch counts toward the response-wide threshold but is only a speed baseline: its bytes are not counted as output generated after its timestamp. Token readiness is separate for each response, never pooled across responses or subagents. Smoothing follows elapsed time rather than delta count. Before readiness, historical TPS takes over, or the row is hidden if unavailable. After 2s without a new delta, a shared in-memory timeout expires the estimate without reading history. Resuming output after expiry starts a fresh baseline and smoothing state and must satisfy the batch/span conditions again; the same response's accumulated token count is retained.
137
+ - Live `TPS` merges deliveries within 100 ms and samples each response independently. The fast path keeps the 2s window, requires at least 80 UTF-8 bytes over the response and at least three batches spanning 500 ms in the window, and smooths by elapsed time. The first batch counts toward readiness but only sets the baseline; its bytes do not enter the speed calculation.
138
+ - When the fast estimate is unavailable, the sparse fallback averages a contiguous span of up to 30s. It needs at least 12 UTF-8 bytes in that span (including the baseline) and at least three batches spanning 3s. The two most recent batch intervals must be at least 500 ms and within a factor of three of each other. A single batch of at least 80 bytes that contributes more than 75% of the measured bytes becomes a new baseline instead of producing a spike. Fast output takes priority again as soon as it qualifies, without inheriting the slow average.
139
+ - A fast estimate expires after 2s of silence. Sparse estimates expire after three times the lower median of up to five recent qualifying intervals, bounded to 6–30s. A shared in-memory timeout uses a local monotonic clock for expiry and never reads history. Short fast expiry does not discard sparse candidates; expired slow samples and tool or retry boundaries require a fresh baseline without resetting response-wide byte counts or ending the step. Without a valid estimate the display uses historical TPS or hides it if unavailable. Positive estimates below `0.1` display as `~<0.1 tok/s`.
136
140
  - Reconnection resets live TPS windows and reconciles all tracked sessions, including offscreen sessions, with the server's active-session set. Quiet unfinished streams get a shared activity check after 60s, without reading message history. Confirmed inactive streams and their TTFT observations expire after a further 60s. Running tools, retries and pre-first-token waits have no hard lifetime; failed activity reads retain state and retry. Provider `streamed` metadata alone never means that tools have finished. Checks stop when no unfinished streams remain.
137
141
  - Live TPS measures observable delivery, not the model's internal token-generation clock. Responses summary bursts, done-only content and transport buffering can still affect estimates; complete hidden reasoning cannot be reconstructed. Without `~`, TPS is `Σ(Output + Reasoning) ÷ Σ(time.streamed − (time.firstToken ?? time.created))` in seconds across valid assistant samples in the tree. Valid native first-token timing excludes pre-first-token waiting, matching the host's per-step denominator; older hosts/history without it retain the full request-duration fallback. This is a tree-wide weighted average, not just the current turn or recent delivery window. No model-specific multipliers, hard TPS caps or hidden-reasoning guesses are applied.
138
142
  - `TTFT` prefers native `time.firstToken − time.created` in history and `session.step.first-token` during streaming. A buffered delta cannot overwrite native timing. Older hosts fall back to the first nonempty text/reasoning/tool-input delta, or historical reasoning/tool creation times when measurable; text-only history without a native first-token timestamp has no recoverable TTFT. Native timing survives reopening and live-observation expiry. Retries reusing a message ID replace the previous attempt's sample. TTFT remains the average across measurable steps in the whole tree, whereas OpenCode's footer uses the first measurable step in the current turn, so multi-step/subagent values need not match.
package/README.zh-CN.md CHANGED
@@ -39,7 +39,7 @@
39
39
  需要 **OpenCode 2** 和 **Node.js 22+**。已验证宿主版本及 OpenTUI 引擎限制见[兼容性](#兼容性)。
40
40
 
41
41
  ```bash
42
- opencode plugin add @chenlongapps/opencode-token-usage
42
+ opencode plugin add @chenlongapps/opencode-token-usage@latest
43
43
  ```
44
44
 
45
45
  安装后重启 OpenCode。
@@ -61,7 +61,9 @@ opencode plugin add @chenlongapps/opencode-token-usage
61
61
  ```json
62
62
  {
63
63
  "$schema": "https://opencode.ai/config.json",
64
- "plugins": ["@chenlongapps/opencode-token-usage"]
64
+ "plugins": [
65
+ "@chenlongapps/opencode-token-usage@latest"
66
+ ]
65
67
  }
66
68
  ```
67
69
 
@@ -114,7 +116,7 @@ OpenCode **2.3.0 现已通过完整检查**,包含插件详情与原生 `/usag
114
116
  | `Steps` | 全树(含子代理)的 assistant 消息数,口径与 OpenCode 自带统计一致,compaction 与用户消息不计为 step |
115
117
  | `Est. Cost` | 按每条 assistant 与 compaction 消息实际模型估算的全树费用 |
116
118
  | `Run Time` | 被查看会话自身的累计原生对话耗时;运行中包含仅用于显示的当前轮已耗时估算,以 `~` 标记;不额外叠加子会话耗时 |
117
- | `TPS` | 服务端已上报的全树 `Output + Reasoning` 平均吞吐。流式进行中时,优先显示有效的近期可观察文本、reasoning summary 和工具输入估算(UTF-8 字节数 / 4),以 `~` 标记;需单次响应累计至少 20 个估算 Token、当前窗口至少 3 个合并批次且跨度至少 500ms,不计首 token 前等待时间。OpenAI Responses 等 API 不会实时暴露完整的隐藏 reasoning token,因此实时值不能表示隐藏推理吞吐。完成后恢复不带 `~` 的服务端上报吞吐 |
119
+ | `TPS` | 服务端已上报的全树 `Output + Reasoning` 平均吞吐。流式进行中时,优先显示已交付文本、推理摘要和工具输入的有效估算(UTF-8 字节数 / 4),以 `~` 标记。优先使用快速窗口,稀疏交付时可回退到较长窗口。完成后恢复不带 `~` 的历史吞吐 |
118
120
  | `TTFT` | 全树中可测 assistant step 的平均首 token 时间,优先使用 OpenCode 原生首 token 时间戳 |
119
121
 
120
122
  #### 行为
@@ -132,7 +134,9 @@ OpenCode **2.3.0 现已通过完整检查**,包含插件详情与原生 `/usag
132
134
  - `Est. Cost` 按每条消息记录的实际模型分别计算。OpenCode 的完整非零价格优先。已确认对应付费型号的 Free SKU,按该参考价计入总额,并在 By Model 标注 `Free usage reference`,不代表实际扣费。没有完整参考价时保留有效零价(已核实的计费例外除外)。费率整条回退,不混用,也不填补缺失类别。
133
135
  - 离线快照用 [models.dev](https://models.dev/catalog.json) 的 LAB/标准模型身份生成。每个模型或计费 SKU 只保留一套费率:原厂非零价优先,再依次查找 OpenRouter、Vercel AI Gateway、Amazon Bedrock、LLM Gateway,其次是其他 Provider 中基础 Input + Output 最低的非零价,最后才是明确的零价。人工例外整条替换。免费参考价只通过精确 SKU 关联已有费率,不复制报价,也不靠删后缀猜价。运行时不下载价格,也不在供应商之间重新选价。
134
136
  - 确认免费时显示 `$0.00`;正费用低于 `$0.001` 时显示 `<$0.001`,不超过 `$0.01` 的费用保留三位小数,更高费用保留两位。价格不可用时显示 `—`;只有部分消息可计算时在已知小计后标注 `partial`。快照不含网关加价、区域溢价、未列明的折扣、非文本计费、工具费和税费;Est. Cost 是估算而非账单。覆盖范围、来源和限制见[价格来源与限制](docs/pricing.md)。
135
- - 实时 `TPS` 使用约 2 秒滑动窗口,合并 100ms 内的增量。只有同时满足三项条件才开始计算和显示:单次响应累计至少 20 个估算 Token(80 个 UTF-8 字节)、当前窗口至少 3 个合并批次、这些批次的有效跨度至少 500ms。首批增量计入响应累计门槛,但仅作测速基线,其字节不计为该时间戳之后生成的输出。各响应独立累计,不跨响应或子代理合并门槛。平滑按经过时间而非 delta 条数推进。门槛未满足时回退到历史 TPS,没有可用历史值则隐藏该行。2 秒没有新增量时,共享的内存超时任务使估算过期,不读取历史。过期后恢复输出时,重新建立基线与平滑状态,并重新满足批次数和跨度条件;同一响应的累计 Token 数保留。
137
+ - 实时 `TPS` 合并 100ms 内的增量,每个响应独立采样。快速路径保留 2 秒窗口,要求响应累计至少 80 个 UTF-8 字节、窗口内至少 3 批且跨度至少 500ms,按经过时间平滑。首批计入门槛,但只作测速基线,其字节不进入速度分子。
138
+ - 快速估算不可用时,低速回退在不超过 30 秒的连续稀疏区间取平均。区间内至少有 12 个 UTF-8 字节(含基线)、至少 3 批且跨度至少 3 秒;最近两个批次间隔均须至少 500ms,且较长者不超过较短者的 3 倍。若单批至少有 80 字节且占测速字节超过 75%,则将其作为新基线,不显示速度尖峰。快速输出重新满足门槛即优先显示,不沿用低速平均。
139
+ - 快速估算静默 2 秒后过期;低速估算取最近最多 5 个有效间隔的下中位数乘以 3,限制在 6–30 秒。共享内存超时用本地单调时钟判断过期,不读取历史。快速估算过期不清空稀疏候选样本;低速窗口过期、工具执行或重试边界则重新建立基线,不清零同一响应累计字节,也不结束 step。没有有效估算时,回退历史 TPS,无历史值则隐藏。正估算值低于 `0.1` 时显示 `~<0.1 tok/s`。
136
140
  - 重连时重置实时 TPS 窗口,并通过服务端活动会话列表对账全部已跟踪会话,包括离屏会话。未结束的流静默 60 秒后进行共享活动检查,不读取消息历史;确认会话已停止后,再保留 60 秒并回收流及其 TTFT 观察。仍在运行的工具、重试及首 token 前等待没有硬性寿命上限;活动查询失败时保留状态并重试。仅有提供商的 `streamed` 元数据不代表工具已结束。没有未结束流时停止检查。
137
141
  - 实时 TPS 测量可观察的内容交付,而非模型内部生成 token 的时钟。Responses 摘要突发、仅在 done 中返回的内容和传输缓冲仍可能影响估算,不能还原完整隐藏推理。不带 `~` 时,TPS 为全树有效 assistant 样本的 `Σ(Output + Reasoning) ÷ Σ(time.streamed − (time.firstToken ?? time.created))`(换算为秒)。有效原生首 token 时间会排除首 token 前等待,与宿主的单步分母一致;旧宿主/历史缺少该时间时保留完整请求时长回退。它是全树加权平均,不是仅取当前轮或近期交付窗口。不做模型专属倍率、TPS 硬上限或隐藏 reasoning token 猜测。
138
142
  - `TTFT` 在历史中优先使用原生 `time.firstToken − time.created`,流式过程中使用 `session.step.first-token`;缓冲后的 delta 不会覆盖原生时间。旧宿主回退到首个非空文本/推理/工具输入 delta,或可测的历史 reasoning/tool 创建时间;没有原生首 token 时间的纯文本历史无法恢复 TTFT。原生时间可在重新打开会话和实时观察过期后恢复。重试复用消息 ID 时替换上次尝试的样本。TTFT 仍是整棵树可测 step 的平均值,而 OpenCode 页脚取当前轮首个可测 step,多步/子代理场景不保证数值相同。
@@ -37,7 +37,7 @@ export interface PerformanceOptions {
37
37
  active?: ReadActiveSessions | undefined;
38
38
  }
39
39
  /** Requires three merged batches; the first is a baseline, not newly generated bytes. */
40
- export declare function estimatedLiveTps(samples: readonly StreamSample[]): number | undefined;
40
+ export declare function estimatedLiveTps(samples: readonly StreamSample[], start?: number): number | undefined;
41
41
  /** Time-based EWMA: elapsed time determines the weight, never delta count. */
42
42
  export declare function smoothLiveTps(previous: number | undefined, raw: number, elapsed?: number): number;
43
43
  export interface PreparedPerformance {
@@ -75,6 +75,8 @@ export declare class PerformanceMonitor {
75
75
  private publish;
76
76
  private deleteSession;
77
77
  private resetLive;
78
+ private breakDelivery;
79
+ private recordDelta;
78
80
  private touch;
79
81
  private finish;
80
82
  /** One shared, history-free read covers offscreen sessions too. Failures are not idle. */
@@ -6,20 +6,31 @@ export const LIVE_MIN_TOKENS = 20;
6
6
  export const LIVE_MIN_BATCHES = 3;
7
7
  export const LIVE_EWMA_ALPHA = 0.35;
8
8
  export const LIVE_BYTES_PER_TOKEN = 4;
9
+ const SLOW_WINDOW_MS = 30_000;
10
+ const SLOW_MIN_SPAN_MS = 3_000;
11
+ const SLOW_MIN_BYTES = 12;
12
+ const SLOW_MIN_INTERVAL_MS = 500;
13
+ const SLOW_MIN_QUIET_MS = 6_000;
14
+ const SLOW_INTERVAL_FACTOR = 3;
15
+ const SLOW_RECENT_INTERVALS = 5;
16
+ const SLOW_MAX_BURST_SHARE = 0.75;
17
+ const FAST_MIN_BYTES = LIVE_MIN_TOKENS * LIVE_BYTES_PER_TOKEN;
18
+ const utf8 = new TextEncoder();
9
19
  /** Quiet streams need a server liveness check, not a maximum tool-wait duration. */
10
20
  export const ACTIVITY_CHECK_MS = 60_000;
11
21
  /** Requires three merged batches; the first is a baseline, not newly generated bytes. */
12
- export function estimatedLiveTps(samples) {
13
- if (samples.length < LIVE_MIN_BATCHES)
22
+ export function estimatedLiveTps(samples, start = 0) {
23
+ if (samples.length - start < LIVE_MIN_BATCHES)
14
24
  return undefined;
15
- const first = samples[0];
25
+ const first = samples[start];
16
26
  const last = samples[samples.length - 1];
17
27
  const duration = last.time - first.time;
18
28
  if (!Number.isFinite(duration) || duration < LIVE_MIN_SPAN_MS)
19
29
  return undefined;
20
30
  let bytes = 0;
21
31
  let time = first.time;
22
- for (const sample of samples) {
32
+ for (let index = start; index < samples.length; index++) {
33
+ const sample = samples[index];
23
34
  if (!Number.isFinite(sample.time) || sample.time < time || !Number.isFinite(sample.bytes) || sample.bytes < 0)
24
35
  return undefined;
25
36
  if (sample.time > first.time)
@@ -30,6 +41,48 @@ export function estimatedLiveTps(samples) {
30
41
  return undefined;
31
42
  return (bytes / LIVE_BYTES_PER_TOKEN) / (duration / 1_000);
32
43
  }
44
+ function estimateSlow(samples, since) {
45
+ const end = samples.length - 1;
46
+ if (end < 2)
47
+ return undefined;
48
+ const last = samples[end];
49
+ const recent = last.time - samples[end - 1].time;
50
+ const previous = samples[end - 1].time - samples[end - 2].time;
51
+ // One long pause between dense deliveries isn't evidence of a slow stream.
52
+ const min = Math.max(SLOW_MIN_INTERVAL_MS, Math.max(recent, previous) / SLOW_INTERVAL_FACTOR);
53
+ const max = Math.min(recent, previous) * SLOW_INTERVAL_FACTOR;
54
+ if (Math.min(recent, previous) < min)
55
+ return undefined;
56
+ const intervals = [];
57
+ let start = end;
58
+ let bytes = 0;
59
+ let largest = last;
60
+ while (start > 0) {
61
+ const batch = samples[start], baseline = samples[start - 1];
62
+ const gap = batch.time - baseline.time;
63
+ if (baseline.time < since || gap < min || gap > max)
64
+ break;
65
+ if (intervals.length < SLOW_RECENT_INTERVALS)
66
+ intervals.push(gap);
67
+ bytes += batch.bytes;
68
+ if (batch.bytes > largest.bytes)
69
+ largest = batch;
70
+ start--;
71
+ }
72
+ const baseline = samples[start];
73
+ const duration = last.time - baseline.time;
74
+ if (end - start + 1 < LIVE_MIN_BATCHES || duration < SLOW_MIN_SPAN_MS || bytes + baseline.bytes < SLOW_MIN_BYTES)
75
+ return undefined;
76
+ // Don't give one substantial buffered burst a long-lived slow estimate.
77
+ // Rebaseline at that delivery rather than capping a legitimate sampled rate.
78
+ if (largest.bytes >= FAST_MIN_BYTES && largest.bytes > bytes * SLOW_MAX_BURST_SHARE)
79
+ return { restartAt: largest.time };
80
+ // The lower median also avoids inflating the deadline with one long gap when
81
+ // there are only two intervals. The baseline counts only toward readiness.
82
+ intervals.sort((a, b) => a - b);
83
+ const quiet = Math.min(SLOW_WINDOW_MS, Math.max(SLOW_MIN_QUIET_MS, SLOW_INTERVAL_FACTOR * intervals[Math.floor((intervals.length - 1) / 2)]));
84
+ return { tps: (bytes / LIVE_BYTES_PER_TOKEN) / (duration / 1_000), duration, quiet };
85
+ }
33
86
  /** Time-based EWMA: elapsed time determines the weight, never delta count. */
34
87
  export function smoothLiveTps(previous, raw, elapsed = LIVE_MIN_SPAN_MS) {
35
88
  if (previous === undefined || !Number.isFinite(previous))
@@ -192,10 +245,82 @@ export class PerformanceMonitor {
192
245
  step.samples = [];
193
246
  delete step.bucketStarted;
194
247
  delete step.observedAt;
195
- delete step.liveTps;
196
- delete step.liveDuration;
248
+ delete step.fastSince;
249
+ delete step.slowSince;
250
+ delete step.slowQuiet;
251
+ delete step.live;
197
252
  delete step.smoothedAt;
198
253
  }
254
+ breakDelivery(step, time) {
255
+ const wasLive = step.live !== undefined;
256
+ step.sampleBoundary = time;
257
+ this.resetLive(step);
258
+ if (wasLive)
259
+ this.publish(step.sessionID);
260
+ }
261
+ recordDelta(step, time, bytes) {
262
+ const now = this.monotonic();
263
+ const last = step.samples.at(-1);
264
+ const gap = last ? time - last.time : 0; // Server time, used only against server time.
265
+ if (gap >= (step.slowQuiet ?? SLOW_WINDOW_MS))
266
+ this.resetLive(step);
267
+ if (gap >= LIVE_WINDOW_MS || (step.observedAt !== undefined && now - step.observedAt >= LIVE_WINDOW_MS)) {
268
+ step.fastSince = time;
269
+ delete step.smoothedAt;
270
+ }
271
+ const batch = step.samples.at(-1);
272
+ if (batch && step.bucketStarted !== undefined && time - step.bucketStarted < LIVE_SAMPLE_MS) {
273
+ // Include a whole delivery burst in one batch, including the initial baseline.
274
+ batch.time = time;
275
+ batch.bytes += bytes;
276
+ }
277
+ else {
278
+ step.bucketStarted = time;
279
+ step.samples.push({ time, bytes });
280
+ }
281
+ // Keep at most ~301 entries (100ms batches); once fast TPS is established,
282
+ // batches older than its window can't seed either estimate.
283
+ const oldest = Math.max(time - SLOW_WINDOW_MS, (step.slowSince ?? -Infinity) - LIVE_WINDOW_MS);
284
+ while (step.samples[0].time < oldest)
285
+ step.samples.shift();
286
+ step.observedAt = now;
287
+ // Fast readiness is response-wide and survives window resets.
288
+ if (step.bytes >= FAST_MIN_BYTES) {
289
+ const cutoff = Math.max(step.fastSince ?? -Infinity, time - LIVE_WINDOW_MS);
290
+ let start = step.samples.length - 1;
291
+ while (start > 0 && step.samples[start - 1].time >= cutoff)
292
+ start--;
293
+ const raw = estimatedLiveTps(step.samples, start);
294
+ if (raw !== undefined) {
295
+ const previous = step.smoothedAt === undefined ? undefined : step.live;
296
+ const elapsed = time - (step.smoothedAt ?? time);
297
+ if (previous && elapsed < LIVE_SAMPLE_MS)
298
+ previous.expiresAt = now + LIVE_WINDOW_MS;
299
+ else {
300
+ step.live = {
301
+ tps: smoothLiveTps(previous?.tps, raw, elapsed),
302
+ duration: time - step.samples[start].time,
303
+ expiresAt: now + LIVE_WINDOW_MS,
304
+ };
305
+ step.smoothedAt = time;
306
+ }
307
+ step.slowSince = time;
308
+ delete step.slowQuiet;
309
+ return;
310
+ }
311
+ }
312
+ delete step.smoothedAt;
313
+ const slow = estimateSlow(step.samples, step.slowSince ?? -Infinity);
314
+ if (slow && slow.restartAt === undefined) {
315
+ step.slowQuiet = slow.quiet;
316
+ step.live = { tps: slow.tps, duration: slow.duration, expiresAt: now + slow.quiet };
317
+ }
318
+ else {
319
+ if (slow)
320
+ step.slowSince = slow.restartAt;
321
+ delete step.live;
322
+ }
323
+ }
199
324
  touch(step, created) {
200
325
  step.revision++;
201
326
  step.checkedAt = this.monotonic();
@@ -286,9 +411,14 @@ export class PerformanceMonitor {
286
411
  this.active.delete(key);
287
412
  changed.add(step.sessionID);
288
413
  }
289
- else if (step.observedAt !== undefined && monotonic - step.observedAt >= LIVE_WINDOW_MS) {
290
- this.resetLive(step);
291
- changed.add(step.sessionID);
414
+ else {
415
+ if (step.live && step.live.expiresAt <= monotonic) {
416
+ delete step.live;
417
+ delete step.smoothedAt;
418
+ changed.add(step.sessionID);
419
+ }
420
+ if (step.observedAt !== undefined && monotonic - step.observedAt >= (step.slowQuiet ?? SLOW_WINDOW_MS))
421
+ this.resetLive(step);
292
422
  }
293
423
  }
294
424
  for (const [key, sample] of this.observed) {
@@ -314,8 +444,10 @@ export class PerformanceMonitor {
314
444
  next = Math.min(next, step.checkedAt + ACTIVITY_CHECK_MS - monotonic);
315
445
  }
316
446
  // Local monotonic age, never client epoch minus a remote event timestamp.
447
+ if (step.live)
448
+ next = Math.min(next, step.live.expiresAt - monotonic);
317
449
  if (step.observedAt !== undefined)
318
- next = Math.min(next, step.observedAt + LIVE_WINDOW_MS - monotonic);
450
+ next = Math.min(next, step.observedAt + (step.slowQuiet ?? SLOW_WINDOW_MS) - monotonic);
319
451
  }
320
452
  for (const sample of this.observed.values()) {
321
453
  if (retain && sample.expiresAt !== undefined)
@@ -370,8 +502,11 @@ export class PerformanceMonitor {
370
502
  if (event.type === "session.execution.started"
371
503
  || (event.type === "session.status" && ["busy", "retry"].includes(String(data.status?.type)))) {
372
504
  for (const step of this.active.values()) {
373
- if (step.sessionID === sessionID && finite(event.created) && event.created >= step.latest)
374
- this.touch(step, event.created);
505
+ if (step.sessionID !== sessionID || !finite(event.created) || event.created < step.latest)
506
+ continue;
507
+ this.touch(step, event.created);
508
+ if (event.type === "session.status" && data.status?.type === "retry")
509
+ this.breakDelivery(step, event.created);
375
510
  }
376
511
  this.scheduleCleanup();
377
512
  return false;
@@ -442,12 +577,15 @@ export class PerformanceMonitor {
442
577
  delete step.inactive;
443
578
  delete step.reconciledAt;
444
579
  delete step.streamed;
445
- this.resetLive(step);
446
580
  const sample = this.observed.get(key);
447
581
  if (sample)
448
582
  delete sample.expiresAt;
449
583
  }
450
584
  this.touch(step, event.created);
585
+ // Tool input can still be generated by the model. Tool execution markers
586
+ // and retries instead break delivery continuity without ending the step.
587
+ if (!event.type.startsWith("session.tool.input."))
588
+ this.breakDelivery(step, event.created);
451
589
  this.scheduleCleanup();
452
590
  return false;
453
591
  }
@@ -494,36 +632,10 @@ export class PerformanceMonitor {
494
632
  delete sample.expiresAt;
495
633
  this.scheduleCleanup();
496
634
  }
497
- const sampleBytes = new TextEncoder().encode(data.delta).byteLength;
635
+ const sampleBytes = utf8.encode(data.delta).byteLength;
498
636
  step.bytes += sampleBytes;
499
- if (step.last !== undefined && event.created - step.last >= LIVE_WINDOW_MS)
500
- this.resetLive(step);
501
- const last = step.samples.at(-1);
502
- if (last && step.bucketStarted !== undefined && event.created - step.bucketStarted < LIVE_SAMPLE_MS) {
503
- // Include a whole delivery burst in one batch, including the initial baseline.
504
- last.time = event.created;
505
- last.bytes += sampleBytes;
506
- }
507
- else {
508
- step.bucketStarted = event.created;
509
- step.samples.push({ time: event.created, bytes: sampleBytes });
510
- }
511
- const cutoff = event.created - LIVE_WINDOW_MS;
512
- while (step.samples.length > 0 && step.samples[0].time < cutoff)
513
- step.samples.shift();
514
- // The response-wide threshold includes the baseline and survives window resets.
515
- const raw = step.bytes >= LIVE_MIN_TOKENS * LIVE_BYTES_PER_TOKEN ? estimatedLiveTps(step.samples) : undefined;
516
- if (raw === undefined) {
517
- delete step.liveTps;
518
- delete step.liveDuration;
519
- delete step.smoothedAt;
520
- }
521
- else if (step.smoothedAt === undefined || event.created - step.smoothedAt >= LIVE_SAMPLE_MS) {
522
- step.liveTps = smoothLiveTps(step.liveTps, raw, event.created - (step.smoothedAt ?? event.created));
523
- step.liveDuration = event.created - step.samples[0].time;
524
- step.smoothedAt = event.created;
525
- }
526
- step.observedAt = this.monotonic();
637
+ if (step.sampleBoundary === undefined || event.created >= step.sampleBoundary)
638
+ this.recordDelta(step, event.created, sampleBytes);
527
639
  step.last = Math.max(step.last ?? event.created, event.created);
528
640
  if (step.first === undefined) {
529
641
  step.first = event.created;
@@ -566,7 +678,7 @@ export class PerformanceMonitor {
566
678
  const samples = [...this.observed.values()].filter(sample => sessions.has(sample.sessionID));
567
679
  const result = performanceWithObservations(prepared, samples);
568
680
  // Live throughput covers only observable deltas after the first one, over a
569
- // short sliding window. TTFT keeps the started -> first wait separately, and
681
+ // bounded sliding window. TTFT keeps the started -> first wait separately, and
570
682
  // completed provider usage still replaces this estimate via reconcile().
571
683
  let weighted = 0;
572
684
  let durationTotal = 0;
@@ -574,14 +686,10 @@ export class PerformanceMonitor {
574
686
  for (const step of this.active.values()) {
575
687
  if (!sessions.has(step.sessionID) || step.reconciledAt !== undefined)
576
688
  continue;
577
- if (step.liveTps === undefined || step.observedAt === undefined
578
- || monotonic - step.observedAt >= LIVE_WINDOW_MS)
579
- continue;
580
- const duration = step.liveDuration;
581
- if (!finite(duration) || duration < LIVE_MIN_SPAN_MS)
689
+ if (!step.live || step.live.expiresAt <= monotonic)
582
690
  continue;
583
- weighted += step.liveTps * duration;
584
- durationTotal += duration;
691
+ weighted += step.live.tps * step.live.duration;
692
+ durationTotal += step.live.duration;
585
693
  }
586
694
  if (durationTotal > 0) {
587
695
  result.tps = weighted / durationTotal;
@@ -1,5 +1,5 @@
1
1
  export const GENERATED_PRICE_SNAPSHOT = {
2
- verified: "2026-11-23",
2
+ verified: "2026-11-24",
3
3
  source: "https://models.dev/catalog.json",
4
4
  entries: [
5
5
  { "lab": "ai21", "id": "jamba-large", "prices": [{ "input": 2, "output": 8 }] },
@@ -127,7 +127,6 @@ export const GENERATED_PRICE_SNAPSHOT = {
127
127
  { "lab": "anthropic", "id": "claude-opus-4-1", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 15, "output": 75, "cache": { "read": 1.5, "write": 18.75 } }] },
128
128
  { "lab": "anthropic", "id": "claude-opus-4-1-20250805", "sourceProvider": "amazon-bedrock", "reference": true, "prices": [{ "input": 15, "output": 75, "cache": { "read": 1.5, "write": 18.75 } }] },
129
129
  { "lab": "anthropic", "id": "claude-opus-4-1-20250805:thinking", "sourceProvider": "302ai", "reference": true, "prices": [{ "input": 15, "output": 75 }], "scoped": true },
130
- { "lab": "anthropic", "id": "claude-opus-4-1:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 15, "output": 75, "cache": { "read": 1.5, "write": 18.75 } }], "scoped": true },
131
130
  { "lab": "anthropic", "id": "claude-opus-4-20250514", "sourceProvider": "jiekou", "reference": true, "prices": [{ "input": 13.5, "output": 67.5 }] },
132
131
  { "lab": "anthropic", "id": "claude-opus-4-5", "prices": [{ "input": 5, "output": 25, "cache": { "read": 0.5, "write": 6.25 } }] },
133
132
  { "lab": "anthropic", "id": "claude-opus-4-5-20251101", "prices": [{ "input": 5, "output": 25, "cache": { "read": 0.5, "write": 6.25 } }] },
@@ -209,13 +208,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
209
208
  { "lab": "deepseek", "id": "deepseek-v3", "sourceProvider": "deepinfra", "reference": true, "prices": [{ "input": 0.32, "output": 0.89 }] },
210
209
  { "lab": "deepseek", "id": "deepseek-v3-0324", "sourceProvider": "submodel", "reference": true, "prices": [{ "input": 0.2, "output": 0.8 }] },
211
210
  { "lab": "deepseek", "id": "deepseek-v3.1", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.25, "output": 0.95, "cache": { "read": 0.13 } }] },
212
- { "lab": "deepseek", "id": "deepseek-v3.1:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.2, "output": 0.7, "cache": { "read": 0.1 } }], "scoped": true },
211
+ { "lab": "deepseek", "id": "deepseek-v3.1:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.2, "output": 0.7, "cache": { "read": 0.13 } }], "scoped": true },
213
212
  { "lab": "deepseek", "id": "deepseek-v3.2", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.26, "output": 0.38, "cache": { "read": 0.13 } }] },
214
213
  { "lab": "deepseek", "id": "deepseek-v3.2:thinking", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.62, "output": 1.85 }], "scoped": true },
215
214
  { "lab": "deepseek", "id": "deepseek-v4-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.09, "output": 0.18, "cache": { "read": 0.018 } }] },
216
215
  { "lab": "deepseek", "id": "deepseek-v4-flash-0423", "sourceProvider": "concentrate", "reference": true, "prices": [{ "input": 0.09, "output": 0.18, "cache": { "read": 0.018 } }] },
217
216
  { "lab": "deepseek", "id": "deepseek-v4-flash-0423:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.14, "output": 0.28, "cache": { "read": 0.028 } }], "scoped": true },
218
- { "lab": "deepseek", "id": "deepseek-v4-flash-0731", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.0434, "output": 0.3, "cache": { "read": 0.035 } }] },
217
+ { "lab": "deepseek", "id": "deepseek-v4-flash-0731", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.069, "output": 0.47, "cache": { "read": 0.055 } }] },
219
218
  { "lab": "deepseek", "id": "deepseek-v4-flash-0731:fast", "sourceProvider": "merge-gateway", "reference": true, "prices": [{ "input": 0.28, "output": 0.56, "cache": { "read": 0.07 } }], "scoped": true },
220
219
  { "lab": "deepseek", "id": "deepseek-v4-flash-0731:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
221
220
  { "lab": "deepseek", "id": "deepseek-v4-flash-0731:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.044, "output": 0.132, "cache": { "read": 0.0014 } }], "scoped": true },
@@ -223,7 +222,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
223
222
  { "lab": "deepseek", "id": "deepseek-v4-flash:fast", "sourceProvider": "commandcode", "reference": true, "prices": [{ "input": 0.28, "output": 0.56, "cache": { "read": 0.07 } }], "scoped": true },
224
223
  { "lab": "deepseek", "id": "deepseek-v4-flash:free", "sourceProvider": "orcarouter", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
225
224
  { "lab": "deepseek", "id": "deepseek-v4-flash:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.14, "output": 0.28, "cache": { "read": 0.028 } }], "scoped": true },
226
- { "lab": "deepseek", "id": "deepseek-v4-pro", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.9, "output": 1.5, "cache": { "read": 0.2 } }] },
225
+ { "lab": "deepseek", "id": "deepseek-v4-pro", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 1.28, "output": 2.56, "cache": { "read": 0.108 } }] },
227
226
  { "lab": "deepseek", "id": "deepseek-v4-pro-0423", "sourceProvider": "merge-gateway", "reference": true, "prices": [{ "input": 1.65, "output": 3.3 }] },
228
227
  { "lab": "deepseek", "id": "deepseek-v4-pro-0813", "prices": [{ "input": 1.32, "output": 3.96, "cache": { "read": 0.044 } }], "source": "https://api-docs.deepseek.com/quick_start/pricing" },
229
228
  { "lab": "deepseek", "id": "deepseek-v4-pro-0813:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.66, "output": 2.5, "cache": { "read": 0.04 } }], "scoped": true },
@@ -245,7 +244,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
245
244
  { "lab": "google", "id": "diffusiongemma-26b-a4b-it", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.05, "output": 0.15, "cache": { "read": 0.025 } }] },
246
245
  { "lab": "google", "id": "gemini-2.0-flash", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 0.1, "output": 0.42 }] },
247
246
  { "lab": "google", "id": "gemini-2.0-flash-lite", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 0.052, "output": 0.21 }] },
248
- { "lab": "google", "id": "gemini-2.5-computer-use-preview-10-2025", "prices": [{ "input": 1.25, "output": 10 }] },
247
+ { "lab": "google", "id": "gemini-2.5-computer-use-preview-10-2025", "sourceProvider": "merge-gateway", "reference": true, "prices": [{ "input": 1.25, "output": 10 }] },
249
248
  { "lab": "google", "id": "gemini-2.5-flash", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.3, "output": 2.5, "cache": { "read": 0.03 } }] },
250
249
  { "lab": "google", "id": "gemini-2.5-flash-lite", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.1, "output": 0.4, "cache": { "read": 0.01 } }] },
251
250
  { "lab": "google", "id": "gemini-2.5-flash-lite-preview-06-17", "sourceProvider": "jiekou", "reference": true, "prices": [{ "input": 0.09, "output": 0.36 }] },
@@ -280,7 +279,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
280
279
  { "lab": "google", "id": "gemma-4-12b-it", "sourceProvider": "kitani", "reference": true, "prices": [{ "input": 0.045, "output": 0.23, "cache": { "read": 0.0225 } }] },
281
280
  { "lab": "google", "id": "gemma-4-26b-a4b-it", "sourceProvider": "google-vertex", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.015 } }] },
282
281
  { "lab": "google", "id": "gemma-4-26b-a4b-it:free", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
283
- { "lab": "google", "id": "gemma-4-26b-a4b-it:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.0675, "output": 0.225, "cache": { "read": 0.0375 } }], "scoped": true },
282
+ { "lab": "google", "id": "gemma-4-26b-a4b-it:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.07, "output": 0.24, "cache": { "read": 0.046 } }], "scoped": true },
284
283
  { "lab": "google", "id": "gemma-4-31b-it", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.2, "output": 0.4 }] },
285
284
  { "lab": "google", "id": "gemma-4-31b-it:free", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
286
285
  { "lab": "google", "id": "gemma-4-31b-it:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.1, "output": 0.34, "cache": { "read": 0.1 } }], "scoped": true },
@@ -296,7 +295,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
296
295
  { "lab": "inception", "id": "mercury-2.5", "prices": [{ "input": 0.2, "output": 0.75, "cache": { "read": 0.02 } }] },
297
296
  { "lab": "inception", "id": "mercury-3", "prices": [{ "input": 0.1, "output": 0.35, "cache": { "read": 0.01 } }] },
298
297
  { "lab": "inception", "id": "mercury-edit-2", "prices": [{ "input": 0.25, "output": 0.75, "cache": { "read": 0.025 } }] },
299
- { "lab": "inclusionai", "id": "ling-3.0-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.021, "output": 0.063, "cache": { "read": 0.0042 } }] },
298
+ { "lab": "inclusionai", "id": "ling-3.0-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.06, "output": 0.18, "cache": { "read": 0.012 } }] },
300
299
  { "lab": "inclusionai", "id": "ling-3.0-flash-fin", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.075, "output": 0.22, "cache": { "read": 0.015 } }] },
301
300
  { "lab": "inclusionai", "id": "ling-3.0-flash-fin:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
302
301
  { "lab": "inclusionai", "id": "ling-3.0-flash-sante", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.075, "output": 0.22, "cache": { "read": 0.015 } }] },
@@ -305,7 +304,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
305
304
  { "lab": "inclusionai", "id": "ling-3.0-flash:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.075, "output": 0.22, "cache": { "read": 0.015 } }], "scoped": true },
306
305
  { "lab": "inclusionai", "id": "ling-3.0-tiny", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.015, "output": 0.045, "cache": { "read": 0.003 } }] },
307
306
  { "lab": "inclusionai", "id": "ling-3.0-tiny:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.015, "output": 0.045, "cache": { "read": 0.003 } }], "scoped": true },
308
- { "lab": "inclusionai", "id": "ling-3.1-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.06, "output": 0.18, "cache": { "read": 0.012 } }] },
307
+ { "lab": "inclusionai", "id": "ling-3.1-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.075, "output": 0.225, "cache": { "read": 0.015 } }] },
309
308
  { "lab": "inclusionai", "id": "ling-3.1-flash:free", "sourceProvider": "commandcode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
310
309
  { "lab": "inference-net", "id": "schematron-v2-small", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.05, "output": 0.23, "cache": { "read": 0.05 } }] },
311
310
  { "lab": "inference-net", "id": "schematron-v2-turbo", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.03, "output": 0.15, "cache": { "read": 0.03 } }] },
@@ -316,13 +315,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
316
315
  { "lab": "meituan", "id": "longcat-2.0", "sourceProvider": "longcat", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }], "source": "https://longcat.chat/platform/docs/Pricing/LongCat-2.0.html" },
317
316
  { "lab": "meituan", "id": "longcat-2.0:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
318
317
  { "lab": "meituan", "id": "longcat-2.0:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.75, "output": 3, "cache": { "read": 0.015 } }], "scoped": true },
319
- { "lab": "meituan", "id": "longcat-2.5", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }] },
318
+ { "lab": "meituan", "id": "longcat-2.5", "sourceProvider": "longcat", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }] },
320
319
  { "lab": "meituan", "id": "longcat-2.5-preview", "sourceProvider": "longcat", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }] },
321
320
  { "lab": "meituan", "id": "longcat-2.5-preview:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
322
321
  { "lab": "meituan", "id": "longcat-2.5:free", "sourceProvider": "kenari", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
323
322
  { "lab": "meragpt", "id": "restyler-1", "prices": [{ "input": 0.04, "output": 0.16 }] },
324
323
  { "lab": "meta", "id": "llama-3.1-70b-instruct", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.72, "output": 0.72 }] },
325
- { "lab": "meta", "id": "llama-3.1-8b-instruct", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.02, "output": 0.04 }] },
324
+ { "lab": "meta", "id": "llama-3.1-8b-instruct", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.05, "output": 0.08, "cache": { "read": 0.025 } }] },
326
325
  { "lab": "meta", "id": "llama-3.1-8b-instruct:fast", "sourceProvider": "zerogpu", "reference": true, "prices": [{ "input": 0.15, "output": 0.28 }], "scoped": true },
327
326
  { "lab": "meta", "id": "llama-3.2-11b-vision-instruct", "sourceProvider": "inference", "reference": true, "prices": [{ "input": 0.055, "output": 0.055 }] },
328
327
  { "lab": "meta", "id": "llama-3.2-1b", "sourceProvider": "cloudflare-workers-ai", "reference": true, "prices": [{ "input": 0.027, "output": 0.201 }] },
@@ -382,9 +381,9 @@ export const GENERATED_PRICE_SNAPSHOT = {
382
381
  { "lab": "minimax", "id": "minimax-text-01", "sourceProvider": "llmgateway-providers", "reference": true, "prices": [{ "input": 0.2, "output": 1.1 }] },
383
382
  { "lab": "mistral", "id": "codestral-2508", "prices": [{ "input": 0.3, "output": 0.9, "cache": { "read": 0.03 } }] },
384
383
  { "lab": "mistral", "id": "codestral-latest", "prices": [{ "input": 0.3, "output": 0.9, "cache": { "read": 0.03 } }] },
385
- { "lab": "mistral", "id": "devstral-2512", "prices": [{ "input": 0.4, "output": 2 }] },
386
- { "lab": "mistral", "id": "devstral-medium-latest", "prices": [{ "input": 0.4, "output": 2 }] },
387
- { "lab": "mistral", "id": "magistral-medium-latest", "prices": [{ "input": 2, "output": 5 }] },
384
+ { "lab": "mistral", "id": "devstral-2512", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.4, "output": 2, "cache": { "read": 0.04 } }] },
385
+ { "lab": "mistral", "id": "devstral-medium-latest", "sourceProvider": "edenai", "reference": true, "prices": [{ "input": 0.4, "output": 2 }] },
386
+ { "lab": "mistral", "id": "magistral-medium-latest", "prices": [{ "input": 1.5, "output": 7.5, "cache": { "read": 0.15 } }] },
388
387
  { "lab": "mistral", "id": "magistral-small-2506", "sourceProvider": "io-net", "reference": true, "prices": [{ "input": 0.5, "output": 1.5, "cache": { "read": 0.25, "write": 1 } }] },
389
388
  { "lab": "mistral", "id": "magistral-small-2509", "sourceProvider": "amazon-bedrock", "reference": true, "prices": [{ "input": 0.5, "output": 1.5 }] },
390
389
  { "lab": "mistral", "id": "ministral-14b", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.2, "output": 0.2, "cache": { "read": 0.02 } }] },
@@ -402,7 +401,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
402
401
  { "lab": "mistral", "id": "mistral-large-2512", "prices": [{ "input": 0.5, "output": 1.5, "cache": { "read": 0.05 } }] },
403
402
  { "lab": "mistral", "id": "mistral-large-4", "prices": [{ "input": 0.7, "output": 2.1, "cache": { "read": 0.07 } }] },
404
403
  { "lab": "mistral", "id": "mistral-large-latest", "sourceProvider": "llmgateway", "reference": true, "prices": [{ "input": 4, "output": 12 }] },
405
- { "lab": "mistral", "id": "mistral-medium-2505", "prices": [{ "input": 0.4, "output": 2 }] },
404
+ { "lab": "mistral", "id": "mistral-medium-2505", "sourceProvider": "merge-gateway", "reference": true, "prices": [{ "input": 0.4, "output": 2, "cache": { "read": 0.04 } }] },
406
405
  { "lab": "mistral", "id": "mistral-medium-2604", "prices": [{ "input": 1.5, "output": 7.5, "cache": { "read": 0.15 } }], "source": "https://docs.mistral.ai/inference/pricing" },
407
406
  { "lab": "mistral", "id": "mistral-medium-3", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.44, "output": 2.2, "cache": { "read": 0.044 } }] },
408
407
  { "lab": "mistral", "id": "mistral-medium-3-5", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 1.5, "output": 7.5 }] },
@@ -411,7 +410,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
411
410
  { "lab": "mistral", "id": "mistral-nemo", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.029, "output": 0.03 }] },
412
411
  { "lab": "mistral", "id": "mistral-saba", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.2, "output": 0.6, "cache": { "read": 0.02 } }] },
413
412
  { "lab": "mistral", "id": "mistral-small-24b-instruct-2501", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.05, "output": 0.08 }] },
414
- { "lab": "mistral", "id": "mistral-small-2506", "prices": [{ "input": 0.1, "output": 0.3 }] },
413
+ { "lab": "mistral", "id": "mistral-small-2506", "sourceProvider": "llmgateway", "reference": true, "prices": [{ "input": 0.1, "output": 0.3 }] },
415
414
  { "lab": "mistral", "id": "mistral-small-2603", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.015 } }] },
416
415
  { "lab": "mistral", "id": "mistral-small-2603:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.4, "output": 1.4, "cache": { "read": 0.2 } }], "scoped": true },
417
416
  { "lab": "mistral", "id": "mistral-small-3-1-24b-instruct-2503", "sourceProvider": "google-vertex", "reference": true, "prices": [{ "input": 0.1, "output": 0.3 }] },
@@ -420,18 +419,17 @@ export const GENERATED_PRICE_SNAPSHOT = {
420
419
  { "lab": "mistral", "id": "mistral-small-latest", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.015 } }] },
421
420
  { "lab": "mistral", "id": "mixtral-8x22b-instruct", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 2, "output": 6, "cache": { "read": 0.2 } }] },
422
421
  { "lab": "mistral", "id": "mixtral-8x7b-instruct-v0.1", "sourceProvider": "edenai", "reference": true, "prices": [{ "input": 0.4, "output": 0.4 }] },
423
- { "lab": "mistral", "id": "pixtral-12b", "prices": [{ "input": 0.15, "output": 0.15 }] },
422
+ { "lab": "mistral", "id": "pixtral-12b", "sourceProvider": "greenpt", "reference": true, "prices": [{ "input": 0.285, "output": 0.285 }] },
424
423
  { "lab": "mistral", "id": "pixtral-large-2502", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 2, "output": 6 }] },
425
424
  { "lab": "mistral", "id": "pixtral-large-latest", "sourceProvider": "merge-gateway", "reference": true, "prices": [{ "input": 2, "output": 6 }] },
426
425
  { "lab": "mistral", "id": "voxtral-mini-3b-2507", "sourceProvider": "amazon-bedrock", "reference": true, "prices": [{ "input": 0.04, "output": 0.04 }] },
427
426
  { "lab": "mistral", "id": "voxtral-small-24b-2507", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.1, "output": 0.3, "cache": { "read": 0.01 } }] },
428
427
  { "lab": "mistral", "id": "voxtral-small-latest", "prices": [{ "input": 0.1, "output": 0.4 }] },
429
428
  { "lab": "mixedbread", "id": "toast-1", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.3, "output": 0.72, "cache": { "read": 0.036 } }] },
430
- { "lab": "moonshotai", "id": "kimi-k2", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.57, "output": 2.3 }] },
429
+ { "lab": "moonshotai", "id": "kimi-k2", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.57, "output": 2.3 }] },
431
430
  { "lab": "moonshotai", "id": "kimi-k2-0905", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.6, "output": 2.5 }] },
432
431
  { "lab": "moonshotai", "id": "kimi-k2-instruct", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.4, "output": 1.8, "cache": { "read": 0.2 } }] },
433
- { "lab": "moonshotai", "id": "kimi-k2-instruct:fast", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.4, "output": 1.8, "cache": { "read": 0.2 } }], "scoped": true },
434
- { "lab": "moonshotai", "id": "kimi-k2-thinking", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.6, "output": 2.5, "cache": { "read": 0.15 } }] },
432
+ { "lab": "moonshotai", "id": "kimi-k2-thinking", "sourceProvider": "amazon-bedrock", "reference": true, "prices": [{ "input": 0.6, "output": 2.5 }] },
435
433
  { "lab": "moonshotai", "id": "kimi-k2.5", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.5, "output": 2.5, "cache": { "read": 0.15 } }] },
436
434
  { "lab": "moonshotai", "id": "kimi-k2.5:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
437
435
  { "lab": "moonshotai", "id": "kimi-k2.5:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.6265, "output": 3.2187, "cache": { "read": 0.1053 } }], "scoped": true },
@@ -473,7 +471,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
473
471
  { "lab": "nvidia", "id": "nemotron-3-ultra-550b-a55b:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.5, "output": 2.5, "cache": { "read": 0.15 } }], "scoped": true },
474
472
  { "lab": "nvidia", "id": "nemotron-3.5-content-safety", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.2, "output": 0.2 }] },
475
473
  { "lab": "nvidia", "id": "nemotron-3.5-content-safety:free", "sourceProvider": "aihubmix", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
476
- { "lab": "nvidia", "id": "nemotron-3.5-lightning", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.07, "output": 0.2, "cache": { "read": 0.04 } }] },
474
+ { "lab": "nvidia", "id": "nemotron-3.5-lightning", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.05, "output": 0.2, "cache": { "read": 0.01 } }] },
477
475
  { "lab": "nvidia", "id": "nemotron-3.5-lightning:free", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
478
476
  { "lab": "nvidia", "id": "nemotron-3.5-lightning:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.05, "output": 0.2, "cache": { "read": 0.01 } }], "scoped": true },
479
477
  { "lab": "nvidia", "id": "nemotron-3.5-super-120b-a12b", "sourceProvider": "perplexity-agent", "reference": true, "prices": [{ "input": 0.2, "output": 0.5, "cache": { "read": 0.04 } }] },
@@ -483,18 +481,17 @@ export const GENERATED_PRICE_SNAPSHOT = {
483
481
  { "lab": "nvidia", "id": "nemotron-nano-9b-v2", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.06, "output": 0.23 }] },
484
482
  { "lab": "nvidia", "id": "nemotron-voicechat", "prices": [{ "input": 0, "output": 0 }] },
485
483
  { "lab": "openai", "id": "chat-latest", "prices": [{ "input": 5, "output": 30, "cache": { "read": 0.5 } }], "source": "https://developers.openai.com/api/docs/pricing" },
486
- { "lab": "openai", "id": "gpt-3.5-turbo", "prices": [{ "input": 0.5, "output": 1.5, "cache": { "read": 0 } }] },
487
- { "lab": "openai", "id": "gpt-4", "prices": [{ "input": 30, "output": 60 }] },
488
- { "lab": "openai", "id": "gpt-4-turbo", "prices": [{ "input": 10, "output": 30 }] },
484
+ { "lab": "openai", "id": "gpt-3.5-turbo", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 0.45, "output": 1.4 }] },
485
+ { "lab": "openai", "id": "gpt-4", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 30, "output": 60 }] },
486
+ { "lab": "openai", "id": "gpt-4-turbo", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 9, "output": 27 }] },
489
487
  { "lab": "openai", "id": "gpt-4.1", "prices": [{ "input": 2, "output": 8, "cache": { "read": 0.5 } }] },
490
488
  { "lab": "openai", "id": "gpt-4.1-mini", "prices": [{ "input": 0.4, "output": 1.6, "cache": { "read": 0.1 } }] },
491
489
  { "lab": "openai", "id": "gpt-4.1-mini:fast", "prices": [{ "input": 0.7, "output": 2.8, "cache": { "read": 0.175 } }], "scoped": true },
492
- { "lab": "openai", "id": "gpt-4.1-nano", "prices": [{ "input": 0.1, "output": 0.4, "cache": { "read": 0.025 } }] },
493
- { "lab": "openai", "id": "gpt-4.1-nano:fast", "prices": [{ "input": 0.2, "output": 0.8, "cache": { "read": 0.05 } }], "scoped": true },
490
+ { "lab": "openai", "id": "gpt-4.1-nano", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.1, "output": 0.4, "cache": { "read": 0.03 } }] },
491
+ { "lab": "openai", "id": "gpt-4.1-nano:fast", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.2, "output": 0.8, "cache": { "read": 0.06 } }], "scoped": true },
494
492
  { "lab": "openai", "id": "gpt-4.1:fast", "prices": [{ "input": 3.5, "output": 14, "cache": { "read": 0.875 } }], "scoped": true },
495
493
  { "lab": "openai", "id": "gpt-4o", "prices": [{ "input": 2.5, "output": 10, "cache": { "read": 1.25 } }] },
496
- { "lab": "openai", "id": "gpt-4o-2024-05-13", "prices": [{ "input": 5, "output": 15 }] },
497
- { "lab": "openai", "id": "gpt-4o-2024-05-13:fast", "prices": [{ "input": 8.75, "output": 26.25 }], "scoped": true },
494
+ { "lab": "openai", "id": "gpt-4o-2024-05-13", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 5, "output": 15 }] },
498
495
  { "lab": "openai", "id": "gpt-4o-2024-08-06", "prices": [{ "input": 2.5, "output": 10, "cache": { "read": 1.25 } }] },
499
496
  { "lab": "openai", "id": "gpt-4o-2024-11-20", "prices": [{ "input": 2.5, "output": 10, "cache": { "read": 1.25 } }] },
500
497
  { "lab": "openai", "id": "gpt-4o-mini", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.075 } }] },
@@ -524,7 +521,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
524
521
  { "lab": "openai", "id": "gpt-5.2:flex", "prices": [{ "input": 0.875, "output": 7, "cache": { "read": 0.0875 } }], "scoped": true },
525
522
  { "lab": "openai", "id": "gpt-5.3-chat-latest", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 1.6, "output": 13, "cache": { "read": 0.16 } }] },
526
523
  { "lab": "openai", "id": "gpt-5.3-codex", "prices": [{ "input": 1.75, "output": 14, "cache": { "read": 0.175 } }] },
527
- { "lab": "openai", "id": "gpt-5.3-codex-spark", "prices": [{ "input": 1.75, "output": 14, "cache": { "read": 0.175 } }] },
524
+ { "lab": "openai", "id": "gpt-5.3-codex-spark", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 1.75, "output": 14, "cache": { "read": 0.175 } }] },
528
525
  { "lab": "openai", "id": "gpt-5.3-codex:fast", "prices": [{ "input": 3.5, "output": 28, "cache": { "read": 0.35 } }], "scoped": true },
529
526
  { "lab": "openai", "id": "gpt-5.4", "prices": [{ "input": 2.5, "output": 15, "cache": { "read": 0.25 } }, { "input": 5, "output": 22.5, "cache": { "read": 0.5 }, "tier": { "type": "context", "size": 272000 } }] },
530
527
  { "lab": "openai", "id": "gpt-5.4-mini", "prices": [{ "input": 0.75, "output": 4.5, "cache": { "read": 0.075 } }] },
@@ -573,18 +570,18 @@ export const GENERATED_PRICE_SNAPSHOT = {
573
570
  { "lab": "openai", "id": "gpt-oss-20b", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.03, "output": 0.13, "cache": { "read": 0.03 } }] },
574
571
  { "lab": "openai", "id": "gpt-oss-safeguard-120b", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.15, "output": 0.6 }] },
575
572
  { "lab": "openai", "id": "gpt-oss-safeguard-20b", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.075, "output": 0.3, "cache": { "read": 0.0375 } }] },
576
- { "lab": "openai", "id": "o1", "prices": [{ "input": 15, "output": 60, "cache": { "read": 7.5 } }] },
577
- { "lab": "openai", "id": "o1-pro", "prices": [{ "input": 150, "output": 600 }] },
573
+ { "lab": "openai", "id": "o1", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 15, "output": 60, "cache": { "read": 7.5 } }] },
574
+ { "lab": "openai", "id": "o1-pro", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 140, "output": 540 }] },
578
575
  { "lab": "openai", "id": "o3", "prices": [{ "input": 2, "output": 8, "cache": { "read": 0.5 } }] },
579
576
  { "lab": "openai", "id": "o3-deep-research", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 9, "output": 36, "cache": { "read": 2.2 } }] },
580
- { "lab": "openai", "id": "o3-mini", "prices": [{ "input": 1.1, "output": 4.4, "cache": { "read": 0.55 } }] },
577
+ { "lab": "openai", "id": "o3-mini", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 1.1, "output": 4.4, "cache": { "read": 0.55 } }] },
581
578
  { "lab": "openai", "id": "o3-pro", "prices": [{ "input": 20, "output": 80 }] },
582
579
  { "lab": "openai", "id": "o3:fast", "prices": [{ "input": 3.5, "output": 14, "cache": { "read": 0.875 } }], "scoped": true },
583
580
  { "lab": "openai", "id": "o3:flex", "prices": [{ "input": 1, "output": 4, "cache": { "read": 0.25 } }], "scoped": true },
584
- { "lab": "openai", "id": "o4-mini", "prices": [{ "input": 1.1, "output": 4.4, "cache": { "read": 0.275 } }] },
581
+ { "lab": "openai", "id": "o4-mini", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 1.1, "output": 4.4, "cache": { "read": 0.275 } }] },
585
582
  { "lab": "openai", "id": "o4-mini-deep-research", "sourceProvider": "poe", "reference": true, "prices": [{ "input": 1.8, "output": 7.2, "cache": { "read": 0.45 } }] },
586
- { "lab": "openai", "id": "o4-mini:fast", "prices": [{ "input": 2, "output": 8, "cache": { "read": 0.5 } }], "scoped": true },
587
- { "lab": "openai", "id": "o4-mini:flex", "prices": [{ "input": 0.55, "output": 2.2, "cache": { "read": 0.1375 } }], "scoped": true },
583
+ { "lab": "openai", "id": "o4-mini:fast", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 2, "output": 8, "cache": { "read": 0.5 } }], "scoped": true },
584
+ { "lab": "openai", "id": "o4-mini:flex", "sourceProvider": "vercel", "reference": true, "prices": [{ "input": 0.55, "output": 2.2, "cache": { "read": 0.1375 } }], "scoped": true },
588
585
  { "lab": "openbmb", "id": "minicpm-v-4.7-1b", "sourceProvider": "amd", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }] },
589
586
  { "lab": "openbmb", "id": "minicpm-v-4.7-35b-a3b", "sourceProvider": "amd", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }] },
590
587
  { "lab": "openbmb", "id": "minicpm5-2b", "sourceProvider": "amd", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }] },
@@ -645,7 +642,9 @@ export const GENERATED_PRICE_SNAPSHOT = {
645
642
  { "lab": "thedrummer", "id": "skyfall-36b-v2", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.55, "output": 0.8, "cache": { "read": 0.25 } }] },
646
643
  { "lab": "thedrummer", "id": "unslopnemo-12b", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.4, "output": 0.4 }] },
647
644
  { "lab": "thinkingmachines", "id": "inkling", "prices": [{ "input": 1.87, "output": 4.68, "cache": { "read": 0.374 } }] },
645
+ { "lab": "thinkingmachines", "id": "inkling-2-mini", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.075, "output": 0.3, "cache": { "read": 0.015 } }] },
648
646
  { "lab": "thinkingmachines", "id": "inkling-2-small", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.3, "output": 1, "cache": { "read": 0.03 } }] },
647
+ { "lab": "thinkingmachines", "id": "inkling-2-small:fast", "sourceProvider": "prime", "reference": true, "prices": [{ "input": 0.3, "output": 1, "cache": { "read": 0.06, "write": 0.3 } }], "scoped": true },
649
648
  { "lab": "thinkingmachines", "id": "inkling-2-small:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0, "write": 0 } }], "scoped": true },
650
649
  { "lab": "thinkingmachines", "id": "inkling-small", "prices": [{ "input": 0.58, "output": 1.44, "cache": { "read": 0.116 } }] },
651
650
  { "lab": "thinkingmachines", "id": "inkling-small:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.45, "output": 1.2, "cache": { "read": 0.1 } }], "scoped": true },
@@ -716,7 +715,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
716
715
  { "lab": "zhipuai", "id": "glm-4.7", "sourceProvider": "zai", "prices": [{ "input": 0.6, "output": 2.2, "cache": { "read": 0.11 } }] },
717
716
  { "lab": "zhipuai", "id": "glm-4.7-flash", "sourceProvider": "openrouter", "reference": true, "prices": [{ "input": 0.0605, "output": 0.4 }] },
718
717
  { "lab": "zhipuai", "id": "glm-4.7-flash:free", "sourceProvider": "aihubmix", "reference": true, "prices": [{ "input": 0, "output": 0 }], "scoped": true },
719
- { "lab": "zhipuai", "id": "glm-4.7-flash:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.0605, "output": 0.4, "cache": { "read": 0.03025 } }], "scoped": true },
718
+ { "lab": "zhipuai", "id": "glm-4.7-flash:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.0605, "output": 0.4, "cache": { "read": 0.0605 } }], "scoped": true },
720
719
  { "lab": "zhipuai", "id": "glm-4.7-flashx", "sourceProvider": "zai", "prices": [{ "input": 0.07, "output": 0.4, "cache": { "read": 0.01 } }] },
721
720
  { "lab": "zhipuai", "id": "glm-4.7:free", "sourceProvider": "opencode", "reference": true, "prices": [{ "input": 0, "output": 0, "cache": { "read": 0 } }], "scoped": true },
722
721
  { "lab": "zhipuai", "id": "glm-4.7:thinking", "sourceProvider": "nano-gpt", "reference": true, "prices": [{ "input": 0.4004, "output": 1.9292, "cache": { "read": 0.08008 } }], "scoped": true },
@@ -847,10 +846,9 @@ export const GENERATED_PRICE_SNAPSHOT = {
847
846
  "anthropic/claude-haiku-4-5:thinking": ["nano-gpt/anthropic/claude-haiku-4.5:thinking"],
848
847
  "anthropic/claude-haiku-5-5": ["aimlapi/anthropic/claude-haiku-5.5", "amazon-bedrock/au.anthropic.claude-haiku-5-5", "amazon-bedrock/jp.anthropic.claude-haiku-5-5", "cloudflare-ai-gateway/anthropic/claude-haiku-5.5", "cortecs/claude-haiku-5.5", "digitalocean/anthropic-claude-5.5-haiku", "edenai/anthropic/claude-haiku-latest", "github-copilot/claude-haiku-5.5", "gitlab/duo-chat-haiku-5-5", "google-vertex-anthropic/claude-haiku-5-5@default", "google-vertex/claude-haiku-5-5@default", "hubris/anthropic/claude-haiku-5.5", "kilo/anthropic/claude-haiku-5.5", "llmgateway-providers/aws-bedrock/claude-haiku-5-5", "llmgateway-providers/vertex-anthropic/claude-haiku-5-5", "lowrouter/auto/anthropic/claude-haiku-5.5", "moneo/claude haiku 5.5", "nano-gpt/anthropic/claude-haiku-5.5", "obscurify/anthropic/claude-haiku-5.5", "ofox/anthropic/claude-haiku-5.5", "openrouter/anthropic/claude-haiku-5.5", "requesty/claude-haiku-5-5@eu", "sparrowcodes/anthropic/claude-haiku-5.5", "standardcompute/anthropic/claude-haiku-5.5", "vercel/anthropic/claude-haiku-5.5", "vivgrid/claude-haiku-5-5"],
849
848
  "anthropic/claude-opus-4-0": ["helicone/claude-opus-4", "poe/anthropic/claude-opus-4", "qiniu-ai/claude-4.0-opus"],
850
- "anthropic/claude-opus-4-1": ["databricks/databricks-claude-opus-4-1", "hubris/anthropic/claude-opus-4.1", "kilo/anthropic/claude-opus-4.1", "nano-gpt/anthropic/claude-opus-4.1", "nano-gpt/anthropic/claude-opus-4.1:thinking:1024", "nano-gpt/anthropic/claude-opus-4.1:thinking:32768", "nano-gpt/anthropic/claude-opus-4.1:thinking:8192", "openrouter/anthropic/claude-opus-4.1", "poe/anthropic/claude-opus-4.1", "qiniu-ai/claude-4.1-opus", "zenmux/anthropic/claude-opus-4.1"],
849
+ "anthropic/claude-opus-4-1": ["databricks/databricks-claude-opus-4-1", "hubris/anthropic/claude-opus-4.1", "kilo/anthropic/claude-opus-4.1", "openrouter/anthropic/claude-opus-4.1", "poe/anthropic/claude-opus-4.1", "qiniu-ai/claude-4.1-opus", "zenmux/anthropic/claude-opus-4.1"],
851
850
  "anthropic/claude-opus-4-1-20250805": ["amazon-bedrock/anthropic.claude-opus-4-1-20250805-v1:0", "amazon-bedrock/us.anthropic.claude-opus-4-1-20250805-v1:0", "fastrouter/anthropic/claude-opus-4.1", "google-vertex-anthropic/claude-opus-4-1@20250805", "google-vertex/claude-opus-4-1@20250805"],
852
851
  "anthropic/claude-opus-4-1-20250805:thinking": ["302ai/claude-opus-4-1-20250805-thinking"],
853
- "anthropic/claude-opus-4-1:thinking": ["nano-gpt/anthropic/claude-opus-4.1:thinking"],
854
852
  "anthropic/claude-opus-4-20250514": ["google-vertex-anthropic/claude-opus-4@20250514", "google-vertex/claude-opus-4@20250514", "sap-ai-core/anthropic--claude-4-opus"],
855
853
  "anthropic/claude-opus-4-5": ["aihubmix/claude-opus-4-5-think", "aimlapi/anthropic/claude-opus-4.5", "cloudflare-ai-gateway/anthropic/claude-opus-4.5", "cortecs/claude-opus4-5", "databricks/databricks-claude-opus-4-5", "digitalocean/anthropic-claude-opus-4.5", "helicone/claude-4.5-opus", "hubris/anthropic/claude-opus-4.5", "kilo/anthropic/claude-opus-4.5", "lowrouter/auto/anthropic/claude-opus-4.5", "nano-gpt/anthropic/claude-opus-4.5", "ofox/anthropic/claude-opus-4.5", "openrouter/anthropic/claude-opus-4.5", "orcarouter/anthropic/claude-opus-4.5", "poe/anthropic/claude-opus-4.5", "qiniu-ai/claude-4.5-opus", "requesty/claude-opus-4-5@eu", "sap-ai-core/anthropic--claude-4.5-opus", "vercel/anthropic/claude-opus-4.5", "zenmux/anthropic/claude-opus-4.5"],
856
854
  "anthropic/claude-opus-4-5-20251101": ["amazon-bedrock/anthropic.claude-opus-4-5-20251101-v1:0", "amazon-bedrock/eu.anthropic.claude-opus-4-5-20251101-v1:0", "amazon-bedrock/global.anthropic.claude-opus-4-5-20251101-v1:0", "amazon-bedrock/us.anthropic.claude-opus-4-5-20251101-v1:0", "gitlab/duo-chat-opus-4-5", "google-vertex-anthropic/claude-opus-4-5@20251101", "google-vertex/claude-opus-4-5@20251101", "llmgateway-providers/aws-bedrock/claude-opus-4-5-20251101", "llmgateway-providers/vertex-anthropic/claude-opus-4-5-20251101"],
@@ -928,8 +926,8 @@ export const GENERATED_PRICE_SNAPSHOT = {
928
926
  "deepseek/deepseek-v4-pro:fast": ["wally/deepseek-v4-pro-fast"],
929
927
  "deepseek/deepseek-v4-pro:free": ["unorouter/deepseek-v4-pro:free"],
930
928
  "deepseek/deepseek-v4.1-flash": ["302ai/deepseek-flash", "abliteratedllm/deepseek-v4.1-flash-original", "above/deepseek-v4-flash", "aki-io/deepseek-v4.1-flash-552b", "alibaba-cn/deepseek-v4.1-flash", "arcee/deepseek/deepseek-v4.1-flash", "baseten/deepseek-ai/deepseek-v4.1-flash", "byteplus/deepseek-v4-1-flash-260910", "cheapaimodel/deepseek-v4-1-flash", "cline-pass/cline-pass/deepseek-v4.1-flash", "concentrate/deepseek-v4-1-flash", "deepinfra/deepseek-ai/deepseek-v4.1-flash", "doubleword/deepseek-ai/deepseek-v4.1-flash", "edenai/arkanecloud/deepseek-ai/deepseek-v4.1-flash", "edenai/deepinfra/deepseek-ai/deepseek-v4.1-flash", "edenai/greenpt/deepseek-v4.1-flash", "edenai/qwen/deepseek-v4.1-flash", "edenai/scaleway/deepseek-v4.1-flash", "edenai/tencent/deepseek-v4.1-flash", "edenai/tensorx/deepseek/deepseek-v4.1-flash", "edenai/together_ai/deepseek-ai/deepseek-v4.1-flash", "fireworks-ai/accounts/fireworks/models/deepseek-v4p1-flash", "fireworks-ai/accounts/fireworks/routers/deepseek-v4p1-flash-spot", "huggingface/deepseek-ai/deepseek-v4.1-flash", "inference-coop/greenpt/deepseek-v4.1-flash", "inference-coop/tinfoil/deepseek-v4-1-flash", "inferenceapis/deepseek-ai/deepseek-v4.1-flash", "keln/deepseek-ai/deepseek-v4.1-flash", "kenari/deepseek-v4-1-flash", "liquid/deepseek-v4.1-flash", "llmgateway-providers/alibaba/deepseek-v4.1-flash", "llmgateway-providers/baidu/deepseek-v4.1-flash", "llmgateway-providers/deepinfra/deepseek-v4.1-flash", "llmgateway-providers/fireworks/deepseek-v4.1-flash", "llmgateway-providers/inference.net/deepseek-v4.1-flash", "llmgateway-providers/luminal/deepseek-v4.1-flash", "llmgateway-providers/novita/deepseek-v4.1-flash", "llmgateway-providers/reka-ai/deepseek-v4.1-flash", "llmgateway-providers/runware/deepseek-v4.1-flash", "llmgateway-providers/scx-ai-gp/deepseek-v4.1-flash", "llmgateway-providers/tencent/deepseek-v4.1-flash", "llmgateway-providers/together-ai/deepseek-v4.1-flash", "modal/deepseek-ai/deepseek-v4.1-flash", "morph/morph-dsv41flash", "nano-gpt/tee/deepseek-v4.1-flash", "neon/deepseek-v4-1-flash", "nvidia/deepseek-ai/deepseek-v4.1-flash", "requesty/deepseek-v4.1-flash@eu", "runcrate/deepseek-ai/deepseek-v4.1-flash", "sensenova/deepseek-flash", "siliconflow-cn/deepseek-ai/deepseek-v4.1-flash", "subconscious/subconscious/deepseek-v4.1-flash-marathon", "superbot-gg/superbot", "thinkingmachines/deepseek-ai/deepseek-v4.1-flash:peft:262144", "tinfoil/deepseek-v4-1-flash", "togetherai/deepseek-ai/deepseek-v4.1-flash", "venice/deepseek-v4-1-flash", "vivgrid/deepseek-v4.1-flash", "volcengine-coding-plan/deepseek-v4.1-flash-economy", "wandb/deepseek-ai/deepseek-v4.1-flash"],
931
- "deepseek/deepseek-v4.1-flash-1017": ["aiand/deepseek-ai/deepseek-v4.1-flash-1017", "aki-io/deepseek-v4.1-flash-1017-tl5", "amd/deepseek-v4.1-flash", "arcee/deepseek/deepseek-v4.1-flash-1017", "baseten/deepseek-ai/deepseek-v4.1-flash-1017", "byteplus/deepseek-v4-1-flash-261017", "byteplus/deepseek-v4-1-flash-economy-261017", "cline-pass/cline-pass/deepseek-v4.1-flash-1017", "cloudflare-ai-gateway/deepseek-ai/deepseek-v4.1-flash-1017", "cloudflare-workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017", "concentrate/deepseek-v4-1-flash-1017", "deepinfra/deepseek-ai/deepseek-v4.1-flash-1017", "deepseek/deepseek-flash", "deepseek/deepseek-v4-flash", "deepseek/deepseek-v4-flash-vision-exp", "dothoosh/deepseek-flash", "doubleword/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/arkanecloud/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/cloudflare/@cf/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/deepinfra/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/flexai/deepseek-v4.1-flash-1017", "edenai/nebius/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/qwen/deepseek-v4.1-flash-1017", "edenai/scaleway/deepseek-v4.1-flash-1017", "edenai/sference/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/tencent/deepseek-v4.1-flash-1017", "edenai/tensorx/deepseek/deepseek-v4.1-flash-1017", "edenai/together_ai/deepseek-ai/deepseek-v4.1-flash-1017", "empiriolabs/deepseek-v4-1-flash-1017", "entrim/deepseek-ai/deepseek-v4.1-flash-1017", "fiftyx/deepseek-ai/deepseek-v4.1-flash-1017", "fireworks-ai/accounts/fireworks/models/deepseek-v4p1-flash-1017", "fireworks-ai/accounts/fireworks/routers/deepseek-flash-latest", "fireworks-ai/accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot", "frogbot/deepseek-v4-1-flash", "graphn/deepseek-v4.1-flash", "hopper/deepseek-v4.1-flash-1017-abliterated", "huggingface/deepseek-ai/deepseek-v4.1-flash-1017", "inceptron/deepseek-ai/deepseek-v4.1-flash-1017", "keln/deepseek-ai/deepseek-v4.1-flash-1017", "liquid/deepseek-v4.1-flash-1017", "lithosai/deepseek-ai/deepseek-v4.1-flash", "lithosai/deepseek-ai/deepseek-v4.1-flash-ultra", "llmgateway-providers/alibaba/deepseek-v4.1-flash-1017", "llmgateway-providers/baidu/deepseek-v4.1-flash-1017", "llmgateway-providers/canopywave/deepseek-v4.1-flash-1017", "llmgateway-providers/cloudflare/deepseek-v4.1-flash-1017", "llmgateway-providers/deepinfra/deepseek-v4.1-flash-1017", "llmgateway-providers/entrim/deepseek-v4.1-flash-1017", "llmgateway-providers/fireworks/deepseek-v4.1-flash-1017", "llmgateway-providers/flexai/deepseek-v4.1-flash-1017", "llmgateway-providers/inference.net/deepseek-v4.1-flash-1017", "llmgateway-providers/mistral/deepseek-v4.1-flash-1017", "llmgateway-providers/novita/deepseek-v4.1-flash-1017", "llmgateway-providers/reka-ai/deepseek-v4.1-flash-1017", "llmgateway-providers/runware/deepseek-v4.1-flash-1017", "llmgateway-providers/sciforium/deepseek-v4.1-flash-1017", "llmgateway-providers/scx-ai-gp/deepseek-v4.1-flash-1017", "llmgateway-providers/tencent/deepseek-v4.1-flash-1017", "llmgateway-providers/together-ai/deepseek-v4.1-flash-1017", "mistral/deepseek-v4-1-flash-1017", "moneo/deepseek-v4-1-flash-1017-uncensored", "morph/morph-dsv41flash-1017", "munito/deepseek-ai/deepseek-v4.1-flash-1017", "nan/deepseek-v4-flash", "nearai/deepseek-ai/deepseek-v4.1-flash-1017", "nebius/deepseek-ai/deepseek-v4.1-flash-1017", "neuralwatt/deepseek-v4.1-flash", "neuralwatt/deepseek-v4.1-flash-speed", "neuralwatt/nw-flash", "nodecode/nodecode-cyber-v1", "ollama-cloud/deepseek-v4.1-flash:1017", "opencode-go/deepseek-v4.1-flash", "opencode/deepseek-v4.1-flash", "primalabs/primalabs-ai/deepseek-v4.1-flash-1017", "proxystacks/deepseek-v4.1-flash", "refuseless/deepseek-v4.1-flash-abliterated", "requesty/deepseek-v4.1-flash-1017@eu", "ruapi/deepseek-flash", "runcrate/deepseek-ai/deepseek-v4.1-flash-1017", "sarvam/deepseekv4.1-flash-1017", "sarvam/deepseekv4.1-flash-1017-interactive", "synthetic/hf:deepseek-ai/deepseek-v4.1-flash-1017", "teamorouter/deepseek-flash-1017", "tencent-token-plan/deepseek/deepseek-flash", "thinkingmachines/deepseek-ai/deepseek-v4.1-flash-1017:peft:262144", "trustedtokens/deepseek-ai/deepseek-v4.1-flash-1017", "umans-ai-coding-plan/umans-coder", "umans-ai-coding-plan/umans-deepseek-v4.1-flash", "umans-ai-coding-plan/umans-deepseek-v4.1-flash-1017", "umans-ai-coding-plan/umans-flash", "umans-ai/umans-coder", "umans-ai/umans-deepseek-v4.1-flash", "umans-ai/umans-deepseek-v4.1-flash-1017", "umans-ai/umans-flash", "uncensuredai/deepseek-v4.1-flash-abliterated", "venice/deepseek-v4-1-flash-1017", "wandb/deepseek-ai/deepseek-v4.1-flash-1017"],
932
- "deepseek/deepseek-v4.1-flash-1017:fast": ["baseten/deepseek-ai/deepseek-v4.1-flash-1017-fast", "concentrate/deepseek-v4-1-fast", "isoquant/deepseek-v4.1-flash-1017-fast", "kilo/deepseek/deepseek-v4.1-flash-1017-fast", "lithosai/deepseek-ai/deepseek-v4.1-flash-fast", "refuseless/deepseek-v4.1-flash-fast", "vercel/deepseek/deepseek-v4.1-flash-1017-fast"],
929
+ "deepseek/deepseek-v4.1-flash-1017": ["aiand/deepseek-ai/deepseek-v4.1-flash-1017", "aki-io/deepseek-v4.1-flash-1017-tl5", "amd/deepseek-v4.1-flash", "arcee/deepseek/deepseek-v4.1-flash-1017", "baseten/deepseek-ai/deepseek-v4.1-flash-1017", "byteplus/deepseek-v4-1-flash-261017", "byteplus/deepseek-v4-1-flash-economy-261017", "cline-pass/cline-pass/deepseek-v4.1-flash-1017", "cloudflare-ai-gateway/deepseek-ai/deepseek-v4.1-flash-1017", "cloudflare-workers-ai/@cf/deepseek-ai/deepseek-v4.1-flash-1017", "concentrate/deepseek-v4-1-flash-1017", "deepinfra/deepseek-ai/deepseek-v4.1-flash-1017", "deepseek/deepseek-flash", "deepseek/deepseek-v4-flash", "deepseek/deepseek-v4-flash-vision-exp", "dothoosh/deepseek-flash", "doubleword/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/arkanecloud/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/cloudflare/@cf/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/deepinfra/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/flexai/deepseek-v4.1-flash-1017", "edenai/nebius/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/qwen/deepseek-v4.1-flash-1017", "edenai/scaleway/deepseek-v4.1-flash-1017", "edenai/sference/deepseek-ai/deepseek-v4.1-flash-1017", "edenai/tencent/deepseek-v4.1-flash-1017", "edenai/tensorx/deepseek/deepseek-v4.1-flash-1017", "edenai/together_ai/deepseek-ai/deepseek-v4.1-flash-1017", "empiriolabs/deepseek-v4-1-flash-1017", "entrim/deepseek-ai/deepseek-v4.1-flash-1017", "fiftyx/deepseek-ai/deepseek-v4.1-flash-1017", "fireworks-ai/accounts/fireworks/models/deepseek-v4p1-flash-1017", "fireworks-ai/accounts/fireworks/routers/deepseek-flash-latest", "fireworks-ai/accounts/fireworks/routers/deepseek-v4p1-flash-1017-spot", "frogbot/deepseek-v4-1-flash", "graphn/deepseek-v4.1-flash", "hopper/deepseek-v4.1-flash-1017-abliterated", "huggingface/deepseek-ai/deepseek-v4.1-flash-1017", "inceptron/deepseek-ai/deepseek-v4.1-flash-1017", "keln/deepseek-ai/deepseek-v4.1-flash-1017", "liquid/deepseek-v4.1-flash-1017", "lithosai/deepseek-ai/deepseek-v4.1-flash", "lithosai/deepseek-ai/deepseek-v4.1-flash-ultra", "llmgateway-providers/alibaba/deepseek-v4.1-flash-1017", "llmgateway-providers/baidu/deepseek-v4.1-flash-1017", "llmgateway-providers/canopywave/deepseek-v4.1-flash-1017", "llmgateway-providers/cloudflare/deepseek-v4.1-flash-1017", "llmgateway-providers/deepinfra/deepseek-v4.1-flash-1017", "llmgateway-providers/entrim/deepseek-v4.1-flash-1017", "llmgateway-providers/fireworks/deepseek-v4.1-flash-1017", "llmgateway-providers/flexai/deepseek-v4.1-flash-1017", "llmgateway-providers/inference.net/deepseek-v4.1-flash-1017", "llmgateway-providers/mistral/deepseek-v4.1-flash-1017", "llmgateway-providers/novita/deepseek-v4.1-flash-1017", "llmgateway-providers/reka-ai/deepseek-v4.1-flash-1017", "llmgateway-providers/runware/deepseek-v4.1-flash-1017", "llmgateway-providers/sciforium/deepseek-v4.1-flash-1017", "llmgateway-providers/scx-ai-gp/deepseek-v4.1-flash-1017", "llmgateway-providers/tencent/deepseek-v4.1-flash-1017", "llmgateway-providers/together-ai/deepseek-v4.1-flash-1017", "llmgateway-providers/vertex-openai/deepseek-v4.1-flash-1017", "mistral/deepseek-v4-1-flash-1017", "moneo/deepseek-v4-1-flash-1017-uncensored", "morph/morph-dsv41flash-1017", "munito/deepseek-ai/deepseek-v4.1-flash-1017", "nan/deepseek-v4-flash", "nearai/deepseek-ai/deepseek-v4.1-flash-1017", "nebius/deepseek-ai/deepseek-v4.1-flash-1017", "neuralwatt/deepseek-v4.1-flash", "neuralwatt/deepseek-v4.1-flash-speed", "neuralwatt/nw-flash", "nodecode/nodecode-cyber-v1", "ollama-cloud/deepseek-v4.1-flash:1017", "opencode-go/deepseek-v4.1-flash", "opencode/deepseek-v4.1-flash", "primalabs/primalabs-ai/deepseek-v4.1-flash-1017", "proxystacks/deepseek-v4.1-flash", "refuseless/deepseek-v4.1-flash-abliterated", "requesty/deepseek-v4.1-flash-1017@eu", "ruapi/deepseek-flash", "runcrate/deepseek-ai/deepseek-v4.1-flash-1017", "sarvam/deepseekv4.1-flash-1017", "sarvam/deepseekv4.1-flash-1017-interactive", "synthetic/hf:deepseek-ai/deepseek-v4.1-flash-1017", "teamorouter/deepseek-flash-1017", "tencent-token-plan/deepseek/deepseek-flash", "thinkingmachines/deepseek-ai/deepseek-v4.1-flash-1017:peft:262144", "togetherai/deepseek-ai/deepseek-v4.1-flash-1017", "trustedtokens/deepseek-ai/deepseek-v4.1-flash-1017", "umans-ai-coding-plan/umans-coder", "umans-ai-coding-plan/umans-deepseek-v4.1-flash", "umans-ai-coding-plan/umans-deepseek-v4.1-flash-1017", "umans-ai-coding-plan/umans-flash", "umans-ai/umans-coder", "umans-ai/umans-deepseek-v4.1-flash", "umans-ai/umans-deepseek-v4.1-flash-1017", "umans-ai/umans-flash", "uncensuredai/deepseek-v4.1-flash-abliterated", "venice/deepseek-v4-1-flash-1017", "wandb/deepseek-ai/deepseek-v4.1-flash-1017"],
930
+ "deepseek/deepseek-v4.1-flash-1017:fast": ["baseten/deepseek-ai/deepseek-v4.1-flash-1017-fast", "concentrate/deepseek-v4-1-fast", "isoquant/deepseek-v4.1-flash-1017-fast", "kilo/deepseek/deepseek-v4.1-flash-1017-fast", "lithosai/deepseek-ai/deepseek-v4.1-flash-fast", "nebius/deepseek-ai/deepseek-v4.1-flash-1017-fast", "refuseless/deepseek-v4.1-flash-fast", "vercel/deepseek/deepseek-v4.1-flash-1017-fast"],
933
931
  "deepseek/deepseek-v4.1-flash-1017:flex": ["neuralwatt/deepseek-v4.1-flash-flex", "neuralwatt/nw-flash-flex"],
934
932
  "deepseek/deepseek-v4.1-flash-1017:free": ["opencode/deepseek-v4.1-flash-free"],
935
933
  "deepseek/deepseek-v4.1-flash-1017:priority": ["abliteratedllm/deepseek-v4.1-flash-1017-priority", "abliteratedllm/deepseek-v4.1-flash-1017@mode:priority", "fireworks-ai/accounts/fireworks/models/deepseek-v4p1-flash-1017-priority", "fireworks-ai/accounts/fireworks/models/deepseek-v4p1-flash-1017@mode:priority", "fireworks-ai/accounts/fireworks/routers/deepseek-flash-latest-priority", "fireworks-ai/accounts/fireworks/routers/deepseek-flash-latest@mode:priority"],
@@ -1007,7 +1005,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
1007
1005
  "meta/llama-prompt-guard-2-22m": ["edenai/groq/meta-llama/llama-prompt-guard-2-22m", "groq/meta-llama/llama-prompt-guard-2-22m"],
1008
1006
  "meta/llama-prompt-guard-2-86m": ["edenai/groq/meta-llama/llama-prompt-guard-2-86m", "groq/meta-llama/llama-prompt-guard-2-86m"],
1009
1007
  "meta/muse-ember-1.0": ["concentrate/muse-ember", "kenari/muse-ember-1-0"],
1010
- "meta/muse-glimmer-30b": ["doubleword/meta-models/muse-glimmer-30b", "edenai/deepinfra/meta-models/muse-glimmer-30b", "edenai/flexai/muse-glimmer-30b", "edenai/together_ai/meta-models/muse-glimmer-30b", "llmgateway-providers/deepinfra/muse-glimmer-30b", "llmgateway-providers/together-ai/muse-glimmer-30b", "llmtr/muse-glimmer-30b-tr", "nvidia/meta/muse-glimmer-30b"],
1008
+ "meta/muse-glimmer-30b": ["doubleword/meta-models/muse-glimmer-30b", "edenai/deepinfra/meta-models/muse-glimmer-30b", "edenai/flexai/muse-glimmer-30b", "edenai/together_ai/meta-models/muse-glimmer-30b", "llmgateway-providers/deepinfra/muse-glimmer-30b", "llmgateway-providers/together-ai/muse-glimmer-30b", "llmtr/muse-glimmer-30b-tr", "nvidia/meta/muse-glimmer-30b", "togetherai/meta-models/muse-glimmer-30b"],
1011
1009
  "meta/muse-glimmer-30b:free": ["kenari/muse-glimmer-30b:free"],
1012
1010
  "meta/muse-spark-1.1": ["empiriolabs/muse-spark-1-1"],
1013
1011
  "meta/muse-spark-1.2": ["empiriolabs/muse-spark-1-2", "kenari/muse-spark-1-2"],
@@ -1036,7 +1034,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
1036
1034
  "minimax/minimax-m2.7-highspeed": ["aihubmix/coding-minimax-m2.7-highspeed", "auriko/minimax-m2-7-highspeed", "concentrate/minimax-m2-7-highspeed", "kenari/minimax-m2-7-highspeed"],
1037
1035
  "minimax/minimax-m2.7:free": ["aihubmix/coding-minimax-m2.7-free", "unorouter/minimax-m2.7:free"],
1038
1036
  "minimax/minimax-m3": ["abacus/minimaxai/minimax-m3", "cline-pass/cline-pass/minimax-m3", "commandcode/minimaxai/minimax-m3", "deepinfra/minimaxai/minimax-m3", "fireworks-ai/accounts/fireworks/models/minimax-m3", "fireworks-ai/accounts/fireworks/routers/minimax-latest", "gmicloud/minimaxai/minimax-m3", "huggingface/minimaxai/minimax-m3", "humain/humain-m3-preview", "humain/humain-m3-research-preview", "inferenceapis/minimaxai/minimax-m3", "llmgateway-providers/deepinfra/minimax-m3", "llmgateway-providers/novita/minimax-m3", "llmgateway-providers/tencent/minimax-m3", "nebius/minimaxai/minimax-m3", "requesty/minimax-m3@eu", "siliconflow/minimaxai/minimax-m3", "tencent-token-plan/minimax-m-3-0", "togetherai/minimaxai/minimax-m3", "wandb/minimaxai/minimax-m3"],
1039
- "minimax/minimax-m3.1-flash": ["cline-pass/cline-pass/minimax-m3.1-flash", "cloudflare-ai-gateway/minimax/m3.1-flash", "concentrate/minimax-m3-1-flash", "empiriolabs/minimax-m3-1-flash", "fireworks-ai/accounts/fireworks/models/minimax-m3p1-flash", "huggingface/minimaxai/minimax-m3.1-flash", "keln/minimaxai/minimax-m3.1-flash", "kenari/minimax-m3-1-flash", "llmgateway-providers/canopywave/minimax-m3.1-flash", "llmgateway-providers/fireworks/minimax-m3.1-flash", "llmgateway-providers/flexai/minimax-m3.1-flash", "llmgateway-providers/inference.net/minimax-m3.1-flash", "llmgateway-providers/nebius/minimax-m3.1-flash", "llmgateway-providers/novita/minimax-m3.1-flash", "llmgateway-providers/together-ai/minimax-m3.1-flash", "modular/minimaxai/minimax-m3.1-flash", "nebius/minimaxai/minimax-m3.1-flash", "nvidia/minimaxai/minimax-m3.1-flash", "requesty/minimax-m3.1-flash@eu", "tenstorrent/minimaxai/minimax-m3.1-flash", "venice/minimax-m3-1-flash"],
1037
+ "minimax/minimax-m3.1-flash": ["cline-pass/cline-pass/minimax-m3.1-flash", "cloudflare-ai-gateway/minimax/m3.1-flash", "concentrate/minimax-m3-1-flash", "empiriolabs/minimax-m3-1-flash", "fireworks-ai/accounts/fireworks/models/minimax-m3p1-flash", "huggingface/minimaxai/minimax-m3.1-flash", "keln/minimaxai/minimax-m3.1-flash", "kenari/minimax-m3-1-flash", "llmgateway-providers/canopywave/minimax-m3.1-flash", "llmgateway-providers/fireworks/minimax-m3.1-flash", "llmgateway-providers/flexai/minimax-m3.1-flash", "llmgateway-providers/inference.net/minimax-m3.1-flash", "llmgateway-providers/nebius/minimax-m3.1-flash", "llmgateway-providers/novita/minimax-m3.1-flash", "llmgateway-providers/together-ai/minimax-m3.1-flash", "modular/minimaxai/minimax-m3.1-flash", "nebius/minimaxai/minimax-m3.1-flash", "nvidia/minimaxai/minimax-m3.1-flash", "requesty/minimax-m3.1-flash@eu", "tenstorrent/minimaxai/minimax-m3.1-flash", "togetherai/minimaxai/minimax-m3.1-flash", "venice/minimax-m3-1-flash"],
1040
1038
  "minimax/minimax-m3.1-flash:free": ["opencode-go/minimax-m3.1-flash-free", "opencode/minimax-m3.1-flash-free"],
1041
1039
  "minimax/minimax-m3.1-flash:priority": ["fireworks-ai/accounts/fireworks/models/minimax-m3p1-flash-priority", "fireworks-ai/accounts/fireworks/models/minimax-m3p1-flash@mode:priority"],
1042
1040
  "minimax/minimax-m3:fast": ["inco/minimax-m3:fast"],
@@ -1051,16 +1049,16 @@ export const GENERATED_PRICE_SNAPSHOT = {
1051
1049
  "mistral/magistral-small-2506": ["nvidia/mistralai/magistral-small-2506"],
1052
1050
  "mistral/ministral-14b": ["edenai/arkanecloud/ministral-14b"],
1053
1051
  "mistral/ministral-14b-2512": ["edenai/mistral/ministral-14b-2512@eu"],
1054
- "mistral/ministral-3-14b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-14b-instruct", "digitalocean/mistral-3-14b", "edenai/infomaniak/mistralai/ministral-3-14b-instruct-2512", "lowrouter/auto/mistralai/ministral-14b-2512", "mistral/ministral-14b-2512", "nano-gpt/mistralai/ministral-14b-instruct-2512"],
1055
- "mistral/ministral-3-3b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-3b-instruct", "concentrate/ministral-3-3b", "lowrouter/auto/mistralai/ministral-3b-2512", "mistral/ministral-3b-2512"],
1056
- "mistral/ministral-3-8b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-8b-instruct", "concentrate/ministral-3-8b", "lowrouter/auto/mistralai/ministral-8b-2512", "mistral/ministral-8b-2512"],
1052
+ "mistral/ministral-3-14b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-14b-instruct", "digitalocean/mistral-3-14b", "edenai/infomaniak/mistralai/ministral-3-14b-instruct-2512", "lowrouter/auto/mistralai/ministral-14b-2512", "mistral/ministral-14b-2512", "mistral/ministral-14b-latest", "nano-gpt/mistralai/ministral-14b-instruct-2512"],
1053
+ "mistral/ministral-3-3b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-3b-instruct", "concentrate/ministral-3-3b", "lowrouter/auto/mistralai/ministral-3b-2512", "mistral/ministral-3b-2512", "mistral/ministral-3b-latest"],
1054
+ "mistral/ministral-3-8b-instruct-2512": ["amazon-bedrock/mistral.ministral-3-8b-instruct", "concentrate/ministral-3-8b", "lowrouter/auto/mistralai/ministral-8b-2512", "mistral/ministral-8b-2512", "mistral/ministral-8b-latest"],
1057
1055
  "mistral/ministral-3b-2512": ["edenai/mistral/ministral-3b-2512@eu"],
1058
1056
  "mistral/ministral-8b-2512": ["edenai/mistral/ministral-8b-2512@eu"],
1059
1057
  "mistral/mistral-7b-instruct-v0.3": ["nvidia/mistralai/mistral-7b-instruct-v0.3"],
1060
1058
  "mistral/mistral-large-2407": ["edenai/mistral/mistral-large-2407@eu", "snowflake-cortex/mistral-large2"],
1061
1059
  "mistral/mistral-large-2411": ["io-net/mistralai/mistral-large-instruct-2411"],
1062
1060
  "mistral/mistral-large-2512": ["amazon-bedrock/mistral.mistral-large-3-675b-instruct", "edenai/mistral/mistral-large-2512@eu", "lowrouter/auto/mistralai/mistral-large-2512", "ollama-cloud/mistral-large-3:675b", "vercel/mistral/mistral-large-3"],
1063
- "mistral/mistral-large-4": ["cortecs/mistral-large-4-0", "edenai/mistral/mistral-large-4@eu", "kilo/mistralai/mistral-large-4-0", "lowrouter/auto/mistralai/mistral-large-4", "mistral/mistral-large-4-0-8", "mistral/mistral-large-latest", "openrouter/mistralai/mistral-large-4-0", "requesty/mistral-large-4@eu", "standardcompute/mistralai/mistral-large-4-0"],
1061
+ "mistral/mistral-large-4": ["cortecs/mistral-large-4-0", "edenai/mistral/mistral-large-4@eu", "kilo/mistralai/mistral-large-4-0", "lowrouter/auto/mistralai/mistral-large-4", "mistral/mistral-large-latest", "openrouter/mistralai/mistral-large-4-0", "requesty/mistral-large-4@eu", "standardcompute/mistralai/mistral-large-4-0"],
1064
1062
  "mistral/mistral-large-latest": ["edenai/mistral/mistral-large-latest@eu"],
1065
1063
  "mistral/mistral-medium-2505": ["google-vertex/mistral-medium-3", "sap-ai-core/mistralai--mistral-medium-instruct"],
1066
1064
  "mistral/mistral-medium-2604": ["edenai/mistral/mistral-medium-2604@eu", "evroc/mistralai/mistral-medium-3.5-128b", "greenpt/mistral-medium-3.5-128b", "lowrouter/auto/mistralai/mistral-medium-3.5", "sap-ai-core/mistralai--mistral-medium", "scaleway/mistral-medium-3.5-128b"],
@@ -1085,8 +1083,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
1085
1083
  "mistral/voxtral-small-latest": ["edenai/mistral/voxtral-small-latest@eu"],
1086
1084
  "moonshotai/kimi-k2": ["helicone/kimi-k2-0711"],
1087
1085
  "moonshotai/kimi-k2-0905": ["302ai/kimi-k2-0905-preview", "huggingface/moonshotai/kimi-k2-instruct-0905", "io-net/moonshotai/kimi-k2-instruct-0905", "nano-gpt/moonshotai/kimi-k2-instruct-0905", "opencode/kimi-k2"],
1088
- "moonshotai/kimi-k2-instruct": ["edenai/deepinfra/moonshotai/kimi-k2-instruct", "nano-gpt/moonshotai/kimi-k2-instruct-0711"],
1089
- "moonshotai/kimi-k2-instruct:fast": ["nano-gpt/kimi-k2-instruct-fast"],
1086
+ "moonshotai/kimi-k2-instruct": ["edenai/deepinfra/moonshotai/kimi-k2-instruct"],
1090
1087
  "moonshotai/kimi-k2-thinking": ["amazon-bedrock/moonshot.kimi-k2-thinking", "edenai/amazon/moonshot.kimi-k2-thinking", "poe/novita/kimi-k2-thinking"],
1091
1088
  "moonshotai/kimi-k2.5": ["concentrate/kimi-k2-5", "edenai/amazon/moonshotai.kimi-k2.5", "edenai/deepinfra/moonshotai/kimi-k2.5", "edenai/tensorx/moonshotai/kimi-k2.5", "llmgateway-providers/alibaba/kimi-k2.5", "llmgateway-providers/moonshot/kimi-k2.5", "merge-gateway/moonshot/kimi-k2.5", "orcarouter/kimi/kimi-k2.5", "poe/fireworks-ai/kimi-k2.5-fw", "poe/novita/kimi-k2.5", "requesty/kimi-k2.5@eu", "siliconflow-cn/pro/moonshotai/kimi-k2.5", "zenifra/zenifra/kimi-k2.5"],
1092
1089
  "moonshotai/kimi-k2.5:free": ["opencode/kimi-k2.5-free"],
@@ -1133,10 +1130,9 @@ export const GENERATED_PRICE_SNAPSHOT = {
1133
1130
  "openai/gpt-4.1-mini": ["helicone/gpt-4.1-mini-2025-04-14", "llmgateway-providers/azure/gpt-4.1-mini", "lowrouter/auto/openai/gpt-4.1-mini", "requesty/gpt-4.1-mini@eu"],
1134
1131
  "openai/gpt-4.1-mini:fast": ["kilo/openai/gpt-4.1-mini-fast", "openai/gpt-4.1-mini-fast", "openai/gpt-4.1-mini@mode:fast", "vercel/openai/gpt-4.1-mini-fast", "vercel/openai/gpt-4.1-mini@mode:fast"],
1135
1132
  "openai/gpt-4.1-nano": ["edenai/azure/gpt-4.1-nano", "edenai/azure/gpt-4.1-nano@eu", "edenai/azure/gpt-4.1-nano@us", "llmgateway-providers/azure/gpt-4.1-nano", "requesty/gpt-4.1-nano@eu"],
1136
- "openai/gpt-4.1-nano:fast": ["openai/gpt-4.1-nano-fast", "openai/gpt-4.1-nano@mode:fast", "vercel/openai/gpt-4.1-nano-fast", "vercel/openai/gpt-4.1-nano@mode:fast"],
1133
+ "openai/gpt-4.1-nano:fast": ["vercel/openai/gpt-4.1-nano-fast", "vercel/openai/gpt-4.1-nano@mode:fast"],
1137
1134
  "openai/gpt-4.1:fast": ["kilo/openai/gpt-4.1-fast", "openai/gpt-4.1-fast", "openai/gpt-4.1@mode:fast", "vercel/openai/gpt-4.1-fast", "vercel/openai/gpt-4.1@mode:fast"],
1138
1135
  "openai/gpt-4o": ["digitalocean/openai-gpt-4o", "llmgateway-providers/azure/gpt-4o", "lowrouter/auto/openai/gpt-4o"],
1139
- "openai/gpt-4o-2024-05-13:fast": ["openai/gpt-4o-2024-05-13-fast", "openai/gpt-4o-2024-05-13@mode:fast"],
1140
1136
  "openai/gpt-4o-2024-08-06": ["poe/openai/gpt-4o-aug"],
1141
1137
  "openai/gpt-4o-2024-11-20": ["venice/openai-gpt-4o-2024-11-20"],
1142
1138
  "openai/gpt-4o-mini": ["digitalocean/openai-gpt-4o-mini", "kilo/openai/gpt-4o-mini-2024-07-18", "llmgateway-providers/azure/gpt-4o-mini", "lowrouter/auto/openai/gpt-4o-mini", "openrouter/openai/gpt-4o-mini-2024-07-18", "requesty/gpt-4o-mini@eu", "venice/openai-gpt-4o-mini-2024-07-18"],
@@ -1221,8 +1217,8 @@ export const GENERATED_PRICE_SNAPSHOT = {
1221
1217
  "openai/o3:fast": ["kilo/openai/o3-fast", "openai/o3-fast", "openai/o3@mode:fast", "vercel/openai/o3-fast", "vercel/openai/o3@mode:fast"],
1222
1218
  "openai/o3:flex": ["openai/o3-flex", "openai/o3@mode:flex", "vercel/openai/o3-flex", "vercel/openai/o3@mode:flex"],
1223
1219
  "openai/o4-mini": ["requesty/o4-mini@eu"],
1224
- "openai/o4-mini:fast": ["openai/o4-mini-fast", "openai/o4-mini@mode:fast", "vercel/openai/o4-mini-fast", "vercel/openai/o4-mini@mode:fast"],
1225
- "openai/o4-mini:flex": ["openai/o4-mini-flex", "openai/o4-mini@mode:flex", "vercel/openai/o4-mini-flex", "vercel/openai/o4-mini@mode:flex"],
1220
+ "openai/o4-mini:fast": ["vercel/openai/o4-mini-fast", "vercel/openai/o4-mini@mode:fast"],
1221
+ "openai/o4-mini:flex": ["vercel/openai/o4-mini-flex", "vercel/openai/o4-mini@mode:flex"],
1226
1222
  "particle-ai/particle-1:free": ["kenari/particle-1:free"],
1227
1223
  "perplexity/sonar": ["edenai/perplexityai/sonar"],
1228
1224
  "perplexity/sonar-deep-research": ["edenai/perplexityai/sonar-deep-research"],
@@ -1255,11 +1251,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
1255
1251
  "tencent/hy3-preview:free": ["opencode/hy3-preview-free"],
1256
1252
  "tencent/hy3:free": ["opencode/hy3-free", "orcarouter/tencent/hy3-free"],
1257
1253
  "tencent/hy4": ["edenai/deepinfra/tencent/hy4", "edenai/together_ai/tencent/hy4", "llmgateway-providers/deepinfra/hy4", "llmgateway-providers/together-ai/hy4"],
1258
- "tencent/hy4-flash": ["vivgrid/hy4-flash"],
1254
+ "tencent/hy4-flash": ["llmgateway-providers/deepinfra/hy4-flash", "vivgrid/hy4-flash"],
1259
1255
  "tencent/hy4-flash:free": ["kenari/hy4-flash:free", "opencode-go/hy4-flash-free", "opencode/hy4-flash-free"],
1260
1256
  "tencent/hy4-preview": ["edenai/deepinfra/tencent/hy4-preview", "llmgateway-providers/deepinfra/hy4-preview", "llmgateway-providers/novita/hy4-preview"],
1261
1257
  "thinkingmachines/inkling": ["edenai/deepinfra/thinkingmachines/inkling", "edenai/fireworks_ai/accounts/fireworks/models/inkling", "edenai/together_ai/thinkingmachines/inkling", "modal/thinkingmachines/inkling-nvfp4", "requesty/inkling-256k", "thinkingmachines/thinkingmachines/inkling:peft:262144", "thinkingmachines/thinkingmachines/inkling:peft:262144:sampling-nvfp4"],
1258
+ "thinkingmachines/inkling-2-mini": ["kenari/inkling-2-mini-uncensored"],
1262
1259
  "thinkingmachines/inkling-2-small": ["edenai/cloudflare/@cf/thinkingmachines/inkling-2-small", "edenai/deepinfra/thinkingmachines/inkling-2-small", "edenai/nebius/thinkingmachines/inkling-2-small", "edenai/together_ai/thinkingmachines/inkling-2-small", "nano-gpt/tee/inkling-2-small"],
1260
+ "thinkingmachines/inkling-2-small:fast": ["prime/thinkingmachines/inkling-2-small-fast"],
1263
1261
  "thinkingmachines/inkling-2-small:free": ["opencode/inkling-2-small-free"],
1264
1262
  "thinkingmachines/inkling-small": ["arcee/thinkingmachines/inkling-small", "edenai/deepinfra/thinkingmachines/inkling-small", "thinkingmachines/thinkingmachines/inkling-small:peft:262144", "thinkingmachines/thinkingmachines/inkling-small:peft:262144:sampling-nvfp4"],
1265
1263
  "thinkingmachines/inkling-small:thinking": ["nano-gpt/thinkingmachines/inkling-small:thinking"],
@@ -1281,7 +1279,7 @@ export const GENERATED_PRICE_SNAPSHOT = {
1281
1279
  "xai/grok-4.5": ["frogbot/grok-4-5", "kenari/grok-4-5", "llmgateway-providers/xai/grok-4-5", "llmgateway/grok-4-5", "orcarouter/grok/grok-4.5", "venice/grok-4-5", "vercel/spacexai/grok-4.5"],
1282
1280
  "xai/grok-4.6": ["google-vertex/xai/grok-4.6", "kenari/grok-4-6", "llmgateway-providers/aws-bedrock/grok-4-6", "llmgateway-providers/vertex-openai/grok-4-6", "llmgateway-providers/xai/grok-4-6", "llmgateway/grok-4-6", "neon/grok-4-6", "oci/xai.grok-4.6", "orcarouter/grok/grok-4.6", "venice/grok-4-6", "vercel/spacexai/grok-4.6"],
1283
1281
  "xai/grok-4.7": ["edenai/xai/grok-latest", "google-vertex/xai/grok-4.7", "infer/infer/grok-4.7:low-cost", "kenari/grok-4-7", "llmgateway-providers/aws-bedrock/grok-4-7", "llmgateway-providers/vertex-openai/grok-4-7", "llmgateway-providers/xai/grok-4-7", "llmgateway/grok-4-7", "neon/grok-4-7", "venice/grok-4-7", "vercel/spacexai/grok-4.7"],
1284
- "xai/grok-build-0.1": ["llmgateway-providers/xai/grok-build-0-1", "llmgateway/grok-build-0-1", "venice/grok-build-0-1"],
1282
+ "xai/grok-build-0.1": ["llmgateway-providers/xai/grok-build-0-1", "llmgateway/grok-build-0-1"],
1285
1283
  "xai/grok-code-fast-1": ["opencode/grok-code"],
1286
1284
  "xiaomi/mimo-v2-flash": ["jiekou/xiaomimimo/mimo-v2-flash", "meganova/xiaomimimo/mimo-v2-flash"],
1287
1285
  "xiaomi/mimo-v2-flash:free": ["opencode/mimo-v2-flash-free"],
package/dist/tui.js CHANGED
@@ -19,7 +19,7 @@ import { ContextSourceRpc } from "./context-rpc.js";
19
19
  import { breakdownRows } from "./context-sources.js";
20
20
  import { createClickHandlers } from "./click.js";
21
21
  import { createSource } from "./source.js";
22
- import { bar, countLabel, fitUsageSummary, formatCompact, formatEstimatedCost, formatRateTier, formatRunTime, formatTokens, rateRows, requestRows, summaryRows, usageRows } from "./usage.js";
22
+ import { bar, countLabel, fitUsageSummary, formatCompact, formatEstimatedCost, formatRateTier, formatRunTime, formatTokens, formatTps, rateRows, requestRows, summaryRows, usageRows } from "./usage.js";
23
23
  function UsageView(props) {
24
24
  const titleClick = createClickHandlers(() => props.openDetails?.(), () => !!props.context.renderer.getSelection()?.getSelectedText());
25
25
  const rows = createMemo(() => usageRows(props.state().summary, props.state().context, props.state().performance, props.state().runtime));
@@ -236,8 +236,7 @@ function ChildUsageLauncher(props) {
236
236
  }[current.status]}`;
237
237
  const context = current.context ? `${formatTokens(current.context.used)} / ${formatTokens(current.context.limit)} (${current.context.percent.toFixed(1)}%)` : "—";
238
238
  const cost = formatEstimatedCost(current.summary.cost, current.summary.costStatus) ?? "—";
239
- const tps = current.performance?.tps !== undefined && Number.isFinite(current.performance.tps) ? `${current.performance.tpsEstimated ? "~" : ""}${Math.max(0, current.performance.tps).toFixed(1)} tok/s` : "—";
240
- return fitUsageSummary([["Context", context], ["Total", formatTokens(current.summary.total)], ["Cost", cost], ["Time", runtime()], ["TPS", tps]], Math.max(20, dimensions().width - 8), current.status === "stale");
239
+ return fitUsageSummary([["Context", context], ["Total", formatTokens(current.summary.total)], ["Cost", cost], ["Time", runtime()], ["TPS", formatTps(current.performance)]], Math.max(20, dimensions().width - 8), current.status === "stale");
241
240
  });
242
241
  return (() => {
243
242
  var _el$17 = _$createElement("box"),
package/dist/usage.d.ts CHANGED
@@ -169,4 +169,5 @@ export declare function requestRows(details: RequestDetails, compact: boolean):
169
169
  export declare function summaryRows(summary: Summary): readonly (readonly [string, string])[];
170
170
  /** `1 step` reads better than `1 steps` in the dialog's single-line summaries. */
171
171
  export declare const countLabel: (value: number, noun: string) => string;
172
+ export declare function formatTps(performance?: PerformanceSummary): string | undefined;
172
173
  export declare function usageRows(summary?: Summary, context?: ContextUsage, performance?: PerformanceSummary, runtime?: RuntimeSummary): readonly (readonly [string, string])[];
package/dist/usage.js CHANGED
@@ -340,6 +340,12 @@ export function summaryRows(summary) {
340
340
  }
341
341
  /** `1 step` reads better than `1 steps` in the dialog's single-line summaries. */
342
342
  export const countLabel = (value, noun) => `${formatTokens(value)} ${noun}${value === 1 ? "" : "s"}`;
343
+ export function formatTps(performance) {
344
+ const tps = performance?.tps;
345
+ if (tps === undefined || !Number.isFinite(tps))
346
+ return undefined;
347
+ return `${performance?.tpsEstimated ? "~" : ""}${tps > 0 && tps < 0.1 ? "<0.1" : Math.max(0, tps).toFixed(1)} tok/s`;
348
+ }
343
349
  export function usageRows(summary, context, performance, runtime) {
344
350
  const t = summary?.tokens;
345
351
  const number = (value) => value === undefined ? "—" : formatTokens(value);
@@ -353,9 +359,9 @@ export function usageRows(summary, context, performance, runtime) {
353
359
  const cost = summary && formatEstimatedCost(summary.cost, summary.costStatus);
354
360
  if (cost !== undefined)
355
361
  rows.push(["Est. Cost", cost]);
356
- if (performance?.tps !== undefined && Number.isFinite(performance.tps)) {
357
- rows.push(["TPS", `${performance.tpsEstimated ? "~" : ""}${Math.max(0, performance.tps).toFixed(1)} tok/s`]);
358
- }
362
+ const tps = formatTps(performance);
363
+ if (tps !== undefined)
364
+ rows.push(["TPS", tps]);
359
365
  if (performance?.ttft !== undefined && Number.isFinite(performance.ttft)) {
360
366
  rows.push(["TTFT", `${(Math.max(0, performance.ttft) / 1_000).toFixed(1)}s`]);
361
367
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chenlongapps/opencode-token-usage",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "OpenCode 2 plugin for session-tree token usage, context window monitoring, estimated costs, and performance metrics (TPS, TTFT, run time).",
5
5
  "keywords": [
6
6
  "opencode",