@tokenzero/mcp 0.2.10 → 0.2.11
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-mcp.mjs +17 -5
- package/package.json +1 -1
package/bin/tokenzero-mcp.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import readline from "node:readline";
|
|
|
9
9
|
import crypto from "node:crypto";
|
|
10
10
|
|
|
11
11
|
// src/pricing.ts
|
|
12
|
-
var PRICING_VERSION = "2026-
|
|
12
|
+
var PRICING_VERSION = "2026-11-01";
|
|
13
13
|
var P = (provider, tier, input, output, cachedInput, cacheWrite, extra = {}) => ({ provider, tier, input, output, cachedInput, cacheWrite, ...extra });
|
|
14
14
|
var PRICES = {
|
|
15
15
|
// ---- OpenAI (standard tier, ≤272K; cache write = 30m TTL rate) ----
|
|
@@ -23,6 +23,9 @@ var PRICES = {
|
|
|
23
23
|
"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 }),
|
|
24
24
|
// Daybreak cyber model: access needs OpenAI approval; 400K window
|
|
25
25
|
"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 }),
|
|
26
|
+
// 2026-11-01 (developers.openai.com/api/docs/pricing): Astra for Law at Astra rates (promo), Daybreak gpt-5.5-cyber.
|
|
27
|
+
"gpt-6-astra-law": P("openai", "frontier", 10, 50, 1, void 0, { minCacheTokens: 1024 }),
|
|
28
|
+
"gpt-5.5-cyber": P("openai", "frontier", 12.5, 75),
|
|
26
29
|
"gpt-5.3-codex": P("openai", "mid", 1.75, 14, 0.175, void 0, { minCacheTokens: 1024 }),
|
|
27
30
|
"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 }),
|
|
28
31
|
"gpt-5.5-pro": P("openai", "frontier", 30, 180),
|
|
@@ -42,6 +45,13 @@ var PRICES = {
|
|
|
42
45
|
"o3-mini": P("openai", "fast", 1.1, 4.4, 0.55, void 0, { minCacheTokens: 1024 }),
|
|
43
46
|
"o4-mini": P("openai", "fast", 1.1, 4.4, 0.275, void 0, { minCacheTokens: 1024 }),
|
|
44
47
|
"o1": P("openai", "frontier", 15, 60, 7.5),
|
|
48
|
+
"o1-pro": P("openai", "frontier", 150, 600),
|
|
49
|
+
// Legacy models still on the pricing page: audited repos use them, so receipts and findings price them correctly
|
|
50
|
+
// instead of falling back to the nearest prefix row (gpt-4o-2024-05-13 is $5/$15, not gpt-4o's $2.50/$10).
|
|
51
|
+
"gpt-4o-2024-05-13": P("openai", "mid", 5, 15),
|
|
52
|
+
"gpt-4-turbo": P("openai", "frontier", 10, 30),
|
|
53
|
+
"gpt-4-0613": P("openai", "frontier", 30, 60),
|
|
54
|
+
"gpt-3.5-turbo": P("openai", "fast", 0.5, 1.5),
|
|
45
55
|
"gpt-4.1": P("openai", "mid", 2, 8, 0.5, void 0, { fastFactor: 1.75, minCacheTokens: 1024 }),
|
|
46
56
|
"gpt-4.1-mini": P("openai", "fast", 0.4, 1.6, 0.1, void 0, { minCacheTokens: 1024 }),
|
|
47
57
|
"gpt-4.1-nano": P("openai", "fast", 0.1, 0.4, 0.025, void 0, { minCacheTokens: 1024 }),
|
|
@@ -85,7 +95,7 @@ var PRICES = {
|
|
|
85
95
|
"deepseek-v4-pro": P("deepseek", "mid", 1.32, 3.96, 0.044),
|
|
86
96
|
"deepseek-flash": P("deepseek", "fast", 0.3, 1.2, 6e-3)
|
|
87
97
|
};
|
|
88
|
-
var MODEL_ALIASES = { "deepseek-v4-flash": "deepseek-flash", "deepseek-v4-flash-vision-exp": "deepseek-flash" };
|
|
98
|
+
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" };
|
|
89
99
|
var CASCADE_TARGET = {
|
|
90
100
|
"gpt-6-astra": "gpt-6.1-sol",
|
|
91
101
|
"gpt-6.1-sol": "gpt-6.1-terra",
|
|
@@ -123,6 +133,7 @@ var CASCADE_TARGET = {
|
|
|
123
133
|
"gemini-2.5-flash": "gemini-2.5-flash-lite"
|
|
124
134
|
};
|
|
125
135
|
var KEYS_BY_LENGTH = Object.keys(PRICES).sort((a, b) => b.length - a.length);
|
|
136
|
+
var DISTINCT_VARIANT = /^(instruct|audio|realtime|search|transcribe|tts|image|embedding|vision|computer-use|deep-research)\b/;
|
|
126
137
|
function normalizeModel(model) {
|
|
127
138
|
if (typeof model !== "string" || !model) return null;
|
|
128
139
|
let m = model.toLowerCase().trim();
|
|
@@ -130,11 +141,12 @@ function normalizeModel(model) {
|
|
|
130
141
|
m = m.replace(/^(us|eu|apac|global)\./, "").replace(/^(anthropic|amazon|meta|mistral|openai)\./, "");
|
|
131
142
|
m = m.replace(/-v\d+(?::\d+)?$/, "");
|
|
132
143
|
if (MODEL_ALIASES[m]) m = MODEL_ALIASES[m];
|
|
144
|
+
if (PRICES[m]) return m;
|
|
133
145
|
m = m.replace(/@\d{8}$/, "");
|
|
134
146
|
m = m.replace(/-(\d{8}|\d{4}-\d{2}-\d{2})$/, "");
|
|
135
147
|
m = m.replace(/-(latest|preview|customtools|thinking)$/, "");
|
|
136
148
|
if (PRICES[m]) return m;
|
|
137
|
-
for (const k of KEYS_BY_LENGTH) if (m.startsWith(k + "-")
|
|
149
|
+
for (const k of KEYS_BY_LENGTH) if (m === k || m.startsWith(k + "-") && !DISTINCT_VARIANT.test(m.slice(k.length + 1))) return k;
|
|
138
150
|
return null;
|
|
139
151
|
}
|
|
140
152
|
var isFreeModel = (model) => typeof model === "string" && (/:free$/i.test(model.trim()) || /^openrouter\/free$/i.test(model.trim()));
|
|
@@ -921,7 +933,7 @@ function manifests(root) {
|
|
|
921
933
|
}
|
|
922
934
|
|
|
923
935
|
// mcp/src/main.ts
|
|
924
|
-
var VERSION = "0.2.
|
|
936
|
+
var VERSION = "0.2.11";
|
|
925
937
|
var BAKED_URL = true ? "https://tokenzero.sh" : "__TOKENZERO_DEFAULT_URL__";
|
|
926
938
|
var SUPPORTED = [...MCP_LEGACY_VERSIONS];
|
|
927
939
|
var SERVER = { name: "tokenzero", version: VERSION };
|
|
@@ -965,7 +977,7 @@ var TOOLS = [
|
|
|
965
977
|
name: "calculate_model_arbitrage",
|
|
966
978
|
title: "Price a workload across models",
|
|
967
979
|
annotations: { title: "Price a workload across models", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
968
|
-
description: `No API key needed; only \`model\` is required (defaults 2,000 tokens in and 400 out). Price a workload at list prices
|
|
980
|
+
description: `No API key needed; only \`model\` is required (defaults 2,000 tokens in and 400 out). Price a workload at list prices for the requested model, its cheaper sibling and any extra models, with and without prompt caching. Runs locally.`,
|
|
969
981
|
inputSchema: { type: "object", properties: { model: { type: "string", description: "model id, e.g. gpt-6.1-sol or claude-sonnet-5-5" }, input_tokens: { type: "number", description: "per request; default 2000" }, output_tokens: { type: "number", description: "per request; default 400" }, requests_per_month: { type: "number" }, static_tokens: { type: "number", description: "portion of input_tokens that is a fixed prefix (system + tools)" }, compare_to: { type: "array", items: { type: "string" } } }, required: ["model"], additionalProperties: false }
|
|
970
982
|
},
|
|
971
983
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenzero/mcp",
|
|
3
3
|
"mcpName": "sh.tokenzero/mcp",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"description": "TokenZero MCP server (stdio): audit LLM token waste in your project locally, price model alternatives, and make prompts cache-friendly from Claude Code, Cursor, Windsurf or Cline.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|