@agentproto/model-catalog 0.9.2 → 0.9.4

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.
@@ -1,7 +1,7 @@
1
- export { evaluateAccess, evaluateCatalogDefaults } from '../chunk-QDQWHWDU.mjs';
2
- import '../chunk-AJLMLBEZ.mjs';
1
+ export { evaluateAccess, evaluateCatalogDefaults } from '../chunk-5XUA72EH.mjs';
2
+ import '../chunk-H467PHUU.mjs';
3
3
  import '../chunk-ZTTWZ7PL.mjs';
4
- import '../chunk-OH37WKVA.mjs';
4
+ import '../chunk-6VUL4I7V.mjs';
5
5
  import '../chunk-QHELXPSL.mjs';
6
6
  //# sourceMappingURL=index.mjs.map
7
7
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import { modelMatchesPriceTier, modelHasTag } from './chunk-AJLMLBEZ.mjs';
1
+ import { modelMatchesPriceTier, modelHasTag } from './chunk-H467PHUU.mjs';
2
2
 
3
3
  /**
4
4
  * @agentproto/model-catalog v0.1.0
@@ -112,5 +112,5 @@ function evaluateAccess(input) {
112
112
  }
113
113
 
114
114
  export { evaluateAccess, evaluateCatalogDefaults };
115
- //# sourceMappingURL=chunk-QDQWHWDU.mjs.map
116
- //# sourceMappingURL=chunk-QDQWHWDU.mjs.map
115
+ //# sourceMappingURL=chunk-5XUA72EH.mjs.map
116
+ //# sourceMappingURL=chunk-5XUA72EH.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/access/catalog-defaults.ts","../src/access/evaluate.ts"],"names":[],"mappings":";;;;;;;;;AAmBO,SAAS,wBACd,KAAA,EACwB;AACxB,EAAA,QAAQ,MAAM,IAAA;AAAM,IAClB,KAAK,OAAA;AACH,MAAA,OAAO,KAAA,CAAM,GAAA,CAAI,YAAA,GACb,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,+BAAA,EAAgC,GACzD,EAAE,OAAA,EAAS,KAAA,EAAO,QAAQ,8BA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AwB,KAAK,CAAA;AAC9C,EAAA,OAAO,EAAE,OAAA,EAAS,QAAA,CAAS,OAAA,EAAS,MAAA,EAAQ,SAAS,MAAA,EAAO;AAC9D","file":"chunk-QDQWHWDU.mjs","sourcesContent":["/**\n * Catalog-flag defaults — the layer that runs before any workspace\n * override. Mirrors the access-control plan:\n * - Default-allow: `lifecycle = stable && agentVisible = true`\n * - Default-block: `lifecycle = preview` or `lifecycle = deprecated`\n * - Default-block: any model with `agentVisible = false`\n *\n * Legacy catalog data (image/video) carries `agentVisible` but not\n * `lifecycle` — until v2 normalization, lifecycle defaults to \"stable\"\n * for every entry. LLM and audio entries default to allow (curated).\n */\n\nimport type { ResolvedModel } from \"../registry/index.js\"\n\nexport interface CatalogDefaultDecision {\n allowed: boolean\n reason: string\n}\n\nexport function evaluateCatalogDefaults(\n model: ResolvedModel\n): CatalogDefaultDecision {\n switch (model.kind) {\n case \"image\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"video\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"llm\":\n // LLM entries are curated — every catalog entry is visible.\n return { allowed: true, reason: \"catalog-default:llm-curated\" }\n case \"audio\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"voice\":\n // Voice metadata catalog is curated.\n return { allowed: true, reason: \"catalog-default:voice-curated\" }\n }\n}\n","/**\n * Access evaluator — resolves whether a workspace can use a given model.\n *\n * Resolution order:\n * 1. App scope — if the app opts out of the model's kind, deny.\n * 2. Workspace explicit `model:<id>` rule — terminal allow or block.\n * 3. Workspace tag / provider / priceTier / kind rules — most-specific\n * band wins. Within a band, block wins. Specificity ladder:\n * tag (4) > provider (3) > priceTier (2) > kind (1).\n * Rationale: an explicit `allow tag:image:generate` should beat a\n * blanket `block kind:llm`. The tag rule is the more specific\n * intent and reflects the operator's allowlist.\n * 4. Catalog defaults — `lifecycle=stable && agentVisible=true` → allow.\n *\n * BYOK relaxation: when `byokActive`, `priceTier=premium` blocks are\n * bypassed (BYOK users pay providers directly). NSFW / compliance\n * blocks NEVER bypass.\n */\n\nimport type { ResolvedModel } from \"../registry/index.js\"\nimport { modelHasTag, modelMatchesPriceTier } from \"../enrichment/index.js\"\nimport { evaluateCatalogDefaults } from \"./catalog-defaults.js\"\nimport type { AccessRule, AppScope } from \"./types.js\"\n\n/**\n * Specificity of non-model rule targets. Higher = more specific.\n * Most-specific band wins; within a band, block wins.\n *\n * Mirrors the scope specificity logic in\n * `packages/core/src/domain/model-access/types.ts:79`.\n */\nconst NON_MODEL_SPECIFICITY: Record<\n \"tag\" | \"provider\" | \"priceTier\" | \"kind\",\n number\n> = {\n tag: 4,\n provider: 3,\n priceTier: 2,\n kind: 1,\n}\n\nexport interface AccessEvalInput {\n model: ResolvedModel\n appScope?: AppScope\n /** Workspace overrides; v1 callers pass `[]`. */\n rules?: AccessRule[]\n byokActive?: boolean\n}\n\nexport interface AccessDecision {\n allowed: boolean\n /** Stable token for logs/metrics. */\n reason: string\n}\n\nconst NSFW_TAG_BLOCK_REASONS = new Set([\"nsfw\", \"compliance\"])\n\n/**\n * Returns true iff the rule matches the resolved model.\n *\n * Tag and priceTier matching go through the enrichment layer\n * (`@agentproto/model-catalog/enrichment`) — explicit per-model\n * enrichment wins, heuristic fallback fills the rest.\n */\nfunction ruleMatches(rule: AccessRule, model: ResolvedModel): boolean {\n const target = rule.target\n switch (target.kind) {\n case \"model\":\n return target.id === model.id\n case \"kind\":\n return target.value === model.kind\n case \"provider\": {\n switch (model.kind) {\n case \"image\":\n return model.def.provider === target.value\n case \"video\":\n return model.def.provider === target.value\n case \"audio\":\n return model.def.provider === target.value\n case \"voice\":\n return model.voice.provider === target.value\n case \"llm\":\n // No provider field on LLM entries — best-effort by canonical id\n // structure. All LLM ids follow `<vendor>/…` or\n // `<router>/<vendor>/…` conventions, so check for an exact\n // prefix segment or an interior `/<vendor>/` segment.\n // NOTE: avoid plain `.includes(target.value)` — it would\n // false-positive on any id that merely *contains* the substring\n // (e.g. \"not-google/…\" matching provider \"google\").\n // A `<router>/<vendor>/…` id (e.g. `openrouter/anthropic/…`) can\n // match BOTH a `router` and a `vendor` provider rule — that is\n // intentional; band resolution (most-specific wins) reconciles it.\n return (\n model.canonicalId.startsWith(`${target.value}/`) ||\n model.canonicalId.includes(`/${target.value}/`)\n )\n }\n }\n case \"tag\":\n return modelHasTag(model, target.value)\n case \"priceTier\":\n return modelMatchesPriceTier(model, target.value)\n }\n}\n\nexport function evaluateAccess(input: AccessEvalInput): AccessDecision {\n const { model, appScope, rules = [], byokActive = false } = input\n\n // 1. App scope. `voice` rows are metadata, not callable models — they\n // bypass kind-scope checks (gating happens on the audio MODEL the\n // voice plays through).\n if (\n appScope &&\n appScope.kinds.length > 0 &&\n model.kind !== \"voice\" &&\n !appScope.kinds.includes(model.kind)\n ) {\n return {\n allowed: false,\n reason: `app-scope:kind-not-allowed:${model.kind}`,\n }\n }\n\n // 2. Explicit per-model rules. Most specific band — terminal if any\n // matches. Within the band, block wins over allow (so a workspace\n // `block model:X` beats a tier-policy `allow model:X` regardless of\n // the order they appear in the merged rule list).\n const modelMatches = rules.filter(\n r =>\n r.target.kind === \"model\" && (r.target as { id: string }).id === model.id\n )\n if (modelMatches.length > 0) {\n const winner =\n modelMatches.find(r => r.effect === \"block\") ?? modelMatches[0]!\n return {\n allowed: winner.effect === \"allow\",\n reason: `rule:model:${winner.effect}${winner.reason ? `:${winner.reason}` : \"\"}`,\n }\n }\n\n // 3. Tag / provider / priceTier / kind rules. Most-specific band wins;\n // within a band, block wins. BYOK relaxation drops priceTier=premium\n // blocks before specificity grouping.\n const matchedByBand = new Map<number, AccessRule[]>()\n for (const rule of rules) {\n const k = rule.target.kind\n if (k === \"model\") continue\n if (!ruleMatches(rule, model)) continue\n if (rule.effect === \"block\") {\n // BYOK relaxation — same condition as before the refactor.\n if (\n byokActive &&\n rule.target.kind === \"priceTier\" &&\n rule.target.value === \"premium\" &&\n !NSFW_TAG_BLOCK_REASONS.has(rule.reason ?? \"\")\n ) {\n continue\n }\n }\n const band = NON_MODEL_SPECIFICITY[k]\n const list = matchedByBand.get(band) ?? []\n list.push(rule)\n matchedByBand.set(band, list)\n }\n\n if (matchedByBand.size > 0) {\n // Walk bands from most-specific to least-specific. The first band\n // with any matching rule decides — block wins within the band.\n const bands = Array.from(matchedByBand.keys()).sort((a, b) => b - a)\n for (const band of bands) {\n const bandRules = matchedByBand.get(band)!\n const blocked = bandRules.find(r => r.effect === \"block\")\n const allowed = bandRules.find(r => r.effect === \"allow\")\n const winner = blocked ?? allowed\n if (!winner) continue\n const t = winner.target\n const targetStr =\n t.kind === \"model\"\n ? `model:${(t as { id: string }).id}`\n : `${t.kind}:${(t as { value: string }).value}`\n const tail = winner.reason ? `:${winner.reason}` : \"\"\n return {\n allowed: winner.effect === \"allow\",\n reason: `rule:${targetStr}:${winner.effect}${tail}`,\n }\n }\n }\n\n // 4. Catalog defaults.\n const fallback = evaluateCatalogDefaults(model)\n return { allowed: fallback.allowed, reason: fallback.reason }\n}\n"]}
1
+ {"version":3,"sources":["../src/access/catalog-defaults.ts","../src/access/evaluate.ts"],"names":[],"mappings":";;;;;;;;;AAmBO,SAAS,wBACd,KAAA,EACwB;AACxB,EAAA,QAAQ,MAAM,IAAA;AAAM,IAClB,KAAK,OAAA;AACH,MAAA,OAAO,KAAA,CAAM,GAAA,CAAI,YAAA,GACb,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ,+BAAA,EAAgC,GACzD,EAAE,OAAA,EAAS,KAAA,EAAO,QAAQ,8BAAA,EAA+B;AAAA,IAC/D,KAAK,OAAA;AACH,MAAA,OAAO,KAAA,CAAM,GAAA,CAAI,YAAA,GACb,EAAE,OAAA,EAAS,IAAA,EAAM,MAAA,EAAQ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A72EH.mjs","sourcesContent":["/**\n * Catalog-flag defaults — the layer that runs before any workspace\n * override. Mirrors the access-control plan:\n * - Default-allow: `lifecycle = stable && agentVisible = true`\n * - Default-block: `lifecycle = preview` or `lifecycle = deprecated`\n * - Default-block: any model with `agentVisible = false`\n *\n * Legacy catalog data (image/video) carries `agentVisible` but not\n * `lifecycle` — until v2 normalization, lifecycle defaults to \"stable\"\n * for every entry. LLM and audio entries default to allow (curated).\n */\n\nimport type { ResolvedModel } from \"../registry/index.js\"\n\nexport interface CatalogDefaultDecision {\n allowed: boolean\n reason: string\n}\n\nexport function evaluateCatalogDefaults(\n model: ResolvedModel\n): CatalogDefaultDecision {\n switch (model.kind) {\n case \"image\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"video\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"llm\":\n // LLM entries are curated — every catalog entry is visible.\n return { allowed: true, reason: \"catalog-default:llm-curated\" }\n case \"audio\":\n return model.def.agentVisible\n ? { allowed: true, reason: \"catalog-default:agent-visible\" }\n : { allowed: false, reason: \"catalog-default:agent-hidden\" }\n case \"voice\":\n // Voice metadata catalog is curated.\n return { allowed: true, reason: \"catalog-default:voice-curated\" }\n }\n}\n","/**\n * Access evaluator — resolves whether a workspace can use a given model.\n *\n * Resolution order:\n * 1. App scope — if the app opts out of the model's kind, deny.\n * 2. Workspace explicit `model:<id>` rule — terminal allow or block.\n * 3. Workspace tag / provider / priceTier / kind rules — most-specific\n * band wins. Within a band, block wins. Specificity ladder:\n * tag (4) > provider (3) > priceTier (2) > kind (1).\n * Rationale: an explicit `allow tag:image:generate` should beat a\n * blanket `block kind:llm`. The tag rule is the more specific\n * intent and reflects the operator's allowlist.\n * 4. Catalog defaults — `lifecycle=stable && agentVisible=true` → allow.\n *\n * BYOK relaxation: when `byokActive`, `priceTier=premium` blocks are\n * bypassed (BYOK users pay providers directly). NSFW / compliance\n * blocks NEVER bypass.\n */\n\nimport type { ResolvedModel } from \"../registry/index.js\"\nimport { modelHasTag, modelMatchesPriceTier } from \"../enrichment/index.js\"\nimport { evaluateCatalogDefaults } from \"./catalog-defaults.js\"\nimport type { AccessRule, AppScope } from \"./types.js\"\n\n/**\n * Specificity of non-model rule targets. Higher = more specific.\n * Most-specific band wins; within a band, block wins.\n *\n * Mirrors the scope specificity logic in\n * `packages/core/src/domain/model-access/types.ts:79`.\n */\nconst NON_MODEL_SPECIFICITY: Record<\n \"tag\" | \"provider\" | \"priceTier\" | \"kind\",\n number\n> = {\n tag: 4,\n provider: 3,\n priceTier: 2,\n kind: 1,\n}\n\nexport interface AccessEvalInput {\n model: ResolvedModel\n appScope?: AppScope\n /** Workspace overrides; v1 callers pass `[]`. */\n rules?: AccessRule[]\n byokActive?: boolean\n}\n\nexport interface AccessDecision {\n allowed: boolean\n /** Stable token for logs/metrics. */\n reason: string\n}\n\nconst NSFW_TAG_BLOCK_REASONS = new Set([\"nsfw\", \"compliance\"])\n\n/**\n * Returns true iff the rule matches the resolved model.\n *\n * Tag and priceTier matching go through the enrichment layer\n * (`@agentproto/model-catalog/enrichment`) — explicit per-model\n * enrichment wins, heuristic fallback fills the rest.\n */\nfunction ruleMatches(rule: AccessRule, model: ResolvedModel): boolean {\n const target = rule.target\n switch (target.kind) {\n case \"model\":\n return target.id === model.id\n case \"kind\":\n return target.value === model.kind\n case \"provider\": {\n switch (model.kind) {\n case \"image\":\n return model.def.provider === target.value\n case \"video\":\n return model.def.provider === target.value\n case \"audio\":\n return model.def.provider === target.value\n case \"voice\":\n return model.voice.provider === target.value\n case \"llm\":\n // No provider field on LLM entries — best-effort by canonical id\n // structure. All LLM ids follow `<vendor>/…` or\n // `<router>/<vendor>/…` conventions, so check for an exact\n // prefix segment or an interior `/<vendor>/` segment.\n // NOTE: avoid plain `.includes(target.value)` — it would\n // false-positive on any id that merely *contains* the substring\n // (e.g. \"not-google/…\" matching provider \"google\").\n // A `<router>/<vendor>/…` id (e.g. `openrouter/anthropic/…`) can\n // match BOTH a `router` and a `vendor` provider rule — that is\n // intentional; band resolution (most-specific wins) reconciles it.\n return (\n model.canonicalId.startsWith(`${target.value}/`) ||\n model.canonicalId.includes(`/${target.value}/`)\n )\n }\n }\n case \"tag\":\n return modelHasTag(model, target.value)\n case \"priceTier\":\n return modelMatchesPriceTier(model, target.value)\n }\n}\n\nexport function evaluateAccess(input: AccessEvalInput): AccessDecision {\n const { model, appScope, rules = [], byokActive = false } = input\n\n // 1. App scope. `voice` rows are metadata, not callable models — they\n // bypass kind-scope checks (gating happens on the audio MODEL the\n // voice plays through).\n if (\n appScope &&\n appScope.kinds.length > 0 &&\n model.kind !== \"voice\" &&\n !appScope.kinds.includes(model.kind)\n ) {\n return {\n allowed: false,\n reason: `app-scope:kind-not-allowed:${model.kind}`,\n }\n }\n\n // 2. Explicit per-model rules. Most specific band — terminal if any\n // matches. Within the band, block wins over allow (so a workspace\n // `block model:X` beats a tier-policy `allow model:X` regardless of\n // the order they appear in the merged rule list).\n const modelMatches = rules.filter(\n r =>\n r.target.kind === \"model\" && (r.target as { id: string }).id === model.id\n )\n if (modelMatches.length > 0) {\n const winner =\n modelMatches.find(r => r.effect === \"block\") ?? modelMatches[0]!\n return {\n allowed: winner.effect === \"allow\",\n reason: `rule:model:${winner.effect}${winner.reason ? `:${winner.reason}` : \"\"}`,\n }\n }\n\n // 3. Tag / provider / priceTier / kind rules. Most-specific band wins;\n // within a band, block wins. BYOK relaxation drops priceTier=premium\n // blocks before specificity grouping.\n const matchedByBand = new Map<number, AccessRule[]>()\n for (const rule of rules) {\n const k = rule.target.kind\n if (k === \"model\") continue\n if (!ruleMatches(rule, model)) continue\n if (rule.effect === \"block\") {\n // BYOK relaxation — same condition as before the refactor.\n if (\n byokActive &&\n rule.target.kind === \"priceTier\" &&\n rule.target.value === \"premium\" &&\n !NSFW_TAG_BLOCK_REASONS.has(rule.reason ?? \"\")\n ) {\n continue\n }\n }\n const band = NON_MODEL_SPECIFICITY[k]\n const list = matchedByBand.get(band) ?? []\n list.push(rule)\n matchedByBand.set(band, list)\n }\n\n if (matchedByBand.size > 0) {\n // Walk bands from most-specific to least-specific. The first band\n // with any matching rule decides — block wins within the band.\n const bands = Array.from(matchedByBand.keys()).sort((a, b) => b - a)\n for (const band of bands) {\n const bandRules = matchedByBand.get(band)!\n const blocked = bandRules.find(r => r.effect === \"block\")\n const allowed = bandRules.find(r => r.effect === \"allow\")\n const winner = blocked ?? allowed\n if (!winner) continue\n const t = winner.target\n const targetStr =\n t.kind === \"model\"\n ? `model:${(t as { id: string }).id}`\n : `${t.kind}:${(t as { value: string }).value}`\n const tail = winner.reason ? `:${winner.reason}` : \"\"\n return {\n allowed: winner.effect === \"allow\",\n reason: `rule:${targetStr}:${winner.effect}${tail}`,\n }\n }\n }\n\n // 4. Catalog defaults.\n const fallback = evaluateCatalogDefaults(model)\n return { allowed: fallback.allowed, reason: fallback.reason }\n}\n"]}
@@ -433,16 +433,17 @@ var OPENROUTER_ROUTES = {
433
433
  provider: "openrouter"
434
434
  },
