@chenlongapps/opencode-token-usage 0.4.13 → 0.4.15
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 +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/performance.d.ts +3 -1
- package/dist/performance.js +6 -3
- package/dist/prices.generated.d.ts +151 -59
- package/dist/prices.generated.js +29 -29
- package/dist/pricing.d.ts +1 -1
- package/docs/verification.md +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ Costs follow the sidebar's pricing and `partial`/unavailable/free conventions. I
|
|
|
77
77
|
| `Steps` | Assistant message count across the session tree, including subagents; follows OpenCode's own stats definition, so compaction and user messages are not steps |
|
|
78
78
|
| `Est. Cost` | Estimated cost across the tree, pricing each assistant and compaction call with its actual model |
|
|
79
79
|
| `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 |
|
|
80
|
-
| `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
|
|
80
|
+
| `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 `~` |
|
|
81
81
|
| `TTFT` | Average time to first token across measurable assistant steps in the tree |
|
|
82
82
|
|
|
83
83
|
#### Behavior
|
|
@@ -95,7 +95,7 @@ Costs follow the sidebar's pricing and `partial`/unavailable/free conventions. I
|
|
|
95
95
|
- `Est. Cost` prices every message with its recorded model. A complete non-zero price resolved by OpenCode takes precedence. If OpenCode reports a complete zero price, a complete first-party snapshot price overrides it; incomplete prices fall back for the whole message without mixing rates.
|
|
96
96
|
- The checked-in fallback snapshot is generated from [models.dev](https://models.dev/api.json) using only reviewed first-party provider/model families; a small set of manufacturer-verified exceptions is kept separately. It covers priced text models, without downloading prices while the plugin runs. Gateway models match exact manufacturer IDs, documented aliases, and known wrappers; only a terminal `-free` or `:free` can be removed for a second exact lookup.
|
|
97
97
|
- 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).
|
|
98
|
-
- Live `TPS` uses a ~2s sliding window
|
|
98
|
+
- 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.
|
|
99
99
|
- 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.
|
|
100
100
|
- 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.created)` in seconds across valid assistant samples in the tree, not just the last request. This historical denominator includes pre-first-token waiting, so it is not the same metric as the recent live estimate. No model-specific multipliers, hard TPS caps or hidden-reasoning guesses are applied.
|
|
101
101
|
- Initial read failures display `Unavailable`. Later failures retain the last complete snapshot, display `Not updated`, and retry automatically.
|
package/README.zh-CN.md
CHANGED
|
@@ -77,7 +77,7 @@ opencode plugin add @chenlongapps/opencode-token-usage
|
|
|
77
77
|
| `Steps` | 全树(含子代理)的 assistant 消息数,口径与 OpenCode 自带统计一致,compaction 与用户消息不计为 step |
|
|
78
78
|
| `Est. Cost` | 按每条 assistant 与 compaction 消息实际模型估算的全树费用 |
|
|
79
79
|
| `Run Time` | 被查看会话自身的累计原生对话耗时;运行中包含仅用于显示的当前轮已耗时估算,以 `~` 标记;不额外叠加子会话耗时 |
|
|
80
|
-
| `TPS` | 服务端已上报的全树 `Output + Reasoning` 平均吞吐。流式进行中时,优先显示有效的近期可观察文本、reasoning summary 和工具输入估算(UTF-8 字节数 / 4),以 `~`
|
|
80
|
+
| `TPS` | 服务端已上报的全树 `Output + Reasoning` 平均吞吐。流式进行中时,优先显示有效的近期可观察文本、reasoning summary 和工具输入估算(UTF-8 字节数 / 4),以 `~` 标记;需单次响应累计至少 20 个估算 Token、当前窗口至少 3 个合并批次且跨度至少 500ms,不计首 token 前等待时间。OpenAI Responses 等 API 不会实时暴露完整的隐藏 reasoning token,因此实时值不能表示隐藏推理吞吐。完成后恢复不带 `~` 的服务端上报吞吐 |
|
|
81
81
|
| `TTFT` | 全树中可测 assistant step 的平均首 token 时间 |
|
|
82
82
|
|
|
83
83
|
#### 行为
|
|
@@ -95,7 +95,7 @@ opencode plugin add @chenlongapps/opencode-token-usage
|
|
|
95
95
|
- `Est. Cost` 按每条消息记录的实际模型分别计算。OpenCode 当前解析出的完整非零价格优先;若 OpenCode 给出完整零价,且内置价格快照可以完整计价,则采用快照价格。价格不完整时整条消息回退,不混用两套费率。
|
|
96
96
|
- 内置回退快照从 [models.dev](https://models.dev/api.json) 生成,只采用审核过的原厂 Provider 与自家模型系列;少量经原厂核实的例外单独维护。快照覆盖有价格的文本模型,插件运行时不下载价格。网关模型通过精确原厂 ID、明确别名和已知包装格式匹配;只有终尾 `-free` 或 `:free` 会在再次精确查找前移除。
|
|
97
97
|
- 确认免费时显示 `$0.00`;正费用低于 `$0.001` 时显示 `<$0.001`,不超过 `$0.01` 的费用保留三位小数,更高费用保留两位。价格不可用时显示 `—`;只有部分消息可计算时在已知小计后标注 `partial`。快照不含网关加价、区域溢价、未列明的折扣、非文本计费、工具费和税费;Est. Cost 是估算而非账单。覆盖范围、来源和限制见[价格来源与限制](docs/pricing.md)。
|
|
98
|
-
- 实时 `TPS` 使用约 2 秒滑动窗口,合并 100ms
|
|
98
|
+
- 实时 `TPS` 使用约 2 秒滑动窗口,合并 100ms 内的增量。只有同时满足三项条件才开始计算和显示:单次响应累计至少 20 个估算 Token(80 个 UTF-8 字节)、当前窗口至少 3 个合并批次、这些批次的有效跨度至少 500ms。首批增量计入响应累计门槛,但仅作测速基线,其字节不计为该时间戳之后生成的输出。各响应独立累计,不跨响应或子代理合并门槛。平滑按经过时间而非 delta 条数推进。门槛未满足时回退到历史 TPS,没有可用历史值则隐藏该行。2 秒没有新增量时,共享的内存超时任务使估算过期,不读取历史。过期后恢复输出时,重新建立基线与平滑状态,并重新满足批次数和跨度条件;同一响应的累计 Token 数保留。
|
|
99
99
|
- 重连时重置实时 TPS 窗口,并通过服务端活动会话列表对账全部已跟踪会话,包括离屏会话。未结束的流静默 60 秒后进行共享活动检查,不读取消息历史;确认会话已停止后,再保留 60 秒并回收流及其 TTFT 观察。仍在运行的工具、重试及首 token 前等待没有硬性寿命上限;活动查询失败时保留状态并重试。仅有提供商的 `streamed` 元数据不代表工具已结束。没有未结束流时停止检查。
|
|
100
100
|
- 实时 TPS 测量可观察的内容交付,而非模型内部生成 token 的时钟。Responses 摘要突发、仅在 done 中返回的内容和传输缓冲仍可能影响估算,不能还原完整隐藏推理。不带 `~` 时,TPS 为全树有效 assistant 样本的 `Σ(Output + Reasoning) ÷ Σ(time.streamed − time.created)`(换算为秒),不是仅取最近请求;该历史分母包含首 token 前等待,与近期实时估算口径不同。不做模型专属倍率、TPS 硬上限或隐藏 reasoning token 猜测。
|
|
101
101
|
- 首次读取失败显示 `Unavailable`;后续失败保留上次完整快照、标注 `Not updated` 并自动重试。
|
package/dist/performance.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface StreamSample {
|
|
|
24
24
|
export declare const LIVE_WINDOW_MS = 2000;
|
|
25
25
|
export declare const LIVE_MIN_SPAN_MS = 500;
|
|
26
26
|
export declare const LIVE_SAMPLE_MS = 100;
|
|
27
|
+
export declare const LIVE_MIN_TOKENS = 20;
|
|
28
|
+
export declare const LIVE_MIN_BATCHES = 3;
|
|
27
29
|
export declare const LIVE_EWMA_ALPHA = 0.35;
|
|
28
30
|
export declare const LIVE_BYTES_PER_TOKEN = 4;
|
|
29
31
|
/** Quiet streams need a server liveness check, not a maximum tool-wait duration. */
|
|
@@ -34,7 +36,7 @@ export interface PerformanceOptions {
|
|
|
34
36
|
monotonic?: () => number;
|
|
35
37
|
active?: ReadActiveSessions | undefined;
|
|
36
38
|
}
|
|
37
|
-
/**
|
|
39
|
+
/** Requires three merged batches; the first is a baseline, not newly generated bytes. */
|
|
38
40
|
export declare function estimatedLiveTps(samples: readonly StreamSample[]): number | undefined;
|
|
39
41
|
/** Time-based EWMA: elapsed time determines the weight, never delta count. */
|
|
40
42
|
export declare function smoothLiveTps(previous: number | undefined, raw: number, elapsed?: number): number;
|
package/dist/performance.js
CHANGED
|
@@ -2,13 +2,15 @@ import { normalize } from "./usage.js";
|
|
|
2
2
|
export const LIVE_WINDOW_MS = 2_000;
|
|
3
3
|
export const LIVE_MIN_SPAN_MS = 500;
|
|
4
4
|
export const LIVE_SAMPLE_MS = 100;
|
|
5
|
+
export const LIVE_MIN_TOKENS = 20;
|
|
6
|
+
export const LIVE_MIN_BATCHES = 3;
|
|
5
7
|
export const LIVE_EWMA_ALPHA = 0.35;
|
|
6
8
|
export const LIVE_BYTES_PER_TOKEN = 4;
|
|
7
9
|
/** Quiet streams need a server liveness check, not a maximum tool-wait duration. */
|
|
8
10
|
export const ACTIVITY_CHECK_MS = 60_000;
|
|
9
|
-
/**
|
|
11
|
+
/** Requires three merged batches; the first is a baseline, not newly generated bytes. */
|
|
10
12
|
export function estimatedLiveTps(samples) {
|
|
11
|
-
if (samples.length <
|
|
13
|
+
if (samples.length < LIVE_MIN_BATCHES)
|
|
12
14
|
return undefined;
|
|
13
15
|
const first = samples[0];
|
|
14
16
|
const last = samples[samples.length - 1];
|
|
@@ -464,7 +466,8 @@ export class PerformanceMonitor {
|
|
|
464
466
|
const cutoff = event.created - LIVE_WINDOW_MS;
|
|
465
467
|
while (step.samples.length > 0 && step.samples[0].time < cutoff)
|
|
466
468
|
step.samples.shift();
|
|
467
|
-
|
|
469
|
+
// The response-wide threshold includes the baseline and survives window resets.
|
|
470
|
+
const raw = step.bytes >= LIVE_MIN_TOKENS * LIVE_BYTES_PER_TOKEN ? estimatedLiveTps(step.samples) : undefined;
|
|
468
471
|
if (raw === undefined) {
|
|
469
472
|
delete step.liveTps;
|
|
470
473
|
delete step.liveDuration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
2
|
-
readonly verified: "2026-10-
|
|
2
|
+
readonly verified: "2026-10-22";
|
|
3
3
|
readonly source: "https://models.dev/api.json";
|
|
4
4
|
readonly entries: readonly [{
|
|
5
5
|
readonly providerID: "ai21";
|
|
@@ -8,7 +8,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
8
8
|
readonly input: 2;
|
|
9
9
|
readonly output: 8;
|
|
10
10
|
}];
|
|
11
|
-
readonly released: "2025-07-
|
|
11
|
+
readonly released: "2025-07-03";
|
|
12
12
|
}, {
|
|
13
13
|
readonly providerID: "ai21";
|
|
14
14
|
readonly id: "jamba-mini";
|
|
@@ -16,7 +16,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
16
16
|
readonly input: 0.2;
|
|
17
17
|
readonly output: 0.4;
|
|
18
18
|
}];
|
|
19
|
-
readonly released: "2026-01-
|
|
19
|
+
readonly released: "2026-01-08";
|
|
20
20
|
}, {
|
|
21
21
|
readonly providerID: "alibaba";
|
|
22
22
|
readonly id: "qvq-max";
|
|
@@ -31,6 +31,13 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
31
31
|
readonly prices: readonly [{
|
|
32
32
|
readonly input: 0.05;
|
|
33
33
|
readonly output: 0.4;
|
|
34
|
+
}, {
|
|
35
|
+
readonly input: 0.25;
|
|
36
|
+
readonly output: 2;
|
|
37
|
+
readonly tier: {
|
|
38
|
+
readonly type: "context";
|
|
39
|
+
readonly size: 256000;
|
|
40
|
+
};
|
|
34
41
|
}];
|
|
35
42
|
readonly released: "2025-07-28";
|
|
36
43
|
}, {
|
|
@@ -62,6 +69,14 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
62
69
|
readonly input: 0.4;
|
|
63
70
|
readonly output: 1.2;
|
|
64
71
|
readonly reasoning: 4;
|
|
72
|
+
}, {
|
|
73
|
+
readonly input: 1.2;
|
|
74
|
+
readonly output: 3.6;
|
|
75
|
+
readonly reasoning: 12;
|
|
76
|
+
readonly tier: {
|
|
77
|
+
readonly type: "context";
|
|
78
|
+
readonly size: 256000;
|
|
79
|
+
};
|
|
65
80
|
}];
|
|
66
81
|
readonly released: "2024-01-25";
|
|
67
82
|
}, {
|
|
@@ -233,6 +248,27 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
233
248
|
readonly prices: readonly [{
|
|
234
249
|
readonly input: 0.3;
|
|
235
250
|
readonly output: 1.5;
|
|
251
|
+
}, {
|
|
252
|
+
readonly input: 0.5;
|
|
253
|
+
readonly output: 2.5;
|
|
254
|
+
readonly tier: {
|
|
255
|
+
readonly type: "context";
|
|
256
|
+
readonly size: 32000;
|
|
257
|
+
};
|
|
258
|
+
}, {
|
|
259
|
+
readonly input: 0.8;
|
|
260
|
+
readonly output: 4;
|
|
261
|
+
readonly tier: {
|
|
262
|
+
readonly type: "context";
|
|
263
|
+
readonly size: 128000;
|
|
264
|
+
};
|
|
265
|
+
}, {
|
|
266
|
+
readonly input: 1.6;
|
|
267
|
+
readonly output: 9.6;
|
|
268
|
+
readonly tier: {
|
|
269
|
+
readonly type: "context";
|
|
270
|
+
readonly size: 256000;
|
|
271
|
+
};
|
|
236
272
|
}];
|
|
237
273
|
readonly released: "2025-07-28";
|
|
238
274
|
}, {
|
|
@@ -287,7 +323,20 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
287
323
|
readonly prices: readonly [{
|
|
288
324
|
readonly input: 0.2;
|
|
289
325
|
readonly output: 1.6;
|
|
290
|
-
|
|
326
|
+
}, {
|
|
327
|
+
readonly input: 0.3;
|
|
328
|
+
readonly output: 2.4;
|
|
329
|
+
readonly tier: {
|
|
330
|
+
readonly type: "context";
|
|
331
|
+
readonly size: 32000;
|
|
332
|
+
};
|
|
333
|
+
}, {
|
|
334
|
+
readonly input: 0.6;
|
|
335
|
+
readonly output: 4.8;
|
|
336
|
+
readonly tier: {
|
|
337
|
+
readonly type: "context";
|
|
338
|
+
readonly size: 128000;
|
|
339
|
+
};
|
|
291
340
|
}];
|
|
292
341
|
readonly released: "2025-09-23";
|
|
293
342
|
}, {
|
|
@@ -339,6 +388,13 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
339
388
|
readonly prices: readonly [{
|
|
340
389
|
readonly input: 0.4;
|
|
341
390
|
readonly output: 2.4;
|
|
391
|
+
}, {
|
|
392
|
+
readonly input: 0.5;
|
|
393
|
+
readonly output: 3;
|
|
394
|
+
readonly tier: {
|
|
395
|
+
readonly type: "context";
|
|
396
|
+
readonly size: 256000;
|
|
397
|
+
};
|
|
342
398
|
}];
|
|
343
399
|
readonly released: "2026-02-16";
|
|
344
400
|
}, {
|
|
@@ -353,17 +409,29 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
353
409
|
readonly providerID: "alibaba";
|
|
354
410
|
readonly id: "qwen3.6-35b-a3b";
|
|
355
411
|
readonly prices: readonly [{
|
|
356
|
-
readonly input: 0.
|
|
357
|
-
readonly output:
|
|
412
|
+
readonly input: 0.375;
|
|
413
|
+
readonly output: 2.25;
|
|
358
414
|
}];
|
|
359
415
|
readonly released: "2026-04-17";
|
|
360
416
|
}, {
|
|
361
417
|
readonly providerID: "alibaba";
|
|
362
418
|
readonly id: "qwen3.6-flash";
|
|
363
419
|
readonly prices: readonly [{
|
|
364
|
-
readonly input: 0.
|
|
365
|
-
readonly output: 1.
|
|
366
|
-
readonly cache: {
|
|
420
|
+
readonly input: 0.25;
|
|
421
|
+
readonly output: 1.5;
|
|
422
|
+
readonly cache: {
|
|
423
|
+
readonly read: 0.025;
|
|
424
|
+
};
|
|
425
|
+
}, {
|
|
426
|
+
readonly input: 1;
|
|
427
|
+
readonly output: 4;
|
|
428
|
+
readonly cache: {
|
|
429
|
+
readonly read: 0.1;
|
|
430
|
+
};
|
|
431
|
+
readonly tier: {
|
|
432
|
+
readonly type: "context";
|
|
433
|
+
readonly size: 256000;
|
|
434
|
+
};
|
|
367
435
|
}];
|
|
368
436
|
readonly released: "2026-04-27";
|
|
369
437
|
}, {
|
|
@@ -830,7 +898,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
830
898
|
readonly input: 0.0375;
|
|
831
899
|
readonly output: 0.15;
|
|
832
900
|
}];
|
|
833
|
-
readonly released: "2024-12-
|
|
901
|
+
readonly released: "2024-12-13";
|
|
834
902
|
}, {
|
|
835
903
|
readonly providerID: "cohere";
|
|
836
904
|
readonly id: "command-r7b-arabic-02-2025";
|
|
@@ -898,7 +966,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
898
966
|
readonly read: 0.022;
|
|
899
967
|
};
|
|
900
968
|
}];
|
|
901
|
-
readonly released: "2026-08-
|
|
969
|
+
readonly released: "2026-08-13";
|
|
902
970
|
}, {
|
|
903
971
|
readonly providerID: "google";
|
|
904
972
|
readonly id: "deep-research-max-preview-04-2026";
|
|
@@ -1162,6 +1230,27 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1162
1230
|
};
|
|
1163
1231
|
}];
|
|
1164
1232
|
readonly released: "2026-07-21";
|
|
1233
|
+
}, {
|
|
1234
|
+
readonly providerID: "google";
|
|
1235
|
+
readonly id: "gemini-pro-latest";
|
|
1236
|
+
readonly prices: readonly [{
|
|
1237
|
+
readonly input: 2;
|
|
1238
|
+
readonly output: 12;
|
|
1239
|
+
readonly cache: {
|
|
1240
|
+
readonly read: 0.2;
|
|
1241
|
+
};
|
|
1242
|
+
}, {
|
|
1243
|
+
readonly input: 4;
|
|
1244
|
+
readonly output: 18;
|
|
1245
|
+
readonly cache: {
|
|
1246
|
+
readonly read: 0.4;
|
|
1247
|
+
};
|
|
1248
|
+
readonly tier: {
|
|
1249
|
+
readonly type: "context";
|
|
1250
|
+
readonly size: 200000;
|
|
1251
|
+
};
|
|
1252
|
+
}];
|
|
1253
|
+
readonly released: "2026-02-19";
|
|
1165
1254
|
}, {
|
|
1166
1255
|
readonly providerID: "inception";
|
|
1167
1256
|
readonly id: "mercury-2";
|
|
@@ -1177,13 +1266,24 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1177
1266
|
readonly providerID: "inception";
|
|
1178
1267
|
readonly id: "mercury-2.5";
|
|
1179
1268
|
readonly prices: readonly [{
|
|
1180
|
-
readonly input: 0.
|
|
1181
|
-
readonly output: 0.
|
|
1269
|
+
readonly input: 0.2;
|
|
1270
|
+
readonly output: 0.75;
|
|
1182
1271
|
readonly cache: {
|
|
1183
|
-
readonly read: 0.
|
|
1272
|
+
readonly read: 0.02;
|
|
1184
1273
|
};
|
|
1185
1274
|
}];
|
|
1186
1275
|
readonly released: "2026-09-08";
|
|
1276
|
+
}, {
|
|
1277
|
+
readonly providerID: "inception";
|
|
1278
|
+
readonly id: "mercury-3";
|
|
1279
|
+
readonly prices: readonly [{
|
|
1280
|
+
readonly input: 0.1;
|
|
1281
|
+
readonly output: 0.35;
|
|
1282
|
+
readonly cache: {
|
|
1283
|
+
readonly read: 0.01;
|
|
1284
|
+
};
|
|
1285
|
+
}];
|
|
1286
|
+
readonly released: "2026-10-16";
|
|
1187
1287
|
}, {
|
|
1188
1288
|
readonly providerID: "inception";
|
|
1189
1289
|
readonly id: "mercury-edit-2";
|
|
@@ -1199,13 +1299,24 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1199
1299
|
readonly providerID: "longcat";
|
|
1200
1300
|
readonly id: "longcat-2.0";
|
|
1201
1301
|
readonly prices: readonly [{
|
|
1202
|
-
readonly input: 0.
|
|
1203
|
-
readonly output: 2
|
|
1302
|
+
readonly input: 0.3;
|
|
1303
|
+
readonly output: 1.2;
|
|
1204
1304
|
readonly cache: {
|
|
1205
|
-
readonly read: 0.
|
|
1305
|
+
readonly read: 0.006;
|
|
1206
1306
|
};
|
|
1207
1307
|
}];
|
|
1208
1308
|
readonly released: "2026-06-30";
|
|
1309
|
+
}, {
|
|
1310
|
+
readonly providerID: "longcat";
|
|
1311
|
+
readonly id: "longcat-2.5-preview";
|
|
1312
|
+
readonly prices: readonly [{
|
|
1313
|
+
readonly input: 0.3;
|
|
1314
|
+
readonly output: 1.2;
|
|
1315
|
+
readonly cache: {
|
|
1316
|
+
readonly read: 0.006;
|
|
1317
|
+
};
|
|
1318
|
+
}];
|
|
1319
|
+
readonly released: "2026-09-25";
|
|
1209
1320
|
}, {
|
|
1210
1321
|
readonly providerID: "meta";
|
|
1211
1322
|
readonly id: "muse-spark-1.1";
|
|
@@ -1484,8 +1595,11 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1484
1595
|
readonly providerID: "mistral";
|
|
1485
1596
|
readonly id: "ministral-3b-latest";
|
|
1486
1597
|
readonly prices: readonly [{
|
|
1487
|
-
readonly input: 0.
|
|
1488
|
-
readonly output: 0.
|
|
1598
|
+
readonly input: 0.1;
|
|
1599
|
+
readonly output: 0.1;
|
|
1600
|
+
readonly cache: {
|
|
1601
|
+
readonly read: 0.01;
|
|
1602
|
+
};
|
|
1489
1603
|
}];
|
|
1490
1604
|
readonly released: "2024-10-01";
|
|
1491
1605
|
}, {
|
|
@@ -1503,8 +1617,11 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1503
1617
|
readonly providerID: "mistral";
|
|
1504
1618
|
readonly id: "ministral-8b-latest";
|
|
1505
1619
|
readonly prices: readonly [{
|
|
1506
|
-
readonly input: 0.
|
|
1507
|
-
readonly output: 0.
|
|
1620
|
+
readonly input: 0.15;
|
|
1621
|
+
readonly output: 0.15;
|
|
1622
|
+
readonly cache: {
|
|
1623
|
+
readonly read: 0.015;
|
|
1624
|
+
};
|
|
1508
1625
|
}];
|
|
1509
1626
|
readonly released: "2024-10-01";
|
|
1510
1627
|
}, {
|
|
@@ -1624,14 +1741,6 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1624
1741
|
};
|
|
1625
1742
|
}];
|
|
1626
1743
|
readonly released: "2026-03-16";
|
|
1627
|
-
}, {
|
|
1628
|
-
readonly providerID: "mistral";
|
|
1629
|
-
readonly id: "open-mistral-7b";
|
|
1630
|
-
readonly prices: readonly [{
|
|
1631
|
-
readonly input: 0.25;
|
|
1632
|
-
readonly output: 0.25;
|
|
1633
|
-
}];
|
|
1634
|
-
readonly released: "2023-09-27";
|
|
1635
1744
|
}, {
|
|
1636
1745
|
readonly providerID: "mistral";
|
|
1637
1746
|
readonly id: "open-mistral-nemo";
|
|
@@ -1640,22 +1749,6 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1640
1749
|
readonly output: 0.15;
|
|
1641
1750
|
}];
|
|
1642
1751
|
readonly released: "2024-07-01";
|
|
1643
|
-
}, {
|
|
1644
|
-
readonly providerID: "mistral";
|
|
1645
|
-
readonly id: "open-mixtral-8x22b";
|
|
1646
|
-
readonly prices: readonly [{
|
|
1647
|
-
readonly input: 2;
|
|
1648
|
-
readonly output: 6;
|
|
1649
|
-
}];
|
|
1650
|
-
readonly released: "2024-04-17";
|
|
1651
|
-
}, {
|
|
1652
|
-
readonly providerID: "mistral";
|
|
1653
|
-
readonly id: "open-mixtral-8x7b";
|
|
1654
|
-
readonly prices: readonly [{
|
|
1655
|
-
readonly input: 0.7;
|
|
1656
|
-
readonly output: 0.7;
|
|
1657
|
-
}];
|
|
1658
|
-
readonly released: "2023-12-11";
|
|
1659
1752
|
}, {
|
|
1660
1753
|
readonly providerID: "mistral";
|
|
1661
1754
|
readonly id: "pixtral-12b";
|
|
@@ -1685,7 +1778,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1685
1778
|
readonly id: "voxtral-small-latest";
|
|
1686
1779
|
readonly prices: readonly [{
|
|
1687
1780
|
readonly input: 0.1;
|
|
1688
|
-
readonly output: 0.
|
|
1781
|
+
readonly output: 0.4;
|
|
1689
1782
|
}];
|
|
1690
1783
|
readonly released: "2025-07-15";
|
|
1691
1784
|
}, {
|
|
@@ -1698,7 +1791,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1698
1791
|
readonly read: 0.16;
|
|
1699
1792
|
};
|
|
1700
1793
|
}];
|
|
1701
|
-
readonly released: "2026-04-
|
|
1794
|
+
readonly released: "2026-04-20";
|
|
1702
1795
|
}, {
|
|
1703
1796
|
readonly providerID: "moonshotai";
|
|
1704
1797
|
readonly id: "kimi-k2.7-code";
|
|
@@ -1780,7 +1873,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1780
1873
|
readonly input: 0;
|
|
1781
1874
|
readonly output: 0;
|
|
1782
1875
|
}];
|
|
1783
|
-
readonly released: "2025-
|
|
1876
|
+
readonly released: "2025-03-18";
|
|
1784
1877
|
}, {
|
|
1785
1878
|
readonly providerID: "nvidia";
|
|
1786
1879
|
readonly id: "nvidia/llama-3.3-nemotron-super-49b-v1.5";
|
|
@@ -1796,7 +1889,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1796
1889
|
readonly input: 0;
|
|
1797
1890
|
readonly output: 0;
|
|
1798
1891
|
}];
|
|
1799
|
-
readonly released: "2026-
|
|
1892
|
+
readonly released: "2026-03-16";
|
|
1800
1893
|
}, {
|
|
1801
1894
|
readonly providerID: "nvidia";
|
|
1802
1895
|
readonly id: "nvidia/nemotron-3-nano-30b-a3b";
|
|
@@ -1804,6 +1897,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1804
1897
|
readonly input: 0;
|
|
1805
1898
|
readonly output: 0;
|
|
1806
1899
|
}];
|
|
1900
|
+
readonly released: "2025-12-15";
|
|
1807
1901
|
}, {
|
|
1808
1902
|
readonly providerID: "nvidia";
|
|
1809
1903
|
readonly id: "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning";
|
|
@@ -1816,11 +1910,8 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1816
1910
|
readonly providerID: "nvidia";
|
|
1817
1911
|
readonly id: "nvidia/nemotron-3-ultra-550b-a55b";
|
|
1818
1912
|
readonly prices: readonly [{
|
|
1819
|
-
readonly input: 0
|
|
1820
|
-
readonly output:
|
|
1821
|
-
readonly cache: {
|
|
1822
|
-
readonly read: 0.15;
|
|
1823
|
-
};
|
|
1913
|
+
readonly input: 0;
|
|
1914
|
+
readonly output: 0;
|
|
1824
1915
|
}];
|
|
1825
1916
|
readonly released: "2026-06-04";
|
|
1826
1917
|
}, {
|
|
@@ -1830,7 +1921,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
1830
1921
|
readonly input: 0;
|
|
1831
1922
|
readonly output: 0;
|
|
1832
1923
|
}];
|
|
1833
|
-
readonly released: "2026-06-
|
|
1924
|
+
readonly released: "2026-06-02";
|
|
1834
1925
|
}, {
|
|
1835
1926
|
readonly providerID: "nvidia";
|
|
1836
1927
|
readonly id: "nvidia/nemotron-3.5-lightning-30b-a3b";
|
|
@@ -2934,10 +3025,10 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
2934
3025
|
readonly providerID: "stepfun-ai";
|
|
2935
3026
|
readonly id: "step-3.7-flash";
|
|
2936
3027
|
readonly prices: readonly [{
|
|
2937
|
-
readonly input: 0.
|
|
2938
|
-
readonly output: 1.
|
|
3028
|
+
readonly input: 0.2;
|
|
3029
|
+
readonly output: 1.15;
|
|
2939
3030
|
readonly cache: {
|
|
2940
|
-
readonly read: 0.
|
|
3031
|
+
readonly read: 0.04;
|
|
2941
3032
|
};
|
|
2942
3033
|
}];
|
|
2943
3034
|
readonly released: "2026-05-29";
|
|
@@ -2948,7 +3039,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
2948
3039
|
readonly input: 1;
|
|
2949
3040
|
readonly output: 2.7;
|
|
2950
3041
|
readonly cache: {
|
|
2951
|
-
readonly read: 0.
|
|
3042
|
+
readonly read: 0.1;
|
|
2952
3043
|
};
|
|
2953
3044
|
}];
|
|
2954
3045
|
readonly released: "2026-09-16";
|
|
@@ -2997,6 +3088,7 @@ export declare const GENERATED_PRICE_SNAPSHOT: {
|
|
|
2997
3088
|
readonly input: 0.25;
|
|
2998
3089
|
readonly output: 0.25;
|
|
2999
3090
|
}];
|
|
3091
|
+
readonly released: "2026-01-26";
|
|
3000
3092
|
}, {
|
|
3001
3093
|
readonly providerID: "upstage";
|
|
3002
3094
|
readonly id: "solar-pro4";
|
package/dist/prices.generated.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export const GENERATED_PRICE_SNAPSHOT = {
|
|
2
|
-
verified: "2026-10-
|
|
2
|
+
verified: "2026-10-22",
|
|
3
3
|
source: "https://models.dev/api.json",
|
|
4
4
|
entries: [
|
|
5
|
-
{ "providerID": "ai21", "id": "jamba-large", "prices": [{ "input": 2, "output": 8 }], "released": "2025-07-
|
|
6
|
-
{ "providerID": "ai21", "id": "jamba-mini", "prices": [{ "input": 0.2, "output": 0.4 }], "released": "2026-01-
|
|
5
|
+
{ "providerID": "ai21", "id": "jamba-large", "prices": [{ "input": 2, "output": 8 }], "released": "2025-07-03" },
|
|
6
|
+
{ "providerID": "ai21", "id": "jamba-mini", "prices": [{ "input": 0.2, "output": 0.4 }], "released": "2026-01-08" },
|
|
7
7
|
{ "providerID": "alibaba", "id": "qvq-max", "prices": [{ "input": 1.2, "output": 4.8 }], "released": "2025-03-25" },
|
|
8
|
-
{ "providerID": "alibaba", "id": "qwen-flash", "prices": [{ "input": 0.05, "output": 0.4 }], "released": "2025-07-28" },
|
|
8
|
+
{ "providerID": "alibaba", "id": "qwen-flash", "prices": [{ "input": 0.05, "output": 0.4 }, { "input": 0.25, "output": 2, "tier": { "type": "context", "size": 256000 } }], "released": "2025-07-28" },
|
|
9
9
|
{ "providerID": "alibaba", "id": "qwen-max", "prices": [{ "input": 1.6, "output": 6.4 }], "released": "2024-04-03" },
|
|
10
10
|
{ "providerID": "alibaba", "id": "qwen-mt-plus", "prices": [{ "input": 2.46, "output": 7.37 }] },
|
|
11
11
|
{ "providerID": "alibaba", "id": "qwen-mt-turbo", "prices": [{ "input": 0.16, "output": 0.49 }] },
|
|
12
|
-
{ "providerID": "alibaba", "id": "qwen-plus", "prices": [{ "input": 0.4, "output": 1.2, "reasoning": 4 }], "released": "2024-01-25" },
|
|
12
|
+
{ "providerID": "alibaba", "id": "qwen-plus", "prices": [{ "input": 0.4, "output": 1.2, "reasoning": 4 }, { "input": 1.2, "output": 3.6, "reasoning": 12, "tier": { "type": "context", "size": 256000 } }], "released": "2024-01-25" },
|
|
13
13
|
{ "providerID": "alibaba", "id": "qwen-plus-character-ja", "prices": [{ "input": 0.5, "output": 1.4 }] },
|
|
14
14
|
{ "providerID": "alibaba", "id": "qwen-turbo", "prices": [{ "input": 0.05, "output": 0.2, "reasoning": 0.5 }], "released": "2024-11-01" },
|
|
15
15
|
{ "providerID": "alibaba", "id": "qwen-vl-max", "prices": [{ "input": 0.8, "output": 3.2 }], "released": "2024-04-08" },
|
|
@@ -28,23 +28,23 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
28
28
|
{ "providerID": "alibaba", "id": "qwen3-8b", "prices": [{ "input": 0.18, "output": 0.7, "reasoning": 2.1 }] },
|
|
29
29
|
{ "providerID": "alibaba", "id": "qwen3-coder-30b-a3b-instruct", "prices": [{ "input": 0.45, "output": 2.25 }, { "input": 0.75, "output": 3.75, "tier": { "type": "context", "size": 32000 } }, { "input": 1.2, "output": 6, "tier": { "type": "context", "size": 128000 } }] },
|
|
30
30
|
{ "providerID": "alibaba", "id": "qwen3-coder-480b-a35b-instruct", "prices": [{ "input": 1.5, "output": 7.5 }, { "input": 2.7, "output": 13.5, "tier": { "type": "context", "size": 32000 } }, { "input": 4.5, "output": 22.5, "tier": { "type": "context", "size": 128000 } }] },
|
|
31
|
-
{ "providerID": "alibaba", "id": "qwen3-coder-flash", "prices": [{ "input": 0.3, "output": 1.5 }], "released": "2025-07-28" },
|
|
31
|
+
{ "providerID": "alibaba", "id": "qwen3-coder-flash", "prices": [{ "input": 0.3, "output": 1.5 }, { "input": 0.5, "output": 2.5, "tier": { "type": "context", "size": 32000 } }, { "input": 0.8, "output": 4, "tier": { "type": "context", "size": 128000 } }, { "input": 1.6, "output": 9.6, "tier": { "type": "context", "size": 256000 } }], "released": "2025-07-28" },
|
|
32
32
|
{ "providerID": "alibaba", "id": "qwen3-coder-plus", "prices": [{ "input": 1, "output": 5 }], "released": "2025-07-23" },
|
|
33
33
|
{ "providerID": "alibaba", "id": "qwen3-max", "prices": [{ "input": 1.2, "output": 6 }], "released": "2025-09-23" },
|
|
34
34
|
{ "providerID": "alibaba", "id": "qwen3-next-80b-a3b-instruct", "prices": [{ "input": 0.5, "output": 2 }] },
|
|
35
35
|
{ "providerID": "alibaba", "id": "qwen3-next-80b-a3b-thinking", "prices": [{ "input": 0.5, "output": 6 }] },
|
|
36
36
|
{ "providerID": "alibaba", "id": "qwen3-vl-235b-a22b", "prices": [{ "input": 0.7, "output": 2.8, "reasoning": 8.4 }] },
|
|
37
37
|
{ "providerID": "alibaba", "id": "qwen3-vl-30b-a3b", "prices": [{ "input": 0.2, "output": 0.8, "reasoning": 2.4 }] },
|
|
38
|
-
{ "providerID": "alibaba", "id": "qwen3-vl-plus", "prices": [{ "input": 0.2, "output": 1.6, "
|
|
38
|
+
{ "providerID": "alibaba", "id": "qwen3-vl-plus", "prices": [{ "input": 0.2, "output": 1.6 }, { "input": 0.3, "output": 2.4, "tier": { "type": "context", "size": 32000 } }, { "input": 0.6, "output": 4.8, "tier": { "type": "context", "size": 128000 } }], "released": "2025-09-23" },
|
|
39
39
|
{ "providerID": "alibaba", "id": "qwen3.5-122b-a10b", "prices": [{ "input": 0.4, "output": 3.2 }], "released": "2026-02-23" },
|
|
40
40
|
{ "providerID": "alibaba", "id": "qwen3.5-27b", "prices": [{ "input": 0.3, "output": 2.4 }], "released": "2026-02-23" },
|
|
41
41
|
{ "providerID": "alibaba", "id": "qwen3.5-35b-a3b", "prices": [{ "input": 0.25, "output": 2 }], "released": "2026-02-23" },
|
|
42
42
|
{ "providerID": "alibaba", "id": "qwen3.5-397b-a17b", "prices": [{ "input": 0.6, "output": 3.6 }], "released": "2026-02-15" },
|
|
43
43
|
{ "providerID": "alibaba", "id": "qwen3.5-flash", "prices": [{ "input": 0.1, "output": 0.4, "cache": { "read": 0.01 } }], "released": "2026-02-23" },
|
|
44
|
-
{ "providerID": "alibaba", "id": "qwen3.5-plus", "prices": [{ "input": 0.4, "output": 2.4 }], "released": "2026-02-16" },
|
|
44
|
+
{ "providerID": "alibaba", "id": "qwen3.5-plus", "prices": [{ "input": 0.4, "output": 2.4 }, { "input": 0.5, "output": 3, "tier": { "type": "context", "size": 256000 } }], "released": "2026-02-16" },
|
|
45
45
|
{ "providerID": "alibaba", "id": "qwen3.6-27b", "prices": [{ "input": 0.6, "output": 3.6 }], "released": "2026-04-22" },
|
|
46
|
-
{ "providerID": "alibaba", "id": "qwen3.6-35b-a3b", "prices": [{ "input": 0.
|
|
47
|
-
{ "providerID": "alibaba", "id": "qwen3.6-flash", "prices": [{ "input": 0.
|
|
46
|
+
{ "providerID": "alibaba", "id": "qwen3.6-35b-a3b", "prices": [{ "input": 0.375, "output": 2.25 }], "released": "2026-04-17" },
|
|
47
|
+
{ "providerID": "alibaba", "id": "qwen3.6-flash", "prices": [{ "input": 0.25, "output": 1.5, "cache": { "read": 0.025 } }, { "input": 1, "output": 4, "cache": { "read": 0.1 }, "tier": { "type": "context", "size": 256000 } }], "released": "2026-04-27" },
|
|
48
48
|
{ "providerID": "alibaba", "id": "qwen3.6-max-preview", "prices": [{ "input": 1.3, "output": 7.8, "cache": { "read": 0.13 } }], "released": "2026-04-20" },
|
|
49
49
|
{ "providerID": "alibaba", "id": "qwen3.6-plus", "prices": [{ "input": 0.5, "output": 3, "cache": { "read": 0.05 } }, { "input": 2, "output": 6, "cache": { "read": 0.2 }, "tier": { "type": "context", "size": 256000 } }], "released": "2026-04-02" },
|
|
50
50
|
{ "providerID": "alibaba", "id": "qwen3.7-flash", "prices": [{ "input": 0.03, "output": 0.13, "cache": { "read": 0.003 } }, { "input": 0.1, "output": 0.4, "cache": { "read": 0.01 }, "tier": { "type": "context", "size": 32000 } }, { "input": 0.2, "output": 0.8, "cache": { "read": 0.02 }, "tier": { "type": "context", "size": 256000 } }], "released": "2026-07-15" },
|
|
@@ -82,14 +82,14 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
82
82
|
{ "providerID": "cohere", "id": "command-a-vision-07-2025", "prices": [{ "input": 2.5, "output": 10 }], "released": "2025-07-31" },
|
|
83
83
|
{ "providerID": "cohere", "id": "command-r-08-2024", "prices": [{ "input": 0.15, "output": 0.6 }], "released": "2024-08-30" },
|
|
84
84
|
{ "providerID": "cohere", "id": "command-r-plus-08-2024", "prices": [{ "input": 2.5, "output": 10 }], "released": "2024-08-30" },
|
|
85
|
-
{ "providerID": "cohere", "id": "command-r7b-12-2024", "prices": [{ "input": 0.0375, "output": 0.15 }], "released": "2024-12-
|
|
85
|
+
{ "providerID": "cohere", "id": "command-r7b-12-2024", "prices": [{ "input": 0.0375, "output": 0.15 }], "released": "2024-12-13" },
|
|
86
86
|
{ "providerID": "cohere", "id": "command-r7b-arabic-02-2025", "prices": [{ "input": 0.0375, "output": 0.15 }], "released": "2025-02-27" },
|
|
87
87
|
{ "providerID": "cohere", "id": "north-mini-code-1-0", "prices": [{ "input": 0, "output": 0 }], "released": "2026-06-09" },
|
|
88
88
|
{ "providerID": "cohere", "id": "north-small-translate-09-2026", "prices": [{ "input": 0, "output": 0 }], "released": "2026-09-09" },
|
|
89
89
|
{ "providerID": "deepseek", "id": "deepseek-flash", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.003 } }], "released": "2026-10-17" },
|
|
90
90
|
{ "providerID": "deepseek", "id": "deepseek-v4-flash", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.003 } }], "released": "2026-10-17" },
|
|
91
91
|
{ "providerID": "deepseek", "id": "deepseek-v4-flash-vision-exp", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.003 } }], "released": "2026-10-17" },
|
|
92
|
-
{ "providerID": "deepseek", "id": "deepseek-v4-pro", "prices": [{ "input": 0.66, "output": 1.98, "cache": { "read": 0.022 } }], "released": "2026-08-
|
|
92
|
+
{ "providerID": "deepseek", "id": "deepseek-v4-pro", "prices": [{ "input": 0.66, "output": 1.98, "cache": { "read": 0.022 } }], "released": "2026-08-13" },
|
|
93
93
|
{ "providerID": "google", "id": "deep-research-max-preview-04-2026", "prices": [{ "input": 2, "output": 12, "cache": { "read": 0.2 } }, { "input": 4, "output": 18, "cache": { "read": 0.4 }, "tier": { "type": "context", "size": 200000 } }], "released": "2026-04-21" },
|
|
94
94
|
{ "providerID": "google", "id": "deep-research-preview-04-2026", "prices": [{ "input": 2, "output": 12, "cache": { "read": 0.2 } }, { "input": 4, "output": 18, "cache": { "read": 0.4 }, "tier": { "type": "context", "size": 200000 } }], "released": "2026-04-21" },
|
|
95
95
|
{ "providerID": "google", "id": "gemini-2.5-computer-use-preview-10-2025", "prices": [{ "input": 1.25, "output": 10 }, { "input": 2.5, "output": 15, "tier": { "type": "context", "size": 200000 } }], "released": "2025-10-07" },
|
|
@@ -109,10 +109,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
109
109
|
{ "providerID": "google", "id": "gemini-4-argon", "prices": [{ "input": 2, "output": 10, "cache": { "read": 0.1 } }], "released": "2026-10-13" },
|
|
110
110
|
{ "providerID": "google", "id": "gemini-flash-latest", "prices": [{ "input": 0.75, "output": 3.75, "cache": { "read": 0.075 } }], "released": "2026-08-13" },
|
|
111
111
|
{ "providerID": "google", "id": "gemini-flash-lite-latest", "prices": [{ "input": 0.3, "output": 2.5, "cache": { "read": 0.03 } }], "released": "2026-07-21" },
|
|
112
|
+
{ "providerID": "google", "id": "gemini-pro-latest", "prices": [{ "input": 2, "output": 12, "cache": { "read": 0.2 } }, { "input": 4, "output": 18, "cache": { "read": 0.4 }, "tier": { "type": "context", "size": 200000 } }], "released": "2026-02-19" },
|
|
112
113
|
{ "providerID": "inception", "id": "mercury-2", "prices": [{ "input": 0.25, "output": 0.75, "cache": { "read": 0.025 } }], "released": "2026-02-24" },
|
|
113
|
-
{ "providerID": "inception", "id": "mercury-2.5", "prices": [{ "input": 0.
|
|
114
|
+
{ "providerID": "inception", "id": "mercury-2.5", "prices": [{ "input": 0.2, "output": 0.75, "cache": { "read": 0.02 } }], "released": "2026-09-08" },
|
|
115
|
+
{ "providerID": "inception", "id": "mercury-3", "prices": [{ "input": 0.1, "output": 0.35, "cache": { "read": 0.01 } }], "released": "2026-10-16" },
|
|
114
116
|
{ "providerID": "inception", "id": "mercury-edit-2", "prices": [{ "input": 0.25, "output": 0.75, "cache": { "read": 0.025 } }], "released": "2026-03-30" },
|
|
115
|
-
{ "providerID": "longcat", "id": "longcat-2.0", "prices": [{ "input": 0.
|
|
117
|
+
{ "providerID": "longcat", "id": "longcat-2.0", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }], "released": "2026-06-30" },
|
|
118
|
+
{ "providerID": "longcat", "id": "longcat-2.5-preview", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.006 } }], "released": "2026-09-25" },
|
|
116
119
|
{ "providerID": "meta", "id": "muse-spark-1.1", "prices": [{ "input": 1.25, "output": 4.25, "cache": { "read": 0.15 } }], "released": "2026-04-08" },
|
|
117
120
|
{ "providerID": "meta", "id": "muse-spark-1.2", "prices": [{ "input": 1.25, "output": 4.25, "cache": { "read": 0.15 } }], "released": "2026-08-05" },
|
|
118
121
|
{ "providerID": "meta", "id": "muse-spark-1.2-contributor", "prices": [{ "input": 0.1, "output": 0.2, "cache": { "read": 0.002 } }], "released": "2026-08-05" },
|
|
@@ -139,9 +142,9 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
139
142
|
{ "providerID": "mistral", "id": "magistral-medium-latest", "prices": [{ "input": 2, "output": 5 }], "released": "2025-03-17" },
|
|
140
143
|
{ "providerID": "mistral", "id": "ministral-14b-2512", "prices": [{ "input": 0.2, "output": 0.2, "cache": { "read": 0.02 } }], "released": "2025-12-02" },
|
|
141
144
|
{ "providerID": "mistral", "id": "ministral-3b-2512", "prices": [{ "input": 0.1, "output": 0.1, "cache": { "read": 0.01 } }], "released": "2025-12-02" },
|
|
142
|
-
{ "providerID": "mistral", "id": "ministral-3b-latest", "prices": [{ "input": 0.
|
|
145
|
+
{ "providerID": "mistral", "id": "ministral-3b-latest", "prices": [{ "input": 0.1, "output": 0.1, "cache": { "read": 0.01 } }], "released": "2024-10-01" },
|
|
143
146
|
{ "providerID": "mistral", "id": "ministral-8b-2512", "prices": [{ "input": 0.15, "output": 0.15, "cache": { "read": 0.015 } }], "released": "2025-12-02" },
|
|
144
|
-
{ "providerID": "mistral", "id": "ministral-8b-latest", "prices": [{ "input": 0.
|
|
147
|
+
{ "providerID": "mistral", "id": "ministral-8b-latest", "prices": [{ "input": 0.15, "output": 0.15, "cache": { "read": 0.015 } }], "released": "2024-10-01" },
|
|
145
148
|
{ "providerID": "mistral", "id": "mistral-large-2411", "prices": [{ "input": 2, "output": 6 }], "released": "2024-11-18" },
|
|
146
149
|
{ "providerID": "mistral", "id": "mistral-large-2512", "prices": [{ "input": 0.5, "output": 1.5, "cache": { "read": 0.05 } }], "released": "2024-11-01" },
|
|
147
150
|
{ "providerID": "mistral", "id": "mistral-large-4", "prices": [{ "input": 0.68, "output": 2.09, "cache": { "read": 0.07 } }], "released": "2026-10-06" },
|
|
@@ -154,15 +157,12 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
154
157
|
{ "providerID": "mistral", "id": "mistral-small-2506", "prices": [{ "input": 0.1, "output": 0.3 }], "released": "2025-06-20" },
|
|
155
158
|
{ "providerID": "mistral", "id": "mistral-small-2603", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.015 } }], "released": "2026-03-16" },
|
|
156
159
|
{ "providerID": "mistral", "id": "mistral-small-latest", "prices": [{ "input": 0.15, "output": 0.6, "cache": { "read": 0.015 } }], "released": "2026-03-16" },
|
|
157
|
-
{ "providerID": "mistral", "id": "open-mistral-7b", "prices": [{ "input": 0.25, "output": 0.25 }], "released": "2023-09-27" },
|
|
158
160
|
{ "providerID": "mistral", "id": "open-mistral-nemo", "prices": [{ "input": 0.15, "output": 0.15 }], "released": "2024-07-01" },
|
|
159
|
-
{ "providerID": "mistral", "id": "open-mixtral-8x22b", "prices": [{ "input": 2, "output": 6 }], "released": "2024-04-17" },
|
|
160
|
-
{ "providerID": "mistral", "id": "open-mixtral-8x7b", "prices": [{ "input": 0.7, "output": 0.7 }], "released": "2023-12-11" },
|
|
161
161
|
{ "providerID": "mistral", "id": "pixtral-12b", "prices": [{ "input": 0.15, "output": 0.15 }], "released": "2024-09-01" },
|
|
162
162
|
{ "providerID": "mistral", "id": "pixtral-large-latest", "prices": [{ "input": 2, "output": 6 }], "released": "2024-11-01" },
|
|
163
163
|
{ "providerID": "mistral", "id": "voxtral-small-2507", "prices": [{ "input": 0.1, "output": 0.4 }], "released": "2025-07-15" },
|
|
164
|
-
{ "providerID": "mistral", "id": "voxtral-small-latest", "prices": [{ "input": 0.1, "output": 0.
|
|
165
|
-
{ "providerID": "moonshotai", "id": "kimi-k2.6", "prices": [{ "input": 0.95, "output": 4, "cache": { "read": 0.16 } }], "released": "2026-04-
|
|
164
|
+
{ "providerID": "mistral", "id": "voxtral-small-latest", "prices": [{ "input": 0.1, "output": 0.4 }], "released": "2025-07-15" },
|
|
165
|
+
{ "providerID": "moonshotai", "id": "kimi-k2.6", "prices": [{ "input": 0.95, "output": 4, "cache": { "read": 0.16 } }], "released": "2026-04-20" },
|
|
166
166
|
{ "providerID": "moonshotai", "id": "kimi-k2.7-code", "prices": [{ "input": 0.95, "output": 4, "cache": { "read": 0.19 } }], "released": "2026-06-12" },
|
|
167
167
|
{ "providerID": "moonshotai", "id": "kimi-k2.7-code-highspeed", "prices": [{ "input": 1.9, "output": 8, "cache": { "read": 0.38 } }], "released": "2026-06-12" },
|
|
168
168
|
{ "providerID": "moonshotai", "id": "kimi-k3", "prices": [{ "input": 3, "output": 15, "cache": { "read": 0.3, "write": 3 } }], "released": "2026-07-16" },
|
|
@@ -171,13 +171,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
171
171
|
{ "providerID": "nvidia", "id": "nvidia/llama-3.1-nemotron-nano-vl-8b-v1", "prices": [{ "input": 0, "output": 0 }], "released": "2025-04-10" },
|
|
172
172
|
{ "providerID": "nvidia", "id": "nvidia/llama-3.1-nemotron-safety-guard-8b-v3", "prices": [{ "input": 0, "output": 0 }], "released": "2025-10-28" },
|
|
173
173
|
{ "providerID": "nvidia", "id": "nvidia/llama-3.1-nemotron-ultra-253b-v1", "prices": [{ "input": 0, "output": 0 }], "released": "2025-04-07" },
|
|
174
|
-
{ "providerID": "nvidia", "id": "nvidia/llama-3.3-nemotron-super-49b-v1", "prices": [{ "input": 0, "output": 0 }], "released": "2025-
|
|
174
|
+
{ "providerID": "nvidia", "id": "nvidia/llama-3.3-nemotron-super-49b-v1", "prices": [{ "input": 0, "output": 0 }], "released": "2025-03-18" },
|
|
175
175
|
{ "providerID": "nvidia", "id": "nvidia/llama-3.3-nemotron-super-49b-v1.5", "prices": [{ "input": 0, "output": 0 }], "released": "2025-07-25" },
|
|
176
|
-
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-content-safety", "prices": [{ "input": 0, "output": 0 }], "released": "2026-
|
|
177
|
-
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-nano-30b-a3b", "prices": [{ "input": 0, "output": 0 }] },
|
|
176
|
+
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-content-safety", "prices": [{ "input": 0, "output": 0 }], "released": "2026-03-16" },
|
|
177
|
+
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-nano-30b-a3b", "prices": [{ "input": 0, "output": 0 }], "released": "2025-12-15" },
|
|
178
178
|
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning", "prices": [{ "input": 0, "output": 0 }], "released": "2026-04-28" },
|
|
179
|
-
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-ultra-550b-a55b", "prices": [{ "input": 0
|
|
180
|
-
{ "providerID": "nvidia", "id": "nvidia/nemotron-3.5-content-safety", "prices": [{ "input": 0, "output": 0 }], "released": "2026-06-
|
|
179
|
+
{ "providerID": "nvidia", "id": "nvidia/nemotron-3-ultra-550b-a55b", "prices": [{ "input": 0, "output": 0 }], "released": "2026-06-04" },
|
|
180
|
+
{ "providerID": "nvidia", "id": "nvidia/nemotron-3.5-content-safety", "prices": [{ "input": 0, "output": 0 }], "released": "2026-06-02" },
|
|
181
181
|
{ "providerID": "nvidia", "id": "nvidia/nemotron-3.5-lightning-30b-a3b", "prices": [{ "input": 0, "output": 0 }], "released": "2026-08-11" },
|
|
182
182
|
{ "providerID": "nvidia", "id": "nvidia/nemotron-3.5-super-vl-120b-a12b", "prices": [{ "input": 0, "output": 0 }], "released": "2026-10-15" },
|
|
183
183
|
{ "providerID": "nvidia", "id": "nvidia/nemotron-content-safety-reasoning-4b", "prices": [{ "input": 0, "output": 0 }], "released": "2026-01-22" },
|
|
@@ -261,13 +261,13 @@ export const GENERATED_PRICE_SNAPSHOT = {
|
|
|
261
261
|
{ "providerID": "stepfun-ai", "id": "step-2-16k", "prices": [{ "input": 5.21, "output": 16.44, "cache": { "read": 1.04 } }], "released": "2025-01-01" },
|
|
262
262
|
{ "providerID": "stepfun-ai", "id": "step-3.5-flash", "prices": [{ "input": 0.1, "output": 0.3, "cache": { "read": 0.02 } }], "released": "2026-01-29" },
|
|
263
263
|
{ "providerID": "stepfun-ai", "id": "step-3.5-flash-2603", "prices": [{ "input": 0.1, "output": 0.3, "cache": { "read": 0.02 } }], "released": "2026-04-02" },
|
|
264
|
-
{ "providerID": "stepfun-ai", "id": "step-3.7-flash", "prices": [{ "input": 0.
|
|
265
|
-
{ "providerID": "stepfun-ai", "id": "step-5-preview", "prices": [{ "input": 1, "output": 2.7, "cache": { "read": 0.
|
|
264
|
+
{ "providerID": "stepfun-ai", "id": "step-3.7-flash", "prices": [{ "input": 0.2, "output": 1.15, "cache": { "read": 0.04 } }], "released": "2026-05-29" },
|
|
265
|
+
{ "providerID": "stepfun-ai", "id": "step-5-preview", "prices": [{ "input": 1, "output": 2.7, "cache": { "read": 0.1 } }], "released": "2026-09-16" },
|
|
266
266
|
{ "providerID": "tencent-tokenhub", "id": "hy4-preview", "prices": [{ "input": 0.834, "output": 2.501, "cache": { "read": 0.042 } }], "released": "2026-08-28" },
|
|
267
267
|
{ "providerID": "upstage", "id": "solar-mini", "prices": [{ "input": 0.15, "output": 0.15 }], "released": "2024-06-12" },
|
|
268
268
|
{ "providerID": "upstage", "id": "solar-mini4", "prices": [{ "input": 0.1, "output": 0.4, "cache": { "read": 0.01 } }], "released": "2026-09-22" },
|
|
269
269
|
{ "providerID": "upstage", "id": "solar-pro2", "prices": [{ "input": 0.25, "output": 0.25 }], "released": "2025-05-20" },
|
|
270
|
-
{ "providerID": "upstage", "id": "solar-pro3", "prices": [{ "input": 0.25, "output": 0.25 }] },
|
|
270
|
+
{ "providerID": "upstage", "id": "solar-pro3", "prices": [{ "input": 0.25, "output": 0.25 }], "released": "2026-01-26" },
|
|
271
271
|
{ "providerID": "upstage", "id": "solar-pro4", "prices": [{ "input": 0.3, "output": 1.2, "cache": { "read": 0.06 } }], "released": "2026-08-06" },
|
|
272
272
|
{ "providerID": "volcengine", "id": "doubao-seed-1-6-251015", "prices": [{ "input": 0.11875, "output": 1.18747, "cache": { "read": 0.02375 } }, { "input": 0.17812, "output": 2.37494, "cache": { "read": 0.02375 }, "tier": { "type": "context", "size": 32000 } }, { "input": 0.35624, "output": 3.56241, "cache": { "read": 0.02375 }, "tier": { "type": "context", "size": 128000 } }], "released": "2025-10-15" },
|
|
273
273
|
{ "providerID": "volcengine", "id": "doubao-seed-1-6-flash-250828", "prices": [{ "input": 0.02227, "output": 0.22265, "cache": { "read": 0.00445 } }, { "input": 0.04453, "output": 0.4453, "cache": { "read": 0.00445 }, "tier": { "type": "context", "size": 32000 } }, { "input": 0.08906, "output": 0.8906, "cache": { "read": 0.00445 }, "tier": { "type": "context", "size": 128000 } }], "released": "2025-08-28" },
|
package/dist/pricing.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface OfficialPriceEntry {
|
|
|
14
14
|
/** Checked-in data: updating prices is explicit, not a network request at
|
|
15
15
|
* startup, during a refresh, or during an npm build. */
|
|
16
16
|
export declare const OFFICIAL_PRICE_SNAPSHOT: {
|
|
17
|
-
verified: "2026-10-
|
|
17
|
+
verified: "2026-10-22";
|
|
18
18
|
source: "https://models.dev/api.json";
|
|
19
19
|
entries: OfficialPriceEntry[];
|
|
20
20
|
};
|
package/docs/verification.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# 验证记录
|
|
2
2
|
|
|
3
|
+
## 2026-10-21 · 实时 TPS 显示门槛(未发布)
|
|
4
|
+
|
|
5
|
+
`src/performance.ts` 的实时估算仅在三项条件同时满足时开始计算和显示:单条 assistant 响应累计可观察增量至少 20 个估算 Token(UTF-8 字节数 / 4,即至少 80 字节)、当前约 2 秒窗口中至少 3 个按 100ms 合并的独立批次、有效观察跨度至少 500ms。首批内容计入累计门槛,但仍只作测速基线,不进入速度分子;不跨响应或子代理合并门槛。原有时间加权平滑、历史 TPS、TTFT 和 2000ms 静默过期规则不变。
|
|
6
|
+
|
|
7
|
+
窗口淘汰、静默过期和重连不清空同一响应的累计字节数,但恢复输出仍需重新满足当前窗口的批次和跨度条件。未就绪时保留历史 TPS,无历史则隐藏;增量和过期处理不新增历史读取或 API 调用。中英文 README 与产品约定已同步。
|
|
8
|
+
|
|
9
|
+
环境:macOS、Node.js v22.23.2、npm 10.9.8,插件包 0.4.14、SDK 2.0.24、真实 OpenCode 2.1.2。类型检查、256 项自动化测试、构建、冒烟脚本语法检查及 `git diff --check` 通过。新增 8 项测试覆盖 79/80/81 字节边界、UTF-8 与各类增量、100ms 合并边界、三批但不足 500ms、窗口淘汰、静默后恢复、跨响应/子代理隔离、重复/空增量,以及侧边栏和详情共享门槛且不读取历史。原有测速夹具拆分为三个有效批次,保持原吞吐和平滑断言;打包冒烟的受控流改为超过 80 字节,以继续验证实时显示。
|
|
10
|
+
|
|
11
|
+
`npm run test:smoke` 完整通过,涵盖打包/隔离安装后的实时显示、完成后回归服务端吞吐、Responses 摘要突发/done-only/静默过期,以及既有侧边栏、详情、子代理、耗时、真实分叉副本和已完成 compaction/消息排序检查。2.1.2 不在既有验证版本列表中,脚本按设计发出兼容性警告后继续;本次通过不代表重跑了旧宿主,也未调整该列表。Node 22 的既有 OpenTUI 引擎警告保留。本地模拟提供商未调用付费模型,未修改现有 OpenCode 配置。产物:`/var/folders/rw/bmx6c8hd737brl55m0_ff_b80000gn/T/token-usage-smoke-vb4kHD`。
|
|
12
|
+
|
|
13
|
+
本次未升级版本、提交、推送或发布。
|
|
14
|
+
|
|
15
|
+
## 2026-10-21 · 自动价格更新的分档测试修复(未发布)
|
|
16
|
+
|
|
17
|
+
[价格工作流 39519970473](https://github.com/chenlongapps/opencode-token-usage/actions/runs/39519970473) 在 `npm test` 阶段失败,尚未升级版本或发布。models.dev 为 `alibaba/qwen-plus` 新增超过 256,000 incoming tokens 的分档;测试请求的 1,000,000 input tokens 正确选中推理费率 12,但旧断言固定读取 `prices[0]` 的基础费率 4,导致普通测试及其嵌套重定价测试同时失败。生产定价算法无需修改。
|
|
18
|
+
|
|
19
|
+
`test/usage.test.ts` 改为按请求选择最高适用分档,再检查推理费率;新增固定夹具覆盖严格阈值、乱序多档、缓存读取参与阈值及缺失独立推理费率时使用当前档 output 价格。`test/price-update.test.mjs` 在隔离快照中主动加入乱序多档,不再只修改标量费率;修改断言之前,该夹具已复现相同类型的失败。
|
|
20
|
+
|
|
21
|
+
环境:macOS、Node.js v22.23.2、插件包 0.4.13。当前仓库的类型检查、248 项测试及构建通过。另在隔离副本实际运行 `npm run prices:update`,获得 313 条原厂价格(新增 2、移除 3、变化 17),随后类型检查、248 项测试、构建及 `npm pack --dry-run` 全部通过。隔离构建首次因副本漏拷 `tsconfig.build.json` 失败,补齐配置后通过,不是仓库构建故障。
|
|
22
|
+
|
|
23
|
+
隔离验证目录:`/private/var/folders/rw/bmx6c8hd737brl55m0_ff_b80000gn/T/opencode/token-usage-price-fix-9ZczT3`。本次只修复测试并记录验证,未修改生产算法或工作流,未提交、推送、重跑 GitHub Actions 或发布 npm。
|
|
24
|
+
|
|
3
25
|
## 2026-10-14 · 首轮 Run Time 起点重置与重连归零(未发布)
|
|
4
26
|
|
|
5
27
|
无 idle 消息并不一定是旧历史:新会话的第一轮在执行结束前也没有该标记。此前每次 synthetic/steer 输入都被当成 legacy 轮次边界,工具延续时丢失首轮之前已经过去的时间;重新读取历史或重建视图可以重新暴露该少算。匿名固定夹具复现原先 `~1m 56s` 与正确 `~18m 57s` 的差异,不依赖屏幕操作。
|