@trazum/core 2.7.11 → 3.0.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.
Files changed (115) hide show
  1. package/README.md +1 -1
  2. package/dist/advisories.d.ts +14 -7
  3. package/dist/advisories.d.ts.map +1 -1
  4. package/dist/advisories.js +27 -20
  5. package/dist/advisories.js.map +1 -1
  6. package/dist/budget.d.ts.map +1 -1
  7. package/dist/budget.js +2 -1
  8. package/dist/budget.js.map +1 -1
  9. package/dist/connector.js +1 -1
  10. package/dist/connector.js.map +1 -1
  11. package/dist/conversation.d.ts.map +1 -1
  12. package/dist/conversation.js +4 -2
  13. package/dist/conversation.js.map +1 -1
  14. package/dist/i18n/en.js +2 -2
  15. package/dist/i18n/en.js.map +1 -1
  16. package/dist/i18n/es.js +2 -2
  17. package/dist/i18n/es.js.map +1 -1
  18. package/dist/i18n/types.d.ts +2 -1
  19. package/dist/i18n/types.d.ts.map +1 -1
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +2 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/input-shape.d.ts.map +1 -1
  25. package/dist/input-shape.js +4 -2
  26. package/dist/input-shape.js.map +1 -1
  27. package/dist/openrouter.d.ts +1 -1
  28. package/dist/openrouter.d.ts.map +1 -1
  29. package/dist/openrouter.js +1 -2
  30. package/dist/openrouter.js.map +1 -1
  31. package/dist/phrases.d.ts +39 -0
  32. package/dist/phrases.d.ts.map +1 -1
  33. package/dist/phrases.js +130 -0
  34. package/dist/phrases.js.map +1 -1
  35. package/dist/pricing-overlay.d.ts +1 -1
  36. package/dist/pricing-overlay.d.ts.map +1 -1
  37. package/dist/pricing-overlay.js +21 -11
  38. package/dist/pricing-overlay.js.map +1 -1
  39. package/dist/pricing.d.ts +33 -6
  40. package/dist/pricing.d.ts.map +1 -1
  41. package/dist/pricing.js +77 -115
  42. package/dist/pricing.js.map +1 -1
  43. package/dist/repeats.d.ts.map +1 -1
  44. package/dist/repeats.js +4 -2
  45. package/dist/repeats.js.map +1 -1
  46. package/dist/reprice.js +1 -1
  47. package/dist/reprice.js.map +1 -1
  48. package/dist/review.js +2 -1
  49. package/dist/review.js.map +1 -1
  50. package/dist/rules.d.ts.map +1 -1
  51. package/dist/rules.js +119 -3
  52. package/dist/rules.js.map +1 -1
  53. package/dist/segment.d.ts +31 -1
  54. package/dist/segment.d.ts.map +1 -1
  55. package/dist/segment.js +128 -2
  56. package/dist/segment.js.map +1 -1
  57. package/dist/session-cost.d.ts.map +1 -1
  58. package/dist/session-cost.js +4 -2
  59. package/dist/session-cost.js.map +1 -1
  60. package/dist/session-ledger.d.ts.map +1 -1
  61. package/dist/session-ledger.js +4 -2
  62. package/dist/session-ledger.js.map +1 -1
  63. package/dist/structure.d.ts +34 -0
  64. package/dist/structure.d.ts.map +1 -1
  65. package/dist/structure.js +143 -12
  66. package/dist/structure.js.map +1 -1
  67. package/dist/truncation-retry.d.ts.map +1 -1
  68. package/dist/truncation-retry.js +4 -2
  69. package/dist/truncation-retry.js.map +1 -1
  70. package/dist/ttl-fit.d.ts.map +1 -1
  71. package/dist/ttl-fit.js +4 -2
  72. package/dist/ttl-fit.js.map +1 -1
  73. package/dist/types.d.ts +17 -7
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/usage.d.ts.map +1 -1
  76. package/dist/usage.js +13 -12
  77. package/dist/usage.js.map +1 -1
  78. package/dist/watch.d.ts +11 -1
  79. package/dist/watch.d.ts.map +1 -1
  80. package/dist/watch.js.map +1 -1
  81. package/dist/weekly.d.ts +140 -0
  82. package/dist/weekly.d.ts.map +1 -0
  83. package/dist/weekly.js +176 -0
  84. package/dist/weekly.js.map +1 -0
  85. package/dist/write.js +2 -2
  86. package/dist/write.js.map +1 -1
  87. package/package.json +1 -1
  88. package/src/advisories.ts +41 -25
  89. package/src/budget.ts +2 -1
  90. package/src/connector.ts +1 -1
  91. package/src/conversation.ts +4 -2
  92. package/src/i18n/en.ts +2 -2
  93. package/src/i18n/es.ts +2 -2
  94. package/src/i18n/types.ts +2 -1
  95. package/src/index.ts +4 -2
  96. package/src/input-shape.ts +4 -2
  97. package/src/openrouter.ts +1 -2
  98. package/src/phrases.ts +134 -0
  99. package/src/pricing-overlay.ts +23 -14
  100. package/src/pricing.ts +82 -120
  101. package/src/repeats.ts +4 -2
  102. package/src/reprice.ts +1 -1
  103. package/src/review.ts +1 -1
  104. package/src/rules.ts +135 -2
  105. package/src/segment.ts +131 -3
  106. package/src/session-cost.ts +4 -2
  107. package/src/session-ledger.ts +4 -2
  108. package/src/structure.ts +152 -13
  109. package/src/truncation-retry.ts +4 -2
  110. package/src/ttl-fit.ts +4 -2
  111. package/src/types.ts +18 -7
  112. package/src/usage.ts +13 -12
  113. package/src/watch.ts +12 -1
  114. package/src/weekly.ts +281 -0
  115. package/src/write.ts +2 -2