435
435
  "deepseek/deepseek-chat-v3-0324": {
436
- inputPer1M: 0.25,
437
- outputPer1M: 1,
436
+ inputPer1M: 0.29,
437
+ outputPer1M: 1.14,
438
+ cacheReadMultiplier: 0.37931,
438
439
  addedAt: "2025-03-24",
439
440
  vendor: "deepseek",
440
441
  provider: "openrouter"
441
442
  },
442
443
  "deepseek/deepseek-chat-v3.1": {
443
- inputPer1M: 0.55,
444
- outputPer1M: 1.65,
445
- cacheReadMultiplier: 1,
444
+ inputPer1M: 0.25,
445
+ outputPer1M: 0.95,
446
+ cacheReadMultiplier: 0.52,
446
447
  addedAt: "2025-08-21",
447
448
  vendor: "deepseek",
448
449
  provider: "openrouter"
@@ -493,8 +494,8 @@ var OPENROUTER_ROUTES = {
493
494
  provider: "openrouter"
494
495
  },
495
496
  "deepseek/deepseek-v4-flash": {
496
- inputPer1M: 0.08386,
497
- outputPer1M: 0.16772,
497
+ inputPer1M: 0.08246,
498
+ outputPer1M: 0.16492,
498
499
  cacheReadMultiplier: 0.2,
499
500
  addedAt: "2026-04-24",
500
501
  vendor: "deepseek",
@@ -509,9 +510,9 @@ var OPENROUTER_ROUTES = {
509
510
  provider: "openrouter"
510
511
  },
511
512
  "deepseek/deepseek-v4-flash-0731:batch": {
512
- inputPer1M: 0.14,
513
- outputPer1M: 0.28,
514
- cacheReadMultiplier: 0.214286,
513
+ inputPer1M: 0.11,
514
+ outputPer1M: 0.33,
515
+ cacheReadMultiplier: 0.031818,
515
516
  addedAt: "2026-07-31",
516
517
  vendor: "deepseek",
517
518
  provider: "openrouter"
@@ -524,9 +525,17 @@ var OPENROUTER_ROUTES = {
524
525
  vendor: "deepseek",
525
526
  provider: "openrouter"
526
527
  },
528
+ "deepseek/deepseek-v4-flash-vision-exp:batch": {
529
+ inputPer1M: 0.11,
530
+ outputPer1M: 0.33,
531
+ cacheReadMultiplier: 0.031818,
532
+ addedAt: "2026-08-21",
533
+ vendor: "deepseek",
534
+ provider: "openrouter"
535
+ },
527
536
  "deepseek/deepseek-v4-pro": {
528
- inputPer1M: 0.819366,
529
- outputPer1M: 1.638732,
537
+ inputPer1M: 0.942906,
538
+ outputPer1M: 1.885812,
530
539
  cacheReadMultiplier: 0.083334,
531
540
  addedAt: "2026-04-24",
532
541
  vendor: "deepseek",
@@ -535,15 +544,15 @@ var OPENROUTER_ROUTES = {
535
544
  "deepseek/deepseek-v4-pro-0813": {
536
545
  inputPer1M: 0.57948,
537
546
  outputPer1M: 1.73844,
538
- cacheReadMultiplier: 0.033333,
547
+ cacheReadMultiplier: 0.1,
539
548
  addedAt: "2026-08-12",
540
549
  vendor: "deepseek",
541
550
  provider: "openrouter"
542
551
  },
543
552
  "deepseek/deepseek-v4-pro-0813:batch": {
544
- inputPer1M: 1.32,
545
- outputPer1M: 3.96,
546
- cacheReadMultiplier: 0.098485,
553
+ inputPer1M: 0.66,
554
+ outputPer1M: 1.98,
555
+ cacheReadMultiplier: 0.033333,
547
556
  addedAt: "2026-08-12",
548
557
  vendor: "deepseek",
549
558
  provider: "openrouter"
@@ -901,11 +910,11 @@ var OPENROUTER_ROUTES = {
901
910
  vendor: "inception",
902
911
  provider: "openrouter"
903
912
  },
904
- "inception/mercury-2.5-preview": {
913
+ "inception/mercury-2.5": {
905
914
  inputPer1M: 0.04,
906
915
  outputPer1M: 0.15,
907
916
  cacheReadMultiplier: 0.1,
908
- addedAt: "2026-08-31",
917
+ addedAt: "2026-09-08",
909
918
  vendor: "inception",
910
919
  provider: "openrouter"
911
920
  },
@@ -1022,8 +1031,8 @@ var OPENROUTER_ROUTES = {
1022
1031
  provider: "openrouter"
1023
1032
  },
1024
1033
  "meta/muse-glimmer-30b:batch": {
1025
- inputPer1M: 0.35,
1026
- outputPer1M: 1.5,
1034
+ inputPer1M: 0.175,
1035
+ outputPer1M: 0.75,
1027
1036
  cacheReadMultiplier: 0.114286,
1028
1037
  addedAt: "2026-08-09",
1029
1038
  vendor: "meta",
@@ -1091,7 +1100,7 @@ var OPENROUTER_ROUTES = {
1091
1100
  provider: "openrouter"
1092
1101
  },
1093
1102
  "minimax/minimax-m1": {
1094
- inputPer1M: 0.55,
1103
+ inputPer1M: 0.4,
1095
1104
  outputPer1M: 2.2,
1096
1105
  addedAt: "2025-06-17",
1097
1106
  vendor: "minimax",
@@ -1345,9 +1354,9 @@ var OPENROUTER_ROUTES = {
1345
1354
  provider: "openrouter"
1346
1355
  },
1347
1356
  "moonshotai/kimi-k2.7-code": {
1348
- inputPer1M: 0.66,
1349
- outputPer1M: 3.4,
1350
- cacheReadMultiplier: 0.272727,
1357
+ inputPer1M: 0.71,
1358
+ outputPer1M: 3.5,
1359
+ cacheReadMultiplier: 0.211268,
1351
1360
  addedAt: "2026-06-12",
1352
1361
  vendor: "moonshotai",
1353
1362
  provider: "openrouter"
@@ -1382,22 +1391,6 @@ var OPENROUTER_ROUTES = {
1382
1391
  vendor: "morph",
1383
1392
  provider: "openrouter"
1384
1393
  },
1385
- "nex-agi/nex-n2-mini": {
1386
- inputPer1M: 0.025,
1387
- outputPer1M: 0.1,
1388
- cacheReadMultiplier: 0.1,
1389
- addedAt: "2026-06-24",
1390
- vendor: "nex-agi",
1391
- provider: "openrouter"
1392
- },
1393
- "nex-agi/nex-n2-pro": {
1394
- inputPer1M: 0.25,
1395
- outputPer1M: 1,
1396
- cacheReadMultiplier: 0.1,
1397
- addedAt: "2026-06-08",
1398
- vendor: "nex-agi",
1399
- provider: "openrouter"
1400
- },
1401
1394
  "nousresearch/hermes-3-llama-3.1-405b": {
1402
1395
  inputPer1M: 1,
1403
1396
  outputPer1M: 1,
@@ -2334,8 +2327,8 @@ var OPENROUTER_ROUTES = {
2334
2327
  provider: "openrouter"
2335
2328
  },
2336
2329
  "qwen/qwen3-14b": {
2337
- inputPer1M: 0.12,
2338
- outputPer1M: 0.24,
2330
+ inputPer1M: 0.2275,
2331
+ outputPer1M: 0.91,
2339
2332
  addedAt: "2025-04-28",
2340
2333
  vendor: "qwen",
2341
2334
  provider: "openrouter"
@@ -3031,9 +3024,8 @@ var OPENROUTER_ROUTES = {
3031
3024
  provider: "openrouter"
3032
3025
  },
3033
3026
  "z-ai/glm-4.7-flash": {
3034
- inputPer1M: 0.06,
3027
+ inputPer1M: 0.0605,
3035
3028
  outputPer1M: 0.4,
3036
- cacheReadMultiplier: 0.166667,
3037
3029
  addedAt: "2026-01-19",
3038
3030
  vendor: "z-ai",
3039
3031
  provider: "openrouter"
@@ -3070,10 +3062,18 @@ var OPENROUTER_ROUTES = {
3070
3062
  vendor: "z-ai",
3071
3063
  provider: "openrouter"
3072
3064
  },
3065
+ "z-ai/glm-5.2:batch": {
3066
+ inputPer1M: 0.7,
3067
+ outputPer1M: 2.2,
3068
+ cacheReadMultiplier: 0.1,
3069
+ addedAt: "2026-06-16",
3070
+ vendor: "z-ai",
3071
+ provider: "openrouter"
3072
+ },
3073
3073
  "z-ai/glm-5.3": {
3074
3074
  inputPer1M: 1.4,
3075
3075
  outputPer1M: 4.4,
3076
- cacheReadMultiplier: 0.1,
3076
+ cacheReadMultiplier: 0.185714,
3077
3077
  addedAt: "2026-08-18",
3078
3078
  vendor: "z-ai",
3079
3079
  provider: "openrouter"
@@ -3087,13 +3087,21 @@ var OPENROUTER_ROUTES = {
3087
3087
  provider: "openrouter"
3088
3088
  },
3089
3089
  "z-ai/glm-5.3-flash:batch": {
3090
- inputPer1M: 0.15,
3091
- outputPer1M: 0.5,
3090
+ inputPer1M: 0.075,
3091
+ outputPer1M: 0.25,
3092
3092
  cacheReadMultiplier: 0.2,
3093
3093
  addedAt: "2026-08-26",
3094
3094
  vendor: "z-ai",
3095
3095
  provider: "openrouter"
3096
3096
  },
3097
+ "z-ai/glm-5.3:batch": {
3098
+ inputPer1M: 0.7,
3099
+ outputPer1M: 2.2,
3100
+ cacheReadMultiplier: 0.185714,
3101
+ addedAt: "2026-08-18",
3102
+ vendor: "z-ai",
3103
+ provider: "openrouter"
3104
+ },
3097
3105
  "z-ai/glm-5v-turbo": {
3098
3106
  inputPer1M: 1.2,
3099
3107
  outputPer1M: 4,
@@ -3139,9 +3147,9 @@ var OPENROUTER_ROUTES = {
3139
3147
  provider: "openrouter"
3140
3148
  },
3141
3149
  "~deepseek/deepseek-v4-flash-latest": {
3142
- inputPer1M: 0.04998,
3143
- outputPer1M: 0.09996,
3144
- cacheReadMultiplier: 0.2,
3150
+ inputPer1M: 0.05,
3151
+ outputPer1M: 0.16,
3152
+ cacheReadMultiplier: 0.26,
3145
3153
  addedAt: "2026-08-01",
3146
3154
  vendor: "~deepseek",
3147
3155
  provider: "openrouter"
@@ -3206,9 +3214,9 @@ var OPENROUTER_ROUTES = {
3206
3214
  provider: "openrouter"
3207
3215
  },
3208
3216
  "~z-ai/glm-latest": {
3209
- inputPer1M: 1.15,
3210
- outputPer1M: 3.5,
3211
- cacheReadMultiplier: 0.086957,
3217
+ inputPer1M: 1.113,
3218
+ outputPer1M: 3.498,
3219
+ cacheReadMultiplier: 0.185714,
3212
3220
  addedAt: "2026-08-19",
3213
3221
  vendor: "~z-ai",
3214
3222
  provider: "openrouter"
@@ -3895,5 +3903,5 @@ function getCacheStats(modelId, usage, opts) {
3895
3903
  }
3896
3904
 
3897
3905
  export { DEFAULT_PRICING, LLM_PRICING_CATALOG, MODEL_ALIASES, OPENROUTER_ROUTES, calculateLLMCreditCost, getCacheStats, getModelProvider, isKnownLlmId, listNativeModelIds, listUnpricedKnownLlmIds, resolveAlias, resolveContextWindow, resolveModelRoute, resolvePricing, resolvePricingExact };
3898
- //# sourceMappingURL=chunk-OH37WKVA.mjs.map
3899
- //# sourceMappingURL=chunk-OH37WKVA.mjs.map
3906
+ //# sourceMappingURL=chunk-6VUL4I7V.mjs.map
3907
+ //# sourceMappingURL=chunk-6VUL4I7V.mjs.map