Skip to content

Commit 9eb538d

Browse files
chore: sync model metadata from OpenRouter
1 parent a7ba44b commit 9eb538d

8 files changed

Lines changed: 7802 additions & 6001 deletions

File tree

.changeset/sync-models.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
2+
'@tanstack/ai-anthropic': patch
3+
'@tanstack/ai-gemini': patch
4+
'@tanstack/ai-grok': patch
5+
'@tanstack/ai-openai': patch
26
'@tanstack/ai-openrouter': patch
37
---
48

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

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,87 @@ const CLAUDE_SONNET_5 = {
491491
* via the `speed` parameter, not a model id) were removed after Anthropic
492492
* turned them off.
493493
*/
494+
const CLAUDE_OPUS_5 = {
495+
name: 'claude-opus-5',
496+
id: 'claude-opus-5',
497+
context_window: 1_000_000,
498+
max_output_tokens: 128_000,
499+
supports: {
500+
input: ['text', 'image', 'document'],
501+
extended_thinking: true,
502+
priority_tier: true,
503+
tools: [
504+
'web_search',
505+
'web_fetch',
506+
'code_execution',
507+
'computer_use',
508+
'bash',
509+
'text_editor',
510+
'memory',
511+
],
512+
},
513+
pricing: {
514+
input: {
515+
normal: 5,
516+
cached: 0.5,
517+
},
518+
output: {
519+
normal: 25,
520+
},
521+
},
522+
} as const satisfies ModelMeta<
523+
AnthropicContainerOptions &
524+
AnthropicContextManagementOptions &
525+
AnthropicMCPOptions &
526+
AnthropicServiceTierOptions &
527+
AnthropicStopSequencesOptions &
528+
AnthropicThinkingOptions &
529+
AnthropicToolChoiceOptions &
530+
AnthropicSamplingOptions
531+
>
532+
533+
const CLAUDE_OPUS_5_FAST = {
534+
name: 'claude-opus-5-fast',
535+
id: 'claude-opus-5-fast',
536+
context_window: 1_000_000,
537+
max_output_tokens: 128_000,
538+
supports: {
539+
input: ['text', 'image', 'document'],
540+
extended_thinking: true,
541+
priority_tier: true,
542+
tools: [
543+
'web_search',
544+
'web_fetch',
545+
'code_execution',
546+
'computer_use',
547+
'bash',
548+
'text_editor',
549+
'memory',
550+
],
551+
},
552+
pricing: {
553+
input: {
554+
normal: 10,
555+
cached: 1,
556+
},
557+
output: {
558+
normal: 50,
559+
},
560+
},
561+
} as const satisfies ModelMeta<
562+
AnthropicContainerOptions &
563+
AnthropicContextManagementOptions &
564+
AnthropicMCPOptions &
565+
AnthropicServiceTierOptions &
566+
AnthropicStopSequencesOptions &
567+
AnthropicThinkingOptions &
568+
AnthropicToolChoiceOptions &
569+
AnthropicSamplingOptions
570+
>
571+
494572
export const ANTHROPIC_MODELS = [
573+
CLAUDE_OPUS_5.id,
574+
CLAUDE_OPUS_5_FAST.id,
495575
CLAUDE_OPUS_4_6.id,
496576
CLAUDE_OPUS_4_5.id,
497577
CLAUDE_SONNET_4_6.id,
@@ -541,6 +621,8 @@ const ANTHROPIC_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> = {
541621
[CLAUDE_OPUS_4_8.id]: CLAUDE_OPUS_4_8.max_output_tokens,
542622
[CLAUDE_FABLE_5.id]: CLAUDE_FABLE_5.max_output_tokens,
543623
[CLAUDE_SONNET_5.id]: CLAUDE_SONNET_5.max_output_tokens,
624+
[CLAUDE_OPUS_5.id]: CLAUDE_OPUS_5.max_output_tokens,
625+
[CLAUDE_OPUS_5_FAST.id]: CLAUDE_OPUS_5_FAST.max_output_tokens,
544626
}
545627

546628
/**
@@ -707,6 +789,22 @@ export type AnthropicChatModelProviderOptionsByName = {
707789
AnthropicToolChoiceOptions &
708790
AnthropicMaxTokensOptions &
709791
AnthropicOutputConfigOptions
792+
[CLAUDE_OPUS_5.id]: AnthropicContainerOptions &
793+
AnthropicContextManagementOptions &
794+
AnthropicMCPOptions &
795+
AnthropicServiceTierOptions &
796+
AnthropicStopSequencesOptions &
797+
AnthropicThinkingOptions &
798+
AnthropicToolChoiceOptions &
799+
AnthropicSamplingOptions
800+
[CLAUDE_OPUS_5_FAST.id]: AnthropicContainerOptions &
801+
AnthropicContextManagementOptions &
802+
AnthropicMCPOptions &
803+
AnthropicServiceTierOptions &
804+
AnthropicStopSequencesOptions &
805+
AnthropicThinkingOptions &
806+
AnthropicToolChoiceOptions &
807+
AnthropicSamplingOptions
710808
}
711809

712810
export type AnthropicChatModelToolCapabilitiesByName = {
@@ -744,4 +842,6 @@ export type AnthropicModelInputModalitiesByName = {
744842
[CLAUDE_OPUS_4_8.id]: typeof CLAUDE_OPUS_4_8.supports.input
745843
[CLAUDE_FABLE_5.id]: typeof CLAUDE_FABLE_5.supports.input
746844
[CLAUDE_SONNET_5.id]: typeof CLAUDE_SONNET_5.supports.input
845+
[CLAUDE_OPUS_5.id]: typeof CLAUDE_OPUS_5.supports.input
846+
[CLAUDE_OPUS_5_FAST.id]: typeof CLAUDE_OPUS_5_FAST.supports.input
747847
}

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

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,77 @@ const GEMINI_3_5_FLASH = {
777777
GeminiThinkingOptions
778778
>
779779

780+
const GEMINI_3_5_FLASH_LITE = {
781+
name: 'gemini-3.5-flash-lite',
782+
max_input_tokens: 1_048_576,
783+
max_output_tokens: 65_536,
784+
supports: {
785+
input: ['text', 'image', 'video', 'document', 'audio'],
786+
output: ['text'],
787+
capabilities: [
788+
'batch_api',
789+
'caching',
790+
'function_calling',
791+
'structured_output',
792+
'thinking',
793+
],
794+
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
795+
},
796+
pricing: {
797+
input: {
798+
normal: 0.3,
799+
cached: 0.03,
800+
},
801+
output: {
802+
normal: 2.5,
803+
},
804+
},
805+
} as const satisfies ModelMeta<
806+
GeminiToolConfigOptions &
807+
GeminiSafetyOptions &
808+
GeminiCommonConfigOptions &
809+
GeminiCachedContentOptions &
810+
GeminiStructuredOutputOptions &
811+
GeminiThinkingOptions
812+
>
813+
814+
const GEMINI_3_6_FLASH = {
815+
name: 'gemini-3.6-flash',
816+
max_input_tokens: 1_048_576,
817+
max_output_tokens: 65_536,
818+
supports: {
819+
input: ['text', 'image', 'video', 'document', 'audio'],
820+
output: ['text'],
821+
capabilities: [
822+
'batch_api',
823+
'caching',
824+
'function_calling',
825+
'structured_output',
826+
'thinking',
827+
],
828+
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
829+
},
830+
pricing: {
831+
input: {
832+
normal: 1.5,
833+
cached: 0.15,
834+
},
835+
output: {
836+
normal: 7.5,
837+
},
838+
},
839+
} as const satisfies ModelMeta<
840+
GeminiToolConfigOptions &
841+
GeminiSafetyOptions &
842+
GeminiCommonConfigOptions &
843+
GeminiCachedContentOptions &
844+
GeminiStructuredOutputOptions &
845+
GeminiThinkingOptions
846+
>
847+
780848
export const GEMINI_MODELS = [
849+
GEMINI_3_5_FLASH_LITE.name,
850+
GEMINI_3_6_FLASH.name,
781851
GEMINI_3_5_FLASH.name,
782852
GEMINI_3_1_PRO.name,
783853
GEMINI_3_FLASH.name,
@@ -948,6 +1018,18 @@ export type GeminiChatModelProviderOptionsByName = {
9481018
GeminiCachedContentOptions &
9491019
GeminiStructuredOutputOptions &
9501020
GeminiThinkingOptions
1021+
[GEMINI_3_5_FLASH_LITE.name]: GeminiToolConfigOptions &
1022+
GeminiSafetyOptions &
1023+
GeminiCommonConfigOptions &
1024+
GeminiCachedContentOptions &
1025+
GeminiStructuredOutputOptions &
1026+
GeminiThinkingOptions
1027+
[GEMINI_3_6_FLASH.name]: GeminiToolConfigOptions &
1028+
GeminiSafetyOptions &
1029+
GeminiCommonConfigOptions &
1030+
GeminiCachedContentOptions &
1031+
GeminiStructuredOutputOptions &
1032+
GeminiThinkingOptions
9511033
}
9521034

9531035
/**
@@ -990,4 +1072,6 @@ export type GeminiModelInputModalitiesByName = {
9901072

9911073
// Models with text, image, audio, video (no document)
9921074
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input
1075+
[GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.input
1076+
[GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.input
9931077
}

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
/**

0 commit comments

Comments
 (0)