@broberg/ai-sdk 0.77.0 → 0.78.0
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/dist/{chunk-XWWFXMDP.js → chunk-GIRYOZQH.js} +2 -2
- package/dist/{chunk-7BJHO235.js → chunk-OFPLJSIV.js} +20 -6
- package/dist/chunk-OFPLJSIV.js.map +1 -0
- package/dist/{chunk-6O6HO7M3.js → chunk-XKLF7UUR.js} +8 -1
- package/dist/chunk-XKLF7UUR.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/pricing.js +2 -2
- package/dist/registry.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-6O6HO7M3.js.map +0 -1
- package/dist/chunk-7BJHO235.js.map +0 -1
- /package/dist/{chunk-XWWFXMDP.js.map → chunk-GIRYOZQH.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRICING,
|
|
3
3
|
stripDatedSuffix
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XKLF7UUR.js";
|
|
5
5
|
|
|
6
6
|
// src/cost/media-pricing.ts
|
|
7
7
|
var MEDIA_PRICING_CHECKED_AT = "2026-11-17";
|
|
@@ -475,4 +475,4 @@ export {
|
|
|
475
475
|
resetPricingWarningForTests,
|
|
476
476
|
cheapestModels
|
|
477
477
|
};
|
|
478
|
-
//# sourceMappingURL=chunk-
|
|
478
|
+
//# sourceMappingURL=chunk-GIRYOZQH.js.map
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPrice
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XKLF7UUR.js";
|
|
4
4
|
|
|
5
5
|
// src/routing/latest.ts
|
|
6
6
|
var CHECKED = "2026-11-26";
|
|
7
7
|
var LATEST = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
// F097 — owner 2026-11-26: «både Deep og Anthropic kører igennem EU så vi skal bare bede
|
|
9
|
+
// om at bruge OpenRouter eller EU modeller». Claude via OpenRouter's EU host, not
|
|
10
|
+
// Anthropic direct (US): every family below answers from the EU.
|
|
11
|
+
{ alias: "claude-haiku-latest", provider: "openrouter", model: "anthropic/claude-haiku-5.5", checkedAt: CHECKED },
|
|
12
|
+
{ alias: "claude-sonnet-latest", provider: "openrouter", model: "anthropic/claude-sonnet-5.5", checkedAt: CHECKED },
|
|
13
|
+
{ alias: "claude-opus-latest", provider: "openrouter", model: "anthropic/claude-opus-5.5", checkedAt: CHECKED },
|
|
11
14
|
{ alias: "mistral-large-latest", provider: "mistral", model: "mistral-large-4-0", checkedAt: CHECKED },
|
|
12
|
-
|
|
15
|
+
// F097 — the newest DeepSeek Flash OpenRouter serves IN THE EU (measured 2026-11-26);
|
|
16
|
+
// v4.1-flash-1017 has no EU endpoint, and all OpenRouter calls now go via the EU host.
|
|
17
|
+
{ alias: "deepseek-flash-latest", provider: "openrouter", model: "deepseek/deepseek-v4-flash-0731", checkedAt: CHECKED }
|
|
13
18
|
];
|
|
14
19
|
var BY_ALIAS = new Map(LATEST.map((e) => [e.alias, e]));
|
|
15
20
|
function listLatest() {
|
|
@@ -19,8 +24,12 @@ function resolveLatest(alias) {
|
|
|
19
24
|
const e = BY_ALIAS.get(alias);
|
|
20
25
|
return e ? { ...e } : void 0;
|
|
21
26
|
}
|
|
27
|
+
var OPENROUTER_VENDOR_PREFIXES = ["anthropic/", "openai/", "google/", "deepseek/", "moonshotai/", "z-ai/", "amazon/"];
|
|
22
28
|
function expandLatest(override) {
|
|
23
29
|
if (!override || override.provider !== void 0 || typeof override.model !== "string") return override;
|
|
30
|
+
if (OPENROUTER_VENDOR_PREFIXES.some((p) => override.model.startsWith(p))) {
|
|
31
|
+
return { ...override, provider: "openrouter" };
|
|
32
|
+
}
|
|
24
33
|
if (!override.model.endsWith("-latest")) return override;
|
|
25
34
|
const e = BY_ALIAS.get(override.model);
|
|
26
35
|
if (!e) {
|
|
@@ -136,6 +145,11 @@ var DEFAULTS = [
|
|
|
136
145
|
// undefined), so a row would pass the gate for a route that silently bills
|
|
137
146
|
// nothing. That is the same green-direction failure this card exists to remove,
|
|
138
147
|
// and it needs a rate from a real source, not a guess. See the plan-doc.
|
|
148
|
+
{ id: "anthropic/claude-haiku-5.5", aliases: [], provider: "openrouter", available: true, status: "available", note: "Claude Haiku 5.5 via OpenRouter EU in-region routing (F097) \u2014 backs claude-haiku-latest", source: "default" },
|
|
149
|
+
{ id: "anthropic/claude-sonnet-5.5", aliases: [], provider: "openrouter", available: true, status: "available", note: "Claude Sonnet 5.5 via OpenRouter EU in-region routing (F097) \u2014 backs claude-sonnet-latest", source: "default" },
|
|
150
|
+
{ id: "anthropic/claude-opus-5.5", aliases: [], provider: "openrouter", available: true, status: "available", note: "Claude Opus 5.5 via OpenRouter EU in-region routing (F097) \u2014 backs claude-opus-latest", source: "default" },
|
|
151
|
+
// F097 — backs `deepseek-flash-latest` since all OpenRouter calls go via the EU host (served there by e.g. Inceptron).
|
|
152
|
+
{ id: "deepseek/deepseek-v4-flash-0731", aliases: [], provider: "openrouter", available: true, status: "available", note: "DeepSeek V4 Flash (dated 0731) via OpenRouter EU; CN-origin model weights, EU-hosted endpoint \u2014 model origin still worth noting for personal data", source: "default", grade: "cheap" },
|
|
139
153
|
// F096 — backs `deepseek-flash-latest`; reached via OpenRouter (CN-hosted model — not for personal data).
|
|
140
154
|
{ id: "deepseek/deepseek-v4.1-flash-1017", aliases: [], provider: "openrouter", available: true, status: "available", note: "DeepSeek V4.1 Flash (dated 1017) via OpenRouter; CN-origin model, upstream picked by OpenRouter \u2014 not for personal data", source: "default", grade: "cheap" },
|
|
141
155
|
{ id: "deepseek-chat", aliases: [], provider: "deepseek", available: true, status: "available", note: "direct api.deepseek.com; documented to deprecate 2026-07-24 in favour of deepseek-v4-flash \u2014 not live-verified", source: "default" },
|
|
@@ -342,4 +356,4 @@ export {
|
|
|
342
356
|
resolveModel,
|
|
343
357
|
describeTier
|
|
344
358
|
};
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
359
|
+
//# sourceMappingURL=chunk-OFPLJSIV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/routing/latest.ts","../src/routing/tier-map.ts","../src/availability/registry.ts","../src/availability/types.ts","../src/availability/resolve.ts","../src/routing/describe-tier.ts"],"sourcesContent":["// F096 — «LATEST» routes. Owner 2026-11-26: «ruter hvor man altid kan bede efter\n// LATEST … det er DIG der har researchet på hvad der er nyest … Det skal aldrig være\n// den enkelte fleet agents ansvar».\n//\n// A consumer asks for a FAMILY (`override: { model: \"claude-sonnet-latest\" }`, no\n// provider) and ai-sdk answers with the newest model it has researched and PINNED to a\n// dated/versioned id. That is not a provider's floating `-latest` (D-385d97 holds): a\n// move happens in an ai-sdk release, visible with a version, never silently upstream.\n// usage.model on every response says which dated model actually answered.\n//\n// Kept current by the model-research skill (every 14 days): check each family for a\n// newer dated model, move the row, bump `checkedAt`, release.\nimport type { TierSpec } from \"../types.js\";\n\nexport interface LatestEntry {\n /** The alias a consumer writes. */\n alias: string;\n provider: string;\n /** Dated / versioned model id — never a floating one. */\n model: string;\n /** When ai-sdk last confirmed this is the newest in the family (YYYY-MM-DD). */\n checkedAt: string;\n}\n\nconst CHECKED = \"2026-11-26\";\n\nexport const LATEST: readonly LatestEntry[] = [\n // F097 — owner 2026-11-26: «både Deep og Anthropic kører igennem EU så vi skal bare bede\n // om at bruge OpenRouter eller EU modeller». Claude via OpenRouter's EU host, not\n // Anthropic direct (US): every family below answers from the EU.\n { alias: \"claude-haiku-latest\", provider: \"openrouter\", model: \"anthropic/claude-haiku-5.5\", checkedAt: CHECKED },\n { alias: \"claude-sonnet-latest\", provider: \"openrouter\", model: \"anthropic/claude-sonnet-5.5\", checkedAt: CHECKED },\n { alias: \"claude-opus-latest\", provider: \"openrouter\", model: \"anthropic/claude-opus-5.5\", checkedAt: CHECKED },\n { alias: \"mistral-large-latest\", provider: \"mistral\", model: \"mistral-large-4-0\", checkedAt: CHECKED },\n // F097 — the newest DeepSeek Flash OpenRouter serves IN THE EU (measured 2026-11-26);\n // v4.1-flash-1017 has no EU endpoint, and all OpenRouter calls now go via the EU host.\n { alias: \"deepseek-flash-latest\", provider: \"openrouter\", model: \"deepseek/deepseek-v4-flash-0731\", checkedAt: CHECKED },\n];\n\nconst BY_ALIAS = new Map(LATEST.map((e) => [e.alias, e]));\n\n/** Every LATEST family, for a model picker. */\nexport function listLatest(): LatestEntry[] {\n return LATEST.map((e) => ({ ...e }));\n}\n\n/** The pinned model behind an alias, or undefined if ai-sdk has no such family. */\nexport function resolveLatest(alias: string): LatestEntry | undefined {\n const e = BY_ALIAS.get(alias);\n return e ? { ...e } : undefined;\n}\n\n/** Expand `override: { model: \"<family>-latest\" }` (WITHOUT a provider) to the pinned\n * provider + model. With a provider the override is left alone, so a provider-native\n * id such as `{ provider: \"mistral\", model: \"mistral-large-latest\" }` behaves exactly as\n * before. An unknown `*-latest` without a provider fails closed, like a misspelt tier. */\n/** F097 — owner 2026-11-26: «gør det nemt for agenterne … at kalde alle modeller gennem\n * OpenRouter EU pånær Mistral den kalder vi direkte». An OpenRouter model id written\n * WITHOUT a provider (`override: { model: \"moonshotai/kimi-k2.6\" }`) routes to OpenRouter,\n * whose default host is the EU one. Only these vendor prefixes, so another provider's\n * slash ids (fal-ai/…, DeepInfra's org/model) are never captured; `mistralai/` is left\n * out on purpose — Mistral is called direct (tiers / provider \"mistral\"). */\nexport const OPENROUTER_VENDOR_PREFIXES = [\"anthropic/\", \"openai/\", \"google/\", \"deepseek/\", \"moonshotai/\", \"z-ai/\", \"amazon/\"] as const;\n\nexport function expandLatest<T extends Partial<TierSpec> | undefined>(override: T): T {\n if (!override || override.provider !== undefined || typeof override.model !== \"string\") return override;\n if (OPENROUTER_VENDOR_PREFIXES.some((p) => override.model!.startsWith(p))) {\n return { ...override, provider: \"openrouter\" };\n }\n if (!override.model.endsWith(\"-latest\")) return override;\n const e = BY_ALIAS.get(override.model);\n if (!e) {\n throw new Error(\n `createAI: \"${override.model}\" is not a LATEST family ai-sdk maintains. Known: ${LATEST.map((x) => x.alias).join(\", \")}. ` +\n `(A provider's own floating id needs its provider, e.g. override: { provider, model }.)`,\n );\n }\n return { ...override, provider: e.provider, model: e.model };\n}\n","// Tier routing: a named Tier resolves to a concrete (provider, model, transport).\n// Precedence is per-call override > client config map > built-in defaults.\nimport type { Tier, TierSpec } from \"../types.js\";\nimport { expandLatest } from \"./latest.js\";\n\n/** Built-in defaults. Every entry is overridable via AiConfig.defaults or a\n * per-call override.\n *\n * F030 — Anthropic API phase-out: `ANTHROPIC_API_KEY` was globally removed, so the\n * default cloud route may NOT hit Anthropic Console. `fast`/`smart`/`powerful`/\n * `vision` now default to **Mistral EU** (Paris-hosted, Schrems II-safe — so every\n * default text/vision call is GDPR-safe by default). Claude stays reachable as a\n * NON-default quality fallback for non-PII via `override:{provider:\"openrouter\",\n * model:\"anthropic/claude-…\"}`. DeepSeek (CN) is the opt-in non-PII secondary\n * (`provider:\"deepseek\"`), never a default. Magistral (reasoning) / mistral-large\n * for vision are per-call overrides, not defaults (don't pay the premium on all). */\n//\n// F077 — PINNED, never \"-latest\" (Christian 2026-10-08: «vi skal ingen steder i flåden\n// tilbyde -latest som default, for så ender vi med at bruge v4 om nogle dage, og\n// regningen følger pludselig efter med en stor overraskelse»). Mistral moves its\n// -latest names on its own schedule (three moved on 2026-10-08 alone), and echoes the\n// alias back so the move is invisible in usage.model. A dated id changes only in a\n// release of ours, with a changelog line and the price difference. The ids below are\n// exactly what each -latest meant on 2026-10-08 — same model, same price.\nexport const DEFAULT_TIER_MAP: Record<Tier, TierSpec> = {\n fast: { provider: \"mistral\", model: \"mistral-small-2603\", transport: \"http\" }, // Small 4\n smart: { provider: \"mistral\", model: \"mistral-large-2512\", transport: \"http\" }, // Large 3\n powerful: { provider: \"mistral\", model: \"mistral-large-2512\", transport: \"http\" }, // Large 3\n cheap: { provider: \"mistral\", model: \"mistral-small-2603\", transport: \"http\" }, // Small 4\n // Vision: small-latest (vision-capable, cheap EU) is the default; override to\n // mistral-large-latest for demanding image/spatial/composition work.\n // F041 — bumped from mistral-small on Christian's ask, and the choice is MEASURED,\n // not assumed from price. On a fine-discrimination test (an 8x10 grid where one cell\n // differs only in its blue channel, 190->150) across 9 cases:\n // mistral-medium-latest 4/9 <- best\n // mistral-small-latest 1/6 + 0/3 = 1/9\n // mistral-large-latest 0/9 <- WORSE than small, despite costing 5x more\n // Large ties small on easy colour blocks (4/4 each) and collapses on subtle ones,\n // so \"bigger is better at vision\" does not hold in Mistral's lineup. Nobody is good\n // at this task; medium is simply the only one that sees anything.\n vision: { provider: \"mistral\", model: \"mistral-medium-2604\", transport: \"http\" }, // Medium 3.5 (was medium-latest, F077)\n // Native video understanding — Gemini leads; flash-lite is the cheap default (F019).\n // NOT Anthropic → out of the F030 phase-out (its own EU epic if/when needed).\n video: { provider: \"gemini\", model: \"gemini-2.5-flash-lite\", transport: \"http\" },\n // NOT Anthropic → out of F030 (EU-embedding migration is its own future epic).\n embedding: { provider: \"openai\", model: \"text-embedding-3-small\", transport: \"http\" },\n};\n\n/**\n * Resolve a Tier to a concrete TierSpec.\n *\n * Merge order (later wins): DEFAULT_TIER_MAP < configMap < override.\n * - `configMap` is the client-level AiConfig.defaults (per-tier full specs).\n * - `override` is a per-call Partial<TierSpec> — only the fields it sets win.\n */\n/** Refuse an override that names a different provider without naming a model (F043.2).\n *\n * Exported and called at EVERY spec merge, not only inside resolveTier. The first\n * version guarded only the six capabilities that route via a tier; image, animate,\n * trainStyle, ocr, moderate, podcast, tts, transcribe and batch merge the override\n * themselves and skipped it entirely — so `ai.image({override:{provider:\"fal\"}})`\n * still posted BFL's flux-2-pro to fal, the exact misleading upstream error this was\n * written to kill. A guard at six of fifteen call sites is a guard you cannot rely on.\n *\n * We REFUSE rather than re-resolve: choosing a model for the new provider would be\n * the SDK making a price decision on the caller's behalf, visible only on the bill.\n *\n * `knownProviders` (when given) lets an UNREGISTERED provider through — that is a\n * typo, and \"no provider adapter registered\" is the useful thing to say about it. */\nexport function assertOverrideProvider(\n base: { provider: string; model: string },\n override: Partial<TierSpec> | undefined,\n label: string,\n knownProviders?: readonly string[],\n): void {\n if (!override?.provider || override.model !== undefined) return;\n if (override.provider === base.provider) return;\n if (knownProviders !== undefined && !knownProviders.includes(override.provider)) return;\n throw new Error(\n `createAI: override sets provider \"${override.provider}\", but \"${label}\" resolves to model ` +\n `\"${base.model}\", which belongs to \"${base.provider}\". Set a model too, e.g. ` +\n `override: { provider: \"${override.provider}\", model: \"<a ${override.provider} model>\" }.`,\n );\n}\n\nexport function resolveTier(\n tier: Tier,\n override?: Partial<TierSpec>,\n configMap?: Partial<Record<Tier, TierSpec>>,\n knownProviders?: readonly string[],\n): TierSpec {\n const base = configMap?.[tier] ?? DEFAULT_TIER_MAP[tier];\n override = expandLatest(override); // F096 — «<family>-latest» → ai-sdk's pinned model\n assertOverrideProvider(base, override, tier, knownProviders);\n return { ...base, ...override };\n}\n","// F022 — the model-availability registry: the ONE source both resolveModel()\n// (spawn / call path) and listModels() (UI picker) read. A curated default seed\n// (works offline — the durable floor) plus a mutable overlay that\n// refreshAvailability() updates from the live provider list.\n//\n// Scope note: this is a LIVENESS view (is this id alive right now?), not the\n// rich capability/price inventory (that is F017 src/catalogue). We only track\n// ids we want to assert status on; anything not here is fail-open (treated\n// available) so we never block a model we simply do not track.\nimport { DEFAULT_TIER_MAP } from \"../routing/tier-map.js\";\nimport type { AvailabilityStatus, AvailabilitySource, ModelGrade, ModelKind, ModelStatus } from \"./types.js\";\n\n/** Internal registry row. `aliases[0]` surfaces as ModelStatus.alias. */\nexport interface RegistryEntry {\n id: string;\n aliases: string[];\n provider: string;\n available: boolean;\n status: AvailabilityStatus;\n note?: string;\n source: AvailabilitySource;\n /** F022.6. Omitted = \"chat\" (most rows); set explicitly for anything else. */\n kind?: ModelKind;\n default?: true;\n grade?: ModelGrade;\n}\n\n/** A `-latest` id is a moving alias — the provider can swap the model behind it.\n * Derived, not hand-written, so a new -latest row cannot forget the flag. */\nexport const isFloatingId = (id: string): boolean => /-latest$/.test(id);\n\n/** F079 — routes that float without saying so in the id: the provider serves only a\n * moving `latest` and has no dated version to pin. Measured 20/10 2026 on BFL's\n * openapi.json: FLUX 3 Video's `version` is the const \"latest\" (\"dated pinnable\n * release tags are added here as they are published\"). Remove a row when it can pin. */\nexport const LATEST_ONLY_ROUTES: ReadonlySet<string> = new Set([\"bfl:flux-3-video\", \"bfl:flux-3-image\", \"bfl:flux-3-image-klein\"]);\n\n/** Does this route float — a `-latest` id, or a provider that only serves latest? */\nexport const isFloatingRoute = (provider: string, model: string): boolean =>\n isFloatingId(model) || LATEST_ONLY_ROUTES.has(`${provider}:${model}`);\n\nconst NO_OPENAI_SNAPSHOT = \"no dated snapshot published (measured 2026-10-11) — the id may start pointing at a newer model\";\nconst SUSPENDED_FABLE_MYTHOS = \"suspended — US export-control directive (2026-06-12)\";\n\n/** Curated defaults. Aliases here are MODEL-IDENTITY names only (short names for\n * the model itself). TIER aliases — fast/smart/powerful/cheap/vision/video/\n * embedding — are NOT written here: they are derived from DEFAULT_TIER_MAP below,\n * because hand-maintaining them in two places is exactly how they drifted.\n *\n * They HAD drifted, and it crossed the EU border: this list said `smart` was\n * claude-sonnet-4-6 (Anthropic, US) for the ~3 months after F030 pointed the\n * default tiers at Mistral EU, so resolveModel('smart') named a US model while\n * ai.chat({tier:'smart'}) called an EU one. Anyone using resolveModel to SHOW or\n * DECIDE where data goes — the obvious use — got the wrong answer. Measured by\n * fd-sundhed in 0.21.1, still true in 0.28.0, fixed here by deleting the second\n * list rather than correcting it. */\nconst DEFAULTS: RegistryEntry[] = [\n // ── Anthropic ────────────────────────────────────────────────────────────\n { id: \"claude-haiku-4-5\", aliases: [\"haiku\"], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-sonnet-4-6\", aliases: [\"sonnet\"], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-opus-4-8\", aliases: [\"opus\"], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-fable-5\", aliases: [\"fable\"], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-mythos-5\", aliases: [\"mythos\"], provider: \"anthropic\", available: false, status: \"suspended\", note: SUSPENDED_FABLE_MYTHOS, source: \"default\" },\n // F022.6 — the live Claude 5 family, measured with GET /v1/models on 2026-10-11.\n // These ids have no dated snapshot: the id IS the pin. The older rows above stay,\n // because removing one would turn a passing requireKnown gate into a refusal.\n { id: \"claude-haiku-5-5\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\", grade: \"cheap\" },\n { id: \"claude-sonnet-5-5\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\", grade: \"standard\", default: true },\n { id: \"claude-opus-5-5\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\", grade: \"strong\" },\n { id: \"claude-fable-5-1\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-opus-5\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-sonnet-5\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-opus-4-7\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n { id: \"claude-opus-4-6\", aliases: [], provider: \"anthropic\", available: true, status: \"available\", source: \"default\" },\n // ── Gemini ───────────────────────────────────────────────────────────────\n { id: \"gemini-2.5-flash\", aliases: [\"gemini-flash\"], provider: \"gemini\", available: true, status: \"available\", source: \"default\", grade: \"standard\", default: true },\n { id: \"gemini-2.5-flash-lite\", aliases: [\"gemini-flash-lite\"], provider: \"gemini\", available: true, status: \"available\", source: \"default\", grade: \"cheap\" },\n // ── OpenAI ───────────────────────────────────────────────────────────────\n { id: \"text-embedding-3-small\", aliases: [], provider: \"openai\", available: true, status: \"available\", source: \"default\", kind: \"embedding\" },\n // F022.6 — chat models, measured with GET /v1/models on 2026-10-11 and priced from\n // developers.openai.com/api/docs/pricing the same day. The cheap/standard/strong\n // picks are DATED snapshots, so a picker's default cannot move under anyone\n // (D-385d97).\n { id: \"gpt-5.4-nano-2026-03-17\", aliases: [], provider: \"openai\", available: true, status: \"available\", source: \"default\", grade: \"cheap\" },\n { id: \"gpt-5.4-mini-2026-03-17\", aliases: [], provider: \"openai\", available: true, status: \"available\", source: \"default\", grade: \"standard\", default: true },\n { id: \"gpt-5.5-2026-04-23\", aliases: [], provider: \"openai\", available: true, status: \"available\", source: \"default\", grade: \"strong\" },\n // OpenAI's newest families had NO dated snapshot in /v1/models on 2026-10-11. They\n // are offered, but not as a default: we cannot show that the id will keep meaning\n // the same model.\n ...[\"gpt-6-luna\", \"gpt-6-sol\", \"gpt-6.1-sol\", \"gpt-6-astra\", \"gpt-5.6-luna\", \"gpt-5.6-terra\", \"gpt-5.6-sol\"].map(\n (id): RegistryEntry => ({ id, aliases: [], provider: \"openai\", available: true, status: \"available\", source: \"default\", note: NO_OPENAI_SNAPSHOT }),\n ),\n // ── DeepSeek (CN-hosted — NOT GDPR-safe; non-PII workloads only) ─────────\n //\n // F057.2. These were missing while pricing.ts carried OFFICIAL rates for them\n // and providers/deepseek.ts shipped an adapter (F030.2) — so our own CLAUDE.md\n // instruction (\"if you are GATING, pass requireKnown:true\") refused a route we\n // built, priced and wrote an F-number for. Two tables disagreed, and the gate\n // is the one that decides. Reported by pitch (ref 28546) via components.\n //\n // The note carries the sunset because the registry is what a picker renders, and\n // a row that says only \"available\" would hide it. Both ids were documented to\n // deprecate 2026-07-24 in favour of `deepseek-v4-flash` — we have NOT verified\n // against a live key (no DEEPSEEK_API_KEY here), so this is the curated seed's\n // usual standing: a default, not a measurement. A live refresh may overrule it.\n //\n // `deepseek-v4-flash` on the DIRECT api is deliberately NOT here: it has no\n // price in pricing.ts (measured — getPrice(\"deepseek\",\"deepseek-v4-flash\") is\n // undefined), so a row would pass the gate for a route that silently bills\n // nothing. That is the same green-direction failure this card exists to remove,\n // and it needs a rate from a real source, not a guess. See the plan-doc.\n { id: \"anthropic/claude-haiku-5.5\", aliases: [], provider: \"openrouter\", available: true, status: \"available\", note: \"Claude Haiku 5.5 via OpenRouter EU in-region routing (F097) — backs claude-haiku-latest\", source: \"default\" },\n { id: \"anthropic/claude-sonnet-5.5\", aliases: [], provider: \"openrouter\", available: true, status: \"available\", note: \"Claude Sonnet 5.5 via OpenRouter EU in-region routing (F097) — backs claude-sonnet-latest\", source: \"default\" },\n { id: \"anthropic/claude-opus-5.5\", aliases: [], provider: \"openrouter\", available: true, status: \"available\", note: \"Claude Opus 5.5 via OpenRouter EU in-region routing (F097) — backs claude-opus-latest\", source: \"default\" },\n // F097 — backs `deepseek-flash-latest` since all OpenRouter calls go via the EU host (served there by e.g. Inceptron).\n { id: \"deepseek/deepseek-v4-flash-0731\", aliases: [], provider: \"openrouter\", available: true, status: \"available\", note: \"DeepSeek V4 Flash (dated 0731) via OpenRouter EU; CN-origin model weights, EU-hosted endpoint — model origin still worth noting for personal data\", source: \"default\", grade: \"cheap\" },\n // F096 — backs `deepseek-flash-latest`; reached via OpenRouter (CN-hosted model — not for personal data).\n { id: \"deepseek/deepseek-v4.1-flash-1017\", aliases: [], provider: \"openrouter\", available: true, status: \"available\", note: \"DeepSeek V4.1 Flash (dated 1017) via OpenRouter; CN-origin model, upstream picked by OpenRouter — not for personal data\", source: \"default\", grade: \"cheap\" },\n { id: \"deepseek-chat\", aliases: [], provider: \"deepseek\", available: true, status: \"available\", note: \"direct api.deepseek.com; documented to deprecate 2026-07-24 in favour of deepseek-v4-flash — not live-verified\", source: \"default\" },\n { id: \"deepseek-reasoner\", aliases: [], provider: \"deepseek\", available: true, status: \"available\", note: \"direct api.deepseek.com (thinking); documented to deprecate 2026-07-24 in favour of deepseek-v4-flash — not live-verified\", source: \"default\" },\n // ── TypeSafe (US-hosted — NOT for personal data) ─────────────────────────\n //\n // F066. Two rows, not an alias. TypeSafe's \"jev-latest\" points at jev-1.13.0 TODAY and\n // moves on their next release; writing it here as an alias of 1.13.0 would make this\n // registry assert a mapping we would have to remember to undo. As separate rows, both\n // pass a requireKnown gate and neither claims to be the other.\n { id: \"jev-1.13.0\", aliases: [\"jev\"], provider: \"typesafe\", available: true, status: \"available\", note: \"TypeSafe Jev, pinned version. US-hosted — not for personal data. Decision model: use ai.judge, not ai.chat\", source: \"default\", kind: \"judge\" },\n { id: \"jev-latest\", aliases: [], provider: \"typesafe\", available: true, status: \"available\", note: \"MOVING alias (jev-1.13.0 as of 2026-10-01). Pin jev-1.13.0 if you tuned thresholds on confidence. US-hosted — not for personal data\", source: \"default\", kind: \"judge\" },\n // F081 — Microsoft-Decision-1, our deployment decision-1-eu (Sweden Central, Data Zone\n // Standard). Version 1 pinned (NoAutoUpgrade). Azure's catalogue: inference ends 2027-02-04.\n { id: \"microsoft-decision-1-v1\", aliases: [\"decision-1\"], provider: \"microsoft-decision\", available: true, status: \"available\", note: \"Microsoft-Decision-1 v1 — EU decision model for ai.judge (Sweden Central, Data Zone Standard = EU+NO+CH). Same answer shape as Jev. Version 1 is RETIRED by Azure on 2027-02-04 (inference stops) — a successor must be deployed before then. Built on Qwen3.5-9B; Microsoft plans to move it to MAI/OpenAI models, so answers may change between versions\", source: \"default\", kind: \"judge\" },\n // ── Mistral (EU / GDPR) ──────────────────────────────────────────────────\n // F083 — speech, measured live 2026-10-25. Not chat models: use ai.tts / ai.transcribe.\n { id: \"voxtral-mini-tts-3-0\", aliases: [], provider: \"mistral\", available: true, status: \"available\", note: \"Voxtral TTS 3 — use ai.tts with override:{provider:\\\"mistral\\\"} and a voice slug (e.g. voice_3150 James, en_us). NOT FOR DANISH: no Danish-labelled voice, and the owner rejected Heidi on Danish 2026-10-26 (German accent) — use Azure da-DK. EU\", source: \"default\", kind: \"tts\" },\n { id: \"voxtral-small-transcribe-3-0\", aliases: [], provider: \"mistral\", available: true, status: \"available\", note: \"Voxtral Small Transcribe 3 — Danish (language:\\\"da\\\") measured word-for-word 2026-10-25; the older voxtral-mini rejects da. EU\", source: \"default\", kind: \"transcribe\" },\n { id: \"mistral-large-latest\", aliases: [\"mistral-large\"], provider: \"mistral\", available: true, status: \"available\", source: \"default\" },\n { id: \"mistral-medium-latest\", aliases: [\"mistral-medium\"], provider: \"mistral\", available: true, status: \"available\", source: \"default\" },\n { id: \"mistral-small-latest\", aliases: [\"mistral-small\"], provider: \"mistral\", available: true, status: \"available\", source: \"default\" },\n // F077 — the dated ids the tiers are pinned to. The -latest rows above stay: callers\n // still pass them, and an unknown id would fail a requireKnown gate.\n // F022.6 — default = what the `smart` tier calls (a test holds them together).\n { id: \"mistral-large-2512\", aliases: [], provider: \"mistral\", available: true, status: \"available\", note: \"Mistral Large 3 — RETIRES 2027-04-30 (Mistral deprecation mail 2026-10-30); Mistral recommends Mistral Large 4 (mistral-large-4-0). Backs the smart/powerful tiers until then (F085.3)\", source: \"default\", grade: \"standard\", default: true },\n { id: \"mistral-medium-2604\", aliases: [], provider: \"mistral\", available: true, status: \"available\", note: \"Mistral Medium 3.5 — RETIRES 2027-04-30 (Mistral deprecation mail 2026-10-30); Mistral recommends Mistral Large 4. Backs the vision tier until then (F085.3)\", source: \"default\" },\n { id: \"mistral-small-2603\", aliases: [], provider: \"mistral\", available: true, status: \"available\", source: \"default\", grade: \"cheap\" },\n // F085.4 — every model named in Mistral's 29-30/10 2026 mails, measured present on /v1/models 30/10.\n { id: \"mistral-large-4-0\", aliases: [\"mistral-large-4\"], provider: \"mistral\", available: true, status: \"available\", note: \"Mistral Large 4 ($0.70/$2.10, 2026-10-29). Reasons by default (High) at Mistral — ai-sdk sends reasoning_effort none unless you pass reasoningEffort (F074.3). Mistral's recommended successor for Large 3 and Medium 3.5 (both retire 2027-04-30)\", source: \"default\", grade: \"strong\" },\n { id: \"codestral-2508\", aliases: [\"codestral-latest\"], provider: \"mistral\", available: true, status: \"available\", note: \"Codestral — code completion (chat + FIM). Codestral Edit (codestral-edit-2602) retires 2026-11-30 with no replacement\", source: \"default\" },\n { id: \"zai-glm-5-3\", aliases: [\"zai-glm-5\", \"zai-glm-latest\"], provider: \"mistral\", available: true, status: \"available\", note: \"Z.ai GLM 5.3, served by Mistral (api.mistral.ai, region eu by host). The MODEL is from Z.ai (China); the serving is Mistral's — check your own data rules before sending personal data. $1.4/$4.4\", source: \"default\" },\n { id: \"voxtral-mini-transcribe-3-0\", aliases: [\"voxtral-mini-transcribe-3\"], provider: \"mistral\", available: true, status: \"available\", note: \"Voxtral Mini Transcribe 3 ($0.0035/min) — use ai.transcribe override:{provider:\\\"mistral\\\", model:\\\"voxtral-mini-transcribe-3-0\\\"}. Successor of voxtral-mini-2602 (retires 2027-04-30). Danish: use voxtral-small-transcribe-3-0 (measured)\", source: \"default\", kind: \"transcribe\" },\n];\n\n/** Attach every tier name as an alias of the model that tier ACTUALLY calls.\n * One source: DEFAULT_TIER_MAP decides, the registry follows. A tier whose model\n * is not in the registry is left unaliased on purpose — resolveModel then reports\n * status \"unknown\" (fail-open) instead of inventing a row, and the drift test\n * catches it. */\nexport const TIER_ALIAS_CONFLICTS: string[] = [];\n\nfunction applyTierAliases(entries: RegistryEntry[]): RegistryEntry[] {\n for (const [tier, spec] of Object.entries(DEFAULT_TIER_MAP)) {\n const owner = entries.find((e) => e.id === spec.model && e.provider === spec.provider);\n // A tier name hand-written on any OTHER row is the drift bug returning. It\n // would resolve correctly TODAY only because seed() lets the last write win\n // and the rows happen to be ordered favourably — reorder the array and the\n // tier silently points at the wrong provider again. Record it so a test can\n // fail on it, then strip it so runtime is right regardless.\n for (const e of entries) {\n if (e !== owner && e.aliases.includes(tier)) {\n TIER_ALIAS_CONFLICTS.push(`${tier} is hand-declared on ${e.id} (${e.provider}) but tier ${tier} calls ${spec.model} (${spec.provider})`);\n e.aliases = e.aliases.filter((a) => a !== tier);\n }\n }\n if (owner && !owner.aliases.includes(tier)) owner.aliases.push(tier);\n }\n return entries;\n}\napplyTierAliases(DEFAULTS);\n\n/** The live overlay, keyed by canonical id. Seeded from DEFAULTS (deep-copied so\n * resetting is clean). refreshAvailability() mutates this; resolve/listModels\n * read it synchronously. */\nlet OVERLAY = new Map<string, RegistryEntry>();\n/** alias → canonical id, rebuilt whenever the overlay is seeded. */\nlet ALIAS_INDEX = new Map<string, string>();\n\nfunction seed(): void {\n OVERLAY = new Map(DEFAULTS.map((e) => [e.id, { ...e, aliases: [...e.aliases] }]));\n ALIAS_INDEX = new Map();\n for (const e of DEFAULTS) for (const a of e.aliases) ALIAS_INDEX.set(a, e.id);\n}\nseed();\n\n/** Reset the overlay back to the curated defaults. For tests. */\nexport function resetRegistry(): void {\n seed();\n}\n\n/** Canonical id for a model id OR alias; null when we track neither. */\nexport function canonicalId(requested: string): string | null {\n if (OVERLAY.has(requested)) return requested;\n return ALIAS_INDEX.get(requested) ?? null;\n}\n\n/** The current entry for an id/alias, or undefined when untracked (fail-open). */\nexport function getEntry(requested: string): RegistryEntry | undefined {\n const id = canonicalId(requested);\n return id ? OVERLAY.get(id) : undefined;\n}\n\n/** All tracked entries (optionally provider-scoped), as a public ModelStatus[]. */\nexport function allEntries(provider?: string): ModelStatus[] {\n const rows: ModelStatus[] = [];\n for (const e of OVERLAY.values()) {\n if (provider && e.provider !== provider) continue;\n rows.push({\n id: e.id,\n alias: e.aliases[0],\n provider: e.provider,\n available: e.available,\n status: e.status,\n note: e.note,\n source: e.source,\n kind: e.kind ?? \"chat\",\n ...(e.default ? { default: true as const } : {}),\n ...(e.grade ? { grade: e.grade } : {}),\n ...(isFloatingId(e.id) ? { floating: true as const } : {}),\n });\n }\n return rows;\n}\n\n/** Provider-scoped canonical ids (for refresh reconciliation). */\nexport function providerIds(provider: string): string[] {\n return [...OVERLAY.values()].filter((e) => e.provider === provider).map((e) => e.id);\n}\n\n/** Mark a tracked id available/suspended from a live refresh. No-op if untracked. */\nexport function setAvailability(id: string, available: boolean, note?: string): void {\n const e = OVERLAY.get(id);\n if (!e) return;\n e.available = available;\n e.status = available ? \"available\" : \"suspended\";\n e.source = \"refresh\";\n if (note !== undefined) e.note = note;\n else if (available) e.note = undefined;\n}\n","// F022 — Model Availability Harness. Public types for the availability layer:\n// the shared status read (ModelStatus), the resolve result, and the structured\n// error a caller can flag on. The registry is the one source both the spawn /\n// call path (resolveModel) and UI pickers (listModels) read.\n\nexport type AvailabilityStatus = \"available\" | \"suspended\" | \"unknown\";\n\n/** Where a model's current availability came from: the curated default seed,\n * or a live provider refresh (Anthropic GET /v1/models). */\nexport type AvailabilitySource = \"default\" | \"refresh\";\n\n/** What a model IS, so a picker can offer only chat models in a chat dropdown (F022.6). */\nexport type ModelKind = \"chat\" | \"embedding\" | \"judge\" | \"tts\" | \"transcribe\";\n\n/** The provider's price/quality step, as a picker labels it (F022.6). Not a tier:\n * tiers route calls, grades only describe a row. */\nexport type ModelGrade = \"cheap\" | \"standard\" | \"strong\";\n\n/** One row of the shared status read — what a UI model-picker renders. */\nexport interface ModelStatus {\n /** Canonical provider model id, e.g. \"claude-fable-5\". */\n id: string;\n /** Short/tier alias, e.g. \"fable\" (the first registered alias). */\n alias?: string;\n /** \"anthropic\" | \"openai\" | \"gemini\" | \"mistral\" | … */\n provider: string;\n available: boolean;\n status: AvailabilityStatus;\n /** Friendly reason, e.g. \"suspended — US export-control directive (2026-06-12)\". */\n note?: string;\n source: AvailabilitySource;\n /** F022.6 — chat / embedding / judge. */\n kind: ModelKind;\n /** F022.6 — exactly one row per provider carries this: the model a picker\n * pre-selects. Always a pinned (non-floating), priced id. */\n default?: true;\n /** F022.6 — present on the cheap / standard / strong pick for a provider. */\n grade?: ModelGrade;\n /** F022.6 — the id is a moving alias (`-latest`): the provider can swap the\n * model behind it without a deploy. Never the default (D-385d97). */\n floating?: true;\n}\n\n/** Result of resolveModel — the spawn / call path consumes this synchronously. */\nexport interface ResolveResult {\n /** True when the requested model itself is available. */\n ok: boolean;\n /** The id to actually use: `requested` when ok, else the first available fallback. */\n model: string;\n /** What the caller asked for (id or alias, normalized to the canonical id). */\n requested: string;\n provider?: string;\n /** True when `model` differs from `requested` because we fell back. */\n fellBack: boolean;\n status: AvailabilityStatus;\n /** Why it degraded / why it is unavailable. */\n reason?: string;\n /** The registry row's caveat, surfaced on the SUCCESS path too (F057.2).\n *\n * `reason` only ever appears when a model is unavailable, so a caveat written\n * on an AVAILABLE row — \"documented to deprecate 2026-07-24\", \"preview\", a\n * known rate limit — was reachable through listModels() and invisible to the\n * one caller who most needs it: the gate. A consumer passing requireKnown got\n * a clean green with the warning sitting one call away, unread. Carrying it\n * here costs an optional field and makes `ok:true` able to say \"yes, but\". */\n note?: string;\n}\n\n/** Thrown by resolveModel when the requested model is unavailable, no usable\n * fallback exists, and the caller passed `throwIfUnavailable`. Callers flag on\n * `.code === \"model_unavailable\"`. */\nexport class ModelUnavailableError extends Error {\n readonly code = \"model_unavailable\";\n readonly requested: string;\n readonly provider?: string;\n readonly note?: string;\n constructor(requested: string, note?: string, provider?: string) {\n super(`model \"${requested}\" is unavailable${note ? ` (${note})` : \"\"}`);\n this.name = \"ModelUnavailableError\";\n this.requested = requested;\n this.note = note;\n this.provider = provider;\n }\n}\n","// F022 — the synchronous, zero-I/O resolve + status read. This is the spawn /\n// call hot path (buddy's launcher calls resolveModel per spawn, cardmem #4842):\n// it MUST never await and never touch the network. Freshness comes only from a\n// prior async refreshAvailability(); resolve just reads the in-memory registry.\nimport { allEntries, canonicalId, getEntry } from \"./registry.js\";\nimport { ModelUnavailableError } from \"./types.js\";\nimport type { ModelStatus, ResolveResult } from \"./types.js\";\n\nexport interface ResolveOptions {\n /** One id/alias or an ordered chain to try when `requested` is unavailable. */\n fallback?: string | string[];\n /** Scope hint (passed through to the result); does not gate lookup. */\n provider?: string;\n /** Throw ModelUnavailableError instead of returning ok:false when there is no\n * usable fallback. For callers that want to flag rather than degrade. */\n throwIfUnavailable?: boolean;\n /** Treat an id we do not track as UNUSABLE instead of fail-open.\n *\n * Default is fail-open: we never block a model we simply do not track. That is\n * right for liveness, and wrong for a caller who is GATING — cms measured the\n * consequence: resolveModel(\"cheap\") answered {ok:true, model:\"cheap\"}, so a\n * consumer following our own instruction to gate on `ok` passed the gate and\n * then sent the literal string \"cheap\" to a provider as a model id. A\n * success-shaped non-answer is worse than an error, because an error gets\n * handled and a shape does not.\n *\n * Set this when you need \"a model you actually know about\". Off by default so\n * no existing caller changes behaviour. */\n requireKnown?: boolean;\n}\n\n/** The shared status read — UI pickers grey out `available:false` rows. */\nexport function listModels(opts: { provider?: string } = {}): ModelStatus[] {\n return allEntries(opts.provider);\n}\n\n/** Is this id/alias currently usable? Untracked ids are fail-open (true) unless\n * the caller asked for requireKnown. */\nfunction isAvailable(requested: string, requireKnown = false): boolean {\n const e = getEntry(requested);\n if (!e) return !requireKnown; // fail-open on unknown, unless gating\n return e.available;\n}\n\n/**\n * Resolve a requested model (id or alias) to one that is actually usable.\n * Synchronous + offline by contract (cardmem #4842) — reads the registry only.\n *\n * - Available → pass through ({ ok:true, fellBack:false }).\n * - Unavailable + a fallback that IS available → swap ({ ok:false, fellBack:true }).\n * - Unavailable + no usable fallback → throw (throwIfUnavailable) or return ok:false.\n * - Unknown id → treated available (never block a model we do not track).\n */\nexport function resolveModel(requested: string, opts: ResolveOptions = {}): ResolveResult {\n const id = canonicalId(requested) ?? requested;\n const entry = getEntry(requested);\n const provider = opts.provider ?? entry?.provider;\n\n if (isAvailable(requested, opts.requireKnown)) {\n return {\n ok: true,\n model: id,\n requested: id,\n provider,\n fellBack: false,\n status: entry?.status ?? \"unknown\",\n // A green gate that hides a known caveat is the failure this whole card is\n // about, one level up: the answer is shaped like \"fine\" and the warning is\n // somewhere else. If the row has a note, the caller gets it with the yes.\n ...(entry?.note ? { note: entry.note } : {}),\n };\n }\n\n // Requested is suspended — walk the fallback chain for the first available one.\n const chain = opts.fallback === undefined ? [] : Array.isArray(opts.fallback) ? opts.fallback : [opts.fallback];\n for (const fb of chain) {\n if (isAvailable(fb, opts.requireKnown)) {\n const fbId = canonicalId(fb) ?? fb;\n return {\n ok: false,\n model: fbId,\n requested: id,\n provider,\n fellBack: true,\n status: entry?.status ?? \"suspended\",\n reason: entry?.note ?? `${id} is unavailable`,\n };\n }\n }\n\n // No usable fallback.\n const unknownAndGating = !entry && opts.requireKnown;\n const reason = unknownAndGating\n ? `${id} is not a model this registry knows — requireKnown was set, so it is not assumed usable`\n : (entry?.note ?? `${id} is unavailable`);\n if (opts.throwIfUnavailable) {\n throw new ModelUnavailableError(id, reason, provider);\n }\n return {\n ok: false,\n model: id,\n requested: id,\n provider,\n fellBack: false,\n status: entry?.status ?? \"unknown\",\n reason,\n };\n}\n","// F077.2 — \"which concrete version is this tier right now, and what does it cost?\"\n// Asked by trail for its settings page and by the owner for the fleet: a tier name\n// says nothing about the bill, and resolveModel answers the model but not the price.\nimport type { Tier } from \"../types.js\";\nimport { DEFAULT_TIER_MAP } from \"./tier-map.js\";\nimport { getPrice } from \"../cost/pricing.js\";\n\nexport interface TierDescription {\n tier: Tier;\n provider: string;\n model: string;\n /** false when the model is a \"-latest\" alias the provider can move under us. */\n pinned: boolean;\n /** USD per 1M tokens from the pricing table; undefined when the model is unpriced. */\n inputPer1M?: number;\n outputPer1M?: number;\n cacheReadPer1M?: number;\n}\n\n/** The built-in default for a tier. A client's own `defaults` or a per-call\n * `override` can route elsewhere — read usage.model off the response for that. */\nexport function describeTier(tier: Tier): TierDescription {\n const spec = DEFAULT_TIER_MAP[tier];\n if (!spec) throw new Error(`describeTier: unknown tier \"${tier}\" — valid: ${Object.keys(DEFAULT_TIER_MAP).join(\", \")}`);\n const price = getPrice(spec.provider, spec.model);\n return {\n tier,\n provider: spec.provider,\n model: spec.model,\n pinned: !spec.model.endsWith(\"-latest\"),\n ...(price ? { inputPer1M: price.inputPer1M, outputPer1M: price.outputPer1M, ...(price.cacheReadPer1M !== undefined ? { cacheReadPer1M: price.cacheReadPer1M } : {}) } : {}),\n };\n}\n"],"mappings":";;;;;A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U,KAAK;AAAA,IACf,OAAO,KAAK;AAAA,IACZ,QAAQ,CAAC,KAAK,MAAM,SAAS,SAAS;AAAA,IACtC,GAAI,QAAQ,EAAE,YAAY,MAAM,YAAY,aAAa,MAAM,aAAa,GAAI,MAAM,mBAAmB,SAAY,EAAE,gBAAgB,MAAM,eAAe,IAAI,CAAC,EAAG,IAAI,CAAC;AAAA,EAC3K;AACF;","names":[]}
|
|
@@ -174,6 +174,13 @@ var PRICING = {
|
|
|
174
174
|
// F067.7: flash re-read 2026-10-20 — rose from 0.028/0.056.
|
|
175
175
|
"openrouter:openai/gpt-6-astra": { inputPer1M: 10, outputPer1M: 50, version: "2026-11-05-openrouter-live" },
|
|
176
176
|
"openrouter:openai/gpt-6.1-sol": { inputPer1M: 2, outputPer1M: 10, version: "2026-11-05-openrouter-live" },
|
|
177
|
+
// F097 — EU-served DeepSeek (OpenRouter catalogue via inventory 2026-11-14); calls book OpenRouter's reported usage.cost anyway.
|
|
178
|
+
// F097 — Claude 5.5 via OpenRouter EU (backs claude-*-latest). OpenRouter catalogue via
|
|
179
|
+
// inventory 2026-11-14 = Anthropic list price; calls book OpenRouter's reported usage.cost.
|
|
180
|
+
"openrouter:anthropic/claude-haiku-5.5": { inputPer1M: 0.1, outputPer1M: 0.5, cacheReadPer1M: 0.01, version: "2026-11-14-openrouter-catalogue" },
|
|
181
|
+
"openrouter:anthropic/claude-sonnet-5.5": { inputPer1M: 2, outputPer1M: 10, cacheReadPer1M: 0.1, version: "2026-11-14-openrouter-catalogue" },
|
|
182
|
+
"openrouter:anthropic/claude-opus-5.5": { inputPer1M: 4, outputPer1M: 20, cacheReadPer1M: 0.2, version: "2026-11-14-openrouter-catalogue" },
|
|
183
|
+
"openrouter:deepseek/deepseek-v4-flash-0731": { inputPer1M: 0.0434, outputPer1M: 0.3, cacheReadPer1M: 0.035, version: "2026-11-14-openrouter-catalogue" },
|
|
177
184
|
"openrouter:deepseek/deepseek-v4.1-flash-1017": { inputPer1M: 0.15, outputPer1M: 0.6, version: "2026-11-05-openrouter-live" },
|
|
178
185
|
"openrouter:deepseek/deepseek-v4-flash": { inputPer1M: 0.091, outputPer1M: 0.182, version: "2026-10-20-openrouter-live" },
|
|
179
186
|
// DeepSeek DIRECT API (provider "deepseek", F030 non-PII secondary). Rates from
|
|
@@ -307,4 +314,4 @@ export {
|
|
|
307
314
|
stripDatedSuffix,
|
|
308
315
|
getPrice
|
|
309
316
|
};
|
|
310
|
-
//# sourceMappingURL=chunk-
|
|
317
|
+
//# sourceMappingURL=chunk-XKLF7UUR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cost/pricing.ts"],"sourcesContent":["// Versioned per-(provider, model) pricing. F3.6 populates the table + adds tests\n// + MiniMax coverage. F3.1 ships the type + lookup with an empty table, so\n// computeCost returns 0 for every model until F3.6 lands (calls still complete).\nexport interface PricingEntry {\n /** USD per 1M input tokens. */\n inputPer1M: number;\n /** USD per 1M output tokens. */\n outputPer1M: number;\n /** USD per 1M cache-read tokens (falls back to input rate if unset). */\n cacheReadPer1M?: number;\n /** USD per 1M cache-write/creation tokens (falls back to input rate if unset). */\n cacheWritePer1M?: number;\n /** Pricing snapshot version (date or tag) so stale entries are detectable. */\n version: string;\n /** F075 — a second set of rates for prompts LONGER than `aboveTokens` (input +\n * cache-read + cache-write). Claude Haiku 5.5 costs 5x above 100k tokens; one row\n * could only be right for one side of that line. */\n longPrompt?: { aboveTokens: number; inputPer1M: number; outputPer1M: number; cacheReadPer1M?: number; cacheWritePer1M?: number };\n}\n\n// USD per 1M tokens. Anthropic cache multipliers follow the standard model:\n// cache-read ≈ 0.1× input, cache-write ≈ 1.25× input. Verified against the\n// pricing tables in cms (packages/cms-ai/src/providers) + trail (model-lab).\n// MiniMax M2.7 is an estimate pending confirmation against OpenRouter's live\n// price page — flagged in its version string.\nconst V = \"2026-06-02\";\n// Mistral prices come straight from mistral.ai/pricing (per Christian's CD report).\nconst MS = \"2026-06-04-mistral.ai\";\n// Anthropic's own price page, read for F075.\nconst AN = \"2026-10-08-platform.claude.com\";\n\n/** Keyed `${provider}:${model}`. Exported so the catalogue-research job (F014)\n * can enumerate every priced entry and diff it against the live provider lists. */\nconst OAI = \"2026-10-11-developers.openai.com\";\n\nexport const PRICING: Record<string, PricingEntry> = {\n // Anthropic (direct API). DEFAULT_TIER_MAP: fast/cheap=haiku, smart/vision=sonnet, powerful=opus.\n // $1.00/$5.00 — Anthropic's published Haiku 4.5 rate, confirmed against the\n // claude-api skill's model table 2026-09-03. F048: this row said $0.80/$4.00 while\n // \"openrouter:anthropic/claude-haiku-4.5\" said $1.00/$5.00 — the SAME model at two\n // prices, and the shorter, likelier id carried the wrong one. A consumer pricing\n // 68M haiku tokens (upmetrics' real volume) was told 20% under.\n \"anthropic:claude-haiku-4-5\": {\n inputPer1M: 1.0,\n outputPer1M: 5.0,\n cacheReadPer1M: 0.1,\n cacheWritePer1M: 1.25,\n version: \"2026-09-03\",\n },\n \"anthropic:claude-sonnet-4-6\": {\n inputPer1M: 3.0,\n outputPer1M: 15.0,\n cacheReadPer1M: 0.3,\n cacheWritePer1M: 3.75,\n version: V,\n },\n // $5.00/$25.00 — Anthropic's published Opus 4.8 rate, confirmed against the\n // claude-api skill's model table 2026-09-03.\n //\n // FOUND BY THE CONTRADICTION GUARD ON ITS FIRST RUN, not by a report. This row said\n // $15.00/$75.00 while \"openrouter:anthropic/claude-opus-4.8\" said $5.00/$25.00 —\n // THREE TIMES too high, the opposite direction from the haiku error and a larger\n // multiple. Nobody had noticed, because both numbers looked like answers.\n \"anthropic:claude-opus-4-8\": {\n inputPer1M: 5.0,\n outputPer1M: 25.0,\n cacheReadPer1M: 0.5,\n cacheWritePer1M: 6.25,\n version: \"2026-09-03\",\n },\n\n // F075 — the rest of what Anthropic's /v1/models lists for our key, read 2026-10-08\n // from platform.claude.com/docs/en/about-claude/pricing. Cache-read is NOT 0.1x\n // everywhere: Opus/Sonnet 5.5 are 0.05x and Fable 5.1 is 0.025x. cacheWrite is the\n // 5-minute rate (the only one the SDK writes).\n \"anthropic:claude-fable-5-1\": { inputPer1M: 10, outputPer1M: 50, cacheReadPer1M: 0.25, cacheWritePer1M: 12.5, version: AN },\n \"anthropic:claude-fable-5\": { inputPer1M: 10, outputPer1M: 50, cacheReadPer1M: 1, cacheWritePer1M: 12.5, version: AN },\n \"anthropic:claude-opus-5-5\": { inputPer1M: 4, outputPer1M: 20, cacheReadPer1M: 0.2, cacheWritePer1M: 5, version: AN },\n \"anthropic:claude-opus-5\": { inputPer1M: 5, outputPer1M: 25, cacheReadPer1M: 0.5, cacheWritePer1M: 6.25, version: AN },\n \"anthropic:claude-opus-4-7\": { inputPer1M: 5, outputPer1M: 25, cacheReadPer1M: 0.5, cacheWritePer1M: 6.25, version: AN },\n \"anthropic:claude-opus-4-6\": { inputPer1M: 5, outputPer1M: 25, cacheReadPer1M: 0.5, cacheWritePer1M: 6.25, version: AN },\n \"anthropic:claude-opus-4-5\": { inputPer1M: 5, outputPer1M: 25, cacheReadPer1M: 0.5, cacheWritePer1M: 6.25, version: AN },\n \"anthropic:claude-sonnet-5-5\": { inputPer1M: 2, outputPer1M: 10, cacheReadPer1M: 0.1, cacheWritePer1M: 2.5, version: AN },\n \"anthropic:claude-sonnet-5\": { inputPer1M: 2, outputPer1M: 10, cacheReadPer1M: 0.2, cacheWritePer1M: 2.5, version: AN },\n \"anthropic:claude-sonnet-4-5\": { inputPer1M: 3, outputPer1M: 15, cacheReadPer1M: 0.3, cacheWritePer1M: 3.75, version: AN },\n \"anthropic:claude-haiku-5-5\": {\n inputPer1M: 0.1, outputPer1M: 0.5, cacheReadPer1M: 0.01, cacheWritePer1M: 0.125, version: AN,\n longPrompt: { aboveTokens: 100_000, inputPer1M: 0.5, outputPer1M: 2.5, cacheReadPer1M: 0.05, cacheWritePer1M: 0.625 },\n },\n\n // OpenAI. embedding default tier = text-embedding-3-small (no output tokens).\n // Cached input is 50% of the input rate — $1.25 vs $2.50 (gpt-4o) and $0.075 vs\n // $0.15 (gpt-4o-mini), read from developers.openai.com/api/docs/pricing on\n // 2026-08-27. NOTE IT IS 50%, NOT the 10% Mistral and Gemini charge: assuming one\n // uniform discount across providers would have understated OpenAI's cost by 4x on\n // the cached half. Caching is automatic above 1,024 tokens — no key, no opt-in.\n // The embedding models list NO cached price (embeddings do not cache), so they\n // deliberately get no row here rather than a guessed one.\n \"openai:text-embedding-3-small\": { inputPer1M: 0.02, outputPer1M: 0, version: V },\n \"openai:text-embedding-3-large\": { inputPer1M: 0.13, outputPer1M: 0, version: V },\n \"openai:gpt-4o\": { inputPer1M: 2.5, cacheReadPer1M: 1.25, outputPer1M: 10.0, version: \"2026-08-27-developers.openai.com\" },\n \"openai:gpt-4o-mini\": { inputPer1M: 0.15, cacheReadPer1M: 0.075, outputPer1M: 0.6, version: \"2026-08-27-developers.openai.com\" },\n // F022.6 — chat models offered to pickers. Official standard (non-batch, non-flex)\n // rates from developers.openai.com/api/docs/pricing, read 2026-10-11. Long context\n // = >272K input tokens, as the page states for every model that has one. Dated ids\n // (gpt-5.4-mini-2026-03-17) price through stripDatedSuffix.\n \"openai:gpt-5.4-nano\": { inputPer1M: 0.2, cacheReadPer1M: 0.02, outputPer1M: 1.25, version: OAI },\n \"openai:gpt-5.4-mini\": { inputPer1M: 0.75, cacheReadPer1M: 0.075, outputPer1M: 4.5, version: OAI },\n \"openai:gpt-5.5\": {\n inputPer1M: 5, cacheReadPer1M: 0.5, outputPer1M: 30, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 10, cacheReadPer1M: 1, outputPer1M: 45 },\n },\n \"openai:gpt-6-luna\": {\n inputPer1M: 0.1, cacheReadPer1M: 0.01, cacheWritePer1M: 0.125, outputPer1M: 0.5, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 0.2, cacheReadPer1M: 0.02, cacheWritePer1M: 0.25, outputPer1M: 0.75 },\n },\n \"openai:gpt-6-sol\": {\n inputPer1M: 2, cacheReadPer1M: 0.2, cacheWritePer1M: 2.5, outputPer1M: 10, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 4, cacheReadPer1M: 0.4, cacheWritePer1M: 5, outputPer1M: 15 },\n },\n \"openai:gpt-6.1-sol\": {\n inputPer1M: 2, cacheReadPer1M: 0.1, cacheWritePer1M: 2.5, outputPer1M: 10, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 4, cacheReadPer1M: 0.2, cacheWritePer1M: 5, outputPer1M: 15 },\n },\n \"openai:gpt-6-astra\": {\n inputPer1M: 10, cacheReadPer1M: 1, cacheWritePer1M: 12.5, outputPer1M: 50, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 20, cacheReadPer1M: 2, cacheWritePer1M: 25, outputPer1M: 75 },\n },\n \"openai:gpt-5.6-luna\": {\n inputPer1M: 0.2, cacheReadPer1M: 0.02, cacheWritePer1M: 0.25, outputPer1M: 1.2, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 0.4, cacheReadPer1M: 0.04, cacheWritePer1M: 0.5, outputPer1M: 1.8 },\n },\n \"openai:gpt-5.6-terra\": {\n inputPer1M: 2, cacheReadPer1M: 0.2, cacheWritePer1M: 2.5, outputPer1M: 12, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 4, cacheReadPer1M: 0.4, cacheWritePer1M: 5, outputPer1M: 18 },\n },\n \"openai:gpt-5.6-sol\": {\n inputPer1M: 4, cacheReadPer1M: 0.4, cacheWritePer1M: 5, outputPer1M: 20, version: OAI,\n longPrompt: { aboveTokens: 272_000, inputPer1M: 8, cacheReadPer1M: 0.8, cacheWritePer1M: 10, outputPer1M: 30 },\n },\n // Whisper is priced per MINUTE — see MEDIA_PRICING in ./media-pricing.ts. It used to\n // sit here as 0/0 \"so token-based compute never charges it\", and inwardly that worked.\n // Outwardly it did not: getModelPrice(\"whisper-1\") answered `{unit:\"per_1m_tokens\",\n // inputPer1M: 0}` — i.e. \"this model is free\" — because media rows are consulted LAST\n // and a token row was already there. The per-minute price was unreachable by its own\n // id. computeCost still returns 0 for it (no entry) and transcribe still computes its\n // own cost, so nothing about billing changed; only the public answer stopped lying.\n\n // OpenRouter (meta-router — model slugs include the upstream vendor). Slugs use\n // dots (claude-sonnet-4.6) to match OpenRouter's live ids; the dashed forms\n // never matched a real call. Caught by the F014 catalogue research.\n \"openrouter:anthropic/claude-sonnet-4.6\": { inputPer1M: 3.0, outputPer1M: 15.0, version: V },\n // OpenRouter ground-truth $1/$5 — a markup over Anthropic-direct's $0.8/$4\n // (the `anthropic:` entry above). Was masked while the slug used dashes.\n \"openrouter:anthropic/claude-haiku-4.5\": { inputPer1M: 1.0, outputPer1M: 5.0, version: \"2026-06-04\" },\n \"openrouter:google/gemini-2.5-flash\": { inputPer1M: 0.3, outputPer1M: 2.5, version: V },\n // Ground-truth from OpenRouter /api/v1/models, re-read 2026-10-20 (F067.7; was 0.21/0.84).\n \"openrouter:minimax/minimax-m2.7\": {\n inputPer1M: 0.3,\n outputPer1M: 1.2,\n version: \"2026-10-20-openrouter-live\",\n },\n // DeepSeek V4 (CN-hosted — NOT GDPR-safe; non-personal-data workloads only).\n // On 2026-05-22 DeepSeek made the \"75% off\" promo the permanent official price.\n // V4-Pro $0.435/$0.87 is ~34x cheaper than GPT-5.5 on output; flash is cheaper\n // still. Numbers match OpenRouter /api/v1/models 1:1 (no router markup). A strong\n // cheap route for fleet background work once `claude -p` is API-billed (15 Jun).\n // Re-read from OpenRouter /api/v1/models 2026-10-02 (F067.5). These moved three\n // times in a month (Sep 3: pro 1.02, Oct 1: flash 0.042, Oct 2: flash 0.028) — an\n // OpenRouter call books usage.cost from the response anyway; this row is the fallback.\n \"openrouter:deepseek/deepseek-v4-pro\": { inputPer1M: 0.2088, outputPer1M: 0.4176, version: \"2026-10-02-openrouter-live\" },\n // F067.7: flash re-read 2026-10-20 — rose from 0.028/0.056.\n \"openrouter:openai/gpt-6-astra\": { inputPer1M: 10, outputPer1M: 50, version: \"2026-11-05-openrouter-live\" },\n \"openrouter:openai/gpt-6.1-sol\": { inputPer1M: 2, outputPer1M: 10, version: \"2026-11-05-openrouter-live\" },\n // F097 — EU-served DeepSeek (OpenRouter catalogue via inventory 2026-11-14); calls book OpenRouter's reported usage.cost anyway.\n // F097 — Claude 5.5 via OpenRouter EU (backs claude-*-latest). OpenRouter catalogue via\n // inventory 2026-11-14 = Anthropic list price; calls book OpenRouter's reported usage.cost.\n \"openrouter:anthropic/claude-haiku-5.5\": { inputPer1M: 0.1, outputPer1M: 0.5, cacheReadPer1M: 0.01, version: \"2026-11-14-openrouter-catalogue\" },\n \"openrouter:anthropic/claude-sonnet-5.5\": { inputPer1M: 2, outputPer1M: 10, cacheReadPer1M: 0.1, version: \"2026-11-14-openrouter-catalogue\" },\n \"openrouter:anthropic/claude-opus-5.5\": { inputPer1M: 4, outputPer1M: 20, cacheReadPer1M: 0.2, version: \"2026-11-14-openrouter-catalogue\" },\n \"openrouter:deepseek/deepseek-v4-flash-0731\": { inputPer1M: 0.0434, outputPer1M: 0.3, cacheReadPer1M: 0.035, version: \"2026-11-14-openrouter-catalogue\" },\n \"openrouter:deepseek/deepseek-v4.1-flash-1017\": { inputPer1M: 0.15, outputPer1M: 0.6, version: \"2026-11-05-openrouter-live\" },\n \"openrouter:deepseek/deepseek-v4-flash\": { inputPer1M: 0.091, outputPer1M: 0.182, version: \"2026-10-20-openrouter-live\" },\n // DeepSeek DIRECT API (provider \"deepseek\", F030 non-PII secondary). Rates from\n // api-docs.deepseek.com 2026-06-30 ($0.14/$0.28 per 1M; both map to deepseek-v4-flash).\n // `deepseek-chat` (non-thinking) + `deepseek-reasoner` (thinking) DEPRECATE 2026-07-24.\n // (The bare `deepseek-v4-flash` basename is already priced via the openrouter entry\n // above — kept distinct here to avoid a basename collision in the F027 pricing-API.)\n // Verify against a real key when it lands.\n \"deepseek:deepseek-chat\": { inputPer1M: 0.14, outputPer1M: 0.28, version: \"2026-06-30-deepseek-direct\" },\n \"deepseek:deepseek-reasoner\": { inputPer1M: 0.14, outputPer1M: 0.28, version: \"2026-06-30-deepseek-direct\" },\n // F066 — TypeSafe Jev. docs.typesafe.ai/models, read 2026-10-01: \"$42 per billion\n // tokens (input only)\", output free. Priced on the VERSIONED id because the response\n // reports the model that actually ran (\"jev-1.13.0\") even when you ask for\n // \"jev-latest\" — so a future version arrives unpriced and is booked as such, rather\n // than inheriting a number nobody checked for it.\n \"typesafe:jev-1.13.0\": { inputPer1M: 0.042, outputPer1M: 0, version: \"2026-10-01-typesafe-official\" },\n // F081 — Microsoft-Decision-1, Azure retail prices API (prices.azure.com, read\n // 2026-10-26): ONE meter, \"Microsoft Decision 1 1M Tokens\" = $0.042, effective\n // 2026-10-01, same in swedencentral as everywhere. A single meter does not say output\n // is free, so output is priced at the same rate — at ~3 output tokens per call that\n // over-counts by a rounding error rather than risking an under-count.\n \"microsoft-decision:microsoft-decision-1-v1\": { inputPer1M: 0.042, outputPer1M: 0.042, version: \"2026-10-26-azure-retail\" },\n\n // Cached input tokens cost 10% of the input rate — $0.03 vs $0.30 (2.5-flash) and\n // $0.01 vs $0.10 (2.5-flash-lite), read from ai.google.dev/gemini-api/docs/pricing\n // on 2026-08-27 rather than recalled. NB the storage fee on that page ($1/1M\n // tokens/hour) applies to EXPLICIT context caching, where you create a CachedContent\n // object with a TTL. We use IMPLICIT caching, which has no storage charge — so this\n // table is not silently under-billing.\n // Google Gemini (direct). Provider key is \"gemini\" — matches the adapter's\n // usage.provider + the override.provider callers pass. (Image-gen models are\n // priced per-image in the adapter, not here.)\n \"gemini:gemini-2.5-flash\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 2.5, version: \"2026-08-27-ai.google.dev\" },\n // flash-lite is the default `video` tier (F019) — cheap native video understanding.\n // F088 — measured 2026-11-05: reachable with our GEMINI_API_KEY; price = OpenRouter's\n // live google/gemini-4-argon row (passes Google's list price through).\n \"gemini:gemini-4-argon\": { inputPer1M: 2, outputPer1M: 10, version: \"2026-11-05-openrouter-live\" },\n \"gemini:gemini-2.5-flash-lite\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.4, version: \"2026-08-27-ai.google.dev\" },\n\n // Vertex AI (F038) — the EU-resident route to the SAME Gemini models, so Google's\n // published Gemini token prices apply. Listed separately because cost lookups key on\n // `provider:model`: without these rows an EU vision/video call would silently log\n // $0, which is worse than no tracking (a confident wrong number).\n \"vertex:gemini-2.5-flash\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 2.5, version: \"2026-08-27-ai.google.dev\" },\n \"vertex:gemini-2.5-flash-lite\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.4, version: \"2026-08-27-ai.google.dev\" },\n\n // Cached prompt tokens bill at 10% of the input rate (F039, measured 2026-08-27:\n // an 8,810-token prefix reported 8,784 cached on the second call WITH a\n // prompt_cache_key, and 0 without one at every size up to 57k).\n // Mistral (direct, La Plateforme). Official prices from mistral.ai/pricing\n // (2026-06-04, per Christian's CD report). EU/Paris-hosted — the designated\n // GDPR-safe provider for client/personal-data workloads (see F015). NB:\n // medium-3.5 is the premium \"Vibe\" coding tier ($1.5/$7.5); Large 3 ($0.5/$1.5)\n // is the cheaper frontier general-purpose model despite the higher number.\n \"mistral:mistral-large-latest\": { inputPer1M: 0.5, cacheReadPer1M: 0.05, outputPer1M: 1.5, version: MS },\n \"mistral:mistral-large-2512\": { inputPer1M: 0.5, cacheReadPer1M: 0.05, outputPer1M: 1.5, version: MS },\n // Large 4 (F074.1), measured 2026-10-08 on docs.mistral.ai/models/mistral-large-4:\n // LIST price. The page also shows a 50% \"Public Preview\" sale ($0.68/$0.07/$2.09)\n // with no end date; booking the sale would under-report the day it ends, unseen.\n // Cached input shows as \"$0.14\": that is 10% of $1.36 rounded to cents (the sale's\n // \"$0.07\" is 0.068 the same way), and 10% is the rate measured for Mistral (F039).\n // F085.1 — Mistral News 29/10 2026 («Le Chonk»): \"Starting today, Mistral Large 4 is priced at\n // $0.70 input / M, $0.07 cached input / M, and $2.10 output / M tokens.\" Was 1.36/4.18 (8/10).\n \"mistral:mistral-large-4\": { inputPer1M: 0.7, cacheReadPer1M: 0.07, outputPer1M: 2.1, version: \"2026-10-29-mistral-news-mail\" },\n \"mistral:mistral-large-4-0\": { inputPer1M: 0.7, cacheReadPer1M: 0.07, outputPer1M: 2.1, version: \"2026-10-29-mistral-news-mail\" },\n \"mistral:mistral-medium-latest\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: MS },\n \"mistral:mistral-medium-3.5\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: MS },\n // F076.2 — Mistral's model API now lists mistral-medium-3 as an alias of Medium 3.5\n // (measured 2026-10-08), so it bills at 3.5's price, not Medium 3's $0.40/$2.00.\n \"mistral:mistral-medium-3\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n // F076.1 — Small 4 (2603) is $0.15/$0.60, measured 2026-10-08 on\n // docs.mistral.ai/models/mistral-small-4-0-26-03 AND OpenRouter's mistral-small-2603.\n // This row said $0.10/$0.30 (Small 3's price, carried over when -latest moved to\n // 2603), so the fleet's fast/cheap tiers were booked at about half their cost.\n \"mistral:mistral-small-latest\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.6, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-small-2603\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.6, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:ministral-3b-latest\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.1, version: MS },\n \"mistral:ministral-8b-latest\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.15, version: MS },\n \"mistral:ministral-14b-latest\": { inputPer1M: 0.2, cacheReadPer1M: 0.02, outputPer1M: 0.2, version: MS },\n // F076.2 — both Magistral aliases now point at the unified models (measured\n // 2026-10-08 via /v1/models): magistral-medium-latest → Medium 3.5, magistral-small-\n // latest → Small 4. They bill at those models' prices, not the old Magistral rates.\n \"mistral:magistral-medium-latest\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:magistral-small-latest\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.6, version: \"2026-10-08-docs.mistral.ai\" },\n // F076.2 — ids Mistral's model API lists for our key that had no row (a call to any\n // of them was booked at $0). Prices from docs.mistral.ai, 2026-10-08; cache-read at\n // the measured 10% (F039).\n \"mistral:mistral-vibe-cli-fast\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.6, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-medium-3-5\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-medium\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-medium-2604\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-vibe-cli-latest\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-vibe-cli-with-tools\": { inputPer1M: 1.5, cacheReadPer1M: 0.15, outputPer1M: 7.5, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:ministral-14b-2512\": { inputPer1M: 0.2, cacheReadPer1M: 0.02, outputPer1M: 0.2, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:ministral-8b-2512\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.15, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:ministral-3b-2512\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.1, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:voxtral-small-2507\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.4, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:voxtral-small-latest\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0.4, version: \"2026-10-08-docs.mistral.ai\" },\n // F085.4 — Z.ai GLM 5.3 served by Mistral. Mistral deprecation mail 2026-10-30: \"$1.4 per 1M\n // input tokens, $0.14 per 1M cached input tokens, and $4.4 per 1M output tokens\". Aliases per\n // /v1/models (measured 30/10): zai-glm-5, zai-glm-latest → zai-glm-5-3.\n \"mistral:zai-glm-5-3\": { inputPer1M: 1.4, cacheReadPer1M: 0.14, outputPer1M: 4.4, version: \"2026-10-30-mistral-deprecation-mail\" },\n \"mistral:zai-glm-5\": { inputPer1M: 1.4, cacheReadPer1M: 0.14, outputPer1M: 4.4, version: \"2026-10-30-mistral-deprecation-mail\" },\n \"mistral:zai-glm-latest\": { inputPer1M: 1.4, cacheReadPer1M: 0.14, outputPer1M: 4.4, version: \"2026-10-30-mistral-deprecation-mail\" },\n \"mistral:codestral-2508\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 0.9, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-code-latest\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 0.9, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:mistral-code-fim-latest\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 0.9, version: \"2026-10-08-docs.mistral.ai\" },\n \"mistral:devstral-latest\": { inputPer1M: 0.4, cacheReadPer1M: 0.04, outputPer1M: 2.0, version: MS },\n \"mistral:codestral-latest\": { inputPer1M: 0.3, cacheReadPer1M: 0.03, outputPer1M: 0.9, version: MS },\n \"mistral:open-mistral-nemo\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0.15, version: MS },\n // Moderation (F016.4) — per input token; output 0. (OCR is per-page in the adapter.)\n \"mistral:mistral-moderation-latest\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0, version: MS },\n \"mistral:mistral-moderation-2603\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0, version: MS }, // F077.4 pinned default\n // Embeddings (F016.5) — per input token.\n \"mistral:mistral-embed\": { inputPer1M: 0.1, cacheReadPer1M: 0.01, outputPer1M: 0, version: MS },\n \"mistral:codestral-embed\": { inputPer1M: 0.15, cacheReadPer1M: 0.015, outputPer1M: 0, version: MS },\n // F048 — reported by upmetrics as an unknown model (6 calls). Official mistral.ai/pricing.\n \"mistral:pixtral-large-latest\": { inputPer1M: 2.0, cacheReadPer1M: 0.2, outputPer1M: 6.0, version: \"2026-09-03\" },\n};\n\n/** Strip a provider's dated snapshot suffix: \"claude-haiku-4-5-20251001\" → \"claude-haiku-4-5\".\n * Returns the input unchanged when there is no suffix.\n *\n * ONE definition, used by BOTH lookups. F012 taught this rule to `getPrice` — the\n * internal cost path — and the exported catalogue never learned it, so for two years\n * `usage.costUsd` priced a dated id correctly while `getModelPrice` returned undefined\n * for the same string. Found by upmetrics, who use the catalogue and not our internals:\n * 19,456 calls of `claude-haiku-4-5-20251001` looked like an unknown model. Fixing the\n * instance and not the class is the shape; a copy of this regex in the other lookup\n * would have been the same mistake a third time. */\nexport function stripDatedSuffix(model: string): string {\n // Anthropic dates as -YYYYMMDD; OpenAI as -YYYY-MM-DD (F022.6).\n return model.replace(/-(\\d{8}|\\d{4}-\\d{2}-\\d{2})$/, \"\");\n}\n\nexport function getPrice(provider: string, model: string): PricingEntry | undefined {\n const exact = PRICING[`${provider}:${model}`];\n if (exact) return exact;\n // A real paid call must never be logged as $0 (F012).\n const base = stripDatedSuffix(model);\n if (base !== model) return PRICING[`${provider}:${base}`];\n return undefined;\n}\n"],"mappings":";AAyBA,IAAM,IAAI;AAEV,IAAM,K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EAAE,YAAY,MAAM,gBAAgB,OAAO,aAAa,MAAM,SAAS,GAAG;AAAA;AAAA,EAEvG,qCAAqC,EAAE,YAAY,KAAK,gBAAgB,MAAM,aAAa,GAAG,SAAS,GAAG;AAAA,EAC1G,mCAAmC,EAAE,YAAY,KAAK,gBAAgB,MAAM,aAAa,GAAG,SAAS,GAAG;AAAA;AAAA;AAAA,EAExG,yBAAyB,EAAE,YAAY,KAAK,gBAAgB,MAAM,aAAa,GAAG,SAAS,GAAG;AAAA,EAC9F,2BAA2B,EAAE,YAAY,MAAM,gBAAgB,OAAO,aAAa,GAAG,SAAS,GAAG;AAAA;AAAA,EAElG,gCAAgC,EAAE,YAAY,GAAK,gBAAgB,KAAK,aAAa,GAAK,SAAS,aAAa;AAClH;AAYO,SAAS,iBAAiB,OAAuB;AAEtD,SAAO,MAAM,QAAQ,+BAA+B,EAAE;AACxD;AAEO,SAAS,SAAS,UAAkB,OAAyC;AAClF,QAAM,QAAQ,QAAQ,GAAG,QAAQ,IAAI,KAAK,EAAE;AAC5C,MAAI,MAAO,QAAO;AAElB,QAAM,OAAO,iBAAiB,KAAK;AACnC,MAAI,SAAS,MAAO,QAAO,QAAQ,GAAG,QAAQ,IAAI,IAAI,EAAE;AACxD,SAAO;AACT;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1596,8 +1596,8 @@ declare const falStubAdapter: ProviderAdapter;
|
|
|
1596
1596
|
* wires the live adapters. */
|
|
1597
1597
|
declare const stubProviders: Record<string, ProviderAdapter>;
|
|
1598
1598
|
|
|
1599
|
-
declare const VERSION: "0.
|
|
1600
|
-
declare const SDK_TAG: "@broberg/ai-sdk@0.
|
|
1599
|
+
declare const VERSION: "0.78.0";
|
|
1600
|
+
declare const SDK_TAG: "@broberg/ai-sdk@0.78.0";
|
|
1601
1601
|
|
|
1602
1602
|
/** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
|
|
1603
1603
|
* per-call override.
|
|
@@ -2030,7 +2030,7 @@ declare const DEFAULT_BASE_URLS: {
|
|
|
2030
2030
|
readonly gemini: "https://generativelanguage.googleapis.com/v1beta";
|
|
2031
2031
|
readonly mistral: "https://api.mistral.ai/v1";
|
|
2032
2032
|
readonly openai: "https://api.openai.com/v1";
|
|
2033
|
-
readonly openrouter: "https://openrouter.ai/api/v1";
|
|
2033
|
+
readonly openrouter: "https://eu.openrouter.ai/api/v1";
|
|
2034
2034
|
readonly typesafe: "https://api.typesafe.ai/v1";
|
|
2035
2035
|
readonly recraft: "https://external.api.recraft.ai/v1";
|
|
2036
2036
|
};
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolveModel,
|
|
16
16
|
resolveTier,
|
|
17
17
|
setAvailability
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OFPLJSIV.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_CLIP_SEC,
|
|
21
21
|
MEDIA_PRICING,
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
listMediaPrices,
|
|
28
28
|
pricingFreshness,
|
|
29
29
|
pricingGeneratedAt
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GIRYOZQH.js";
|
|
31
31
|
import {
|
|
32
32
|
PRICING,
|
|
33
33
|
getPrice
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XKLF7UUR.js";
|
|
35
35
|
|
|
36
36
|
// src/search/brave.ts
|
|
37
37
|
async function braveSearch(req, apiKey, f) {
|
|
@@ -418,7 +418,10 @@ var DEFAULT_BASE_URLS = {
|
|
|
418
418
|
gemini: "https://generativelanguage.googleapis.com/v1beta",
|
|
419
419
|
mistral: "https://api.mistral.ai/v1",
|
|
420
420
|
openai: "https://api.openai.com/v1",
|
|
421
|
-
|
|
421
|
+
// F097 — owner 2026-11-26: «brug https://eu.openrouter.ai/api/v1 fra nu af på alle
|
|
422
|
+
// OpenRouter kald» (account on Business, EU in-region routing). Recraft images are the
|
|
423
|
+
// one deliberate exception — see OPENROUTER_GLOBAL_URL.
|
|
424
|
+
openrouter: "https://eu.openrouter.ai/api/v1",
|
|
422
425
|
// F066. US-hosted per the TypeSafe privacy policy — see region.ts.
|
|
423
426
|
typesafe: "https://api.typesafe.ai/v1",
|
|
424
427
|
// F070 — Recraft (vectorize). Residency not stated where we looked — see region.ts.
|
|
@@ -437,6 +440,7 @@ var CONFIG_DERIVED_HOSTS = {
|
|
|
437
440
|
function defaultBaseUrl(provider) {
|
|
438
441
|
return DEFAULT_BASE_URLS[provider];
|
|
439
442
|
}
|
|
443
|
+
var OPENROUTER_GLOBAL_URL = "https://openrouter.ai/api/v1";
|
|
440
444
|
|
|
441
445
|
// src/transport/http.ts
|
|
442
446
|
async function httpTransport(req) {
|
|
@@ -674,6 +678,11 @@ var HOST_REGION = {
|
|
|
674
678
|
"external.api.recraft.ai": "unknown",
|
|
675
679
|
// Aggregators: the host is theirs, the upstream is not ours to know.
|
|
676
680
|
"openrouter.ai": "unknown",
|
|
681
|
+
// F097 — OpenRouter EU in-region routing (Business plan): requests «go only to provider
|
|
682
|
+
// endpoints in Europe … never fall back to a provider outside it» (OpenRouter, 2026-11-18).
|
|
683
|
+
// A promise from a US company under its DPA, not something we can inspect — the same
|
|
684
|
+
// footing as the other host-derived "eu" rows.
|
|
685
|
+
"eu.openrouter.ai": "eu",
|
|
677
686
|
"router.requesty.ai": "unknown"
|
|
678
687
|
};
|
|
679
688
|
function regionOfHost(hostOrUrl) {
|
|
@@ -1745,7 +1754,8 @@ function openrouterAdapter(config = {}) {
|
|
|
1745
1754
|
}
|
|
1746
1755
|
if (req.seed !== void 0) body.seed = req.seed;
|
|
1747
1756
|
if (req.outputFormat !== void 0) body.output_format = req.outputFormat;
|
|
1748
|
-
const
|
|
1757
|
+
const imageBase = config.baseUrl === void 0 && req.spec.model.startsWith("recraft/") ? OPENROUTER_GLOBAL_URL : baseUrl;
|
|
1758
|
+
const res = await doFetch(`${imageBase}/images`, {
|
|
1749
1759
|
method: "POST",
|
|
1750
1760
|
headers: {
|
|
1751
1761
|
"content-type": "application/json",
|
|
@@ -1768,6 +1778,8 @@ function openrouterAdapter(config = {}) {
|
|
|
1768
1778
|
model: req.spec.model,
|
|
1769
1779
|
transport: "http",
|
|
1770
1780
|
capability: "image",
|
|
1781
|
+
region: regionOfHost(imageBase),
|
|
1782
|
+
// F097 — EU default → "eu"; the Recraft exception → "unknown"
|
|
1771
1783
|
inputTokens: 0,
|
|
1772
1784
|
outputTokens: 0
|
|
1773
1785
|
});
|
|
@@ -3892,7 +3904,8 @@ var SECOND_OPINION_PANEL = [
|
|
|
3892
3904
|
{ label: "OpenAI GPT-6.1 Sol", provider: "openrouter", model: "openai/gpt-6.1-sol" },
|
|
3893
3905
|
{ label: "Google Gemini 4 Argon", provider: "gemini", model: "gemini-4-argon" },
|
|
3894
3906
|
{ label: "Mistral Large 4", provider: "mistral", model: "mistral-large-4-0" },
|
|
3895
|
-
{ label: "DeepSeek V4
|
|
3907
|
+
{ label: "DeepSeek V4 Flash 0731", provider: "openrouter", model: "deepseek/deepseek-v4-flash-0731" }
|
|
3908
|
+
// F097 — the EU-served DeepSeek
|
|
3896
3909
|
];
|
|
3897
3910
|
var SECOND_OPINION_SYNTH = {
|
|
3898
3911
|
label: "Opsummering (Mistral Large 4)",
|
|
@@ -4578,8 +4591,8 @@ var aiConfigSchema = z.object({
|
|
|
4578
4591
|
import { randomUUID } from "crypto";
|
|
4579
4592
|
|
|
4580
4593
|
// src/version.ts
|
|
4581
|
-
var VERSION = "0.
|
|
4582
|
-
var SDK_TAG = "@broberg/ai-sdk@0.
|
|
4594
|
+
var VERSION = "0.78.0";
|
|
4595
|
+
var SDK_TAG = "@broberg/ai-sdk@0.78.0";
|
|
4583
4596
|
|
|
4584
4597
|
// src/cost/sinks/upmetrics.ts
|
|
4585
4598
|
function isRetryableStatus(status) {
|