package/dist/pricing.js CHANGED
@@ -120,10 +120,17 @@ export const PROVIDER_REVIEWED = Object.freeze({
120
120
  * target's rates. 2.5 Pro carries that as a second period; 2.5 Flash's text
121
121
  * rates are 3.5 Flash-Lite's, so its price does not move. The Gemini 4
122
122
  * family and 3.5 Flash-Lite are priced in their own rows, from the same
123
- * read; the page's other models are still unpriced. Not modelled: the
124
- * Batch tabs of 3.1 Pro Preview and both
125
- * 2.5 models charge the standard cache price, and this table bills a batch
126
- * call's cache reads at half of it, as it does every other rate.
123
+ * read; the page's other models are still unpriced.
124
+ *
125
+ * Batch tabs read again 2026-11-17, for the cache price alone. Six of the
126
+ * nine rows print a batch cache price that is half the standard one, as
127
+ * the batch input is: 4 Carbon, Argon and Hydrogen, 3.8 and 3.6 Flash and
128
+ * 3.5 Flash-Lite. Three do not. 3.1 Pro Preview's reads "Same as Standard",
129
+ * $0.20 and $0.40, and 2.5 Pro's and 2.5 Flash's print the standard figures
130
+ * ($0.125 and $0.25; $0.03). Those three carry `batchCacheRead: 0.2`: the
131
+ * cache price over the batch input, where a standard call reads at 0.1.
132
+ * For the two 2.5 models it ends on 2026-12-01, when they are billed at
133
+ * the rates of 3.8 Flash and 3.5 Flash-Lite, whose Batch tabs halve it.
127
134
  */
128
135
  google: '2026-11-16',
129
136
  /*
@@ -221,26 +228,40 @@ export const COST_MULTIPLIERS = {
221
228
  /** Batch API: 50% discount on input and output. */
222
229
  batch: 0.5,
223
230
  };
231
+ const multipliersMemo = new WeakMap();
232
+ const batchMultipliersMemo = new WeakMap();
224
233
  /**
225
- * The multipliers that apply to one model, defaults filled in.
234
+ * The cache and batch ratios of a row, at a date and for a kind of call.
226
235
  *
227
- * `batch` stays `null` when the provider has no batch API, which is different
228
- * from "unspecified": the first should stop the advisory firing, the second
229
- * should fall back to the default.
236
+ * `how` is the same context `effectivePricing` is given, and it matters for
237
+ * one figure. Every ratio here multiplies the input rate `effectivePricing`
238
+ * returned, which for a batch call is already the batch rate. Where a
239
+ * provider's Batch table charges the cache at something other than the
240
+ * standard share of that halved input, the row says so in `batchCacheRead`,
241
+ * and a batch call gets that as its `cacheRead`. Until 2.7.12 nothing asked
242
+ * how the call ran: Google's Batch tab for Gemini 3.1 Pro Preview and both
243
+ * 2.5 models prints "Same as Standard" for the cache, and a batch call's
244
+ * cache reads on them were billed at half of what the page charges.
230
245
  */
231
- /** Memoised for the same reason as `effectivePricing`: once per record. */
232
- const multipliersMemo = new WeakMap();
233
- export function multipliersFor(model, on) {
246
+ export function multipliersFor(model, on, how) {
234
247
  // A dated question about a repriced model asks the period in force then.
235
248
  if (on !== undefined && model.history !== undefined) {
236
249
  const period = pricedAt(model, on);
237
250
  if (period !== model)
238
- return multipliersFor(period);
251
+ return multipliersFor(period, undefined, how);
252
+ }
253
+ const m = model.multipliers ?? {};
254
+ if (how?.batch === true && m.batchCacheRead !== undefined && m.batch !== null) {
255
+ const cached = batchMultipliersMemo.get(model);
256
+ if (cached !== undefined)
257
+ return cached;
258
+ const result = Object.freeze({ ...multipliersFor(model), cacheRead: m.batchCacheRead });
259
+ batchMultipliersMemo.set(model, result);
260
+ return result;
239
261
  }
240
262
  const cached = multipliersMemo.get(model);
241
263
  if (cached !== undefined)
242
264
  return cached;
243
- const m = model.multipliers ?? {};
244
265
  const result = Object.freeze({
245
266
  cacheWrite5m: m.cacheWrite5m ?? COST_MULTIPLIERS.cacheWrite5m,
246
267
  cacheWrite1h: m.cacheWrite1h ?? COST_MULTIPLIERS.cacheWrite1h,
@@ -383,7 +404,6 @@ export const MODELS = [
383
404
  */
384
405
  tiers: [{ id: 'fast', when: { kind: 'speed', speed: 'fast' }, inputPerMTok: 16, outputPerMTok: 80 }],
385
406
  capability: 'frontier',
386
- tier: 'frontier',
387
407
  notes: 'Cache hits cost 2.5% of the input price ($0.20). Fast mode (usage.speed "fast") bills $16/$80.'
388
408
  + ' Requires 30-day data retention.',
389
409
  },
@@ -410,7 +430,6 @@ export const MODELS = [
410
430
  multipliers: { cacheRead: 0.025, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
411
431
  tiers: [{ id: 'fast', when: { kind: 'speed', speed: 'fast' }, inputPerMTok: 16, outputPerMTok: 80 }],
412
432
  capability: 'frontier',
413
- tier: 'frontier',
414
433
  notes: 'Available only to organizations verified through Anthropic\'s verification programs.'
415
434
  + ' Fast mode (usage.speed "fast") bills $16/$80. Requires 30-day data retention.',
416
435
  },
@@ -437,7 +456,6 @@ export const MODELS = [
437
456
  cacheMinTokens: 512,
438
457
  multipliers: { cacheRead: 0.025, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
439
458
  capability: 'frontier',
440
- tier: 'frontier',
441
459
  notes: 'Legacy: superseded by Claude Fable 5.2, which costs less ($8/$40). Cache hits cost 2.5% of the input'
442
460
  + ' price ($0.25). Requires 30-day data retention.',
443
461
  },
@@ -459,7 +477,6 @@ export const MODELS = [
459
477
  cacheMinTokens: 512,
460
478
  multipliers: { cacheRead: 0.025, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
461
479
  capability: 'frontier',
462
- tier: 'frontier',
463
480
  notes: 'Available only to organizations verified through Anthropic\'s verification programs.'
464
481
  + ' Requires 30-day data retention.',
465
482
  },
@@ -474,7 +491,6 @@ export const MODELS = [
474
491
  contextWindow: 1_000_000,
475
492
  cacheMinTokens: 512,
476
493
  capability: 'frontier',
477
- tier: 'frontier',
478
494
  notes: 'Legacy: superseded by Claude Fable 5.1 at the same prices. Requires 30-day data retention.',
479
495
  },
480
496
  {
@@ -489,7 +505,6 @@ export const MODELS = [
489
505
  contextWindow: 1_000_000,
490
506
  cacheMinTokens: 512,
491
507
  capability: 'frontier',
492
- tier: 'frontier',
493
508
  notes: 'Available only to organizations verified through Anthropic\'s verification programs.'
494
509
  + ' Requires 30-day data retention.',
495
510
  },
@@ -519,7 +534,6 @@ export const MODELS = [
519
534
  */
520
535
  tiers: [{ id: 'fast', when: { kind: 'speed', speed: 'fast' }, inputPerMTok: 8, outputPerMTok: 40 }],
521
536
  capability: 'large',
522
- tier: 'opus',
523
537
  notes: 'Cache hits cost 5% of the input price ($0.20), against 10% on Opus 5 and earlier.'
524
538
  + ' Fast mode (usage.speed "fast") bills $8/$40.',
525
539
  },
@@ -536,7 +550,6 @@ export const MODELS = [
536
550
  // Fast mode in research preview, $10/$50; same sources as Opus 5.5's.
537
551
  tiers: [{ id: 'fast', when: { kind: 'speed', speed: 'fast' }, inputPerMTok: 10, outputPerMTok: 50 }],
538
552
  capability: 'large',
539
- tier: 'opus',
540
553
  notes: '512-token cache minimum: caches prompts that would miss on Opus 4.6. Fast mode bills $10/$50.',
541
554
  },
542
555
  {
@@ -556,7 +569,6 @@ export const MODELS = [
556
569
  */
557
570
  tiers: [{ id: 'fast', when: { kind: 'speed', speed: 'fast' }, inputPerMTok: 10, outputPerMTok: 50 }],
558
571
  capability: 'large',
559
- tier: 'opus',
560
572
  notes: 'Fast mode bills $10/$50 until it is removed from this model on 2026-11-30.',
561
573
  },
562
574
  {
@@ -570,7 +582,6 @@ export const MODELS = [
570
582
  contextWindow: 1_000_000,
571
583
  cacheMinTokens: 2048,
572
584
  capability: 'large',
573
- tier: 'opus',
574
585
  },
575
586
  {
576
587
  id: 'claude-opus-4-6',
@@ -583,7 +594,6 @@ export const MODELS = [
583
594
  contextWindow: 1_000_000,
584
595
  cacheMinTokens: 4096,
585
596
  capability: 'large',
586
- tier: 'opus',
587
597
  },
588
598
  {
589
599
  /*
@@ -604,7 +614,6 @@ export const MODELS = [
604
614
  contextWindow: 200_000,
605
615
  cacheMinTokens: 4096,
606
616
  capability: 'large',
607
- tier: 'opus',
608
617
  notes: '200K context window and a 64K output cap.',
609
618
  },
610
619
  {
@@ -630,7 +639,6 @@ export const MODELS = [
630
639
  contextWindow: 200_000,
631
640
  cacheMinTokens: 1024,
632
641
  capability: 'large',
633
- tier: 'opus',
634
642
  notes: 'Retired on the Claude API on 2026-08-05; still served on Google Cloud (Google managed) and Bedrock.'
635
643
  + ' Anthropic names Claude Opus 4.8 as the replacement.',
636
644
  },
@@ -650,7 +658,6 @@ export const MODELS = [
650
658
  contextWindow: 200_000,
651
659
  cacheMinTokens: 1024,
652
660
  capability: 'large',
653
- tier: 'opus',
654
661
  notes: 'Retired on the Claude API on 2026-06-15; still served on Google Cloud (Google managed).'
655
662
  + ' Anthropic names Claude Opus 4.8 as the replacement.',
656
663
  },
@@ -671,7 +678,6 @@ export const MODELS = [
671
678
  cacheMinTokens: 512,
672
679
  multipliers: { cacheRead: 0.05, cacheWrite5m: 1.25, cacheWrite1h: 2, batch: 0.5 },
673
680
  capability: 'mid',
674
- tier: 'sonnet',
675
681
  notes: 'Cache hits cost 5% of the input price ($0.10), against 10% ($0.20) on Sonnet 5.',
676
682
  },
677
683
  {
@@ -685,7 +691,6 @@ export const MODELS = [
685
691
  contextWindow: 1_000_000,
686
692
  cacheMinTokens: 1024,
687
693
  capability: 'mid',
688
- tier: 'sonnet',
689
694
  notes: 'Launched with 2/10 as introductory pricing through 2026-08-31; the scheduled'
690
695
  + ' increase to 3/15 on 2026-09-01 was cancelled and 2/10 is the standard price.',
691
696
  },
@@ -700,7 +705,6 @@ export const MODELS = [
700
705
  contextWindow: 1_000_000,
701
706
  cacheMinTokens: 1024,
702
707
  capability: 'mid',
703
- tier: 'sonnet',
704
708
  },
705
709
  {
706
710
  /*
@@ -723,7 +727,6 @@ export const MODELS = [
723
727
  contextWindow: 200_000,
724
728
  cacheMinTokens: 1024,
725
729
  capability: 'mid',
726
- tier: 'sonnet',
727
730
  notes: 'Deprecated; retires 2026-11-30. Recommended replacement: Claude Sonnet 5.5.',
728
731
  },
729
732
  {
@@ -746,7 +749,6 @@ export const MODELS = [
746
749
  contextWindow: 200_000,
747
750
  cacheMinTokens: 1024,
748
751
  capability: 'mid',
749
- tier: 'sonnet',
750
752
  notes: 'Retired on the Claude API on 2026-06-15; still served on Google Cloud (Google managed) and Bedrock.'
751
753
  + ' Anthropic names Claude Sonnet 5.5 as the replacement.',
752
754
  },
@@ -786,7 +788,6 @@ export const MODELS = [
786
788
  },
787
789
  ],
788
790
  capability: 'small',
789
- tier: 'haiku',
790
791
  notes: 'Priced per request by prompt length: $0.10/$0.50 up to 100,000 input tokens, cache reads'
791
792
  + ' and writes included, and $0.50/$2.50 over it.',
792
793
  },
@@ -804,7 +805,6 @@ export const MODELS = [
804
805
  contextWindow: 200_000,
805
806
  cacheMinTokens: 4096,
806
807
  capability: 'small',
807
- tier: 'haiku',
808
808
  notes: '200K context window and a 64K output cap, smaller than the rest.',
809
809
  },
810
810
  {
@@ -826,7 +826,6 @@ export const MODELS = [
826
826
  contextWindow: 200_000,
827
827
  cacheMinTokens: 2048,
828
828
  capability: 'small',
829
- tier: 'haiku',
830
829
  notes: 'Retired on the Claude API on 2026-02-19; still served on Google Cloud (Google managed).'
831
830
  + ' Anthropic names Claude Haiku 4.5 as the replacement.',
832
831
  },
@@ -895,7 +894,6 @@ export const MODELS = [
895
894
  ultrafast: { inputPerMTok: 60, outputPerMTok: 300, tiers: openAiLongBand(120, 450) },
896
895
  },
897
896
  capability: 'frontier',
898
- tier: 'frontier',
899
897
  notes: OPENAI_CURRENT_NOTE,
900
898
  },
901
899
  {
@@ -923,7 +921,6 @@ export const MODELS = [
923
921
  ultrafast: { inputPerMTok: 12, outputPerMTok: 60, tiers: openAiLongBand(24, 90) },
924
922
  },
925
923
  capability: 'large',
926
- tier: 'opus',
927
924
  notes: OPENAI_CURRENT_NOTE,
928
925
  },
929
926
  {
@@ -956,7 +953,6 @@ export const MODELS = [
956
953
  fast: { inputPerMTok: 2, outputPerMTok: 10, tiers: openAiLongBand(4, 15) },
957
954
  },
958
955
  capability: 'mid',
959
- tier: 'sonnet',
960
956
  notes: OPENAI_CURRENT_NOTE,
961
957
  },
962
958
  {
@@ -983,7 +979,6 @@ export const MODELS = [
983
979
  fast: { inputPerMTok: 4, outputPerMTok: 20, tiers: openAiLongBand(8, 30) },
984
980
  },
985
981
  capability: 'large',
986
- tier: 'opus',
987
982
  notes: OPENAI_CURRENT_NOTE,
988
983
  },
989
984
  {
@@ -1010,7 +1005,6 @@ export const MODELS = [
1010
1005
  fast: { inputPerMTok: 0.2, outputPerMTok: 1, tiers: openAiLongBand(0.4, 1.5) },
1011
1006
  },
1012
1007
  capability: 'small',
1013
- tier: 'haiku',
1014
1008
  notes: OPENAI_CURRENT_NOTE,
1015
1009
  },
1016
1010
  {
@@ -1051,7 +1045,6 @@ export const MODELS = [
1051
1045
  fast: { inputPerMTok: 8, outputPerMTok: 40, tiers: openAiLongBand(16, 60) },
1052
1046
  },
1053
1047
  capability: 'large',
1054
- tier: 'opus',
1055
1048
  notes: OPENAI_CURRENT_NOTE
1056
1049
  + ' $4/$20 is promotional until 2026-11-30, and OpenAI has not published the price after it as a figure.',
1057
1050
  },
@@ -1079,7 +1072,6 @@ export const MODELS = [
1079
1072
  fast: { inputPerMTok: 4, outputPerMTok: 24, tiers: openAiLongBand(8, 36) },
1080
1073
  },
1081
1074
  capability: 'mid',
1082
- tier: 'sonnet',
1083
1075
  notes: OPENAI_CURRENT_NOTE,
1084
1076
  },
1085
1077
  {
@@ -1106,7 +1098,6 @@ export const MODELS = [
1106
1098
  fast: { inputPerMTok: 0.4, outputPerMTok: 2.4, tiers: openAiLongBand(0.8, 3.6) },
1107
1099
  },
1108
1100
  capability: 'small',
1109
- tier: 'haiku',
1110
1101
  notes: OPENAI_CURRENT_NOTE,
1111
1102
  },
1112
1103
  {
@@ -1137,7 +1128,6 @@ export const MODELS = [
1137
1128
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1.25, cacheWrite1h: 2.5, batch: null },
1138
1129
  cacheTtl: OPENAI_CACHE_TTL,
1139
1130
  capability: 'large',
1140
- tier: 'opus',
1141
1131
  notes: 'Needs approval through the Daybreak programme. At most 272,000 input tokens, Responses API only, no batch.'
1142
1132
  + ' Cache writes cost 1.25x input for the default 30-minute entry and 2.5x for a 12-hour one.',
1143
1133
  },
@@ -1163,7 +1153,6 @@ export const MODELS = [
1163
1153
  fast: { inputPerMTok: 2.5, outputPerMTok: 20 },
1164
1154
  },
1165
1155
  capability: 'frontier',
1166
- tier: 'frontier',
1167
1156
  notes: OPENAI_GPT5_NOTE + OPENAI_DEPRECATED_SUFFIX,
1168
1157
  },
1169
1158
  {
@@ -1183,7 +1172,6 @@ export const MODELS = [
1183
1172
  fast: { inputPerMTok: 0.45, outputPerMTok: 3.6 },
1184
1173
  },
1185
1174
  capability: 'mid',
1186
- tier: 'sonnet',
1187
1175
  notes: OPENAI_GPT5_NOTE + OPENAI_DEPRECATED_SUFFIX,
1188
1176
  },
1189
1177
  {
@@ -1202,7 +1190,6 @@ export const MODELS = [
1202
1190
  flex: { inputPerMTok: 0.025, outputPerMTok: 0.2 },
1203
1191
  },
1204
1192
  capability: 'small',
1205
- tier: 'haiku',
1206
1193
  notes: OPENAI_GPT5_NOTE + OPENAI_DEPRECATED_SUFFIX,
1207
1194
  },
1208
1195
  // ------------------------------------------------------------------------
@@ -1245,7 +1232,6 @@ export const MODELS = [
1245
1232
  fast: { inputPerMTok: 12.5, outputPerMTok: 75 },
1246
1233
  },
1247
1234
  capability: 'frontier',
1248
- tier: 'frontier',
1249
1235
  notes: OPENAI_EARLIER_LONG_NOTE,
1250
1236
  },
1251
1237
  {
@@ -1271,7 +1257,6 @@ export const MODELS = [
1271
1257
  flex: { inputPerMTok: 15, outputPerMTok: 90 },
1272
1258
  },
1273
1259
  capability: 'frontier',
1274
- tier: 'frontier',
1275
1260
  notes: OPENAI_EARLIER_LONG_NOTE,
1276
1261
  },
1277
1262
  {
@@ -1298,7 +1283,6 @@ export const MODELS = [
1298
1283
  fast: { inputPerMTok: 5, outputPerMTok: 30 },
1299
1284
  },
1300
1285
  capability: 'frontier',
1301
- tier: 'frontier',
1302
1286
  notes: OPENAI_EARLIER_LONG_NOTE,
1303
1287
  },
1304
1288
  {
@@ -1324,7 +1308,6 @@ export const MODELS = [
1324
1308
  flex: { inputPerMTok: 15, outputPerMTok: 90, tiers: openAiLongBand(30, 135) },
1325
1309
  },
1326
1310
  capability: 'frontier',
1327
- tier: 'frontier',
1328
1311
  notes: OPENAI_EARLIER_LONG_NOTE,
1329
1312
  },
1330
1313
  {
@@ -1343,7 +1326,6 @@ export const MODELS = [
1343
1326
  fast: { inputPerMTok: 1.5, outputPerMTok: 9 },
1344
1327
  },
1345
1328
  capability: 'mid',
1346
- tier: 'sonnet',
1347
1329
  notes: OPENAI_EARLIER_NOTE,
1348
1330
  },
1349
1331
  {
@@ -1362,7 +1344,6 @@ export const MODELS = [
1362
1344
  flex: { inputPerMTok: 0.1, outputPerMTok: 0.625 },
1363
1345
  },
1364
1346
  capability: 'small',
1365
- tier: 'haiku',
1366
1347
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1367
1348
  },
1368
1349
  {
@@ -1381,7 +1362,6 @@ export const MODELS = [
1381
1362
  fast: { inputPerMTok: 3.5, outputPerMTok: 28 },
1382
1363
  },
1383
1364
  capability: 'frontier',
1384
- tier: 'frontier',
1385
1365
  notes: OPENAI_EARLIER_NOTE,
1386
1366
  },
1387
1367
  {
@@ -1396,7 +1376,6 @@ export const MODELS = [
1396
1376
  caching: 'none',
1397
1377
  multipliers: { batch: 0.5 },
1398
1378
  capability: 'frontier',
1399
- tier: 'frontier',
1400
1379
  notes: OPENAI_EARLIER_NO_CACHE_NOTE,
1401
1380
  },
1402
1381
  {
@@ -1416,7 +1395,6 @@ export const MODELS = [
1416
1395
  fast: { inputPerMTok: 2.5, outputPerMTok: 20 },
1417
1396
  },
1418
1397
  capability: 'frontier',
1419
- tier: 'frontier',
1420
1398
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1421
1399
  },
1422
1400
  {
@@ -1432,7 +1410,6 @@ export const MODELS = [
1432
1410
  caching: 'none',
1433
1411
  multipliers: { batch: 0.5 },
1434
1412
  capability: 'frontier',
1435
- tier: 'frontier',
1436
1413
  notes: OPENAI_EARLIER_NO_CACHE_NOTE + OPENAI_DEPRECATED_SUFFIX,
1437
1414
  },
1438
1415
  {
@@ -1451,7 +1428,6 @@ export const MODELS = [
1451
1428
  fast: { inputPerMTok: 3.5, outputPerMTok: 14 },
1452
1429
  },
1453
1430
  capability: 'large',
1454
- tier: 'opus',
1455
1431
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1456
1432
  },
1457
1433
  {
@@ -1470,7 +1446,6 @@ export const MODELS = [
1470
1446
  fast: { inputPerMTok: 0.7, outputPerMTok: 2.8 },
1471
1447
  },
1472
1448
  capability: 'mid',
1473
- tier: 'sonnet',
1474
1449
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1475
1450
  },
1476
1451
  {
@@ -1489,7 +1464,6 @@ export const MODELS = [
1489
1464
  fast: { inputPerMTok: 4.25, outputPerMTok: 17 },
1490
1465
  },
1491
1466
  capability: 'large',
1492
- tier: 'opus',
1493
1467
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1494
1468
  },
1495
1469
  {
@@ -1508,7 +1482,6 @@ export const MODELS = [
1508
1482
  fast: { inputPerMTok: 0.25, outputPerMTok: 1 },
1509
1483
  },
1510
1484
  capability: 'small',
1511
- tier: 'haiku',
1512
1485
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1513
1486
  },
1514
1487
  {
@@ -1528,7 +1501,6 @@ export const MODELS = [
1528
1501
  fast: { inputPerMTok: 3.5, outputPerMTok: 14 },
1529
1502
  },
1530
1503
  capability: 'frontier',
1531
- tier: 'frontier',
1532
1504
  notes: OPENAI_EARLIER_NOTE + OPENAI_DEPRECATED_SUFFIX,
1533
1505
  },
1534
1506
  {
@@ -1544,7 +1516,6 @@ export const MODELS = [
1544
1516
  caching: 'none',
1545
1517
  multipliers: { batch: 0.5 },
1546
1518
  capability: 'frontier',
1547
- tier: 'frontier',
1548
1519
  notes: OPENAI_EARLIER_NO_CACHE_NOTE + OPENAI_DEPRECATED_SUFFIX,
1549
1520
  },
1550
1521
  // ------------------------------------------------------------------------
@@ -1576,7 +1547,6 @@ export const MODELS = [
1576
1547
  // The pricing page's specialized "Fast" table: $3.50/$28, cached $0.35.
1577
1548
  serviceTiers: { fast: { inputPerMTok: 3.5, outputPerMTok: 28 } },
1578
1549
  capability: 'frontier',
1579
- tier: 'frontier',
1580
1550
  notes: OPENAI_CODEX_NOTE + ' At most 272,000 input tokens.' + OPENAI_DEPRECATED_SUFFIX,
1581
1551
  },
1582
1552
  {
@@ -1591,7 +1561,6 @@ export const MODELS = [
1591
1561
  caching: 'automatic',
1592
1562
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1593
1563
  capability: 'frontier',
1594
- tier: 'frontier',
1595
1564
  notes: OPENAI_CODEX_NOTE + ' At most 272,000 input tokens.' + OPENAI_SHUT_DOWN_SUFFIX,
1596
1565
  },
1597
1566
  {
@@ -1606,7 +1575,6 @@ export const MODELS = [
1606
1575
  caching: 'automatic',
1607
1576
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1608
1577
  capability: 'frontier',
1609
- tier: 'frontier',
1610
1578
  notes: OPENAI_CODEX_NOTE + OPENAI_SHUT_DOWN_SUFFIX,
1611
1579
  },
1612
1580
  {
@@ -1621,7 +1589,6 @@ export const MODELS = [
1621
1589
  caching: 'automatic',
1622
1590
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1623
1591
  capability: 'frontier',
1624
- tier: 'frontier',
1625
1592
  notes: OPENAI_CODEX_NOTE + OPENAI_SHUT_DOWN_SUFFIX,
1626
1593
  },
1627
1594
  {
@@ -1636,7 +1603,6 @@ export const MODELS = [
1636
1603
  caching: 'automatic',
1637
1604
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1638
1605
  capability: 'mid',
1639
- tier: 'sonnet',
1640
1606
  notes: OPENAI_CODEX_NOTE + OPENAI_SHUT_DOWN_SUFFIX,
1641
1607
  },
1642
1608
  {
@@ -1651,7 +1617,6 @@ export const MODELS = [
1651
1617
  caching: 'automatic',
1652
1618
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1653
1619
  capability: 'frontier',
1654
- tier: 'frontier',
1655
1620
  notes: OPENAI_CODEX_NOTE + ' At most 272,000 input tokens.' + OPENAI_SHUT_DOWN_SUFFIX,
1656
1621
  },
1657
1622
  {
@@ -1666,7 +1631,6 @@ export const MODELS = [
1666
1631
  caching: 'automatic',
1667
1632
  multipliers: { cacheRead: 0.25, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1668
1633
  capability: 'mid',
1669
- tier: 'sonnet',
1670
1634
  notes: OPENAI_CODEX_NOTE + ' A cache read costs 0.25x input.' + OPENAI_SHUT_DOWN_SUFFIX,
1671
1635
  },
1672
1636
  {
@@ -1681,7 +1645,6 @@ export const MODELS = [
1681
1645
  caching: 'automatic',
1682
1646
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
1683
1647
  capability: 'large',
1684
- tier: 'opus',
1685
1648
  notes: 'Points at the model ChatGPT currently uses, so it is priced and never recommended. Caching is automatic; a write costs what input costs. At most 272,000 input tokens, and no batch.',
1686
1649
  },
1687
1650
  // ------------------------------------------------------------------------
@@ -1710,8 +1673,17 @@ export const MODELS = [
1710
1673
  outputPerMTok: 7.5,
1711
1674
  promo: { inputPerMTok: 0.75, outputPerMTok: 3.75, until: '2026-12-31', confirmedOn: '2026-11-16' },
1712
1675
  history: [
1713
- /* Its own price: $0.125 cached (10%) and batch half, the ratios 3.8 Flash also has. */
1714
- { until: '2026-12-01T00:00:00Z', inputPerMTok: 1.25, outputPerMTok: 10 },
1676
+ /*
1677
+ * Its own price: $0.125 cached (10%) and batch half. Its Batch tab charges
1678
+ * the cache at the standard $0.125 against a batch input of $0.625 (and
1679
+ * $0.25 against $1.25 above 200k): 0.2 of the batch rate, read 2026-11-17.
1680
+ */
1681
+ {
1682
+ until: '2026-12-01T00:00:00Z',
1683
+ inputPerMTok: 1.25,
1684
+ outputPerMTok: 10,
1685
+ multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5, batchCacheRead: 0.2 },
1686
+ },
1715
1687
  ],
1716
1688
  contextWindow: 1_048_576,
1717
1689
  cacheMinTokens: 2048,
@@ -1724,7 +1696,6 @@ export const MODELS = [
1724
1696
  because: 'This model models/gemini-2.5-pro is no longer available to new users. Please update your code to use models/gemini-3.1-pro-preview for the latest features and improvements. We recommend you to use the Interactions API.',
1725
1697
  },
1726
1698
  capability: 'large',
1727
- tier: 'opus',
1728
1699
  notes: 'From 2026-12-01 Google routes this id to Gemini 3.8 Flash and bills it at 3.8 Flash rates.'
1729
1700
  + ' Before then it bills $1.25/$10, and $2.50/$15.00 for a prompt over 200k tokens; this row prices every prompt'
1730
1701
  + ' before then at the up-to-200k rate, because no log Trazum prices says how long each prompt was. Implicit caching'
@@ -1745,6 +1716,21 @@ export const MODELS = [
1745
1716
  displayName: 'Gemini 2.5 Flash',
1746
1717
  inputPerMTok: 0.3,
1747
1718
  outputPerMTok: 2.5,
1719
+ history: [
1720
+ /*
1721
+ * The same $0.30/$2.50, and one figure that differs until the rerouting:
1722
+ * its own Batch tab charges the cache at the standard $0.03 against a
1723
+ * batch input of $0.15, 0.2 of the batch rate (read 2026-11-17). From
1724
+ * 2026-12-01 it is billed at 3.5 Flash-Lite's rates, whose Batch tab
1725
+ * prints $0.015.
1726
+ */
1727
+ {
1728
+ until: '2026-12-01T00:00:00Z',
1729
+ inputPerMTok: 0.3,
1730
+ outputPerMTok: 2.5,
1731
+ multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5, batchCacheRead: 0.2 },
1732
+ },
1733
+ ],
1748
1734
  contextWindow: 1_048_576,
1749
1735
  cacheMinTokens: 2048,
1750
1736
  caching: 'automatic',
@@ -1756,7 +1742,6 @@ export const MODELS = [
1756
1742
  because: 'This model models/gemini-2.5-flash is no longer available to new users. Please update your code to use models/gemini-3.6-flash for the latest features and improvements. We recommend you to use the Interactions API.',
1757
1743
  },
1758
1744
  capability: 'mid',
1759
- tier: 'sonnet',
1760
1745
  notes: 'From 2026-12-01 Google routes this id to Gemini 3.5 Flash-Lite and bills it at 3.5 Flash-Lite rates,'
1761
1746
  + ' which for text are the $0.30/$2.50 and $0.03 cached this row carries.',
1762
1747
  },
@@ -1798,7 +1783,6 @@ export const MODELS = [
1798
1783
  */
1799
1784
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1800
1785
  capability: 'mid',
1801
- tier: 'sonnet',
1802
1786
  notes: 'Implicit caching is automatic above 4,096 tokens. Explicit caching is also billed for storage:'
1803
1787
  + ' $0.50 per 1M tokens per hour through 2026-12-31, $1.00 after.',
1804
1788
  },
@@ -1826,7 +1810,6 @@ export const MODELS = [
1826
1810
  /* $0.075 / $0.75 = 0.1 (and $0.15 / $1.50); batch $0.375 / $0.75 = 0.5 (and $1.875 / $3.75). */
1827
1811
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1828
1812
  capability: 'mid',
1829
- tier: 'sonnet',
1830
1813
  notes: 'Implicit caching is automatic above 4,096 tokens. Explicit caching is also billed for storage:'
1831
1814
  + ' $0.50 per 1M tokens per hour through 2026-12-31, $1.00 after.',
1832
1815
  },
@@ -1855,7 +1838,12 @@ export const MODELS = [
1855
1838
  contextWindow: 1_048_576,
1856
1839
  cacheMinTokens: 4096,
1857
1840
  caching: 'automatic',
1858
- multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1841
+ /*
1842
+ * The Batch tab's cache row reads "Same as Standard": $0.20 against a batch
1843
+ * input of $1.00, and $0.40 against $2.00 above 200k. 0.2 of the batch rate
1844
+ * in both bands, where a standard call reads at 0.1 (read 2026-11-17).
1845
+ */
1846
+ multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5, batchCacheRead: 0.2 },
1859
1847
  tiers: [
1860
1848
  {
1861
1849
  id: 'over-200k',
@@ -1865,7 +1853,6 @@ export const MODELS = [
1865
1853
  },
1866
1854
  ],
1867
1855
  capability: 'large',
1868
- tier: 'opus',
1869
1856
  notes: 'Priced per request by prompt length: $2/$12 up to 200,000 input tokens and $4/$18 over it.'
1870
1857
  + ' Implicit caching is automatic above 4,096 tokens; explicit caching is also billed for storage,'
1871
1858
  + ' $4.50 per 1M tokens per hour.',
@@ -1910,7 +1897,6 @@ export const MODELS = [
1910
1897
  caching: 'automatic',
1911
1898
  multipliers: { cacheRead: 0.05, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1912
1899
  capability: 'frontier',
1913
- tier: 'frontier',
1914
1900
  notes: GEMINI_4_NOTE,
1915
1901
  },
1916
1902
  {
@@ -1925,7 +1911,6 @@ export const MODELS = [
1925
1911
  caching: 'automatic',
1926
1912
  multipliers: { cacheRead: 0.05, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1927
1913
  capability: 'frontier',
1928
- tier: 'frontier',
1929
1914
  notes: GEMINI_4_NOTE,
1930
1915
  },
1931
1916
  {
@@ -1939,7 +1924,6 @@ export const MODELS = [
1939
1924
  caching: 'automatic',
1940
1925
  multipliers: { cacheRead: 0.05, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1941
1926
  capability: 'mid',
1942
- tier: 'sonnet',
1943
1927
  notes: GEMINI_4_NOTE,
1944
1928
  },
1945
1929
  {
@@ -1964,7 +1948,6 @@ export const MODELS = [
1964
1948
  caching: 'automatic',
1965
1949
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
1966
1950
  capability: 'small',
1967
- tier: 'haiku',
1968
1951
  notes: 'Implicit caching is automatic, and no minimum prefix length is published for this model. Explicit caching is'
1969
1952
  + ' also billed for storage, $1.00 per 1M tokens per hour.',
1970
1953
  },
@@ -2004,7 +1987,6 @@ export const MODELS = [
2004
1987
  caching: 'automatic',
2005
1988
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 2, batch: 0.6 },
2006
1989
  capability: 'frontier',
2007
- tier: 'frontier',
2008
1990
  notes: 'Cache writes are billed as their own line: 1x input for a 5-minute entry, 2x for an hour.'
2009
1991
  + ` ${NO_PUBLISHED_CACHE_MINIMUM}`,
2010
1992
  },
@@ -2023,7 +2005,6 @@ export const MODELS = [
2023
2005
  caching: 'automatic',
2024
2006
  multipliers: { cacheRead: 0.05, cacheWrite5m: 1, cacheWrite1h: 2, batch: null },
2025
2007
  capability: 'frontier',
2026
- tier: 'frontier',
2027
2008
  notes: 'Cache writes are billed as their own line: 1x input for a 5-minute entry, 2x for an hour.'
2028
2009
  + ` No batch API for this model. ${NO_PUBLISHED_CACHE_MINIMUM}`,
2029
2010
  },
@@ -2038,7 +2019,6 @@ export const MODELS = [
2038
2019
  caching: 'automatic',
2039
2020
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 2, batch: 0.6 },
2040
2021
  capability: 'frontier',
2041
- tier: 'frontier',
2042
2022
  notes: 'Cache writes are billed as their own line: 1x input for a 5-minute entry, 2x for an hour.'
2043
2023
  + ` Batch at 60% since the batch page listed it (read 2026-11-05). ${NO_PUBLISHED_CACHE_MINIMUM}`,
2044
2024
  },
@@ -2056,7 +2036,6 @@ export const MODELS = [
2056
2036
  /* $0.19 on a hit against $0.95; batch $0.57 / $2.40, 60%. */
2057
2037
  multipliers: { cacheRead: 0.2, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.6 },
2058
2038
  capability: 'mid',
2059
- tier: 'sonnet',
2060
2039
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2061
2040
  },
2062
2041
  {
@@ -2073,7 +2052,6 @@ export const MODELS = [
2073
2052
  /* $0.38 on a hit against $1.90; no batch API for this variant. */
2074
2053
  multipliers: { cacheRead: 0.2, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2075
2054
  capability: 'mid',
2076
- tier: 'sonnet',
2077
2055
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2078
2056
  },
2079
2057
  {
@@ -2090,7 +2068,6 @@ export const MODELS = [
2090
2068
  /* $0.16 on a hit against $0.95, written as the ratio so the product is the page's figure. */
2091
2069
  multipliers: { cacheRead: 0.16 / 0.95, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.6 },
2092
2070
  capability: 'mid',
2093
- tier: 'sonnet',
2094
2071
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2095
2072
  },
2096
2073
  {
@@ -2113,7 +2090,6 @@ export const MODELS = [
2113
2090
  */
2114
2091
  recommendable: false,
2115
2092
  capability: 'mid',
2116
- tier: 'sonnet',
2117
2093
  notes: 'Discontinued by Moonshot on 2026-05-25; priced at the last rate it published. No batch API.'
2118
2094
  + ` ${NO_PUBLISHED_CACHE_MINIMUM}`,
2119
2095
  },
@@ -2136,7 +2112,6 @@ export const MODELS = [
2136
2112
  because: 'The supported API model names are deepseek-v4-pro, deepseek-v4-flash, and deepseek-v4-flash-vision-exp, but you passed deepseek-v3.',
2137
2113
  },
2138
2114
  capability: 'mid',
2139
- tier: 'sonnet',
2140
2115
  },
2141
2116
  {
2142
2117
  /*
@@ -2193,7 +2168,6 @@ export const MODELS = [
2193
2168
  /* $0.003 cache hit against $0.15 input off-peak, $0.006 against $0.30 at peak. */
2194
2169
  multipliers: { cacheRead: 0.02, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2195
2170
  capability: 'mid',
2196
- tier: 'sonnet',
2197
2171
  notes: 'Retired 2026-09-10: the id is still accepted, served by V4.1 Flash and billed at the deepseek-flash price.'
2198
2172
  + ' Maximum output 384K tokens. Peak excludes Chinese public holidays, which this table cannot express.',
2199
2173
  },
@@ -2226,7 +2200,6 @@ export const MODELS = [
2226
2200
  caching: 'automatic',
2227
2201
  multipliers: { cacheRead: 0.02, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2228
2202
  capability: 'mid',
2229
- tier: 'sonnet',
2230
2203
  notes: 'Maximum output 384K tokens. Peak excludes Chinese public holidays, which this table cannot express:'
2231
2204
  + ' on a weekday holiday it charges peak where DeepSeek charges off-peak.',
2232
2205
  },
@@ -2251,7 +2224,6 @@ export const MODELS = [
2251
2224
  /* $0.022 cache hit against $0.66 input off-peak. */
2252
2225
  multipliers: { cacheRead: 0.0333, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2253
2226
  capability: 'large',
2254
- tier: 'opus',
2255
2227
  notes: 'Maximum output 384K tokens.',
2256
2228
  },
2257
2229
  // ------------------------------------------------------------------------
@@ -2279,7 +2251,6 @@ export const MODELS = [
2279
2251
  multipliers: { cacheRead: 0.25, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2280
2252
  tiers: [GROK_LONG(4, 12)],
2281
2253
  capability: 'frontier',
2282
- tier: 'frontier',
2283
2254
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2284
2255
  },
2285
2256
  {
@@ -2294,7 +2265,6 @@ export const MODELS = [
2294
2265
  multipliers: { cacheRead: 0.25, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2295
2266
  tiers: [GROK_LONG(4, 12)],
2296
2267
  capability: 'large',
2297
- tier: 'opus',
2298
2268
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2299
2269
  },
2300
2270
  {
@@ -2310,7 +2280,6 @@ export const MODELS = [
2310
2280
  multipliers: { cacheRead: 0.15, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2311
2281
  tiers: [GROK_LONG(4, 12)],
2312
2282
  capability: 'large',
2313
- tier: 'opus',
2314
2283
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2315
2284
  },
2316
2285
  {
@@ -2326,7 +2295,6 @@ export const MODELS = [
2326
2295
  multipliers: { cacheRead: 0.16, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.8 },
2327
2296
  tiers: [GROK_LONG(2.5, 5)],
2328
2297
  capability: 'mid',
2329
- tier: 'sonnet',
2330
2298
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2331
2299
  },
2332
2300
  {
@@ -2342,7 +2310,6 @@ export const MODELS = [
2342
2310
  multipliers: { cacheRead: 0.16, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.8 },
2343
2311
  tiers: [GROK_LONG(2.5, 5)],
2344
2312
  capability: 'mid',
2345
- tier: 'sonnet',
2346
2313
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2347
2314
  },
2348
2315
  {
@@ -2358,7 +2325,6 @@ export const MODELS = [
2358
2325
  multipliers: { cacheRead: 0.16, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.8 },
2359
2326
  tiers: [GROK_LONG(2.5, 5)],
2360
2327
  capability: 'mid',
2361
- tier: 'sonnet',
2362
2328
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2363
2329
  },
2364
2330
  {
@@ -2374,7 +2340,6 @@ export const MODELS = [
2374
2340
  multipliers: { cacheRead: 0.16, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.8 },
2375
2341
  tiers: [GROK_LONG(2.5, 5)],
2376
2342
  capability: 'mid',
2377
- tier: 'sonnet',
2378
2343
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2379
2344
  },
2380
2345
  {
@@ -2389,7 +2354,6 @@ export const MODELS = [
2389
2354
  multipliers: { cacheRead: 0.2, cacheWrite5m: 1, cacheWrite1h: 1, batch: null },
2390
2355
  tiers: [GROK_LONG(2, 4)],
2391
2356
  capability: 'mid',
2392
- tier: 'sonnet',
2393
2357
  notes: NO_PUBLISHED_CACHE_MINIMUM,
2394
2358
  },
2395
2359
  {
@@ -2422,7 +2386,6 @@ export const MODELS = [
2422
2386
  ],
2423
2387
  recommendable: false,
2424
2388
  capability: 'large',
2425
- tier: 'opus',
2426
2389
  notes: 'Retired by xAI on 2026-05-15 and redirected to Grok 4.3, whose price it bills at from then;'
2427
2390
  + ` $3/$15 before. ${NO_PUBLISHED_CACHE_MINIMUM}`,
2428
2391
  },
@@ -2445,7 +2408,6 @@ export const MODELS = [
2445
2408
  because: 'Invalid model: mistral-large-2',
2446
2409
  },
2447
2410
  capability: 'large',
2448
- tier: 'opus',
2449
2411
  notes: 'No prompt caching: reordering still helps readability but saves nothing here.',
2450
2412
  },
2451
2413
  {
@@ -2476,7 +2438,6 @@ export const MODELS = [
2476
2438
  caching: 'unknown',
2477
2439
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
2478
2440
  capability: 'large',
2479
- tier: 'opus',
2480
2441
  notes: MISTRAL_CACHE_NOTE,
2481
2442
  },
2482
2443
  {
@@ -2504,7 +2465,6 @@ export const MODELS = [
2504
2465
  caching: 'unknown',
2505
2466
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
2506
2467
  capability: 'mid',
2507
- tier: 'sonnet',
2508
2468
  notes: MISTRAL_CACHE_NOTE,
2509
2469
  },
2510
2470
  {
@@ -2520,7 +2480,6 @@ export const MODELS = [
2520
2480
  caching: 'unknown',
2521
2481
  multipliers: { cacheRead: 0.1, cacheWrite5m: 1, cacheWrite1h: 1, batch: 0.5 },
2522
2482
  capability: 'small',
2523
- tier: 'haiku',
2524
2483
  notes: MISTRAL_CACHE_NOTE,
2525
2484
  },
2526
2485
  ];
@@ -2584,12 +2543,15 @@ export function modelFrom(catalogue, id) {
2584
2543
  return model;
2585
2544
  }
2586
2545
  /**
2587
- * Cheapest model of a tier within a catalogue.
2546
+ * Cheapest model of a capability within a catalogue.
2547
+ *
2548
+ * Takes the names `recommendTier` answers in, which are the names of the
2549
+ * `capability` a model carries.
2588
2550
  *
2589
2551
  * Compared on the **effective** price, so a model in a promotional window is
2590
2552
  * ranked at what it actually costs today rather than at its list price.
2591
2553
  */
2592
- export function cheapestOfTierIn(catalogue, tier, on = new Date(),
2554
+ export function cheapestOfCapabilityIn(catalogue, capability, on = new Date(),
2593
2555
  /**
2594
2556
  * Restrict to one provider. Omit to search the whole catalogue, which is what
2595
2557
  * this did before other providers existed — kept as the default so the
@@ -2597,12 +2559,12 @@ export function cheapestOfTierIn(catalogue, tier, on = new Date(),
2597
2559
  * vendor is a migration, not a cheaper model.
2598
2560
  */
2599
2561
  provider) {
2600
- const candidates = catalogue.models.filter((m) => m.tier === tier &&
2562
+ const candidates = catalogue.models.filter((m) => m.capability === capability &&
2601
2563
  isOffered(m) &&
2602
2564
  (provider === undefined || m.provider === provider));
2603
2565
  const first = candidates[0];
2604
2566
  if (!first)
2605
- throw new Error(`No models for tier "${tier}"`);
2567
+ throw new Error(`No models for capability "${capability}"`);
2606
2568
  return candidates.reduce((best, m) => effectivePricing(m, on).inputPerMTok < effectivePricing(best, on).inputPerMTok ? m : best, first);
2607
2569
  }
2608
2570
  export function getModel(id) {
@@ -2995,12 +2957,12 @@ export function reviewedForModels(models, catalogue) {
2995
2957
  date stands rather than an absence being read as freshness. */
2996
2958
  return oldest ?? catalogue.lastReviewed;
2997
2959
  }
2998
- /** Cheapest model of each capability tier, for recommendations. */
2999
- export function cheapestOfTier(tier) {
3000
- const candidates = MODELS.filter((m) => m.tier === tier && isOffered(m));
2960
+ /** Cheapest model of a capability across the bundled catalogue, for recommendations. */
2961
+ export function cheapestOfCapability(capability) {
2962
+ const candidates = MODELS.filter((m) => m.capability === capability && isOffered(m));
3001
2963
  const first = candidates[0];
3002
2964
  if (!first)
3003
- throw new Error(`No models for tier "${tier}"`);
2965
+ throw new Error(`No models for capability "${capability}"`);
3004
2966
  return candidates.reduce((best, m) => (m.inputPerMTok < best.inputPerMTok ? m : best), first);
3005
2967
  }
3006
2968
  /**