Repository Public Research preview
1// Derives mcp/knowledge.json from the two live probe matrices plus the official pricing page.2// Nothing in the knowledge file is typed from memory: behaviour comes from observed API responses,3// prices from https://platform.claude.com/docs/en/about-claude/pricing (read 2026-11-09).4import { readFileSync, writeFileSync } from "node:fs";5const m1 = JSON.parse(readFileSync(new URL("./matrix.json", import.meta.url)));6const m2 = JSON.parse(readFileSync(new URL("./matrix2.json", import.meta.url)));78// USD per million tokens: [input, cache write 5 min, cache write 1 h, cache read, output]9const PRICES = {10 "claude-fable-5-2": [8, 10, 16, 0.2, 40], "claude-fable-5-1": [10, 12.5, 20, 0.25, 50], "claude-fable-5": [10, 12.5, 20, 1, 50],11 "claude-opus-5-5": [4, 5, 8, 0.2, 20], "claude-opus-5": [5, 6.25, 10, 0.5, 25], "claude-opus-4-8": [5, 6.25, 10, 0.5, 25],12 "claude-opus-4-7": [5, 6.25, 10, 0.5, 25], "claude-opus-4-6": [5, 6.25, 10, 0.5, 25], "claude-opus-4-5-20251101": [5, 6.25, 10, 0.5, 25],13 "claude-sonnet-5-5": [2, 2.5, 4, 0.1, 10], "claude-sonnet-5": [2, 2.5, 4, 0.2, 10], "claude-sonnet-4-6": [3, 3.75, 6, 0.3, 15],14 "claude-sonnet-4-5-20250929": [3, 3.75, 6, 0.3, 15], "claude-haiku-5-5": [0.1, 0.125, 0.2, 0.01, 0.5], "claude-haiku-4-5-20251001": [1, 1.25, 2, 0.1, 5],15};16const FAST = { "claude-fable-5-2": [16, 80], "claude-opus-5-5": [8, 40], "claude-opus-5": [10, 50], "claude-opus-4-8": [10, 50] };17const LONG_PROMPT = { "claude-haiku-5-5": { threshold_input_tokens: 100000, prices: [0.5, 0.625, 1, 0.05, 2.5] } };18const TIER = (id) => (id.includes("fable") ? "fable" : id.includes("opus") ? "opus" : id.includes("sonnet") ? "sonnet" : "haiku");19const ALIASES = { "claude-opus-4-5-20251101": "claude-opus-4-5", "claude-sonnet-4-5-20250929": "claude-sonnet-4-5", "claude-haiku-4-5-20251001": "claude-haiku-4-5" };2021const models = {};22for (const [id, a] of Object.entries(m1.models)) {23 const p = a.probes, q = m2.models[id], ok = (x) => x.ok === true, msg = (x) => (x.ok ? null : x.message);24 const levels = ["low", "medium", "high", "xhigh", "max"].filter((l) => ok(p[`effort_${l}`]));25 const disabled = ok(p.thinking_disabled) ? "accepted" : ok(p.thinking_between_tools) ? "use_between_tools" : "rejected";26 const price = PRICES[id];27 models[id] = {28 id, alias: ALIASES[id] ?? null, display_name: a.display_name, tier: TIER(id), released: a.created_at,29 max_input_tokens: a.max_input_tokens, max_output_tokens: a.max_tokens,30 pricing_usd_per_mtok: price ? { input: price[0], cache_write_5m: price[1], cache_write_1h: price[2], cache_read: price[3], output: price[4], batch_input: price[0] / 2, batch_output: price[4] / 2, fast: FAST[id] ? { input: FAST[id][0], output: FAST[id][1] } : null, long_prompt: LONG_PROMPT[id] ?? null } : null,31 thinking: {32 adaptive: ok(p.thinking_adaptive), budget_tokens: ok(p.thinking_budget), disabled, between_tools: ok(p.thinking_between_tools),33 disabled_blocked_at_effort: ok(p.thinking_disabled) && !ok(p.disabled_at_xhigh) && levels.includes("xhigh") ? ["xhigh", "max"] : [],34 display_updates_beta: ok(q.display_updates),35 },36 effort: { supported: levels.length > 0, levels },37 sampling_params: { api_2026_10_21: ok(p.temperature), api_2023_06_01: ok(q.legacy_temperature) },38 forced_tool_choice: ok(p.tool_any) && ok(p.tool_forced),39 assistant_prefill: ok(p.prefill),40 mid_conversation_system: ok(p.mid_system),41 structured_outputs: ok(p.structured_output),42 task_budget_beta: ok(q.task_budget), compaction_beta: ok(q.compaction), context_editing_beta: ok(q.context_edit_tools), server_fallbacks_beta: ok(q.fallbacks_default),43 fast_mode: ok(p.speed_fast) ? "ga" : /fast-mode-2026-02-01/.test(msg(p.speed_fast) ?? "") ? "beta_header_required" : "unsupported",44 inference_geo: ok(p.inference_geo_us),45 server_tools: { web_search_20260209: ok(p.web_search_2026), web_search_20250305: ok(p.web_search_2025), web_fetch_20260209: ok(q.web_fetch_2026), code_execution_20260521: ok(p.code_execution_2026), tool_search: ok(q.tool_search_bm25) },46 client_tools: { memory_20250818: ok(q.memory_tool), bash_20250124: ok(q.bash_tool), text_editor_20250728: ok(q.text_editor_tool) },47 citations: ok(q.citations_doc), count_tokens: ok(p.count_tokens),48 capabilities: a.capabilities,49 observed_errors: Object.fromEntries([...Object.entries(p), ...Object.entries(q)].filter(([, v]) => !v.ok && v.status === 400 && !/Could not process image/.test(v.message)).map(([k, v]) => [k, v.message])),50 };51}52const out = {53 schema: 1, observed_at: m1.generated_at, api_version_probed: "2026-10-21 (SDK default) and 2023-06-01 (legacy probes)",54 sources: { behaviour: "Live Messages API probes (probes/probe.mjs, probes/probe2.mjs)", pricing: "https://platform.claude.com/docs/en/about-claude/pricing (read 2026-11-09)", models: "GET /v1/models" },55 notes: ["Mythos models are not visible to the probing key and are absent.", "Behaviour can change: call list_models / refresh with scripts in probes/ before relying on an edge case."],56 models,57};58writeFileSync(new URL("../knowledge.json", import.meta.url), JSON.stringify(out, null, 1));59for (const m of Object.values(models)) console.log(m.id.padEnd(28), `think:${m.thinking.adaptive ? "A" : "-"}${m.thinking.budget_tokens ? "B" : "-"} off:${m.thinking.disabled.padEnd(17)} effort:${m.effort.levels.join("/") || "none"} | forced:${+m.forced_tool_choice} prefill:${+m.assistant_prefill} midsys:${+m.mid_conversation_system} tb:${+m.task_budget_beta} cmp:${+m.compaction_beta} fast:${m.fast_mode}`);60