@molecule/api-resource-ai-models 1.0.1 → 1.1.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/README.md +103 -16
- package/dist/handlers/list.d.ts +5 -4
- package/dist/handlers/list.d.ts.map +1 -1
- package/dist/handlers/list.js +7 -5
- package/dist/lookup.d.ts +33 -8
- package/dist/lookup.d.ts.map +1 -1
- package/dist/lookup.js +47 -10
- package/dist/models.d.ts +32 -7
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +204 -43
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-08-
|
|
6
|
+
Generated: 2026-08-12T22:38:26.212Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-resource-ai-models
|
|
@@ -310,6 +310,35 @@ interface ModelDefinition {
|
|
|
310
310
|
* or its past usage silently meters as free. Omit entirely for active models.
|
|
311
311
|
*/
|
|
312
312
|
disabled?: boolean
|
|
313
|
+
/**
|
|
314
|
+
* The id of the NEWER-generation model that replaces this one, set on the
|
|
315
|
+
* OLDER entry and naming its successor (e.g. `qwen3.7-max` carries
|
|
316
|
+
* `supersededBy: 'qwen3.8-max'`).
|
|
317
|
+
*
|
|
318
|
+
* A superseded model is NOT selectable — like {@link disabled} it is excluded
|
|
319
|
+
* from `MODEL_IDS`, `getAvailableModels()`, the `GET /ai/models` listing and
|
|
320
|
+
* the client-side picker partitions, so a user is only ever offered the
|
|
321
|
+
* newest generation of a family. It differs from `disabled` in *why* and in
|
|
322
|
+
* what it points at: a disabled model is one the provider retired (it can no
|
|
323
|
+
* longer answer), whereas a superseded model is usually still served upstream
|
|
324
|
+
* and simply has nothing to offer over its successor — and the successor id
|
|
325
|
+
* is a real migration target, so a saved selection can resolve forward
|
|
326
|
+
* (`resolveSelectableModelId`) instead of silently falling back to the
|
|
327
|
+
* platform default.
|
|
328
|
+
*
|
|
329
|
+
* `getModel(id)` STILL returns a superseded entry — historical usage must stay
|
|
330
|
+
* priceable, so NEVER delete one.
|
|
331
|
+
*
|
|
332
|
+
* Set this ONLY when the successor covers the same TIER. A cheaper or
|
|
333
|
+
* specialist tier with no newer equivalent is NOT superseded merely because
|
|
334
|
+
* its version number is lower (Google's sole pro tier `gemini-3.1-pro-preview`
|
|
335
|
+
* alongside the newer flash flagship; `qwen3-coder-plus`; `kimi-k2.7-code`) —
|
|
336
|
+
* hiding those would leave a provider with no cheap option. Mark those
|
|
337
|
+
* {@link deprecatedAt} at most. The invariant is enforced by
|
|
338
|
+
* `__tests__/lookup.test.ts`: two selectable models of the same family at
|
|
339
|
+
* different versions fail unless listed there as a documented exception.
|
|
340
|
+
*/
|
|
341
|
+
supersededBy?: string
|
|
313
342
|
}
|
|
314
343
|
```
|
|
315
344
|
|
|
@@ -424,7 +453,8 @@ function effectiveModelRegion(modelDef: ModelDefinition | undefined, requested?:
|
|
|
424
453
|
Get models that are currently usable — filtered to only providers that are available.
|
|
425
454
|
|
|
426
455
|
The caller passes in which provider IDs are active (i.e. have a bond wired).
|
|
427
|
-
|
|
456
|
+
Models that are not {@link isSelectableModel} — `disabled` or superseded by a
|
|
457
|
+
newer generation — are excluded; they are never offered for selection.
|
|
428
458
|
|
|
429
459
|
```typescript
|
|
430
460
|
function getAvailableModels(
|
|
@@ -434,16 +464,16 @@ function getAvailableModels(
|
|
|
434
464
|
|
|
435
465
|
- `availableProviders` — Set or array of provider IDs that have active bonds.
|
|
436
466
|
|
|
437
|
-
**Returns:**
|
|
467
|
+
**Returns:** Selectable models whose provider is in the available set.
|
|
438
468
|
|
|
439
469
|
#### `getModel(id)`
|
|
440
470
|
|
|
441
471
|
Look up a model definition by ID.
|
|
442
472
|
|
|
443
|
-
Returns `disabled` models too: a saved selection or a
|
|
444
|
-
may reference a since-retired model,
|
|
445
|
-
{@link MODEL_IDS} / {@link getAvailableModels}
|
|
446
|
-
|
|
473
|
+
Returns `disabled` and `supersededBy` models too: a saved selection or a
|
|
474
|
+
historical usage row may reference a since-retired or since-superseded model,
|
|
475
|
+
and it must stay priceable. Use {@link MODEL_IDS} / {@link getAvailableModels}
|
|
476
|
+
(or {@link isSelectableModel}) to decide what is _selectable_.
|
|
447
477
|
|
|
448
478
|
```typescript
|
|
449
479
|
function getModel(id: string): ModelDefinition | undefined
|
|
@@ -465,6 +495,21 @@ function getModelsByProvider(provider: AIProviderID): readonly ModelDefinition[]
|
|
|
465
495
|
|
|
466
496
|
**Returns:** Array of model definitions for that provider.
|
|
467
497
|
|
|
498
|
+
#### `isSelectableModel(model)`
|
|
499
|
+
|
|
500
|
+
Whether a model may be offered for selection: not `disabled` (retired
|
|
501
|
+
upstream) and not `supersededBy` a newer generation of its own family. Both
|
|
502
|
+
kinds stay in the catalog for pricing — this predicate is the single place
|
|
503
|
+
that decides _exposure_, so every listing/validation surface agrees.
|
|
504
|
+
|
|
505
|
+
```typescript
|
|
506
|
+
function isSelectableModel(model: Pick<ModelDefinition, 'disabled' | 'supersededBy'>): boolean
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
- `model` — The model definition (or the two flags from one).
|
|
510
|
+
|
|
511
|
+
**Returns:** True when the model may be listed and chosen.
|
|
512
|
+
|
|
468
513
|
#### `list(_req, res)`
|
|
469
514
|
|
|
470
515
|
Returns models whose `provider` has a bond registered under the `'ai'`
|
|
@@ -518,6 +563,22 @@ function priceMultiplierAt(modelDef: ModelDefinition | undefined, at: Date): num
|
|
|
518
563
|
|
|
519
564
|
**Returns:** The multiplier (`1` outside peak windows or when none are declared).
|
|
520
565
|
|
|
566
|
+
#### `resolveSelectableModelId(id)`
|
|
567
|
+
|
|
568
|
+
Resolve a model id FORWARD to the selectable model that replaces it, following
|
|
569
|
+
the {@link ModelDefinition.supersededBy} chain (a saved `qwen3.7-max` →
|
|
570
|
+
`qwen3.8-max`). Lets a persisted selection keep the user's intent — the same
|
|
571
|
+
tier from the same provider — instead of falling back to the platform default
|
|
572
|
+
once the older generation stops being offered.
|
|
573
|
+
|
|
574
|
+
```typescript
|
|
575
|
+
function resolveSelectableModelId(id: string): string | undefined
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
- `id` — The persisted model id.
|
|
579
|
+
|
|
580
|
+
**Returns:** The selectable successor's id, the id itself when it is already selectable, or `undefined` for an unknown or `disabled` model (nothing to forward to).
|
|
581
|
+
|
|
521
582
|
### Constants
|
|
522
583
|
|
|
523
584
|
#### `MODEL_IDS`
|
|
@@ -525,8 +586,9 @@ function priceMultiplierAt(modelDef: ModelDefinition | undefined, at: Date): num
|
|
|
525
586
|
Set of _selectable_ model IDs for fast validation.
|
|
526
587
|
|
|
527
588
|
Excludes `disabled` models so a retired model (e.g. `grok-code-fast-1`) can
|
|
528
|
-
never be chosen for a new chat,
|
|
529
|
-
|
|
589
|
+
never be chosen for a new chat, and `supersededBy` models so an older
|
|
590
|
+
generation of a family (e.g. `qwen3.7-max` next to `qwen3.8-max`) is never
|
|
591
|
+
offered — while {@link getModel} still resolves both for historical pricing.
|
|
530
592
|
|
|
531
593
|
```typescript
|
|
532
594
|
const MODEL_IDS: ReadonlySet<string>
|
|
@@ -554,6 +616,18 @@ Effort is each model's OWN native value — there is no abstract scale (see
|
|
|
554
616
|
control) carries `thinkingConfigurable: false` and OMITS both fields —
|
|
555
617
|
there is nothing to tune.
|
|
556
618
|
|
|
619
|
+
ONE GENERATION PER FAMILY. When a provider ships a newer generation of a
|
|
620
|
+
model line, the older entry gets `supersededBy: '<newer id>'` and stops being
|
|
621
|
+
offered — the picker never shows both `qwen3.7-max` and `qwen3.8-max`. The
|
|
622
|
+
entry is NEVER deleted: `getModel()` still resolves it so saved selections and
|
|
623
|
+
historical usage stay priceable, and a persisted id resolves forward to the
|
|
624
|
+
successor. Supersede only within the same TIER: a cheaper or specialist model
|
|
625
|
+
with no newer equivalent (`gemini-3.1-pro-preview`, `qwen3-coder-plus`,
|
|
626
|
+
`kimi-k2.7-code`, `grok-build-0.1`) keeps at most `deprecatedAt`, so every
|
|
627
|
+
provider keeps a real choice. `__tests__/lookup.test.ts` fails on any two
|
|
628
|
+
selectable models of one family at different versions that aren't a
|
|
629
|
+
documented exception.
|
|
630
|
+
|
|
557
631
|
Sources (verified 2026-07-28; OpenAI re-verified 2026-07-31 after the
|
|
558
632
|
2026-07-30 GPT-5.6 repricing — cross-check prices against models.dev with
|
|
559
633
|
`npm run check:model-freshness` from the workspace root):
|
|
@@ -563,6 +637,9 @@ Sources (verified 2026-07-28; OpenAI re-verified 2026-07-31 after the
|
|
|
563
637
|
opus-4-8 superseded by opus-5 at identical pricing but still served — it is
|
|
564
638
|
the recommended refusal-fallback model; effort ladder on all three current
|
|
565
639
|
models is low|medium|high|xhigh|max; budget_tokens 400s on 4.7+)
|
|
640
|
+
(re-verified 2026-08-06: added opus-4-7 — legacy but Active, $5/$25,
|
|
641
|
+
cache $0.50/$6.25, 1M ctx / 128K out per the overview + pricing pages;
|
|
642
|
+
models.dev first listed it 2026-08-06)
|
|
566
643
|
- OpenAI: https://developers.openai.com/api/docs/pricing (GPT-5.6 family GA
|
|
567
644
|
2026-07-09; REPRICED 2026-07-30: -luna cut 80% to $0.20/$1.20, -terra cut
|
|
568
645
|
20% to $2/$12, -sol unchanged $5/$30; cache read 0.1× input; gpt-5.5/
|
|
@@ -582,18 +659,28 @@ Sources (verified 2026-07-28; OpenAI re-verified 2026-07-31 after the
|
|
|
582
659
|
Pro/Flash pricing; legacy deepseek-chat/-reasoner ids fully retired
|
|
583
660
|
2026-07-24 — never in this catalog; the announced peak-hour 2× surcharge is
|
|
584
661
|
still NOT active as of 2026-07-28, see the entries)
|
|
585
|
-
- Moonshot: https://platform.kimi.ai/docs/models
|
|
662
|
+
- Moonshot: https://platform.kimi.ai/docs/models + DeepInfra's model API for
|
|
663
|
+
the US re-host (kimi-k3 flagship 2026-07-16
|
|
586
664
|
— 2.8T MoE, 1M ctx, $3/$15 — NOT added: thinking is forced-on with
|
|
587
665
|
reasoning_content that must be replayed through tool loops, the same
|
|
588
|
-
constraint that
|
|
589
|
-
|
|
590
|
-
|
|
666
|
+
constraint that kept kimi-k2.7-code out. BOTH are now in the catalog: the
|
|
667
|
+
moonshot bond gained preserved thinking (reasoning replayed through tool
|
|
668
|
+
loops), so kimi-k3 is the Moonshot pick.)
|
|
591
669
|
- MiniMax: https://platform.minimax.io/docs/guides/pricing-paygo (unchanged;
|
|
592
670
|
minimax-m3 $0.30/$1.20 is a "permanent 50% off" list rate)
|
|
593
671
|
- Alibaba: https://www.alibabacloud.com/help/en/model-studio/deep-thinking
|
|
594
|
-
(
|
|
595
|
-
|
|
596
|
-
|
|
672
|
+
(qwen3.8-max GA'd 2026-08-03 on the pay-as-you-go international API and is
|
|
673
|
+
IN the catalog — verified 2026-08-04: flat $2/$6 per MTok on
|
|
674
|
+
help.aliyun.com/en/model-studio/model-pricing (Singapore International
|
|
675
|
+
CNY 14.988/44.965 at the same fixed conversion that maps qwen3.7-max's
|
|
676
|
+
CNY 18.736/56.207 to its $2.50/$7.50 list), 1M ctx, hybrid thinking,
|
|
677
|
+
tools. Cache rates come from the ZH context-cache doc
|
|
678
|
+
(help.aliyun.com/zh/model-studio/context-cache), which lists qwen3.8-max
|
|
679
|
+
as supported in every region under the unconditional standard table
|
|
680
|
+
(implicit: hit 20% of input, creation 100%; explicit: hit 10%, creation
|
|
681
|
+
125%) — the EN edition of that doc simply lags (zero qwen3.8 mentions),
|
|
682
|
+
which an earlier pass misread as "excepted/console-only". qwen3.7-max
|
|
683
|
+
still runs its 50%-off promo — billed here at list, $2.50/$7.50)
|
|
597
684
|
- Zhipu: https://docs.z.ai/guides/overview/pricing (unchanged; glm-5.2 is
|
|
598
685
|
the newest — "GLM-5.3/5.5" rumors have no released ids as of 2026-07-28)
|
|
599
686
|
|
package/dist/handlers/list.d.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* `GET /ai/models` — returns the catalog of available AI models.
|
|
3
3
|
*
|
|
4
4
|
* Filters the central `MODELS` list to only those whose provider is currently
|
|
5
|
-
* bonded under the `'ai'` category AND are
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* bonded under the `'ai'` category AND are selectable — neither `disabled` (a
|
|
6
|
+
* model the provider retired) nor superseded by a newer generation of the same
|
|
7
|
+
* family, so the picker offers exactly one generation per family. Both kinds
|
|
8
|
+
* stay priceable via `getModel`. No further projection is applied — every
|
|
9
|
+
* `ModelDefinition` field is fine to expose to authenticated clients today.
|
|
9
10
|
*
|
|
10
11
|
* Secure-by-default: this handler enforces authentication IN the handler
|
|
11
12
|
* (`res.locals.session.userId`) and fails closed with `401` for an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/handlers/list.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/handlers/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAM/E;;;;;;;;;;;GAWG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CActF"}
|
package/dist/handlers/list.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* `GET /ai/models` — returns the catalog of available AI models.
|
|
3
3
|
*
|
|
4
4
|
* Filters the central `MODELS` list to only those whose provider is currently
|
|
5
|
-
* bonded under the `'ai'` category AND are
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* bonded under the `'ai'` category AND are selectable — neither `disabled` (a
|
|
6
|
+
* model the provider retired) nor superseded by a newer generation of the same
|
|
7
|
+
* family, so the picker offers exactly one generation per family. Both kinds
|
|
8
|
+
* stay priceable via `getModel`. No further projection is applied — every
|
|
9
|
+
* `ModelDefinition` field is fine to expose to authenticated clients today.
|
|
9
10
|
*
|
|
10
11
|
* Secure-by-default: this handler enforces authentication IN the handler
|
|
11
12
|
* (`res.locals.session.userId`) and fails closed with `401` for an
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
*/
|
|
20
21
|
import { getAll } from '@molecule/api-bond';
|
|
21
22
|
import { t } from '@molecule/api-i18n';
|
|
23
|
+
import { isSelectableModel } from '../lookup.js';
|
|
22
24
|
import { MODELS } from '../models.js';
|
|
23
25
|
/**
|
|
24
26
|
* Returns models whose `provider` has a bond registered under the `'ai'`
|
|
@@ -42,7 +44,7 @@ export async function list(_req, res) {
|
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
const bondedProviders = new Set(getAll('ai').keys());
|
|
45
|
-
const models = MODELS.filter((m) => bondedProviders.has(m.provider) &&
|
|
47
|
+
const models = MODELS.filter((m) => bondedProviders.has(m.provider) && isSelectableModel(m));
|
|
46
48
|
const response = { models: [...models] };
|
|
47
49
|
res.json(response);
|
|
48
50
|
}
|
package/dist/lookup.d.ts
CHANGED
|
@@ -4,21 +4,45 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import type { AIProviderID, ModelDefinition } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Whether a model may be offered for selection: not `disabled` (retired
|
|
9
|
+
* upstream) and not `supersededBy` a newer generation of its own family. Both
|
|
10
|
+
* kinds stay in the catalog for pricing — this predicate is the single place
|
|
11
|
+
* that decides *exposure*, so every listing/validation surface agrees.
|
|
12
|
+
*
|
|
13
|
+
* @param model - The model definition (or the two flags from one).
|
|
14
|
+
* @returns True when the model may be listed and chosen.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSelectableModel(model: Pick<ModelDefinition, 'disabled' | 'supersededBy'>): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a model id FORWARD to the selectable model that replaces it, following
|
|
19
|
+
* the {@link ModelDefinition.supersededBy} chain (a saved `qwen3.7-max` →
|
|
20
|
+
* `qwen3.8-max`). Lets a persisted selection keep the user's intent — the same
|
|
21
|
+
* tier from the same provider — instead of falling back to the platform default
|
|
22
|
+
* once the older generation stops being offered.
|
|
23
|
+
*
|
|
24
|
+
* @param id - The persisted model id.
|
|
25
|
+
* @returns The selectable successor's id, the id itself when it is already
|
|
26
|
+
* selectable, or `undefined` for an unknown or `disabled` model (nothing to
|
|
27
|
+
* forward to).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveSelectableModelId(id: string): string | undefined;
|
|
7
30
|
/**
|
|
8
31
|
* Set of *selectable* model IDs for fast validation.
|
|
9
32
|
*
|
|
10
33
|
* Excludes `disabled` models so a retired model (e.g. `grok-code-fast-1`) can
|
|
11
|
-
* never be chosen for a new chat,
|
|
12
|
-
*
|
|
34
|
+
* never be chosen for a new chat, and `supersededBy` models so an older
|
|
35
|
+
* generation of a family (e.g. `qwen3.7-max` next to `qwen3.8-max`) is never
|
|
36
|
+
* offered — while {@link getModel} still resolves both for historical pricing.
|
|
13
37
|
*/
|
|
14
38
|
export declare const MODEL_IDS: ReadonlySet<string>;
|
|
15
39
|
/**
|
|
16
40
|
* Look up a model definition by ID.
|
|
17
41
|
*
|
|
18
|
-
* Returns `disabled` models too: a saved selection or a
|
|
19
|
-
* may reference a since-retired model,
|
|
20
|
-
* {@link MODEL_IDS} / {@link getAvailableModels}
|
|
21
|
-
*
|
|
42
|
+
* Returns `disabled` and `supersededBy` models too: a saved selection or a
|
|
43
|
+
* historical usage row may reference a since-retired or since-superseded model,
|
|
44
|
+
* and it must stay priceable. Use {@link MODEL_IDS} / {@link getAvailableModels}
|
|
45
|
+
* (or {@link isSelectableModel}) to decide what is *selectable*.
|
|
22
46
|
*
|
|
23
47
|
* @param id - The API model ID.
|
|
24
48
|
* @returns The model definition, or `undefined` if not found.
|
|
@@ -35,10 +59,11 @@ export declare function getModelsByProvider(provider: AIProviderID): readonly Mo
|
|
|
35
59
|
* Get models that are currently usable — filtered to only providers that are available.
|
|
36
60
|
*
|
|
37
61
|
* The caller passes in which provider IDs are active (i.e. have a bond wired).
|
|
38
|
-
*
|
|
62
|
+
* Models that are not {@link isSelectableModel} — `disabled` or superseded by a
|
|
63
|
+
* newer generation — are excluded; they are never offered for selection.
|
|
39
64
|
*
|
|
40
65
|
* @param availableProviders - Set or array of provider IDs that have active bonds.
|
|
41
|
-
* @returns
|
|
66
|
+
* @returns Selectable models whose provider is in the available set.
|
|
42
67
|
*/
|
|
43
68
|
export declare function getAvailableModels(availableProviders: ReadonlySet<AIProviderID> | readonly AIProviderID[]): readonly ModelDefinition[];
|
|
44
69
|
/**
|
package/dist/lookup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../src/lookup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE/D
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../src/lookup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE/D;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,cAAc,CAAC,GACxD,OAAO,CAET;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASvE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,CAEzC,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,eAAe,EAAE,CAEtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,SAAS,YAAY,EAAE,GACtE,SAAS,eAAe,EAAE,CAI5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,CAYzF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAGR;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,iBAAiB,EAAE,MAAM,CAAA;IACzB,8CAA8C;IAC9C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,qBAAqB,EAAE,MAAM,CAAA;IAC7B,0DAA0D;IAC1D,sBAAsB,EAAE,MAAM,CAAA;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAiB/F"}
|
package/dist/lookup.js
CHANGED
|
@@ -4,21 +4,57 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { MODELS } from './models.js';
|
|
7
|
+
/**
|
|
8
|
+
* Whether a model may be offered for selection: not `disabled` (retired
|
|
9
|
+
* upstream) and not `supersededBy` a newer generation of its own family. Both
|
|
10
|
+
* kinds stay in the catalog for pricing — this predicate is the single place
|
|
11
|
+
* that decides *exposure*, so every listing/validation surface agrees.
|
|
12
|
+
*
|
|
13
|
+
* @param model - The model definition (or the two flags from one).
|
|
14
|
+
* @returns True when the model may be listed and chosen.
|
|
15
|
+
*/
|
|
16
|
+
export function isSelectableModel(model) {
|
|
17
|
+
return !model.disabled && !model.supersededBy;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolve a model id FORWARD to the selectable model that replaces it, following
|
|
21
|
+
* the {@link ModelDefinition.supersededBy} chain (a saved `qwen3.7-max` →
|
|
22
|
+
* `qwen3.8-max`). Lets a persisted selection keep the user's intent — the same
|
|
23
|
+
* tier from the same provider — instead of falling back to the platform default
|
|
24
|
+
* once the older generation stops being offered.
|
|
25
|
+
*
|
|
26
|
+
* @param id - The persisted model id.
|
|
27
|
+
* @returns The selectable successor's id, the id itself when it is already
|
|
28
|
+
* selectable, or `undefined` for an unknown or `disabled` model (nothing to
|
|
29
|
+
* forward to).
|
|
30
|
+
*/
|
|
31
|
+
export function resolveSelectableModelId(id) {
|
|
32
|
+
let model = getModel(id);
|
|
33
|
+
// Bounded by the catalog size: a supersession cycle would otherwise spin here,
|
|
34
|
+
// and the invariant that forbids one is a test, not a runtime guarantee.
|
|
35
|
+
for (let hops = 0; model && !isSelectableModel(model) && hops <= MODELS.length; hops++) {
|
|
36
|
+
if (!model.supersededBy)
|
|
37
|
+
return undefined; // disabled — no successor declared
|
|
38
|
+
model = getModel(model.supersededBy);
|
|
39
|
+
}
|
|
40
|
+
return model && isSelectableModel(model) ? model.id : undefined;
|
|
41
|
+
}
|
|
7
42
|
/**
|
|
8
43
|
* Set of *selectable* model IDs for fast validation.
|
|
9
44
|
*
|
|
10
45
|
* Excludes `disabled` models so a retired model (e.g. `grok-code-fast-1`) can
|
|
11
|
-
* never be chosen for a new chat,
|
|
12
|
-
*
|
|
46
|
+
* never be chosen for a new chat, and `supersededBy` models so an older
|
|
47
|
+
* generation of a family (e.g. `qwen3.7-max` next to `qwen3.8-max`) is never
|
|
48
|
+
* offered — while {@link getModel} still resolves both for historical pricing.
|
|
13
49
|
*/
|
|
14
|
-
export const MODEL_IDS = new Set(MODELS.filter(
|
|
50
|
+
export const MODEL_IDS = new Set(MODELS.filter(isSelectableModel).map((m) => m.id));
|
|
15
51
|
/**
|
|
16
52
|
* Look up a model definition by ID.
|
|
17
53
|
*
|
|
18
|
-
* Returns `disabled` models too: a saved selection or a
|
|
19
|
-
* may reference a since-retired model,
|
|
20
|
-
* {@link MODEL_IDS} / {@link getAvailableModels}
|
|
21
|
-
*
|
|
54
|
+
* Returns `disabled` and `supersededBy` models too: a saved selection or a
|
|
55
|
+
* historical usage row may reference a since-retired or since-superseded model,
|
|
56
|
+
* and it must stay priceable. Use {@link MODEL_IDS} / {@link getAvailableModels}
|
|
57
|
+
* (or {@link isSelectableModel}) to decide what is *selectable*.
|
|
22
58
|
*
|
|
23
59
|
* @param id - The API model ID.
|
|
24
60
|
* @returns The model definition, or `undefined` if not found.
|
|
@@ -39,14 +75,15 @@ export function getModelsByProvider(provider) {
|
|
|
39
75
|
* Get models that are currently usable — filtered to only providers that are available.
|
|
40
76
|
*
|
|
41
77
|
* The caller passes in which provider IDs are active (i.e. have a bond wired).
|
|
42
|
-
*
|
|
78
|
+
* Models that are not {@link isSelectableModel} — `disabled` or superseded by a
|
|
79
|
+
* newer generation — are excluded; they are never offered for selection.
|
|
43
80
|
*
|
|
44
81
|
* @param availableProviders - Set or array of provider IDs that have active bonds.
|
|
45
|
-
* @returns
|
|
82
|
+
* @returns Selectable models whose provider is in the available set.
|
|
46
83
|
*/
|
|
47
84
|
export function getAvailableModels(availableProviders) {
|
|
48
85
|
const providerSet = availableProviders instanceof Set ? availableProviders : new Set(availableProviders);
|
|
49
|
-
return MODELS.filter((m) => providerSet.has(m.provider) &&
|
|
86
|
+
return MODELS.filter((m) => providerSet.has(m.provider) && isSelectableModel(m));
|
|
50
87
|
}
|
|
51
88
|
/**
|
|
52
89
|
* The price multiplier in effect for a model at a given instant.
|
package/dist/models.d.ts
CHANGED
|
@@ -28,6 +28,18 @@ import type { ModelDefinition } from './types.js';
|
|
|
28
28
|
* control) carries `thinkingConfigurable: false` and OMITS both fields —
|
|
29
29
|
* there is nothing to tune.
|
|
30
30
|
*
|
|
31
|
+
* ONE GENERATION PER FAMILY. When a provider ships a newer generation of a
|
|
32
|
+
* model line, the older entry gets `supersededBy: '<newer id>'` and stops being
|
|
33
|
+
* offered — the picker never shows both `qwen3.7-max` and `qwen3.8-max`. The
|
|
34
|
+
* entry is NEVER deleted: `getModel()` still resolves it so saved selections and
|
|
35
|
+
* historical usage stay priceable, and a persisted id resolves forward to the
|
|
36
|
+
* successor. Supersede only within the same TIER: a cheaper or specialist model
|
|
37
|
+
* with no newer equivalent (`gemini-3.1-pro-preview`, `qwen3-coder-plus`,
|
|
38
|
+
* `kimi-k2.7-code`, `grok-build-0.1`) keeps at most `deprecatedAt`, so every
|
|
39
|
+
* provider keeps a real choice. `__tests__/lookup.test.ts` fails on any two
|
|
40
|
+
* selectable models of one family at different versions that aren't a
|
|
41
|
+
* documented exception.
|
|
42
|
+
*
|
|
31
43
|
* Sources (verified 2026-07-28; OpenAI re-verified 2026-07-31 after the
|
|
32
44
|
* 2026-07-30 GPT-5.6 repricing — cross-check prices against models.dev with
|
|
33
45
|
* `npm run check:model-freshness` from the workspace root):
|
|
@@ -36,6 +48,9 @@ import type { ModelDefinition } from './types.js';
|
|
|
36
48
|
* opus-4-8 superseded by opus-5 at identical pricing but still served — it is
|
|
37
49
|
* the recommended refusal-fallback model; effort ladder on all three current
|
|
38
50
|
* models is low|medium|high|xhigh|max; budget_tokens 400s on 4.7+)
|
|
51
|
+
* (re-verified 2026-08-06: added opus-4-7 — legacy but Active, $5/$25,
|
|
52
|
+
* cache $0.50/$6.25, 1M ctx / 128K out per the overview + pricing pages;
|
|
53
|
+
* models.dev first listed it 2026-08-06)
|
|
39
54
|
* - OpenAI: https://developers.openai.com/api/docs/pricing (GPT-5.6 family GA
|
|
40
55
|
* 2026-07-09; REPRICED 2026-07-30: -luna cut 80% to $0.20/$1.20, -terra cut
|
|
41
56
|
* 20% to $2/$12, -sol unchanged $5/$30; cache read 0.1× input; gpt-5.5/
|
|
@@ -55,18 +70,28 @@ import type { ModelDefinition } from './types.js';
|
|
|
55
70
|
* Pro/Flash pricing; legacy deepseek-chat/-reasoner ids fully retired
|
|
56
71
|
* 2026-07-24 — never in this catalog; the announced peak-hour 2× surcharge is
|
|
57
72
|
* still NOT active as of 2026-07-28, see the entries)
|
|
58
|
-
* - Moonshot: https://platform.kimi.ai/docs/models
|
|
73
|
+
* - Moonshot: https://platform.kimi.ai/docs/models + DeepInfra's model API for
|
|
74
|
+
* the US re-host (kimi-k3 flagship 2026-07-16
|
|
59
75
|
* — 2.8T MoE, 1M ctx, $3/$15 — NOT added: thinking is forced-on with
|
|
60
76
|
* reasoning_content that must be replayed through tool loops, the same
|
|
61
|
-
* constraint that
|
|
62
|
-
*
|
|
63
|
-
*
|
|
77
|
+
* constraint that kept kimi-k2.7-code out. BOTH are now in the catalog: the
|
|
78
|
+
* moonshot bond gained preserved thinking (reasoning replayed through tool
|
|
79
|
+
* loops), so kimi-k3 is the Moonshot pick.)
|
|
64
80
|
* - MiniMax: https://platform.minimax.io/docs/guides/pricing-paygo (unchanged;
|
|
65
81
|
* minimax-m3 $0.30/$1.20 is a "permanent 50% off" list rate)
|
|
66
82
|
* - Alibaba: https://www.alibabacloud.com/help/en/model-studio/deep-thinking
|
|
67
|
-
* (
|
|
68
|
-
*
|
|
69
|
-
*
|
|
83
|
+
* (qwen3.8-max GA'd 2026-08-03 on the pay-as-you-go international API and is
|
|
84
|
+
* IN the catalog — verified 2026-08-04: flat $2/$6 per MTok on
|
|
85
|
+
* help.aliyun.com/en/model-studio/model-pricing (Singapore International
|
|
86
|
+
* CNY 14.988/44.965 at the same fixed conversion that maps qwen3.7-max's
|
|
87
|
+
* CNY 18.736/56.207 to its $2.50/$7.50 list), 1M ctx, hybrid thinking,
|
|
88
|
+
* tools. Cache rates come from the ZH context-cache doc
|
|
89
|
+
* (help.aliyun.com/zh/model-studio/context-cache), which lists qwen3.8-max
|
|
90
|
+
* as supported in every region under the unconditional standard table
|
|
91
|
+
* (implicit: hit 20% of input, creation 100%; explicit: hit 10%, creation
|
|
92
|
+
* 125%) — the EN edition of that doc simply lags (zero qwen3.8 mentions),
|
|
93
|
+
* which an earlier pass misread as "excepted/console-only". qwen3.7-max
|
|
94
|
+
* still runs its 50%-off promo — billed here at list, $2.50/$7.50)
|
|
70
95
|
* - Zhipu: https://docs.z.ai/guides/overview/pricing (unchanged; glm-5.2 is
|
|
71
96
|
* the newest — "GLM-5.3/5.5" rumors have no released ids as of 2026-07-28)
|
|
72
97
|
*
|
package/dist/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,eAAe,EAqxCnC,CAAA"}
|
package/dist/models.js
CHANGED
|
@@ -27,6 +27,18 @@
|
|
|
27
27
|
* control) carries `thinkingConfigurable: false` and OMITS both fields —
|
|
28
28
|
* there is nothing to tune.
|
|
29
29
|
*
|
|
30
|
+
* ONE GENERATION PER FAMILY. When a provider ships a newer generation of a
|
|
31
|
+
* model line, the older entry gets `supersededBy: '<newer id>'` and stops being
|
|
32
|
+
* offered — the picker never shows both `qwen3.7-max` and `qwen3.8-max`. The
|
|
33
|
+
* entry is NEVER deleted: `getModel()` still resolves it so saved selections and
|
|
34
|
+
* historical usage stay priceable, and a persisted id resolves forward to the
|
|
35
|
+
* successor. Supersede only within the same TIER: a cheaper or specialist model
|
|
36
|
+
* with no newer equivalent (`gemini-3.1-pro-preview`, `qwen3-coder-plus`,
|
|
37
|
+
* `kimi-k2.7-code`, `grok-build-0.1`) keeps at most `deprecatedAt`, so every
|
|
38
|
+
* provider keeps a real choice. `__tests__/lookup.test.ts` fails on any two
|
|
39
|
+
* selectable models of one family at different versions that aren't a
|
|
40
|
+
* documented exception.
|
|
41
|
+
*
|
|
30
42
|
* Sources (verified 2026-07-28; OpenAI re-verified 2026-07-31 after the
|
|
31
43
|
* 2026-07-30 GPT-5.6 repricing — cross-check prices against models.dev with
|
|
32
44
|
* `npm run check:model-freshness` from the workspace root):
|
|
@@ -35,6 +47,9 @@
|
|
|
35
47
|
* opus-4-8 superseded by opus-5 at identical pricing but still served — it is
|
|
36
48
|
* the recommended refusal-fallback model; effort ladder on all three current
|
|
37
49
|
* models is low|medium|high|xhigh|max; budget_tokens 400s on 4.7+)
|
|
50
|
+
* (re-verified 2026-08-06: added opus-4-7 — legacy but Active, $5/$25,
|
|
51
|
+
* cache $0.50/$6.25, 1M ctx / 128K out per the overview + pricing pages;
|
|
52
|
+
* models.dev first listed it 2026-08-06)
|
|
38
53
|
* - OpenAI: https://developers.openai.com/api/docs/pricing (GPT-5.6 family GA
|
|
39
54
|
* 2026-07-09; REPRICED 2026-07-30: -luna cut 80% to $0.20/$1.20, -terra cut
|
|
40
55
|
* 20% to $2/$12, -sol unchanged $5/$30; cache read 0.1× input; gpt-5.5/
|
|
@@ -54,18 +69,28 @@
|
|
|
54
69
|
* Pro/Flash pricing; legacy deepseek-chat/-reasoner ids fully retired
|
|
55
70
|
* 2026-07-24 — never in this catalog; the announced peak-hour 2× surcharge is
|
|
56
71
|
* still NOT active as of 2026-07-28, see the entries)
|
|
57
|
-
* - Moonshot: https://platform.kimi.ai/docs/models
|
|
72
|
+
* - Moonshot: https://platform.kimi.ai/docs/models + DeepInfra's model API for
|
|
73
|
+
* the US re-host (kimi-k3 flagship 2026-07-16
|
|
58
74
|
* — 2.8T MoE, 1M ctx, $3/$15 — NOT added: thinking is forced-on with
|
|
59
75
|
* reasoning_content that must be replayed through tool loops, the same
|
|
60
|
-
* constraint that
|
|
61
|
-
*
|
|
62
|
-
*
|
|
76
|
+
* constraint that kept kimi-k2.7-code out. BOTH are now in the catalog: the
|
|
77
|
+
* moonshot bond gained preserved thinking (reasoning replayed through tool
|
|
78
|
+
* loops), so kimi-k3 is the Moonshot pick.)
|
|
63
79
|
* - MiniMax: https://platform.minimax.io/docs/guides/pricing-paygo (unchanged;
|
|
64
80
|
* minimax-m3 $0.30/$1.20 is a "permanent 50% off" list rate)
|
|
65
81
|
* - Alibaba: https://www.alibabacloud.com/help/en/model-studio/deep-thinking
|
|
66
|
-
* (
|
|
67
|
-
*
|
|
68
|
-
*
|
|
82
|
+
* (qwen3.8-max GA'd 2026-08-03 on the pay-as-you-go international API and is
|
|
83
|
+
* IN the catalog — verified 2026-08-04: flat $2/$6 per MTok on
|
|
84
|
+
* help.aliyun.com/en/model-studio/model-pricing (Singapore International
|
|
85
|
+
* CNY 14.988/44.965 at the same fixed conversion that maps qwen3.7-max's
|
|
86
|
+
* CNY 18.736/56.207 to its $2.50/$7.50 list), 1M ctx, hybrid thinking,
|
|
87
|
+
* tools. Cache rates come from the ZH context-cache doc
|
|
88
|
+
* (help.aliyun.com/zh/model-studio/context-cache), which lists qwen3.8-max
|
|
89
|
+
* as supported in every region under the unconditional standard table
|
|
90
|
+
* (implicit: hit 20% of input, creation 100%; explicit: hit 10%, creation
|
|
91
|
+
* 125%) — the EN edition of that doc simply lags (zero qwen3.8 mentions),
|
|
92
|
+
* which an earlier pass misread as "excepted/console-only". qwen3.7-max
|
|
93
|
+
* still runs its 50%-off promo — billed here at list, $2.50/$7.50)
|
|
69
94
|
* - Zhipu: https://docs.z.ai/guides/overview/pricing (unchanged; glm-5.2 is
|
|
70
95
|
* the newest — "GLM-5.3/5.5" rumors have no released ids as of 2026-07-28)
|
|
71
96
|
*
|
|
@@ -179,9 +204,11 @@ export const MODELS = [
|
|
|
179
204
|
cacheReadPricePerMTok: 0.5,
|
|
180
205
|
cacheWritePricePerMTok: 6.25,
|
|
181
206
|
knowledgeCutoff: '2026-01-01',
|
|
182
|
-
// Superseded by claude-opus-5 (same price); still served upstream
|
|
183
|
-
// recommended refusal-fallback target
|
|
207
|
+
// Superseded by claude-opus-5 (same price, same tier); still served upstream
|
|
208
|
+
// and the recommended refusal-fallback target, so it stays priceable and
|
|
209
|
+
// callable by id — it is just not OFFERED, since opus-5 is a drop-in.
|
|
184
210
|
deprecatedAt: '2026-07-28',
|
|
211
|
+
supersededBy: 'claude-opus-5',
|
|
185
212
|
},
|
|
186
213
|
{
|
|
187
214
|
id: 'claude-sonnet-5',
|
|
@@ -213,6 +240,43 @@ export const MODELS = [
|
|
|
213
240
|
cacheWritePricePerMTok: 3.75,
|
|
214
241
|
knowledgeCutoff: '2026-01-01',
|
|
215
242
|
},
|
|
243
|
+
{
|
|
244
|
+
id: 'claude-opus-4-7',
|
|
245
|
+
provider: 'anthropic',
|
|
246
|
+
label: 'Claude Opus 4.7',
|
|
247
|
+
description: 'Older Opus — long-horizon agentic work, knowledge work & vision',
|
|
248
|
+
contextWindow: 1_000_000,
|
|
249
|
+
maxOutputTokens: 128_000,
|
|
250
|
+
supportsThinking: true,
|
|
251
|
+
thinkingBudgetTokens: 16_000,
|
|
252
|
+
thinkingConfigurable: true,
|
|
253
|
+
supportedEffortLevels: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
254
|
+
defaultEffortLevel: 'high',
|
|
255
|
+
// Adaptive thinking only — budget_tokens is REJECTED (400); xhigh effort
|
|
256
|
+
// debuted on this model. Unlike opus-5, omitting `thinking` runs WITHOUT
|
|
257
|
+
// thinking — set {type:"adaptive"} explicitly. First model on the new
|
|
258
|
+
// tokenizer (~30% more tokens than 4.6 for the same text).
|
|
259
|
+
supportsVision: true,
|
|
260
|
+
supportsPromptCaching: true,
|
|
261
|
+
supportsTools: true,
|
|
262
|
+
webSearchToolType: 'web_search_20260209',
|
|
263
|
+
codeExecutionToolType: 'code_execution_20250825',
|
|
264
|
+
webFetchToolType: 'web_fetch_20260209',
|
|
265
|
+
inputPricePerMTok: 5,
|
|
266
|
+
outputPricePerMTok: 25,
|
|
267
|
+
// Anthropic 5-minute prompt cache: read 0.1× input, write 1.25× input.
|
|
268
|
+
cacheReadPricePerMTok: 0.5,
|
|
269
|
+
cacheWritePricePerMTok: 6.25,
|
|
270
|
+
knowledgeCutoff: '2026-01-01',
|
|
271
|
+
// Superseded by claude-opus-4-8 (launched 2026-05-28) at identical pricing;
|
|
272
|
+
// still Active upstream (deprecations page 2026-08-06: retires no sooner
|
|
273
|
+
// than 2027-04-16). NO fast mode — speed:"fast" on 4.7 returns an error
|
|
274
|
+
// (pricing page, fast-mode section). `supersededBy` names the CURRENT
|
|
275
|
+
// selectable Opus (opus-5), not the also-superseded 4.8, so a saved
|
|
276
|
+
// selection resolves forward in one hop.
|
|
277
|
+
deprecatedAt: '2026-05-28',
|
|
278
|
+
supersededBy: 'claude-opus-5',
|
|
279
|
+
},
|
|
216
280
|
{
|
|
217
281
|
id: 'claude-opus-4-6',
|
|
218
282
|
provider: 'anthropic',
|
|
@@ -239,8 +303,9 @@ export const MODELS = [
|
|
|
239
303
|
cacheReadPricePerMTok: 0.5,
|
|
240
304
|
cacheWritePricePerMTok: 6.25,
|
|
241
305
|
knowledgeCutoff: '2025-05-01',
|
|
242
|
-
// Superseded by
|
|
306
|
+
// Superseded by the current Opus (opus-5) — kept priceable, not offered.
|
|
243
307
|
deprecatedAt: '2026-06-16',
|
|
308
|
+
supersededBy: 'claude-opus-5',
|
|
244
309
|
},
|
|
245
310
|
{
|
|
246
311
|
id: 'claude-sonnet-4-6',
|
|
@@ -269,8 +334,9 @@ export const MODELS = [
|
|
|
269
334
|
cacheReadPricePerMTok: 0.3,
|
|
270
335
|
cacheWritePricePerMTok: 3.75,
|
|
271
336
|
knowledgeCutoff: '2025-08-01',
|
|
272
|
-
// Superseded by claude-sonnet-5
|
|
337
|
+
// Superseded by claude-sonnet-5 (same tier) — kept priceable, not offered.
|
|
273
338
|
deprecatedAt: '2026-07-07',
|
|
339
|
+
supersededBy: 'claude-sonnet-5',
|
|
274
340
|
},
|
|
275
341
|
{
|
|
276
342
|
id: 'claude-haiku-4-5-20251001',
|
|
@@ -425,9 +491,10 @@ export const MODELS = [
|
|
|
425
491
|
cacheReadPricePerMTok: 0.5,
|
|
426
492
|
cacheWritePricePerMTok: 5,
|
|
427
493
|
knowledgeCutoff: '2025-12-01',
|
|
428
|
-
// Superseded by gpt-5.6-sol (same
|
|
429
|
-
// OpenAI
|
|
494
|
+
// Superseded by gpt-5.6-sol (same frontier tier, same $5/$30); still listed
|
|
495
|
+
// as current by OpenAI, so it stays priceable — it is just not offered.
|
|
430
496
|
deprecatedAt: '2026-07-09',
|
|
497
|
+
supersededBy: 'gpt-5.6-sol',
|
|
431
498
|
},
|
|
432
499
|
{
|
|
433
500
|
id: 'gpt-5.4',
|
|
@@ -455,9 +522,11 @@ export const MODELS = [
|
|
|
455
522
|
cacheWritePricePerMTok: 2.5,
|
|
456
523
|
knowledgeCutoff: '2025-08-31',
|
|
457
524
|
// OpenAI still lists gpt-5.4 as current, but gpt-5.6-terra covers this
|
|
458
|
-
// tier
|
|
459
|
-
//
|
|
525
|
+
// balanced tier for LESS ($2/$12 vs $2.50/$15) — superseded, so the picker
|
|
526
|
+
// offers only the 5.6 generation (this is OUR taxonomy, not OpenAI's
|
|
527
|
+
// deprecations page; the model stays priceable).
|
|
460
528
|
deprecatedAt: '2026-07-28',
|
|
529
|
+
supersededBy: 'gpt-5.6-terra',
|
|
461
530
|
},
|
|
462
531
|
{
|
|
463
532
|
id: 'gpt-5.4-mini',
|
|
@@ -484,11 +553,12 @@ export const MODELS = [
|
|
|
484
553
|
cacheReadPricePerMTok: 0.075,
|
|
485
554
|
cacheWritePricePerMTok: 0.75,
|
|
486
555
|
knowledgeCutoff: '2025-08-31',
|
|
487
|
-
//
|
|
488
|
-
//
|
|
489
|
-
//
|
|
490
|
-
//
|
|
556
|
+
// Superseded by gpt-5.6-luna, which IS the newer cheap/fast tier and is
|
|
557
|
+
// strictly better on every axis that made this the budget pick: $0.20/$1.20
|
|
558
|
+
// vs $0.75/$4.50 after the 2026-07-30 repricing, and a 1M window vs 400K.
|
|
559
|
+
// Hiding it therefore costs OpenAI no cheap option. Stays priceable.
|
|
491
560
|
deprecatedAt: '2026-08-01',
|
|
561
|
+
supersededBy: 'gpt-5.6-luna',
|
|
492
562
|
},
|
|
493
563
|
// ---------------------------------------------------------------------------
|
|
494
564
|
// Google
|
|
@@ -562,9 +632,10 @@ export const MODELS = [
|
|
|
562
632
|
cacheReadPricePerMTok: 0.15,
|
|
563
633
|
cacheWritePricePerMTok: 1.5,
|
|
564
634
|
knowledgeCutoff: '2025-01-01',
|
|
565
|
-
// Superseded by gemini-3.6-flash (2026-07-21)
|
|
566
|
-
//
|
|
635
|
+
// Superseded by gemini-3.6-flash (2026-07-21) — same flash tier, same input
|
|
636
|
+
// price, cheaper output. Still served upstream, so it stays priceable.
|
|
567
637
|
deprecatedAt: '2026-07-21',
|
|
638
|
+
supersededBy: 'gemini-3.6-flash',
|
|
568
639
|
},
|
|
569
640
|
{
|
|
570
641
|
id: 'gemini-3.1-pro-preview',
|
|
@@ -594,6 +665,10 @@ export const MODELS = [
|
|
|
594
665
|
cacheReadPricePerMTok: 0.2,
|
|
595
666
|
cacheWritePricePerMTok: 2,
|
|
596
667
|
knowledgeCutoff: '2025-01-01',
|
|
668
|
+
// NOT superseded despite the lower version number: this is Google's only
|
|
669
|
+
// PRO-tier id (no GA "3.5/3.6 Pro" exists), and the 3.6 flash flagship is a
|
|
670
|
+
// different tier. Superseding it would leave Google with no deep-reasoning
|
|
671
|
+
// option at all — see `ModelDefinition.supersededBy` (same-tier rule).
|
|
597
672
|
},
|
|
598
673
|
// ---------------------------------------------------------------------------
|
|
599
674
|
// xAI (Grok)
|
|
@@ -657,9 +732,13 @@ export const MODELS = [
|
|
|
657
732
|
cacheReadPricePerMTok: 0.2,
|
|
658
733
|
cacheWritePricePerMTok: 1.25,
|
|
659
734
|
knowledgeCutoff: '2025-12-01',
|
|
660
|
-
// Superseded by grok-4.5
|
|
661
|
-
//
|
|
735
|
+
// Superseded by grok-4.5: the previous version of the same general-purpose
|
|
736
|
+
// Grok line, not a separately-named tier. It keeps a bigger window (1M vs
|
|
737
|
+
// 500K) and a lower price, which is why it was previously left selectable —
|
|
738
|
+
// but offering two generations of one family is exactly what the picker no
|
|
739
|
+
// longer does, and grok-4.5 is xAI's own recommendation. Stays priceable.
|
|
662
740
|
deprecatedAt: '2026-07-28',
|
|
741
|
+
supersededBy: 'grok-4.5',
|
|
663
742
|
},
|
|
664
743
|
{
|
|
665
744
|
id: 'grok-build-0.1',
|
|
@@ -686,6 +765,9 @@ export const MODELS = [
|
|
|
686
765
|
// Not published by xAI — best-effort estimate (grok-4-generation base).
|
|
687
766
|
knowledgeCutoff: '2025-06-01',
|
|
688
767
|
// Niche coding beta; grok-4.5 is the xAI pick — kept out of the main list.
|
|
768
|
+
// NOT superseded: its own family (grok-build) has no newer version, and it
|
|
769
|
+
// is xAI's cheapest tool-capable model, so it stays selectable under
|
|
770
|
+
// "Older models" (and is the deliberately-weak live selftest target).
|
|
689
771
|
deprecatedAt: '2026-07-28',
|
|
690
772
|
},
|
|
691
773
|
{
|
|
@@ -845,9 +927,13 @@ export const MODELS = [
|
|
|
845
927
|
// though Flash's US list price is BELOW native, its cache reads are 6.4×,
|
|
846
928
|
// and the plan/execute pair defaults to one region deliberately.
|
|
847
929
|
regions: ['cn', 'us'],
|
|
848
|
-
// US = DeepInfra, verified 2026-08-
|
|
930
|
+
// US = DeepInfra, verified 2026-08-13 against the id the bond actually
|
|
931
|
+
// sends: `deepseek-ai/DeepSeek-V4-Flash-0731`, the official release that
|
|
932
|
+
// supersedes the preview weights still served under the un-dated id
|
|
933
|
+
// (cents_per_input_token 0.000008, cents_per_output_token 0.000018,
|
|
934
|
+
// rate_per_input_token_cached 0.2 → cache read = 0.2 × input).
|
|
849
935
|
regionPricing: {
|
|
850
|
-
us: { inputPricePerMTok: 0.
|
|
936
|
+
us: { inputPricePerMTok: 0.08, outputPricePerMTok: 0.18, cacheReadPricePerMTok: 0.016 },
|
|
851
937
|
},
|
|
852
938
|
// Peak-hour surcharge NOT active (see deepseek-v4-pro) — windows removed.
|
|
853
939
|
// Not published by DeepSeek — best-effort estimate.
|
|
@@ -864,6 +950,12 @@ export const MODELS = [
|
|
|
864
950
|
// and kimi-k2.7-code (coding flagship — forced thinking, no depth knob).
|
|
865
951
|
// kimi-k2.x thinking stays on/off only; the bond disables it for those by
|
|
866
952
|
// default (KIMI_REASONING_EFFORT env tunes it).
|
|
953
|
+
// EVERY moonshot entry declares `regions` explicitly. A model that omits the
|
|
954
|
+
// field defaults to `['us']` (effectiveModelRegion), which would route it to
|
|
955
|
+
// the bare `moonshot` bond — DeepInfra when its key is set — with an id that
|
|
956
|
+
// host has never heard of, i.e. a 404 at dispatch. The freshness gate's
|
|
957
|
+
// region-re-host coverage check fails on exactly that (a us-region moonshot
|
|
958
|
+
// model missing from the bond's modelMap).
|
|
867
959
|
// ---------------------------------------------------------------------------
|
|
868
960
|
{
|
|
869
961
|
id: 'kimi-k3',
|
|
@@ -890,8 +982,21 @@ export const MODELS = [
|
|
|
890
982
|
// Automatic context cache: absolute cache-hit price ($0.30/M = 0.1× input).
|
|
891
983
|
cacheReadPricePerMTok: 0.3,
|
|
892
984
|
cacheWritePricePerMTok: 3,
|
|
893
|
-
//
|
|
894
|
-
|
|
985
|
+
// US default = DeepInfra, verified 2026-08-13 against
|
|
986
|
+
// api.deepinfra.com/models/moonshotai/Kimi-K3: cents_per_input_token
|
|
987
|
+
// 0.000285 → $2.85/MTok, cents_per_output_token 0.001425 → $14.25/MTok,
|
|
988
|
+
// rate_per_input_token_cached 0.1 → cache read $0.285/MTok, and
|
|
989
|
+
// rate_per_input_token_cache_write null → no write premium (the omitted
|
|
990
|
+
// cache-write field falls back to the region's input rate). Cheaper than
|
|
991
|
+
// Moonshot native on every axis, which is why US leads (see the
|
|
992
|
+
// cheapest-default-region invariant in __tests__/lookup.test.ts).
|
|
993
|
+
// The host serves the full 1M context, unquantized, and returns
|
|
994
|
+
// reasoning_content while accepting reasoning_effort — probed live
|
|
995
|
+
// 2026-08-13 — so the preserved-thinking tool loop works there unchanged.
|
|
996
|
+
regions: ['us', 'cn'],
|
|
997
|
+
regionPricing: {
|
|
998
|
+
us: { inputPricePerMTok: 2.85, outputPricePerMTok: 14.25, cacheReadPricePerMTok: 0.285 },
|
|
999
|
+
},
|
|
895
1000
|
// Not published — best-effort estimate.
|
|
896
1001
|
knowledgeCutoff: '2026-01-01',
|
|
897
1002
|
},
|
|
@@ -916,15 +1021,21 @@ export const MODELS = [
|
|
|
916
1021
|
// Automatic context cache: absolute cache-hit price ($0.19/M = 0.2× input).
|
|
917
1022
|
cacheReadPricePerMTok: 0.19,
|
|
918
1023
|
cacheWritePricePerMTok: 0.95,
|
|
919
|
-
// US default (DeepInfra bills below native here).
|
|
1024
|
+
// US default (DeepInfra bills below native here). Re-verified 2026-08-13
|
|
1025
|
+
// against api.deepinfra.com/models/moonshotai/Kimi-K2.7-Code — the host
|
|
1026
|
+
// repriced since 2026-08-01 ($0.74/$3.50/$0.15): cents_per_input_token
|
|
1027
|
+
// 0.000068, cents_per_output_token 0.00034, rate_per_input_token_cached
|
|
1028
|
+
// 0.2 → cache read $0.136, no write premium.
|
|
920
1029
|
regions: ['us', 'cn'],
|
|
921
1030
|
regionPricing: {
|
|
922
|
-
us: { inputPricePerMTok: 0.
|
|
1031
|
+
us: { inputPricePerMTok: 0.68, outputPricePerMTok: 3.4, cacheReadPricePerMTok: 0.136 },
|
|
923
1032
|
},
|
|
924
1033
|
// Not published — best-effort estimate.
|
|
925
1034
|
knowledgeCutoff: '2025-10-01',
|
|
926
|
-
// kimi-k3 is the Moonshot pick
|
|
927
|
-
//
|
|
1035
|
+
// kimi-k3 is the Moonshot pick, but this is NOT superseded: the coding
|
|
1036
|
+
// specialist is a distinct, much cheaper tier ($0.95/$4 vs $3/$15) with no
|
|
1037
|
+
// K3 equivalent, so it stays selectable under "Older models" — superseding
|
|
1038
|
+
// it would leave Moonshot with only the flagship.
|
|
928
1039
|
deprecatedAt: '2026-07-28',
|
|
929
1040
|
},
|
|
930
1041
|
{
|
|
@@ -956,8 +1067,9 @@ export const MODELS = [
|
|
|
956
1067
|
us: { inputPricePerMTok: 0.75, outputPricePerMTok: 3.5, cacheReadPricePerMTok: 0.15 },
|
|
957
1068
|
},
|
|
958
1069
|
knowledgeCutoff: '2025-04-01',
|
|
959
|
-
// Superseded by kimi-k3
|
|
1070
|
+
// Superseded by kimi-k3 (same general-purpose line) — kept priceable.
|
|
960
1071
|
deprecatedAt: '2026-07-28',
|
|
1072
|
+
supersededBy: 'kimi-k3',
|
|
961
1073
|
},
|
|
962
1074
|
{
|
|
963
1075
|
id: 'kimi-k2.5',
|
|
@@ -984,9 +1096,11 @@ export const MODELS = [
|
|
|
984
1096
|
us: { inputPricePerMTok: 0.45, outputPricePerMTok: 2.25, cacheReadPricePerMTok: 0.07 },
|
|
985
1097
|
},
|
|
986
1098
|
knowledgeCutoff: '2024-04-01',
|
|
987
|
-
//
|
|
988
|
-
//
|
|
1099
|
+
// Two generations behind. `supersededBy` names the current selectable Kimi
|
|
1100
|
+
// (k3) rather than the also-superseded k2.6, so a saved selection resolves
|
|
1101
|
+
// forward in one hop. Still served upstream; stays priceable.
|
|
989
1102
|
deprecatedAt: '2026-04-01',
|
|
1103
|
+
supersededBy: 'kimi-k3',
|
|
990
1104
|
},
|
|
991
1105
|
// ---------------------------------------------------------------------------
|
|
992
1106
|
// MiniMax
|
|
@@ -1055,9 +1169,9 @@ export const MODELS = [
|
|
|
1055
1169
|
us: { inputPricePerMTok: 0.25, outputPricePerMTok: 1, cacheReadPricePerMTok: 0.05 },
|
|
1056
1170
|
},
|
|
1057
1171
|
knowledgeCutoff: '2025-09-01',
|
|
1058
|
-
// Superseded by minimax-m3 (same price, 1M ctx, multimodal)
|
|
1059
|
-
// "Older models".
|
|
1172
|
+
// Superseded by minimax-m3 (same price, 1M ctx, multimodal) — kept priceable.
|
|
1060
1173
|
deprecatedAt: '2026-07-28',
|
|
1174
|
+
supersededBy: 'minimax-m3',
|
|
1061
1175
|
},
|
|
1062
1176
|
{
|
|
1063
1177
|
id: 'minimax-m2.5',
|
|
@@ -1080,23 +1194,60 @@ export const MODELS = [
|
|
|
1080
1194
|
// No US re-host exists (not on DeepInfra) — pinned to native China.
|
|
1081
1195
|
regions: ['cn'],
|
|
1082
1196
|
knowledgeCutoff: '2025-01-01',
|
|
1083
|
-
// Superseded by minimax-m3 (legacy upstream, still served)
|
|
1084
|
-
// (Older models) + priceable.
|
|
1197
|
+
// Superseded by minimax-m3 (legacy upstream, still served) — kept priceable.
|
|
1085
1198
|
deprecatedAt: '2026-03-18',
|
|
1199
|
+
supersededBy: 'minimax-m3',
|
|
1086
1200
|
},
|
|
1087
1201
|
// ---------------------------------------------------------------------------
|
|
1088
1202
|
// Alibaba (Qwen)
|
|
1089
1203
|
// Verified: https://www.alibabacloud.com/help/en/model-studio/deep-thinking
|
|
1090
1204
|
// https://www.alibabacloud.com/help/en/model-studio/qwen-coder
|
|
1091
1205
|
// https://openrouter.ai/qwen/qwen3.7-max
|
|
1092
|
-
// qwen3.
|
|
1093
|
-
// docs now recommend the general-purpose models over
|
|
1206
|
+
// qwen3.8-max (2026-08-03) is the agentic flagship, succeeding qwen3.7-max —
|
|
1207
|
+
// Alibaba's own Qwen-Coder docs now recommend the general-purpose models over
|
|
1208
|
+
// Qwen-Coder. Their thinking
|
|
1094
1209
|
// uses enable_thinking (default ON for the 3.7 series) + thinking_budget
|
|
1095
1210
|
// (token cap) — a real budget param, so effort scales the budget. The
|
|
1096
1211
|
// qwen3-coder models are NON-thinking (previous catalog entry was wrong).
|
|
1097
1212
|
// Prices are DashScope international list rates (the bond calls DashScope,
|
|
1098
1213
|
// not OpenRouter; a 50%-off promo currently applies — billed at list).
|
|
1099
1214
|
// ---------------------------------------------------------------------------
|
|
1215
|
+
// qwen3.8-max (GA 2026-08-03) succeeds qwen3.7-max as the agentic flagship,
|
|
1216
|
+
// priced BELOW it at $2/$6 (intl CNY 14.988/44.965, same fixed conversion).
|
|
1217
|
+
// Same hybrid thinking mechanism as the 3.7 series (enable_thinking default
|
|
1218
|
+
// ON + thinking_budget; preserve_thinking supported). Context cache uses the
|
|
1219
|
+
// standard implicit rates — see the Sources block for the ZH-doc citation.
|
|
1220
|
+
{
|
|
1221
|
+
id: 'qwen3.8-max',
|
|
1222
|
+
provider: 'alibaba',
|
|
1223
|
+
label: 'Qwen3.8 Max',
|
|
1224
|
+
description: 'Alibaba agentic flagship — 1M context, hybrid thinking',
|
|
1225
|
+
contextWindow: 1_000_000,
|
|
1226
|
+
// Alibaba's public pages don't state a max-output figure; models.dev says
|
|
1227
|
+
// 131,072 — kept at the 3.7-max figure until the provider publishes one
|
|
1228
|
+
// (understating only shortens completions; overstating would error).
|
|
1229
|
+
maxOutputTokens: 65_536,
|
|
1230
|
+
supportsThinking: true,
|
|
1231
|
+
thinkingBudgetTokens: 8_000,
|
|
1232
|
+
thinkingConfigurable: true,
|
|
1233
|
+
supportedEffortLevels: ['4K', '8K', '16K', '32K'],
|
|
1234
|
+
defaultEffortLevel: '8K',
|
|
1235
|
+
effortBudgetTokens: { '4K': 4000, '8K': 8000, '16K': 16000, '32K': 32000 },
|
|
1236
|
+
// models.dev claims image+video input, but Alibaba's own model catalog
|
|
1237
|
+
// lists qwen3.8-max under text generation (VL remains a separate line) —
|
|
1238
|
+
// false until the provider's page says otherwise.
|
|
1239
|
+
supportsVision: false,
|
|
1240
|
+
supportsPromptCaching: true,
|
|
1241
|
+
supportsTools: true,
|
|
1242
|
+
inputPricePerMTok: 2,
|
|
1243
|
+
outputPricePerMTok: 6,
|
|
1244
|
+
// Implicit context cache: read = 20% of input, no write premium.
|
|
1245
|
+
cacheReadPricePerMTok: 0.4,
|
|
1246
|
+
cacheWritePricePerMTok: 2,
|
|
1247
|
+
regions: ['us', 'cn'],
|
|
1248
|
+
// Not published by Alibaba — best-effort estimate.
|
|
1249
|
+
knowledgeCutoff: '2026-04-01',
|
|
1250
|
+
},
|
|
1100
1251
|
{
|
|
1101
1252
|
id: 'qwen3.7-max',
|
|
1102
1253
|
provider: 'alibaba',
|
|
@@ -1125,6 +1276,11 @@ export const MODELS = [
|
|
|
1125
1276
|
regions: ['us', 'cn'],
|
|
1126
1277
|
// Not published by Alibaba — best-effort estimate.
|
|
1127
1278
|
knowledgeCutoff: '2026-01-01',
|
|
1279
|
+
// Superseded by qwen3.8-max (GA 2026-08-03): same tier and mechanism, and
|
|
1280
|
+
// CHEAPER at list ($2/$6 vs $2.50/$7.50). Still served upstream (the 50%-off
|
|
1281
|
+
// promo runs on this id), so it stays priceable — it is just not offered.
|
|
1282
|
+
deprecatedAt: '2026-08-03',
|
|
1283
|
+
supersededBy: 'qwen3.8-max',
|
|
1128
1284
|
},
|
|
1129
1285
|
{
|
|
1130
1286
|
id: 'qwen3-coder-plus',
|
|
@@ -1154,8 +1310,11 @@ export const MODELS = [
|
|
|
1154
1310
|
us: { inputPricePerMTok: 0.3, outputPricePerMTok: 1, cacheReadPricePerMTok: 0.1 },
|
|
1155
1311
|
},
|
|
1156
1312
|
knowledgeCutoff: '2025-06-01',
|
|
1157
|
-
// Alibaba itself recommends the general-purpose models over Qwen-Coder
|
|
1158
|
-
//
|
|
1313
|
+
// Alibaba itself recommends the general-purpose models over Qwen-Coder, so
|
|
1314
|
+
// this sits in "Older models" — but it is NOT superseded: it is a distinct
|
|
1315
|
+
// coding specialist and Alibaba's cheap tier (US $0.30/$1 vs qwen3.8-max's
|
|
1316
|
+
// $2/$6), with no newer coder id. Superseding it would leave Alibaba with
|
|
1317
|
+
// only the flagship.
|
|
1159
1318
|
deprecatedAt: '2026-07-28',
|
|
1160
1319
|
},
|
|
1161
1320
|
// ---------------------------------------------------------------------------
|
|
@@ -1227,7 +1386,9 @@ export const MODELS = [
|
|
|
1227
1386
|
us: { inputPricePerMTok: 0.6, outputPricePerMTok: 2.08, cacheReadPricePerMTok: 0.12 },
|
|
1228
1387
|
},
|
|
1229
1388
|
knowledgeCutoff: '2025-01-01',
|
|
1230
|
-
// Superseded by glm-5.2
|
|
1389
|
+
// Superseded by glm-5.2 (same line, bigger window, reasoning_effort) — kept
|
|
1390
|
+
// priceable.
|
|
1231
1391
|
deprecatedAt: '2026-07-28',
|
|
1392
|
+
supersededBy: 'glm-5.2',
|
|
1232
1393
|
},
|
|
1233
1394
|
];
|
package/dist/types.d.ts
CHANGED
|
@@ -282,6 +282,35 @@ export interface ModelDefinition {
|
|
|
282
282
|
* or its past usage silently meters as free. Omit entirely for active models.
|
|
283
283
|
*/
|
|
284
284
|
disabled?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* The id of the NEWER-generation model that replaces this one, set on the
|
|
287
|
+
* OLDER entry and naming its successor (e.g. `qwen3.7-max` carries
|
|
288
|
+
* `supersededBy: 'qwen3.8-max'`).
|
|
289
|
+
*
|
|
290
|
+
* A superseded model is NOT selectable — like {@link disabled} it is excluded
|
|
291
|
+
* from `MODEL_IDS`, `getAvailableModels()`, the `GET /ai/models` listing and
|
|
292
|
+
* the client-side picker partitions, so a user is only ever offered the
|
|
293
|
+
* newest generation of a family. It differs from `disabled` in *why* and in
|
|
294
|
+
* what it points at: a disabled model is one the provider retired (it can no
|
|
295
|
+
* longer answer), whereas a superseded model is usually still served upstream
|
|
296
|
+
* and simply has nothing to offer over its successor — and the successor id
|
|
297
|
+
* is a real migration target, so a saved selection can resolve forward
|
|
298
|
+
* (`resolveSelectableModelId`) instead of silently falling back to the
|
|
299
|
+
* platform default.
|
|
300
|
+
*
|
|
301
|
+
* `getModel(id)` STILL returns a superseded entry — historical usage must stay
|
|
302
|
+
* priceable, so NEVER delete one.
|
|
303
|
+
*
|
|
304
|
+
* Set this ONLY when the successor covers the same TIER. A cheaper or
|
|
305
|
+
* specialist tier with no newer equivalent is NOT superseded merely because
|
|
306
|
+
* its version number is lower (Google's sole pro tier `gemini-3.1-pro-preview`
|
|
307
|
+
* alongside the newer flash flagship; `qwen3-coder-plus`; `kimi-k2.7-code`) —
|
|
308
|
+
* hiding those would leave a provider with no cheap option. Mark those
|
|
309
|
+
* {@link deprecatedAt} at most. The invariant is enforced by
|
|
310
|
+
* `__tests__/lookup.test.ts`: two selectable models of the same family at
|
|
311
|
+
* different versions fail unless listed there as a documented exception.
|
|
312
|
+
*/
|
|
313
|
+
supersededBy?: string;
|
|
285
314
|
}
|
|
286
315
|
/**
|
|
287
316
|
* The model ids the SERVER falls back to per mode/job when the user hasn't
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,UAAU,GACV,MAAM,GACN,UAAU,GACV,SAAS,GACT,SAAS,GACT,OAAO;AACT;;;;;GAKG;GACD,QAAQ,CAAA;AAEZ;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,QAAQ,EAAE,YAAY,CAAA;IACtB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,WAAW,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