@chenlongapps/opencode-token-usage 0.3.1 → 0.3.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/ROADMAP.md +6 -0
- package/dist/pricing.js +22 -8
- package/docs/pricing.md +10 -8
- package/docs/verification.md +13 -1
- package/package.json +1 -1
package/ROADMAP.md
CHANGED
|
@@ -82,6 +82,12 @@ Steps 1,234
|
|
|
82
82
|
* [x] 已收录模型永久保留,后续持续核验价格和来源
|
|
83
83
|
* [x] 通过单元测试与 OpenCode 2.0.11 打包集成验证
|
|
84
84
|
|
|
85
|
+
## v0.3.2 — GPT-6 Sol / Luna 定价
|
|
86
|
+
|
|
87
|
+
* [x] 根据 OpenAI 官方 Standard 价格补全两款模型的短、长上下文费率
|
|
88
|
+
* [x] 将 OpenAI 长上下文切换边界校正为传入 token 超过 272,000
|
|
89
|
+
* [x] 通过类型检查、45 项自动化测试及构建
|
|
90
|
+
|
|
85
91
|
## v0.4.0 — 用量命令
|
|
86
92
|
|
|
87
93
|
目标:按需提供比侧边栏更详细的 token 信息。
|
package/dist/pricing.js
CHANGED
|
@@ -2,48 +2,62 @@ export const OFFICIAL_PRICE_SNAPSHOT = {
|
|
|
2
2
|
verified: "2026-09-23",
|
|
3
3
|
newModelCutoff: "2026-03-22",
|
|
4
4
|
entries: [
|
|
5
|
-
// OpenAI standard processing.
|
|
6
|
-
//
|
|
5
|
+
// OpenAI standard processing. Tier sizes are exclusive thresholds, so
|
|
6
|
+
// 272,000 implements the official ">272K input tokens" boundary.
|
|
7
7
|
{
|
|
8
8
|
id: "gpt-5.5", released: "2026-04-23", source: "https://developers.openai.com/api/docs/pricing",
|
|
9
9
|
prices: [
|
|
10
10
|
{ input: 5, output: 30, cache: { read: 0.5 } },
|
|
11
|
-
{ tier: { type: "context", size:
|
|
11
|
+
{ tier: { type: "context", size: 272_000 }, input: 10, output: 45, cache: { read: 1 } },
|
|
12
12
|
],
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
id: "gpt-5.5-pro", released: "2026-04-23", source: "https://developers.openai.com/api/docs/pricing",
|
|
16
16
|
prices: [
|
|
17
17
|
{ input: 30, output: 180 },
|
|
18
|
-
{ tier: { type: "context", size:
|
|
18
|
+
{ tier: { type: "context", size: 272_000 }, input: 60, output: 270 },
|
|
19
19
|
],
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
id: "gpt-5.6-sol", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
|
|
23
23
|
prices: [
|
|
24
24
|
{ input: 4, output: 20, cache: { read: 0.4, write: 5 } },
|
|
25
|
-
{ tier: { type: "context", size:
|
|
25
|
+
{ tier: { type: "context", size: 272_000 }, input: 8, output: 30, cache: { read: 0.8, write: 10 } },
|
|
26
26
|
],
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
id: "gpt-5.6-terra", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
|
|
30
30
|
prices: [
|
|
31
31
|
{ input: 2, output: 12, cache: { read: 0.2, write: 2.5 } },
|
|
32
|
-
{ tier: { type: "context", size:
|
|
32
|
+
{ tier: { type: "context", size: 272_000 }, input: 4, output: 18, cache: { read: 0.4, write: 5 } },
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
id: "gpt-5.6-luna", released: "2026-07-09", source: "https://developers.openai.com/api/docs/pricing",
|
|
37
37
|
prices: [
|
|
38
38
|
{ input: 0.2, output: 1.2, cache: { read: 0.02, write: 0.25 } },
|
|
39
|
-
{ tier: { type: "context", size:
|
|
39
|
+
{ tier: { type: "context", size: 272_000 }, input: 0.4, output: 1.8, cache: { read: 0.04, write: 0.5 } },
|
|
40
40
|
],
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
id: "gpt-6-astra", released: "2026-09-04", source: "https://developers.openai.com/api/docs/pricing",
|
|
44
44
|
prices: [
|
|
45
45
|
{ input: 10, output: 50, cache: { read: 1, write: 12.5 } },
|
|
46
|
-
{ tier: { type: "context", size:
|
|
46
|
+
{ tier: { type: "context", size: 272_000 }, input: 20, output: 75, cache: { read: 2, write: 25 } },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "gpt-6-sol", released: "2026-09-22", source: "https://developers.openai.com/api/docs/pricing",
|
|
51
|
+
prices: [
|
|
52
|
+
{ input: 2, output: 10, cache: { read: 0.2, write: 2.5 } },
|
|
53
|
+
{ tier: { type: "context", size: 272_000 }, input: 4, output: 15, cache: { read: 0.4, write: 5 } },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "gpt-6-luna", released: "2026-09-22", source: "https://developers.openai.com/api/docs/pricing",
|
|
58
|
+
prices: [
|
|
59
|
+
{ input: 0.1, output: 0.5, cache: { read: 0.01, write: 0.125 } },
|
|
60
|
+
{ tier: { type: "context", size: 272_000 }, input: 0.2, output: 0.75, cache: { read: 0.02, write: 0.25 } },
|
|
47
61
|
],
|
|
48
62
|
},
|
|
49
63
|
// The official ChatGPT SKU `chat-latest`. OpenRouter serves it under the
|
package/docs/pricing.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 内置官方价格快照
|
|
2
2
|
|
|
3
|
-
v0.3.0
|
|
3
|
+
插件自 v0.3.0 起,在 OpenCode 当前模型目录没有可用于某条消息的完整价格时,使用本页所列的厂商官方标准价补全。v0.3.2 快照核验于 **2026-09-23**,共收录 74 个模型,金额均为美元 / 100 万 token。
|
|
4
4
|
|
|
5
5
|
## 规则
|
|
6
6
|
|
|
@@ -18,15 +18,17 @@ v0.3.0 在 OpenCode 当前模型目录没有可用于某条消息的完整价格
|
|
|
18
18
|
|
|
19
19
|
| 模型 | 发布日期 | Input | Output | Cache Read | Cache Write | 长上下文档位 |
|
|
20
20
|
| --- | --- | ---: | ---: | ---: | ---: | --- |
|
|
21
|
-
| `gpt-5.5` | 2026-04-23 | 5 | 30 | 0.5 | — |
|
|
22
|
-
| `gpt-5.5-pro` | 2026-04-23 | 30 | 180 | — | — |
|
|
23
|
-
| `gpt-5.6-sol` | 2026-07-09 | 4 | 20 | 0.4 | 5 |
|
|
24
|
-
| `gpt-5.6-terra` | 2026-07-09 | 2 | 12 | 0.2 | 2.5 |
|
|
25
|
-
| `gpt-5.6-luna` | 2026-07-09 | 0.2 | 1.2 | 0.02 | 0.25 |
|
|
26
|
-
| `gpt-6-astra` | 2026-09-04 | 10 | 50 | 1 | 12.5 |
|
|
21
|
+
| `gpt-5.5` | 2026-04-23 | 5 | 30 | 0.5 | — | >272K:10 / 45 / 1 / — |
|
|
22
|
+
| `gpt-5.5-pro` | 2026-04-23 | 30 | 180 | — | — | >272K:60 / 270 / — / — |
|
|
23
|
+
| `gpt-5.6-sol` | 2026-07-09 | 4 | 20 | 0.4 | 5 | >272K:8 / 30 / 0.8 / 10 |
|
|
24
|
+
| `gpt-5.6-terra` | 2026-07-09 | 2 | 12 | 0.2 | 2.5 | >272K:4 / 18 / 0.4 / 5 |
|
|
25
|
+
| `gpt-5.6-luna` | 2026-07-09 | 0.2 | 1.2 | 0.02 | 0.25 | >272K:0.4 / 1.8 / 0.04 / 0.5 |
|
|
26
|
+
| `gpt-6-astra` | 2026-09-04 | 10 | 50 | 1 | 12.5 | >272K:20 / 75 / 2 / 25 |
|
|
27
|
+
| `gpt-6-sol` | 2026-09-22 | 2 | 10 | 0.2 | 2.5 | >272K:4 / 15 / 0.4 / 5 |
|
|
28
|
+
| `gpt-6-luna` | 2026-09-22 | 0.1 | 0.5 | 0.01 | 0.125 | >272K:0.2 / 0.75 / 0.02 / 0.25 |
|
|
27
29
|
| `chat-latest`(别名 `gpt-chat-latest`) | 2026-05-05 | 5 | 30 | 0.5 | — | — |
|
|
28
30
|
|
|
29
|
-
`gpt-5.6-sol` 的当前标准价是限期促销价;快照采用核验日官网显示的费率。`chat-latest` 是官方 ChatGPT SKU,OpenRouter 上的 `gpt-chat-latest` 作为精确别名指向同一条目。
|
|
31
|
+
`gpt-6-sol` 和 `gpt-6-luna` 的发布日期见 [OpenAI API 更新日志](https://developers.openai.com/api/docs/changelog)。表内 OpenAI 长上下文价格在传入 token 超过 272,000 时对整条请求生效。`gpt-5.6-sol` 的当前标准价是限期促销价;快照采用核验日官网显示的费率。`chat-latest` 是官方 ChatGPT SKU,OpenRouter 上的 `gpt-chat-latest` 作为精确别名指向同一条目。
|
|
30
32
|
|
|
31
33
|
## Anthropic
|
|
32
34
|
|
package/docs/verification.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# 验证记录
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## v0.3.2(GPT-6 Sol / Luna 价格更新,SDK 2.0.11)
|
|
4
|
+
|
|
5
|
+
验证日期:2026-09-23。根据 [OpenAI API 更新日志](https://developers.openai.com/api/docs/changelog),`gpt-6-sol` 和 `gpt-6-luna` 于 2026-09-22 发布;[官方定价页](https://developers.openai.com/api/docs/pricing)列出两者的 Standard 短、长上下文四类 token 费率。内置快照由 72 个模型增至 74 个。根据 [Sol](https://developers.openai.com/api/docs/models/gpt-6-sol) 与 [Luna](https://developers.openai.com/api/docs/models/gpt-6-luna) 模型说明,传入 token 超过 272,000 时才使用长上下文价格;同轮也将已有 OpenAI 条目的边界从 271,999 校正为 272,000。
|
|
6
|
+
|
|
7
|
+
| 检查 | 结果 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `npm run typecheck` | 通过 |
|
|
10
|
+
| `npm test` | 45 项通过,新增两款模型的费率、精确匹配和档位边界断言 |
|
|
11
|
+
| `npm run build` | 通过 |
|
|
12
|
+
|
|
13
|
+
本轮未重跑 `npm run test:smoke`;下方的打包集成记录对应更新前的 72 模型快照。
|
|
14
|
+
|
|
15
|
+
## v0.3.1(SDK 2.0.11)
|
|
4
16
|
|
|
5
17
|
验证日期:2026-09-23。环境:macOS、Node.js v22.23.2、npm 10.9.8、OpenCode v2.0.11;`@opencode/plugin`、`@opencode/client`、`@opencode/schema` 和 `@opencode/theme` 均精确锁定为 2.0.11。
|
|
6
18
|
|