Skip to content

Commit a5ca6a3

Browse files
chore: sync model metadata from OpenRouter
1 parent e02b661 commit a5ca6a3

7 files changed

Lines changed: 26095 additions & 14589 deletions

File tree

.changeset/sync-models.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@tanstack/ai-anthropic': patch
3+
'@tanstack/ai-grok': patch
4+
'@tanstack/ai-openai': patch
5+
'@tanstack/ai-openrouter': patch
6+
---
7+
8+
Update model metadata from OpenRouter API

packages/ai-anthropic/src/model-meta.ts

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,87 @@ const CLAUDE_SONNET_5 = {
502502
* via the `speed` parameter, not a model id) were removed after Anthropic
503503
* turned them off.
504504
*/
505+
const CLAUDE_OPUS_5 = {
506+
name: 'claude-opus-5',
507+
id: 'claude-opus-5',
508+
context_window: 1_000_000,
509+
max_output_tokens: 128_000,
510+
supports: {
511+
input: ['text', 'image', 'document'],
512+
extended_thinking: true,
513+
priority_tier: true,
514+
tools: [
515+
'web_search',
516+
'web_fetch',
517+
'code_execution',
518+
'computer_use',
519+
'bash',
520+
'text_editor',
521+
'memory',
522+
],
523+
},
524+
pricing: {
525+
input: {
526+
normal: 5,
527+
cached: 0.5,
528+
},
529+
output: {
530+
normal: 25,
531+
},
532+
},
533+
} as const satisfies ModelMeta<
534+
AnthropicContainerOptions &
535+
AnthropicContextManagementOptions &
536+
AnthropicMCPOptions &
537+
AnthropicServiceTierOptions &
538+
AnthropicStopSequencesOptions &
539+
AnthropicThinkingOptions &
540+
AnthropicToolChoiceOptions &
541+
AnthropicSamplingOptions
542+
>
543+
544+
const CLAUDE_OPUS_5_FAST = {
545+
name: 'claude-opus-5-fast',
546+
id: 'claude-opus-5-fast',
547+
context_window: 1_000_000,
548+
max_output_tokens: 128_000,
549+
supports: {
550+
input: ['text', 'image', 'document'],
551+
extended_thinking: true,
552+
priority_tier: true,
553+
tools: [
554+
'web_search',
555+
'web_fetch',
556+
'code_execution',
557+
'computer_use',
558+
'bash',
559+
'text_editor',
560+
'memory',
561+
],
562+
},
563+
pricing: {
564+
input: {
565+
normal: 10,
566+
cached: 1,
567+
},
568+
output: {
569+
normal: 50,
570+
},
571+
},
572+
} as const satisfies ModelMeta<
573+
AnthropicContainerOptions &
574+
AnthropicContextManagementOptions &
575+
AnthropicMCPOptions &
576+
AnthropicServiceTierOptions &
577+
AnthropicStopSequencesOptions &
578+
AnthropicThinkingOptions &
579+
AnthropicToolChoiceOptions &
580+
AnthropicSamplingOptions
581+
>
582+
505583
export const ANTHROPIC_MODELS = [
584+
CLAUDE_OPUS_5.id,
585+
CLAUDE_OPUS_5_FAST.id,
506586
CLAUDE_OPUS_4_6.id,
507587
CLAUDE_OPUS_4_5.id,
508588
CLAUDE_SONNET_4_6.id,
@@ -552,6 +632,8 @@ const ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = {
552632
[CLAUDE_OPUS_4_8.id]: CLAUDE_OPUS_4_8.max_output_tokens,
553633
[CLAUDE_FABLE_5.id]: CLAUDE_FABLE_5.max_output_tokens,
554634
[CLAUDE_SONNET_5.id]: CLAUDE_SONNET_5.max_output_tokens,
635+
[CLAUDE_OPUS_5.id]: CLAUDE_OPUS_5.max_output_tokens,
636+
[CLAUDE_OPUS_5_FAST.id]: CLAUDE_OPUS_5_FAST.max_output_tokens,
555637
}
556638

557639
/**
@@ -728,6 +810,22 @@ export type AnthropicChatModelProviderOptionsByName = {
728810
AnthropicToolChoiceOptions &
729811
AnthropicMaxTokensOptions &
730812
AnthropicOutputConfigOptions
813+
[CLAUDE_OPUS_5.id]: AnthropicContainerOptions &
814+
AnthropicContextManagementOptions &
815+
AnthropicMCPOptions &
816+
AnthropicServiceTierOptions &
817+
AnthropicStopSequencesOptions &
818+
AnthropicThinkingOptions &
819+
AnthropicToolChoiceOptions &
820+
AnthropicSamplingOptions
821+
[CLAUDE_OPUS_5_FAST.id]: AnthropicContainerOptions &
822+
AnthropicContextManagementOptions &
823+
AnthropicMCPOptions &
824+
AnthropicServiceTierOptions &
825+
AnthropicStopSequencesOptions &
826+
AnthropicThinkingOptions &
827+
AnthropicToolChoiceOptions &
828+
AnthropicSamplingOptions
731829
}
732830

733831
export type AnthropicChatModelToolCapabilitiesByName = {
@@ -765,4 +863,6 @@ export type AnthropicModelInputModalitiesByName = {
765863
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input
766864
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input
767865
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input
866+
[CLAUDE_OPUS_5.id]: typeof CLAUDE_OPUS_5.supports.input
867+
[CLAUDE_OPUS_5_FAST.id]: typeof CLAUDE_OPUS_5_FAST.supports.input
768868
}

packages/ai-grok/src/model-meta.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ interface ModelMeta {
2929
}
3030
}
3131

32+
const GROK_4_5 = {
33+
name: 'grok-4.5',
34+
context_window: 500_000,
35+
supports: {
36+
input: ['text', 'image', 'document'],
37+
output: ['text'],
38+
capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],
39+
tools: [],
40+
},
41+
pricing: {
42+
input: {
43+
normal: 2,
44+
cached: 0.3,
45+
},
46+
output: {
47+
normal: 6,
48+
},
49+
},
50+
} as const satisfies ModelMeta
51+
3252
export type GrokProviderToolKind =
3353
| 'web_search'
3454
| 'x_search'
@@ -175,7 +195,11 @@ const GROK_BUILD_0_1 = {
175195
/**
176196
* Grok chat models supported by the Responses adapter.
177197
*/
178-
export const GROK_CHAT_MODELS = [GROK_BUILD_0_1.name, GROK_4_3.name] as const
198+
export const GROK_CHAT_MODELS = [
199+
GROK_4_5.name,
200+
GROK_BUILD_0_1.name,
201+
GROK_4_3.name,
202+
] as const
179203

180204
/**
181205
* Grok Image Generation Models
@@ -261,6 +285,7 @@ export type GrokRealtimeModel = (typeof GROK_REALTIME_MODELS)[number]
261285
export type GrokModelInputModalitiesByName = {
262286
[GROK_4_3.name]: typeof GROK_4_3.supports.input
263287
[GROK_BUILD_0_1.name]: typeof GROK_BUILD_0_1.supports.input
288+
[GROK_4_5.name]: typeof GROK_4_5.supports.input
264289
}
265290

266291
/**

packages/ai-openai/src/model-meta.ts

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,145 @@ const GPT_CHAT_LATEST = {
23622362
OpenAIMetadataOptions
23632363
>
23642364

2365+
const GPT_5_6_LUNA_PRO = {
2366+
name: 'gpt-5.6-luna-pro',
2367+
context_window: 1_050_000,
2368+
max_output_tokens: 128_000,
2369+
supports: {
2370+
input: ['image', 'text'],
2371+
output: ['text'],
2372+
endpoints: ['chat', 'chat-completions'],
2373+
features: [
2374+
'streaming',
2375+
'function_calling',
2376+
'structured_outputs',
2377+
'distillation',
2378+
],
2379+
tools: [
2380+
'web_search',
2381+
'web_search_preview',
2382+
'file_search',
2383+
'image_generation',
2384+
'code_interpreter',
2385+
'mcp',
2386+
'computer_use',
2387+
'local_shell',
2388+
'shell',
2389+
'apply_patch',
2390+
],
2391+
},
2392+
pricing: {
2393+
input: {
2394+
normal: 0.1,
2395+
cached: 0.01,
2396+
},
2397+
output: {
2398+
normal: 0.6,
2399+
},
2400+
},
2401+
} as const satisfies ModelMeta<
2402+
OpenAIBaseOptions &
2403+
OpenAIReasoningOptions &
2404+
OpenAIStructuredOutputOptions &
2405+
OpenAIToolsOptions &
2406+
OpenAIStreamingOptions &
2407+
OpenAIMetadataOptions
2408+
>
2409+
2410+
const GPT_5_6_SOL_PRO = {
2411+
name: 'gpt-5.6-sol-pro',
2412+
context_window: 1_050_000,
2413+
max_output_tokens: 128_000,
2414+
supports: {
2415+
input: ['image', 'text'],
2416+
output: ['text'],
2417+
endpoints: ['chat', 'chat-completions'],
2418+
features: [
2419+
'streaming',
2420+
'function_calling',
2421+
'structured_outputs',
2422+
'distillation',
2423+
],
2424+
tools: [
2425+
'web_search',
2426+
'web_search_preview',
2427+
'file_search',
2428+
'image_generation',
2429+
'code_interpreter',
2430+
'mcp',
2431+
'computer_use',
2432+
'local_shell',
2433+
'shell',
2434+
'apply_patch',
2435+
],
2436+
},
2437+
pricing: {
2438+
input: {
2439+
normal: 5,
2440+
cached: 0.5,
2441+
},
2442+
output: {
2443+
normal: 30,
2444+
},
2445+
},
2446+
} as const satisfies ModelMeta<
2447+
OpenAIBaseOptions &
2448+
OpenAIReasoningOptions &
2449+
OpenAIStructuredOutputOptions &
2450+
OpenAIToolsOptions &
2451+
OpenAIStreamingOptions &
2452+
OpenAIMetadataOptions
2453+
>
2454+
2455+
const GPT_5_6_TERRA_PRO = {
2456+
name: 'gpt-5.6-terra-pro',
2457+
context_window: 1_050_000,
2458+
max_output_tokens: 128_000,
2459+
supports: {
2460+
input: ['image', 'text'],
2461+
output: ['text'],
2462+
endpoints: ['chat', 'chat-completions'],
2463+
features: [
2464+
'streaming',
2465+
'function_calling',
2466+
'structured_outputs',
2467+
'distillation',
2468+
],
2469+
tools: [
2470+
'web_search',
2471+
'web_search_preview',
2472+
'file_search',
2473+
'image_generation',
2474+
'code_interpreter',
2475+
'mcp',
2476+
'computer_use',
2477+
'local_shell',
2478+
'shell',
2479+
'apply_patch',
2480+
],
2481+
},
2482+
pricing: {
2483+
input: {
2484+
normal: 1,
2485+
cached: 0.1,
2486+
},
2487+
output: {
2488+
normal: 6,
2489+
},
2490+
},
2491+
} as const satisfies ModelMeta<
2492+
OpenAIBaseOptions &
2493+
OpenAIReasoningOptions &
2494+
OpenAIStructuredOutputOptions &
2495+
OpenAIToolsOptions &
2496+
OpenAIStreamingOptions &
2497+
OpenAIMetadataOptions
2498+
>
2499+
23652500
export const OPENAI_CHAT_MODELS = [
2501+
GPT_5_6_LUNA_PRO.name,
2502+
GPT_5_6_SOL_PRO.name,
2503+
GPT_5_6_TERRA_PRO.name,
23662504
// Frontier models
23672505
GPT5_2.name,
23682506
GPT5_2_PRO.name,
@@ -2780,6 +2918,24 @@ export type OpenAIChatModelProviderOptionsByName = {
27802918
OpenAIToolsOptions &
27812919
OpenAIStreamingOptions &
27822920
OpenAIMetadataOptions
2921+
[GPT_5_6_LUNA_PRO.name]: OpenAIBaseOptions &
2922+
OpenAIReasoningOptions &
2923+
OpenAIStructuredOutputOptions &
2924+
OpenAIToolsOptions &
2925+
OpenAIStreamingOptions &
2926+
OpenAIMetadataOptions
2927+
[GPT_5_6_SOL_PRO.name]: OpenAIBaseOptions &
2928+
OpenAIReasoningOptions &
2929+
OpenAIStructuredOutputOptions &
2930+
OpenAIToolsOptions &
2931+
OpenAIStreamingOptions &
2932+
OpenAIMetadataOptions
2933+
[GPT_5_6_TERRA_PRO.name]: OpenAIBaseOptions &
2934+
OpenAIReasoningOptions &
2935+
OpenAIStructuredOutputOptions &
2936+
OpenAIToolsOptions &
2937+
OpenAIStreamingOptions &
2938+
OpenAIMetadataOptions
27832939
}
27842940

27852941
/**
@@ -2901,4 +3057,7 @@ export type OpenAIModelInputModalitiesByName = {
29013057
[GPT_5_5.name]: typeof GPT_5_5.supports.input
29023058
[GPT_5_5_PRO.name]: typeof GPT_5_5_PRO.supports.input
29033059
[GPT_CHAT_LATEST.name]: typeof GPT_CHAT_LATEST.supports.input
3060+
[GPT_5_6_LUNA_PRO.name]: typeof GPT_5_6_LUNA_PRO.supports.input
3061+
[GPT_5_6_SOL_PRO.name]: typeof GPT_5_6_SOL_PRO.supports.input
3062+
[GPT_5_6_TERRA_PRO.name]: typeof GPT_5_6_TERRA_PRO.supports.input
29043063
}

0 commit comments

Comments
 (0)