@molecule/api-resource-ai-models 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/handlers/list.js +1 -1
- package/dist/models.d.ts +28 -4
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +117 -18
- package/package.json +4 -4
package/dist/handlers/list.js
CHANGED
|
@@ -45,7 +45,7 @@ export async function list(_req, res) {
|
|
|
45
45
|
const userId = res.locals.session?.userId;
|
|
46
46
|
if (!userId) {
|
|
47
47
|
res.status(401).json({
|
|
48
|
-
error: t('resource.error.unauthorized', undefined, { defaultValue: 'Unauthorized' }),
|
|
48
|
+
error: t('resource.error.unauthorized', undefined, { defaultValue: 'Unauthorized.' }),
|
|
49
49
|
errorKey: 'resource.error.unauthorized',
|
|
50
50
|
});
|
|
51
51
|
return;
|
package/dist/models.d.ts
CHANGED
|
@@ -255,11 +255,17 @@ import type { ModelDefinition } from './types.js';
|
|
|
255
255
|
* cataloged superseded by grok-4.7.
|
|
256
256
|
* grok-4.5 still served at $2/$6, cached $0.30; grok-4.3 still served at
|
|
257
257
|
* $1.25/$2.50 with the bigger 1M window; grok-code-fast-1 no longer listed)
|
|
258
|
-
* - Chinese public holidays (DeepSeek's peak excludes them):
|
|
259
|
-
*
|
|
260
|
-
*
|
|
258
|
+
* - Chinese public holidays (DeepSeek's peak excludes them): the State
|
|
259
|
+
* Council's notices — 2026 at
|
|
260
|
+
* https://www.12371.gov.cn/web/article/web/content_1451614684968525824.html,
|
|
261
|
+
* 2027 (published 2026-11-05, read 2026-11-17) at
|
|
262
|
+
* https://paper.people.com.cn/rmrb/pc/content/202611/06/content_30189674.html
|
|
263
|
+
* (see CHINA_PUBLIC_HOLIDAYS)
|
|
261
264
|
* - DeepSeek: https://api-docs.deepseek.com/quick_start/pricing +
|
|
262
|
-
* /updates/ (
|
|
265
|
+
* /updates/ (2026-11-17: the 2027 State Council holiday notice landed above —
|
|
266
|
+
* no DeepSeek card change; this morning's freshness-gate chunk read found the
|
|
267
|
+
* peak-rule sentence and every price unchanged, so the 2026-10-20
|
|
268
|
+
* verification stands. Earlier, verified 2026-10-20 — the whole rate card RE-READ, unchanged:
|
|
263
269
|
* pro 0.66/1.98/0.022 off-peak ×2 peak, flash 0.15/0.6/0.003, peak windows
|
|
264
270
|
* and the Chinese-public-holidays exclusion verbatim as before. The page is
|
|
265
271
|
* now a client-rendered SPA — its HTML is an app shell and the card text
|
|
@@ -374,6 +380,24 @@ import type { ModelDefinition } from './types.js';
|
|
|
374
380
|
* model page still describes it (docs lag the endpoint). The catalog entry
|
|
375
381
|
* dropped its cn region and is now US/DeepInfra-only, whose rates re-verified
|
|
376
382
|
* unchanged the same day: $0.30/$1, cache read 0.3333× input.)
|
|
383
|
+
* (re-verified 2026-11-17 across the provider's own pages: qwen4-max
|
|
384
|
+
* (released 2026-11-16) ADDED. alibabacloud.com/help/en/model-studio/
|
|
385
|
+
* qwen4-max + the EN model-pricing page: Singapore intl $1.5/$4.5 with
|
|
386
|
+
* explicit/implicit cache read $0.075 (5% of input) and every Global region
|
|
387
|
+
* at $1.413/$4.24 with cache read $0.071 — the ZH context-cache doc lists
|
|
388
|
+
* qwen4-max OUTSIDE its standard 20% cache-read table and defers to the
|
|
389
|
+
* console, whose per-region figures the pricing page publishes (explicit
|
|
390
|
+
* 5m creation 125%, 1h 200%; implicit creation 1× input). 1M ctx / 131,072
|
|
391
|
+
* out (262,144 thinking), Text+Image+Video input in every region, hybrid
|
|
392
|
+
* thinking ON by default (thinking_budget, native reasoning_effort
|
|
393
|
+
* low|high|xhigh exists but the bond sends the budget form), parallel tool
|
|
394
|
+
* calling. US = DeepInfra (Qwen/Qwen4-Max), read live the same day off
|
|
395
|
+
* api.deepinfra.com/models/Qwen/Qwen4-Max: $1.413/$4.24, cache read
|
|
396
|
+
* 0.0502477× input = $0.071, no write premium, multimodal + input-video
|
|
397
|
+
* tags, and the host's live list carries exactly one qwen4 id (no dated
|
|
398
|
+
* snapshot sibling). Knowledge cutoff: not published by either host —
|
|
399
|
+
* best-effort estimate. qwen4-max supersedes qwen3.8-max: same
|
|
400
|
+
* agentic-flagship tier, cheaper at list on both hosts.)
|
|
377
401
|
* - Zhipu: https://docs.z.ai/guides/overview/pricing + docs.z.ai/guides/llm/
|
|
378
402
|
* glm-5.3 (verified 2026-08-26: glm-5.3 shipped 2026-08-14 and IS in the
|
|
379
403
|
* catalog — $1.40/$4.40, cached $0.26, i.e. glm-5.2's card unchanged, 1M ctx,
|
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;
|
|
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;AAwEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6bG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,eAAe,EAmvFnC,CAAA"}
|
package/dist/models.js
CHANGED
|
@@ -44,8 +44,14 @@ function dateRange(from, to) {
|
|
|
44
44
|
* 2026-09-23). Those windows are 09:00–12:00 and 14:00–18:00 Beijing time, so
|
|
45
45
|
* the Beijing holiday date IS the UTC date of every window.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
* 2026-09-23 at
|
|
47
|
+
* Sources — the State Council's notices, 放假 ranges verbatim:
|
|
48
|
+
* - 2026 (国办发明电〔2025〕7号), read 2026-09-23 at
|
|
49
|
+
* https://www.12371.gov.cn/web/article/web/content_1451614684968525824.html
|
|
50
|
+
* - 2027 (published 2026-11-05), read 2026-11-17 at
|
|
51
|
+
* https://paper.people.com.cn/rmrb/pc/content/202611/06/content_30189674.html
|
|
52
|
+
* (People's Daily reproduction of the 新华社 dispatch; cross-checked against
|
|
53
|
+
* news.ifeng.com/c/8xoAMrtRK7T — all seven clauses and the 2026-11-05 date
|
|
54
|
+
* identical, and every 放假 weekday annotation matches the 2027 calendar).
|
|
49
55
|
* Make-up working days (调休 weekends) need no entry: the peak is Mon–Fri only.
|
|
50
56
|
*
|
|
51
57
|
* ADD NEXT YEAR'S DATES when the State Council publishes them (each November);
|
|
@@ -59,6 +65,13 @@ const CHINA_PUBLIC_HOLIDAYS = [
|
|
|
59
65
|
...dateRange('2026-06-19', '2026-06-21'), // 端午节
|
|
60
66
|
...dateRange('2026-09-25', '2026-09-27'), // 中秋节
|
|
61
67
|
...dateRange('2026-10-01', '2026-10-07'), // 国庆节
|
|
68
|
+
...dateRange('2027-01-01', '2027-01-03'), // 元旦
|
|
69
|
+
...dateRange('2027-02-05', '2027-02-13'), // 春节 (除夕 to 正月初八, 9 days)
|
|
70
|
+
...dateRange('2027-04-03', '2027-04-05'), // 清明节
|
|
71
|
+
...dateRange('2027-05-01', '2027-05-05'), // 劳动节
|
|
72
|
+
...dateRange('2027-06-09', '2027-06-09'), // 端午节 (single day)
|
|
73
|
+
...dateRange('2027-09-15', '2027-09-15'), // 中秋节 (single day)
|
|
74
|
+
...dateRange('2027-10-01', '2027-10-07'), // 国庆节
|
|
62
75
|
];
|
|
63
76
|
/**
|
|
64
77
|
* All available AI models, grouped by provider, ordered from most to least capable.
|
|
@@ -307,11 +320,17 @@ const CHINA_PUBLIC_HOLIDAYS = [
|
|
|
307
320
|
* cataloged superseded by grok-4.7.
|
|
308
321
|
* grok-4.5 still served at $2/$6, cached $0.30; grok-4.3 still served at
|
|
309
322
|
* $1.25/$2.50 with the bigger 1M window; grok-code-fast-1 no longer listed)
|
|
310
|
-
* - Chinese public holidays (DeepSeek's peak excludes them):
|
|
311
|
-
*
|
|
312
|
-
*
|
|
323
|
+
* - Chinese public holidays (DeepSeek's peak excludes them): the State
|
|
324
|
+
* Council's notices — 2026 at
|
|
325
|
+
* https://www.12371.gov.cn/web/article/web/content_1451614684968525824.html,
|
|
326
|
+
* 2027 (published 2026-11-05, read 2026-11-17) at
|
|
327
|
+
* https://paper.people.com.cn/rmrb/pc/content/202611/06/content_30189674.html
|
|
328
|
+
* (see CHINA_PUBLIC_HOLIDAYS)
|
|
313
329
|
* - DeepSeek: https://api-docs.deepseek.com/quick_start/pricing +
|
|
314
|
-
* /updates/ (
|
|
330
|
+
* /updates/ (2026-11-17: the 2027 State Council holiday notice landed above —
|
|
331
|
+
* no DeepSeek card change; this morning's freshness-gate chunk read found the
|
|
332
|
+
* peak-rule sentence and every price unchanged, so the 2026-10-20
|
|
333
|
+
* verification stands. Earlier, verified 2026-10-20 — the whole rate card RE-READ, unchanged:
|
|
315
334
|
* pro 0.66/1.98/0.022 off-peak ×2 peak, flash 0.15/0.6/0.003, peak windows
|
|
316
335
|
* and the Chinese-public-holidays exclusion verbatim as before. The page is
|
|
317
336
|
* now a client-rendered SPA — its HTML is an app shell and the card text
|
|
@@ -426,6 +445,24 @@ const CHINA_PUBLIC_HOLIDAYS = [
|
|
|
426
445
|
* model page still describes it (docs lag the endpoint). The catalog entry
|
|
427
446
|
* dropped its cn region and is now US/DeepInfra-only, whose rates re-verified
|
|
428
447
|
* unchanged the same day: $0.30/$1, cache read 0.3333× input.)
|
|
448
|
+
* (re-verified 2026-11-17 across the provider's own pages: qwen4-max
|
|
449
|
+
* (released 2026-11-16) ADDED. alibabacloud.com/help/en/model-studio/
|
|
450
|
+
* qwen4-max + the EN model-pricing page: Singapore intl $1.5/$4.5 with
|
|
451
|
+
* explicit/implicit cache read $0.075 (5% of input) and every Global region
|
|
452
|
+
* at $1.413/$4.24 with cache read $0.071 — the ZH context-cache doc lists
|
|
453
|
+
* qwen4-max OUTSIDE its standard 20% cache-read table and defers to the
|
|
454
|
+
* console, whose per-region figures the pricing page publishes (explicit
|
|
455
|
+
* 5m creation 125%, 1h 200%; implicit creation 1× input). 1M ctx / 131,072
|
|
456
|
+
* out (262,144 thinking), Text+Image+Video input in every region, hybrid
|
|
457
|
+
* thinking ON by default (thinking_budget, native reasoning_effort
|
|
458
|
+
* low|high|xhigh exists but the bond sends the budget form), parallel tool
|
|
459
|
+
* calling. US = DeepInfra (Qwen/Qwen4-Max), read live the same day off
|
|
460
|
+
* api.deepinfra.com/models/Qwen/Qwen4-Max: $1.413/$4.24, cache read
|
|
461
|
+
* 0.0502477× input = $0.071, no write premium, multimodal + input-video
|
|
462
|
+
* tags, and the host's live list carries exactly one qwen4 id (no dated
|
|
463
|
+
* snapshot sibling). Knowledge cutoff: not published by either host —
|
|
464
|
+
* best-effort estimate. qwen4-max supersedes qwen3.8-max: same
|
|
465
|
+
* agentic-flagship tier, cheaper at list on both hosts.)
|
|
429
466
|
* - Zhipu: https://docs.z.ai/guides/overview/pricing + docs.z.ai/guides/llm/
|
|
430
467
|
* glm-5.3 (verified 2026-08-26: glm-5.3 shipped 2026-08-14 and IS in the
|
|
431
468
|
* catalog — $1.40/$4.40, cached $0.26, i.e. glm-5.2's card unchanged, 1M ctx,
|
|
@@ -2796,20 +2833,78 @@ export const MODELS = [
|
|
|
2796
2833
|
// Verified: https://www.alibabacloud.com/help/en/model-studio/deep-thinking
|
|
2797
2834
|
// https://www.alibabacloud.com/help/en/model-studio/qwen-coder
|
|
2798
2835
|
// https://openrouter.ai/qwen/qwen3.7-max
|
|
2799
|
-
//
|
|
2800
|
-
//
|
|
2801
|
-
//
|
|
2802
|
-
//
|
|
2803
|
-
//
|
|
2804
|
-
//
|
|
2836
|
+
// qwen4-max (2026-11-16) is the agentic flagship, succeeding qwen3.8-max —
|
|
2837
|
+
// multimodal (Text+Image+Video input) on BOTH hosts this generation. Hybrid
|
|
2838
|
+
// thinking uses enable_thinking (default ON) + thinking_budget (token cap) —
|
|
2839
|
+
// a real budget param, so effort scales the budget. (Qwen4-Max also exposes a
|
|
2840
|
+
// native reasoning_effort low|high|xhigh, but the alibaba bond speaks only
|
|
2841
|
+
// the budget form, so the catalog models effort as scaled budgets like the
|
|
2842
|
+
// 3.x flagships.) The qwen3-coder models are NON-thinking.
|
|
2805
2843
|
// Prices are DashScope international list rates (the bond calls DashScope,
|
|
2806
|
-
// not OpenRouter;
|
|
2844
|
+
// not OpenRouter; bill at list).
|
|
2807
2845
|
// ---------------------------------------------------------------------------
|
|
2808
|
-
//
|
|
2846
|
+
// qwen4-max (2026-11-16) succeeds qwen3.8-max as the agentic flagship,
|
|
2847
|
+
// priced BELOW it at $1.5/$4.5 on the Singapore international card (every
|
|
2848
|
+
// other native region and the US re-host bill $1.413/$4.24). Same hybrid
|
|
2849
|
+
// thinking mechanism as the 3.x series. Cache rates are published per region
|
|
2850
|
+
// on the model-pricing page — see the Sources block for the citation.
|
|
2851
|
+
{
|
|
2852
|
+
id: 'qwen4-max',
|
|
2853
|
+
provider: 'alibaba',
|
|
2854
|
+
label: 'Qwen4 Max',
|
|
2855
|
+
description: 'Alibaba agentic flagship — 1M context, multimodal, hybrid thinking',
|
|
2856
|
+
// Model page (verified 2026-11-17): context 1,000,000; max input 991,808
|
|
2857
|
+
// (983,616 thinking); max output 131,072 (262,144 in thinking mode); max
|
|
2858
|
+
// chain-of-thought 262,144. Kept at the non-thinking output figure —
|
|
2859
|
+
// understating only shortens completions.
|
|
2860
|
+
contextWindow: 1_000_000,
|
|
2861
|
+
maxOutputTokens: 131_072,
|
|
2862
|
+
supportsThinking: true,
|
|
2863
|
+
thinkingBudgetTokens: 8_000,
|
|
2864
|
+
thinkingConfigurable: true,
|
|
2865
|
+
supportedEffortLevels: ['4K', '8K', '16K', '32K'],
|
|
2866
|
+
defaultEffortLevel: '8K',
|
|
2867
|
+
effortBudgetTokens: { '4K': 4000, '8K': 8000, '16K': 16000, '32K': 32000 },
|
|
2868
|
+
// Multimodal on BOTH hosts this generation: the model page lists
|
|
2869
|
+
// Text/Image/Video input in every region, and the DeepInfra re-host's own
|
|
2870
|
+
// record tags the id multimodal + input-video (Qwen3.8-Max's re-host
|
|
2871
|
+
// carried no such tags — that is why vision stayed false there).
|
|
2872
|
+
supportsVision: true,
|
|
2873
|
+
supportsPromptCaching: true,
|
|
2874
|
+
supportsTools: true,
|
|
2875
|
+
// Singapore international list card (model page + model-pricing page,
|
|
2876
|
+
// verified 2026-11-17). The ZH context-cache doc lists qwen4-max among the
|
|
2877
|
+
// models OUTSIDE the standard 20% cache-read table and defers to the
|
|
2878
|
+
// console, whose figures the pricing page publishes per region: cache read
|
|
2879
|
+
// $0.075 in Singapore (5% of input; $0.071 in every Global region).
|
|
2880
|
+
// Implicit creation is billed at plain input (write 1×); the explicit 5m
|
|
2881
|
+
// creation premium is 125% = $1.875, which implicit-mode billing never
|
|
2882
|
+
// charges.
|
|
2883
|
+
inputPricePerMTok: 1.5,
|
|
2884
|
+
outputPricePerMTok: 4.5,
|
|
2885
|
+
cacheReadPricePerMTok: 0.075,
|
|
2886
|
+
cacheWritePricePerMTok: 1.5,
|
|
2887
|
+
regions: ['us', 'cn'],
|
|
2888
|
+
// US = DeepInfra (Qwen/Qwen4-Max), verified 2026-11-17 against
|
|
2889
|
+
// api.deepinfra.com/models/Qwen/Qwen4-Max: $1.413/$4.24, cache read
|
|
2890
|
+
// 0.0502477× input = $0.071, no write premium (omitted → region input).
|
|
2891
|
+
// The host's live model list carries exactly one qwen4 id — no dated
|
|
2892
|
+
// snapshot sibling — and the entry is not deprecated.
|
|
2893
|
+
regionPricing: {
|
|
2894
|
+
us: { inputPricePerMTok: 1.413, outputPricePerMTok: 4.24, cacheReadPricePerMTok: 0.071 },
|
|
2895
|
+
},
|
|
2896
|
+
// Not published by Alibaba — best-effort estimate for the Qwen4 generation
|
|
2897
|
+
// (released 2026-11-16).
|
|
2898
|
+
knowledgeCutoff: '2026-08-01',
|
|
2899
|
+
},
|
|
2900
|
+
// qwen3.8-max (GA 2026-08-03) succeeded qwen3.7-max as the agentic flagship,
|
|
2809
2901
|
// priced BELOW it at $2/$6 (intl CNY 14.988/44.965, same fixed conversion).
|
|
2810
2902
|
// Same hybrid thinking mechanism as the 3.7 series (enable_thinking default
|
|
2811
2903
|
// ON + thinking_budget; preserve_thinking supported). Context cache uses the
|
|
2812
2904
|
// standard implicit rates — see the Sources block for the ZH-doc citation.
|
|
2905
|
+
// Superseded by qwen4-max (2026-11-16): same tier at a LOWER list price on
|
|
2906
|
+
// both hosts. Still served upstream, so it stays priceable — just not
|
|
2907
|
+
// offered.
|
|
2813
2908
|
{
|
|
2814
2909
|
id: 'qwen3.8-max',
|
|
2815
2910
|
provider: 'alibaba',
|
|
@@ -2856,6 +2951,8 @@ export const MODELS = [
|
|
|
2856
2951
|
},
|
|
2857
2952
|
// Not published by Alibaba — best-effort estimate.
|
|
2858
2953
|
knowledgeCutoff: '2026-04-01',
|
|
2954
|
+
deprecatedAt: '2026-11-16',
|
|
2955
|
+
supersededBy: 'qwen4-max',
|
|
2859
2956
|
},
|
|
2860
2957
|
{
|
|
2861
2958
|
id: 'qwen3.8-flash',
|
|
@@ -2933,11 +3030,13 @@ export const MODELS = [
|
|
|
2933
3030
|
},
|
|
2934
3031
|
// Not published by Alibaba — best-effort estimate.
|
|
2935
3032
|
knowledgeCutoff: '2026-01-01',
|
|
2936
|
-
// Superseded
|
|
2937
|
-
//
|
|
2938
|
-
//
|
|
3033
|
+
// Superseded (GA 2026-08-03) and now pointed one hop forward at qwen4-max
|
|
3034
|
+
// (2026-11-16): same tier and mechanism, each generation CHEAPER at list
|
|
3035
|
+
// ($2/$6 then $1.5/$4.5, vs this id's $2.50/$7.50). Still served upstream
|
|
3036
|
+
// (the 50%-off promo runs on this id), so it stays priceable — it is just
|
|
3037
|
+
// not offered.
|
|
2939
3038
|
deprecatedAt: '2026-08-03',
|
|
2940
|
-
supersededBy: '
|
|
3039
|
+
supersededBy: 'qwen4-max',
|
|
2941
3040
|
},
|
|
2942
3041
|
{
|
|
2943
3042
|
id: 'qwen3-coder-plus',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-resource-ai-models",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AI model catalog
|
|
3
|
+
"version": "1.21.0",
|
|
4
|
+
"description": "Server-side AI model catalog plus GET /ai/models endpoint",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@molecule/api-bond": "1.0.4",
|
|
31
|
-
"@molecule/api-i18n": "1.0.
|
|
32
|
-
"@molecule/api-resource": "1.1.
|
|
31
|
+
"@molecule/api-i18n": "1.0.6",
|
|
32
|
+
"@molecule/api-resource": "1.1.3",
|
|
33
33
|
"@types/node": "26.6.5",
|
|
34
34
|
"typescript": "6.0.3",
|
|
35
35
|
"vitest": "4.1.12"
|