@tokenzero/cli 0.2.10 → 0.2.12
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/bin/tokenzero.mjs +15 -3
- package/package.json +1 -1
package/bin/tokenzero.mjs
CHANGED
|
@@ -25,6 +25,9 @@ var PRICES = {
|
|
|
25
25
|
"gpt-5.6-luna": P("openai", "fast", 0.2, 1.2, 0.02, 0.25, { longCtxAt: 272e3, longCtx: { input: 0.4, output: 1.8, cachedInput: 0.04, cacheWrite: 0.5 }, minCacheTokens: 1024 }),
|
|
26
26
|
// Daybreak cyber model: access needs OpenAI approval; 400K window
|
|
27
27
|
"gpt-5.6-cyber": P("openai", "frontier", 12.5, 75, 1.25, 15.625, { longCtxAt: 272e3, longCtx: { input: 25, output: 112.5, cachedInput: 2.5, cacheWrite: 31.25 }, minCacheTokens: 1024 }),
|
|
28
|
+
// 2026-11-01 (developers.openai.com/api/docs/pricing): Astra for Law at Astra rates (promo), Daybreak gpt-5.5-cyber.
|
|
29
|
+
"gpt-6-astra-law": P("openai", "frontier", 10, 50, 1, void 0, { minCacheTokens: 1024 }),
|
|
30
|
+
"gpt-5.5-cyber": P("openai", "frontier", 12.5, 75),
|
|
28
31
|
"gpt-5.3-codex": P("openai", "mid", 1.75, 14, 0.175, void 0, { minCacheTokens: 1024 }),
|
|
29
32
|
"gpt-5.5": P("openai", "frontier", 5, 30, 0.5, void 0, { fastFactor: 2.5, longCtxAt: 272e3, longCtx: { input: 10, output: 45, cachedInput: 1 }, minCacheTokens: 1024 }),
|
|
30
33
|
"gpt-5.5-pro": P("openai", "frontier", 30, 180),
|
|
@@ -44,6 +47,13 @@ var PRICES = {
|
|
|
44
47
|
"o3-mini": P("openai", "fast", 1.1, 4.4, 0.55, void 0, { minCacheTokens: 1024 }),
|
|
45
48
|
"o4-mini": P("openai", "fast", 1.1, 4.4, 0.275, void 0, { minCacheTokens: 1024 }),
|
|
46
49
|
"o1": P("openai", "frontier", 15, 60, 7.5),
|
|
50
|
+
"o1-pro": P("openai", "frontier", 150, 600),
|
|
51
|
+
// Legacy models still on the pricing page: audited repos use them, so receipts and findings price them correctly
|
|
52
|
+
// instead of falling back to the nearest prefix row (gpt-4o-2024-05-13 is $5/$15, not gpt-4o's $2.50/$10).
|
|
53
|
+
"gpt-4o-2024-05-13": P("openai", "mid", 5, 15),
|
|
54
|
+
"gpt-4-turbo": P("openai", "frontier", 10, 30),
|
|
55
|
+
"gpt-4-0613": P("openai", "frontier", 30, 60),
|
|
56
|
+
"gpt-3.5-turbo": P("openai", "fast", 0.5, 1.5),
|
|
47
57
|
"gpt-4.1": P("openai", "mid", 2, 8, 0.5, void 0, { fastFactor: 1.75, minCacheTokens: 1024 }),
|
|
48
58
|
"gpt-4.1-mini": P("openai", "fast", 0.4, 1.6, 0.1, void 0, { minCacheTokens: 1024 }),
|
|
49
59
|
"gpt-4.1-nano": P("openai", "fast", 0.1, 0.4, 0.025, void 0, { minCacheTokens: 1024 }),
|
|
@@ -87,7 +97,7 @@ var PRICES = {
|
|
|
87
97
|
"deepseek-v4-pro": P("deepseek", "mid", 1.32, 3.96, 0.044),
|
|
88
98
|
"deepseek-flash": P("deepseek", "fast", 0.3, 1.2, 6e-3)
|
|
89
99
|
};
|
|
90
|
-
var MODEL_ALIASES = { "deepseek-v4-flash": "deepseek-flash", "deepseek-v4-flash-vision-exp": "deepseek-flash" };
|
|
100
|
+
var MODEL_ALIASES = { "deepseek-v4-flash": "deepseek-flash", "deepseek-v4-flash-vision-exp": "deepseek-flash", "deepseek-v4.1-flash": "deepseek-flash", "deepseek-v4.1-flash-1017": "deepseek-flash", "deepseek-v4-pro-0813": "deepseek-v4-pro", "gpt-4-turbo-2024-04-09": "gpt-4-turbo", "gpt-4": "gpt-4-0613", "gpt-3.5-turbo-0125": "gpt-3.5-turbo" };
|
|
91
101
|
var CASCADE_TARGET = {
|
|
92
102
|
"gpt-6-astra": "gpt-6.1-sol",
|
|
93
103
|
"gpt-6.1-sol": "gpt-6.1-terra",
|
|
@@ -125,6 +135,7 @@ var CASCADE_TARGET = {
|
|
|
125
135
|
"gemini-2.5-flash": "gemini-2.5-flash-lite"
|
|
126
136
|
};
|
|
127
137
|
var KEYS_BY_LENGTH = Object.keys(PRICES).sort((a, b) => b.length - a.length);
|
|
138
|
+
var DISTINCT_VARIANT = /^(instruct|audio|realtime|search|transcribe|tts|image|embedding|vision|computer-use|deep-research)\b/;
|
|
128
139
|
function normalizeModel(model) {
|
|
129
140
|
if (typeof model !== "string" || !model) return null;
|
|
130
141
|
let m = model.toLowerCase().trim();
|
|
@@ -132,11 +143,12 @@ function normalizeModel(model) {
|
|
|
132
143
|
m = m.replace(/^(us|eu|apac|global)\./, "").replace(/^(anthropic|amazon|meta|mistral|openai)\./, "");
|
|
133
144
|
m = m.replace(/-v\d+(?::\d+)?$/, "");
|
|
134
145
|
if (MODEL_ALIASES[m]) m = MODEL_ALIASES[m];
|
|
146
|
+
if (PRICES[m]) return m;
|
|
135
147
|
m = m.replace(/@\d{8}$/, "");
|
|
136
148
|
m = m.replace(/-(\d{8}|\d{4}-\d{2}-\d{2})$/, "");
|
|
137
149
|
m = m.replace(/-(latest|preview|customtools|thinking)$/, "");
|
|
138
150
|
if (PRICES[m]) return m;
|
|
139
|
-
for (const k of KEYS_BY_LENGTH) if (m.startsWith(k + "-")
|
|
151
|
+
for (const k of KEYS_BY_LENGTH) if (m === k || m.startsWith(k + "-") && !DISTINCT_VARIANT.test(m.slice(k.length + 1))) return k;
|
|
140
152
|
return null;
|
|
141
153
|
}
|
|
142
154
|
var isFreeModel = (model) => typeof model === "string" && (/:free$/i.test(model.trim()) || /^openrouter\/free$/i.test(model.trim()));
|
|
@@ -875,7 +887,7 @@ function canonical(obj) {
|
|
|
875
887
|
}
|
|
876
888
|
|
|
877
889
|
// cli/src/main.ts
|
|
878
|
-
var VERSION = "0.2.
|
|
890
|
+
var VERSION = "0.2.12";
|
|
879
891
|
var BAKED_URL = true ? "https://tokenzero.sh" : "__TOKENZERO_DEFAULT_URL__";
|
|
880
892
|
function parseArgs(argv) {
|
|
881
893
|
const a = { _: [], flags: {} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenzero/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "TokenZero CLI: connect a project to the TokenZero BYOK gateway, audit LLM token waste locally, check usage and verify signed savings receipts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|