1use std::borrow::Cow;
5use std::sync::LazyLock;
6use crate::ReasoningEffort;
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
11pub enum Provider {
12 Anthropic,
13 AzureFoundry,
14 Codex,
15 DeepSeek,
16 Fireworks,
17 Gemini,
18 Moonshot,
19 Openai,
20 OpenRouter,
21 ZAi,
22 Bedrock,
23 Ollama,
24 LlamaCpp,
25}
26impl Provider {
27 pub const ALL: &[Provider] = &[
29 Self::Anthropic,
30 Self::AzureFoundry,
31 Self::Codex,
32 Self::DeepSeek,
33 Self::Fireworks,
34 Self::Gemini,
35 Self::Moonshot,
36 Self::Openai,
37 Self::OpenRouter,
38 Self::ZAi,
39 Self::Bedrock,
40 Self::Ollama,
41 Self::LlamaCpp,
42 ];
43 pub fn parser_name(self) -> &'static str {
45 match self {
46 Self::Anthropic => "anthropic",
47 Self::AzureFoundry => "azure-foundry",
48 Self::Codex => "codex",
49 Self::DeepSeek => "deepseek",
50 Self::Fireworks => "fireworks",
51 Self::Gemini => "gemini",
52 Self::Moonshot => "moonshot",
53 Self::Openai => "openai",
54 Self::OpenRouter => "openrouter",
55 Self::ZAi => "zai",
56 Self::Bedrock => "bedrock",
57 Self::Ollama => "ollama",
58 Self::LlamaCpp => "llamacpp",
59 }
60 }
61 #[allow(clippy::match_same_arms)]
63 pub fn genai_provider_name(self) -> &'static str {
64 match self {
65 Self::Anthropic => "anthropic",
66 Self::AzureFoundry => "azure.ai.openai",
67 Self::Codex => "openai",
68 Self::DeepSeek => "deepseek",
69 Self::Fireworks => "fireworks",
70 Self::Gemini => "gcp.gemini",
71 Self::Moonshot => "moonshot_ai",
72 Self::Openai => "openai",
73 Self::OpenRouter => "openrouter",
74 Self::ZAi => "zai",
75 Self::Bedrock => "aws.bedrock",
76 Self::Ollama => "ollama",
77 Self::LlamaCpp => "llama.cpp",
78 }
79 }
80 pub fn display_name(self) -> &'static str {
82 match self {
83 Self::Anthropic => "Anthropic",
84 Self::AzureFoundry => "Microsoft Foundry",
85 Self::Codex => "Codex",
86 Self::DeepSeek => "DeepSeek",
87 Self::Fireworks => "Fireworks AI",
88 Self::Gemini => "Gemini",
89 Self::Moonshot => "Moonshot",
90 Self::Openai => "OpenAI",
91 Self::OpenRouter => "OpenRouter",
92 Self::ZAi => "ZAI",
93 Self::Bedrock => "AWS Bedrock",
94 Self::Ollama => "Ollama",
95 Self::LlamaCpp => "LlamaCpp",
96 }
97 }
98 pub fn required_env_var(self) -> Option<&'static str> {
100 match self {
101 Self::Anthropic => Some("ANTHROPIC_API_KEY"),
102 Self::AzureFoundry => Some("AZURE_OPENAI_API_KEY"),
103 Self::DeepSeek => Some("DEEPSEEK_API_KEY"),
104 Self::Fireworks => Some("FIREWORKS_API_KEY"),
105 Self::Gemini => Some("GEMINI_API_KEY"),
106 Self::Moonshot => Some("MOONSHOT_API_KEY"),
107 Self::Openai => Some("OPENAI_API_KEY"),
108 Self::OpenRouter => Some("OPENROUTER_API_KEY"),
109 Self::ZAi => Some("ZAI_API_KEY"),
110 Self::Codex | Self::Bedrock | Self::Ollama | Self::LlamaCpp => None,
111 }
112 }
113 pub fn oauth_provider_id(self) -> Option<&'static str> {
115 match self {
116 Self::Codex => Some("codex"),
117 Self::Anthropic
118 | Self::AzureFoundry
119 | Self::DeepSeek
120 | Self::Fireworks
121 | Self::Gemini
122 | Self::Moonshot
123 | Self::Openai
124 | Self::OpenRouter
125 | Self::ZAi
126 | Self::Bedrock
127 | Self::Ollama
128 | Self::LlamaCpp => None,
129 }
130 }
131 pub fn is_local(self) -> bool {
134 match self {
135 Self::Ollama | Self::LlamaCpp => true,
136 Self::Anthropic
137 | Self::AzureFoundry
138 | Self::Codex
139 | Self::DeepSeek
140 | Self::Fireworks
141 | Self::Gemini
142 | Self::Moonshot
143 | Self::Openai
144 | Self::OpenRouter
145 | Self::ZAi
146 | Self::Bedrock => false,
147 }
148 }
149}
150impl std::fmt::Display for Provider {
151 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
152 f.write_str(self.parser_name())
153 }
154}
155impl std::str::FromStr for Provider {
156 type Err = String;
157 fn from_str(s: &str) -> Result<Self, Self::Err> {
158 match s {
159 "anthropic" => Ok(Self::Anthropic),
160 "azure-foundry" => Ok(Self::AzureFoundry),
161 "codex" => Ok(Self::Codex),
162 "deepseek" => Ok(Self::DeepSeek),
163 "fireworks" => Ok(Self::Fireworks),
164 "gemini" => Ok(Self::Gemini),
165 "moonshot" => Ok(Self::Moonshot),
166 "openai" => Ok(Self::Openai),
167 "openrouter" => Ok(Self::OpenRouter),
168 "zai" => Ok(Self::ZAi),
169 "bedrock" => Ok(Self::Bedrock),
170 "ollama" => Ok(Self::Ollama),
171 "llamacpp" => Ok(Self::LlamaCpp),
172 other => Err(format!("Unknown provider: '{other}'")),
173 }
174 }
175}
176#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
177pub enum AnthropicModel {
178 ClaudeFable5,
179 ClaudeHaiku45,
180 ClaudeHaiku4520251001,
181 ClaudeOpus41,
182 ClaudeOpus4120250805,
183 ClaudeOpus45,
184 ClaudeOpus4520251101,
185 ClaudeOpus46,
186 ClaudeOpus47,
187 ClaudeOpus48,
188 ClaudeOpus5,
189 ClaudeSonnet45,
190 ClaudeSonnet4520250929,
191 ClaudeSonnet46,
192 ClaudeSonnet5,
193}
194#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
195pub enum AzureFoundryModel {
196 ClaudeFable5,
197 ClaudeHaiku45,
198 ClaudeOpus41,
199 ClaudeOpus45,
200 ClaudeOpus46,
201 ClaudeOpus48,
202 ClaudeOpus5,
203 ClaudeSonnet45,
204 ClaudeSonnet46,
205 ClaudeSonnet5,
206 Codestral2501,
207 CodexMini,
208 CohereCommandA,
209 DeepseekV32,
210 Gpt4Turbo,
211 Gpt4TurboVision,
212 Gpt41,
213 Gpt41Mini,
214 Gpt41Nano,
215 Gpt4o,
216 Gpt4oMini,
217 Gpt5,
218 Gpt5Codex,
219 Gpt5Mini,
220 Gpt5Nano,
221 Gpt5Pro,
222 Gpt51,
223 Gpt51Codex,
224 Gpt51CodexMax,
225 Gpt51CodexMini,
226 Gpt52,
227 Gpt52Codex,
228 Gpt53Codex,
229 Gpt54,
230 Gpt54Mini,
231 Gpt54Nano,
232 Gpt54Pro,
233 Gpt55,
234 Gpt56Luna,
235 Gpt56Sol,
236 Gpt56Terra,
237 Grok41FastNonReasoning,
238 Grok41FastReasoning,
239 Grok420NonReasoning,
240 Grok420Reasoning,
241 KimiK25,
242 KimiK26,
243 Llama3370bInstruct,
244 Llama4Maverick17b128eInstructFp8,
245 Llama4Scout17b16eInstruct,
246 Ministral3b,
247 MistralMedium2505,
248 MistralSmall2503,
249 ModelRouter,
250 O1,
251 O3,
252 O3Mini,
253 O4Mini,
254 Phi4Mini,
255 Phi4MiniReasoning,
256}
257#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
258pub enum CodexModel {
259 Gpt52,
260 Gpt54,
261 Gpt54Mini,
262 Gpt55,
263 Gpt56Luna,
264 Gpt56Sol,
265 Gpt56Terra,
266}
267#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
268pub enum DeepSeekModel {
269 DeepseekChat,
270 DeepseekReasoner,
271 DeepseekV4Flash,
272 DeepseekV4Pro,
273}
274#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
275pub enum FireworksModel {
276 AccountsFireworksModelsDeepseekV4Flash,
277 AccountsFireworksModelsDeepseekV4Pro,
278 AccountsFireworksModelsGlm5p2,
279 AccountsFireworksModelsGptOss120b,
280 AccountsFireworksModelsGptOss20b,
281 AccountsFireworksModelsKimiK2p6,
282 AccountsFireworksModelsKimiK2p7Code,
283 AccountsFireworksModelsMinimaxM2p7,
284 AccountsFireworksModelsMinimaxM3,
285 AccountsFireworksModelsQwen3p7Plus,
286 AccountsFireworksRoutersGlm5p2Fast,
287 AccountsFireworksRoutersKimiK2p6Fast,
288 AccountsFireworksRoutersKimiK2p6Turbo,
289 AccountsFireworksRoutersKimiK2p7CodeFast,
290}
291#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
292pub enum GeminiModel {
293 DeepResearchMaxPreview042026,
294 DeepResearchPreview042026,
295 Gemini20Flash,
296 Gemini20FlashLite,
297 Gemini25ComputerUsePreview102025,
298 Gemini25Flash,
299 Gemini25FlashLite,
300 Gemini25Pro,
301 Gemini3FlashPreview,
302 Gemini3ProPreview,
303 Gemini31FlashLite,
304 Gemini31FlashLiteImage,
305 Gemini31FlashLitePreview,
306 Gemini31FlashLivePreview,
307 Gemini31ProPreview,
308 Gemini31ProPreviewCustomtools,
309 Gemini35Flash,
310 Gemini35FlashLite,
311 Gemini36Flash,
312 GeminiRoboticsEr16Preview,
313 Gemma426bA4bIt,
314 Gemma431bIt,
315}
316#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
317pub enum MoonshotModel {
318 KimiK20711Preview,
319 KimiK20905Preview,
320 KimiK2Thinking,
321 KimiK2ThinkingTurbo,
322 KimiK2TurboPreview,
323 KimiK25,
324 KimiK26,
325 KimiK27Code,
326 KimiK27CodeHighspeed,
327 KimiK3,
328}
329#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
330pub enum OpenaiModel {
331 Gpt4,
332 Gpt4Turbo,
333 Gpt41,
334 Gpt41Mini,
335 Gpt41Nano,
336 Gpt4o,
337 Gpt4o20240513,
338 Gpt4o20240806,
339 Gpt4o20241120,
340 Gpt4oMini,
341 Gpt5,
342 Gpt5Mini,
343 Gpt5Nano,
344 Gpt5Pro,
345 Gpt51,
346 Gpt52,
347 Gpt52Pro,
348 Gpt53Codex,
349 Gpt53CodexSpark,
350 Gpt54,
351 Gpt54Mini,
352 Gpt54Nano,
353 Gpt54Pro,
354 Gpt55,
355 Gpt55Pro,
356 Gpt56,
357 Gpt56Luna,
358 Gpt56Sol,
359 Gpt56Terra,
360 GptRealtime21,
361 O1,
362 O1Pro,
363 O3,
364 O3Mini,
365 O3Pro,
366 O4Mini,
367}
368#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
369pub enum OpenRouterModel {
370 Ai21JambaLarge17,
371 AionLabsAion20,
372 AionLabsAion30,
373 AionLabsAion30Mini,
374 AmazonNova2LiteV1,
375 AmazonNovaLiteV1,
376 AmazonNovaMicroV1,
377 AmazonNovaPremierV1,
378 AmazonNovaProV1,
379 AnthropicClaude3Haiku,
380 AnthropicClaudeFable5,
381 AnthropicClaudeHaiku45,
382 AnthropicClaudeOpus4,
383 AnthropicClaudeOpus41,
384 AnthropicClaudeOpus45,
385 AnthropicClaudeOpus46,
386 AnthropicClaudeOpus47,
387 AnthropicClaudeOpus47Fast,
388 AnthropicClaudeOpus48,
389 AnthropicClaudeOpus48Fast,
390 AnthropicClaudeOpus5,
391 AnthropicClaudeOpus5Fast,
392 AnthropicClaudeSonnet4,
393 AnthropicClaudeSonnet45,
394 AnthropicClaudeSonnet46,
395 AnthropicClaudeSonnet5,
396 ArceeAiTrinityLargeThinking,
397 ArceeAiVirtuosoLarge,
398 BytedanceSeedSeed16,
399 BytedanceSeedSeed16Flash,
400 BytedanceSeedSeed20Lite,
401 BytedanceSeedSeed20Mini,
402 CohereCommandR082024,
403 CohereCommandRPlus082024,
404 CohereNorthMiniCodeFree,
405 DeepseekDeepseekChat,
406 DeepseekDeepseekChatV30324,
407 DeepseekDeepseekChatV31,
408 DeepseekDeepseekR1,
409 DeepseekDeepseekR10528,
410 DeepseekDeepseekV31Terminus,
411 DeepseekDeepseekV32,
412 DeepseekDeepseekV32Exp,
413 DeepseekDeepseekV4Flash,
414 DeepseekDeepseekV4Pro,
415 GoogleGemini25Flash,
416 GoogleGemini25FlashLite,
417 GoogleGemini25Pro,
418 GoogleGemini25ProPreview,
419 GoogleGemini25ProPreview0506,
420 GoogleGemini3FlashPreview,
421 GoogleGemini3ProImage,
422 GoogleGemini31FlashLite,
423 GoogleGemini31FlashLitePreview,
424 GoogleGemini31ProPreview,
425 GoogleGemini31ProPreviewCustomtools,
426 GoogleGemini35Flash,
427 GoogleGemini35FlashLite,
428 GoogleGemini36Flash,
429 GoogleGemma312bIt,
430 GoogleGemma327bIt,
431 GoogleGemma426bA4bIt,
432 GoogleGemma426bA4bItFree,
433 GoogleGemma431bIt,
434 GoogleGemma431bItFree,
435 IbmGraniteGranite418b,
436 InceptionMercury2,
437 InclusionaiLing261t,
438 InclusionaiLing26Flash,
439 InclusionaiLing30FlashFree,
440 InclusionaiRing261t,
441 KwaipilotKatCoderAirV25,
442 KwaipilotKatCoderProV2,
443 KwaipilotKatCoderProV25,
444 MeituanLongcat20,
445 MetaLlamaLlama3170bInstruct,
446 MetaLlamaLlama318bInstruct,
447 MetaLlamaLlama3370bInstruct,
448 MetaLlamaLlama4Maverick,
449 MetaLlamaLlama4Scout,
450 MetaMuseSpark11,
451 MinimaxMinimaxM1,
452 MinimaxMinimaxM2,
453 MinimaxMinimaxM21,
454 MinimaxMinimaxM25,
455 MinimaxMinimaxM27,
456 MinimaxMinimaxM3,
457 MistralaiCodestral2508,
458 MistralaiDevstral2512,
459 MistralaiMinistral14b2512,
460 MistralaiMinistral3b2512,
461 MistralaiMinistral8b2512,
462 MistralaiMistralLarge,
463 MistralaiMistralLarge2407,
464 MistralaiMistralLarge2512,
465 MistralaiMistralMedium3,
466 MistralaiMistralMedium35,
467 MistralaiMistralMedium31,
468 MistralaiMistralNemo,
469 MistralaiMistralSaba,
470 MistralaiMistralSmall2603,
471 MistralaiMistralSmall3224bInstruct,
472 MistralaiMixtral8x22bInstruct,
473 MistralaiVoxtralSmall24b2507,
474 MoonshotaiKimiK2,
475 MoonshotaiKimiK20905,
476 MoonshotaiKimiK2Thinking,
477 MoonshotaiKimiK25,
478 MoonshotaiKimiK26,
479 MoonshotaiKimiK27Code,
480 MoonshotaiKimiK3,
481 NexAgiNexN2Mini,
482 NexAgiNexN2Pro,
483 NvidiaNemotron3Nano30bA3b,
484 NvidiaNemotron3Nano30bA3bFree,
485 NvidiaNemotron3NanoOmni30bA3bReasoningFree,
486 NvidiaNemotron3Super120bA12b,
487 NvidiaNemotron3Super120bA12bFree,
488 NvidiaNemotron3Ultra550bA55b,
489 NvidiaNemotron3Ultra550bA55bFree,
490 NvidiaNemotronNano12bV2VlFree,
491 NvidiaNemotronNano9bV2Free,
492 OpenaiGpt35Turbo,
493 OpenaiGpt35Turbo0613,
494 OpenaiGpt35Turbo16k,
495 OpenaiGpt4,
496 OpenaiGpt4Turbo,
497 OpenaiGpt4TurboPreview,
498 OpenaiGpt41,
499 OpenaiGpt41Mini,
500 OpenaiGpt41Nano,
501 OpenaiGpt4o,
502 OpenaiGpt4o20240513,
503 OpenaiGpt4o20240806,
504 OpenaiGpt4o20241120,
505 OpenaiGpt4oMini,
506 OpenaiGpt4oMini20240718,
507 OpenaiGpt5,
508 OpenaiGpt5Codex,
509 OpenaiGpt5Mini,
510 OpenaiGpt5Nano,
511 OpenaiGpt5Pro,
512 OpenaiGpt51,
513 OpenaiGpt51Chat,
514 OpenaiGpt51Codex,
515 OpenaiGpt51CodexMax,
516 OpenaiGpt51CodexMini,
517 OpenaiGpt52,
518 OpenaiGpt52Chat,
519 OpenaiGpt52Codex,
520 OpenaiGpt52Pro,
521 OpenaiGpt53Chat,
522 OpenaiGpt53Codex,
523 OpenaiGpt54,
524 OpenaiGpt54Mini,
525 OpenaiGpt54Nano,
526 OpenaiGpt54Pro,
527 OpenaiGpt55,
528 OpenaiGpt55Pro,
529 OpenaiGpt56Luna,
530 OpenaiGpt56LunaPro,
531 OpenaiGpt56Sol,
532 OpenaiGpt56SolPro,
533 OpenaiGpt56Terra,
534 OpenaiGpt56TerraPro,
535 OpenaiGptAudio,
536 OpenaiGptAudioMini,
537 OpenaiGptOss120b,
538 OpenaiGptOss20b,
539 OpenaiGptOss20bFree,
540 OpenaiGptOssSafeguard20b,
541 OpenaiO1,
542 OpenaiO3,
543 OpenaiO3DeepResearch,
544 OpenaiO3Mini,
545 OpenaiO3MiniHigh,
546 OpenaiO3Pro,
547 OpenaiO4Mini,
548 OpenaiO4MiniDeepResearch,
549 OpenaiO4MiniHigh,
550 OpenrouterAuto,
551 OpenrouterFree,
552 PoolsideLagunaM1,
553 PoolsideLagunaM1Free,
554 PoolsideLagunaS21,
555 PoolsideLagunaS21Free,
556 PoolsideLagunaXs21,
557 PoolsideLagunaXs21Free,
558 QwenQwen2572bInstruct,
559 QwenQwen257bInstruct,
560 QwenQwenPlus,
561 QwenQwenPlus20250728,
562 QwenQwenPlus20250728Thinking,
563 QwenQwen314b,
564 QwenQwen3235bA22b,
565 QwenQwen3235bA22b2507,
566 QwenQwen3235bA22bThinking2507,
567 QwenQwen330bA3b,
568 QwenQwen330bA3bInstruct2507,
569 QwenQwen330bA3bThinking2507,
570 QwenQwen332b,
571 QwenQwen38b,
572 QwenQwen3Coder,
573 QwenQwen3Coder30bA3bInstruct,
574 QwenQwen3CoderFlash,
575 QwenQwen3CoderNext,
576 QwenQwen3CoderPlus,
577 QwenQwen3Max,
578 QwenQwen3MaxThinking,
579 QwenQwen3Next80bA3bInstruct,
580 QwenQwen3Next80bA3bThinking,
581 QwenQwen3Vl235bA22bInstruct,
582 QwenQwen3Vl235bA22bThinking,
583 QwenQwen3Vl30bA3bInstruct,
584 QwenQwen3Vl30bA3bThinking,
585 QwenQwen3Vl32bInstruct,
586 QwenQwen3Vl8bInstruct,
587 QwenQwen3Vl8bThinking,
588 QwenQwen35122bA10b,
589 QwenQwen3527b,
590 QwenQwen3535bA3b,
591 QwenQwen35397bA17b,
592 QwenQwen359b,
593 QwenQwen35Flash0223,
594 QwenQwen35Plus0215,
595 QwenQwen35Plus20260420,
596 QwenQwen3627b,
597 QwenQwen3635bA3b,
598 QwenQwen36Flash,
599 QwenQwen36MaxPreview,
600 QwenQwen36Plus,
601 QwenQwen37Max,
602 QwenQwen37Plus,
603 RekaaiRekaEdge,
604 RelaceRelaceSearch,
605 SakanaFuguUltra,
606 Sao10kL31Euryale70b,
607 StepfunStep35Flash,
608 StepfunStep37Flash,
609 TencentHy3,
610 TencentHy3Preview,
611 ThedrummerUnslopnemo12b,
612 ThinkingmachinesInkling,
613 UpstageSolarPro3,
614 XAiGrok420,
615 XAiGrok43,
616 XAiGrok45,
617 XAiGrokBuild01,
618 XiaomiMimoV25,
619 XiaomiMimoV25Pro,
620 ZAiGlm45,
621 ZAiGlm45Air,
622 ZAiGlm45v,
623 ZAiGlm46,
624 ZAiGlm46v,
625 ZAiGlm47,
626 ZAiGlm47Flash,
627 ZAiGlm5,
628 ZAiGlm5Turbo,
629 ZAiGlm51,
630 ZAiGlm52,
631 ZAiGlm5vTurbo,
632}
633#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
634pub enum ZAiModel {
635 Glm45,
636 Glm45Air,
637 Glm45Flash,
638 Glm45v,
639 Glm46,
640 Glm46v,
641 Glm47,
642 Glm47Flash,
643 Glm47Flashx,
644 Glm5,
645 Glm5Turbo,
646 Glm51,
647 Glm52,
648 Glm5vTurbo,
649}
650#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
651pub enum BedrockFoundationModel {
652 AmazonNova2LiteV10,
653 AmazonNovaLiteV10,
654 AmazonNovaMicroV10,
655 AmazonNovaProV10,
656 AnthropicClaudeFable5,
657 AnthropicClaudeHaiku4520251001V10,
658 AnthropicClaudeOpus4120250805V10,
659 AnthropicClaudeOpus4520251101V10,
660 AnthropicClaudeOpus46V1,
661 AnthropicClaudeOpus47,
662 AnthropicClaudeOpus48,
663 AnthropicClaudeOpus5,
664 AnthropicClaudeSonnet4520250929V10,
665 AnthropicClaudeSonnet46,
666 AnthropicClaudeSonnet5,
667 AuAnthropicClaudeHaiku4520251001V10,
668 AuAnthropicClaudeOpus46V1,
669 AuAnthropicClaudeOpus48,
670 AuAnthropicClaudeOpus5,
671 AuAnthropicClaudeSonnet4520250929V10,
672 AuAnthropicClaudeSonnet46,
673 AuAnthropicClaudeSonnet5,
674 DeepseekR1V10,
675 DeepseekV3V10,
676 DeepseekV32,
677 EuAnthropicClaudeFable5,
678 EuAnthropicClaudeHaiku4520251001V10,
679 EuAnthropicClaudeOpus4520251101V10,
680 EuAnthropicClaudeOpus46V1,
681 EuAnthropicClaudeOpus47,
682 EuAnthropicClaudeOpus48,
683 EuAnthropicClaudeOpus5,
684 EuAnthropicClaudeSonnet4520250929V10,
685 EuAnthropicClaudeSonnet46,
686 EuAnthropicClaudeSonnet5,
687 GlobalAnthropicClaudeFable5,
688 GlobalAnthropicClaudeHaiku4520251001V10,
689 GlobalAnthropicClaudeOpus4520251101V10,
690 GlobalAnthropicClaudeOpus46V1,
691 GlobalAnthropicClaudeOpus47,
692 GlobalAnthropicClaudeOpus48,
693 GlobalAnthropicClaudeOpus5,
694 GlobalAnthropicClaudeSonnet4520250929V10,
695 GlobalAnthropicClaudeSonnet46,
696 GlobalAnthropicClaudeSonnet5,
697 GoogleGemma327bIt,
698 GoogleGemma34bIt,
699 JpAnthropicClaudeHaiku4520251001V10,
700 JpAnthropicClaudeOpus47,
701 JpAnthropicClaudeOpus48,
702 JpAnthropicClaudeOpus5,
703 JpAnthropicClaudeSonnet4520250929V10,
704 JpAnthropicClaudeSonnet46,
705 JpAnthropicClaudeSonnet5,
706 MetaLlama3170bInstructV10,
707 MetaLlama318bInstructV10,
708 MetaLlama3370bInstructV10,
709 MetaLlama4Maverick17bInstructV10,
710 MetaLlama4Scout17bInstructV10,
711 MinimaxMinimaxM2,
712 MinimaxMinimaxM21,
713 MinimaxMinimaxM25,
714 MistralDevstral2123b,
715 MistralMagistralSmall2509,
716 MistralMinistral314bInstruct,
717 MistralMinistral33bInstruct,
718 MistralMinistral38bInstruct,
719 MistralMistralLarge3675bInstruct,
720 MistralPixtralLarge2502V10,
721 MistralVoxtralMini3b2507,
722 MistralVoxtralSmall24b2507,
723 MoonshotKimiK2Thinking,
724 MoonshotaiKimiK25,
725 NvidiaNemotronNano12bV2,
726 NvidiaNemotronNano330b,
727 NvidiaNemotronNano9bV2,
728 NvidiaNemotronSuper3120b,
729 OpenaiGpt54,
730 OpenaiGpt55,
731 OpenaiGpt56Luna,
732 OpenaiGpt56Sol,
733 OpenaiGpt56Terra,
734 OpenaiGptOss120b,
735 OpenaiGptOss120b10,
736 OpenaiGptOss20b,
737 OpenaiGptOss20b10,
738 OpenaiGptOssSafeguard120b,
739 OpenaiGptOssSafeguard20b,
740 QwenQwen3235bA22b2507V10,
741 QwenQwen332bV10,
742 QwenQwen3Coder30bA3bV10,
743 QwenQwen3Coder480bA35bV10,
744 QwenQwen3CoderNext,
745 QwenQwen3Next80bA3b,
746 QwenQwen3Vl235bA22b,
747 UsAnthropicClaudeFable5,
748 UsAnthropicClaudeHaiku4520251001V10,
749 UsAnthropicClaudeOpus4120250805V10,
750 UsAnthropicClaudeOpus4520251101V10,
751 UsAnthropicClaudeOpus46V1,
752 UsAnthropicClaudeOpus47,
753 UsAnthropicClaudeOpus48,
754 UsAnthropicClaudeOpus5,
755 UsAnthropicClaudeSonnet4520250929V10,
756 UsAnthropicClaudeSonnet46,
757 UsAnthropicClaudeSonnet5,
758 UsDeepseekR1V10,
759 UsMetaLlama4Maverick17bInstructV10,
760 UsMetaLlama4Scout17bInstructV10,
761 WriterPalmyraX4V10,
762 WriterPalmyraX5V10,
763 XaiGrok43,
764 ZaiGlm47,
765 ZaiGlm47Flash,
766 ZaiGlm5,
767}
768impl AnthropicModel {
769 #[allow(clippy::too_many_lines)]
770 fn model_id(self) -> &'static str {
771 match self {
772 Self::ClaudeFable5 => "claude-fable-5",
773 Self::ClaudeHaiku45 => "claude-haiku-4-5",
774 Self::ClaudeHaiku4520251001 => "claude-haiku-4-5-20251001",
775 Self::ClaudeOpus41 => "claude-opus-4-1",
776 Self::ClaudeOpus4120250805 => "claude-opus-4-1-20250805",
777 Self::ClaudeOpus45 => "claude-opus-4-5",
778 Self::ClaudeOpus4520251101 => "claude-opus-4-5-20251101",
779 Self::ClaudeOpus46 => "claude-opus-4-6",
780 Self::ClaudeOpus47 => "claude-opus-4-7",
781 Self::ClaudeOpus48 => "claude-opus-4-8",
782 Self::ClaudeOpus5 => "claude-opus-5",
783 Self::ClaudeSonnet45 => "claude-sonnet-4-5",
784 Self::ClaudeSonnet4520250929 => "claude-sonnet-4-5-20250929",
785 Self::ClaudeSonnet46 => "claude-sonnet-4-6",
786 Self::ClaudeSonnet5 => "claude-sonnet-5",
787 }
788 }
789 #[allow(clippy::too_many_lines)]
790 fn display_name(self) -> &'static str {
791 match self {
792 Self::ClaudeFable5 => "Claude Fable 5",
793 Self::ClaudeHaiku4520251001 => "Claude Haiku 4.5",
794 Self::ClaudeHaiku45 => "Claude Haiku 4.5 (latest)",
795 Self::ClaudeOpus4120250805 => "Claude Opus 4.1",
796 Self::ClaudeOpus41 => "Claude Opus 4.1 (latest)",
797 Self::ClaudeOpus4520251101 => "Claude Opus 4.5",
798 Self::ClaudeOpus45 => "Claude Opus 4.5 (latest)",
799 Self::ClaudeOpus46 => "Claude Opus 4.6",
800 Self::ClaudeOpus47 => "Claude Opus 4.7",
801 Self::ClaudeOpus48 => "Claude Opus 4.8",
802 Self::ClaudeOpus5 => "Claude Opus 5",
803 Self::ClaudeSonnet4520250929 => "Claude Sonnet 4.5",
804 Self::ClaudeSonnet45 => "Claude Sonnet 4.5 (latest)",
805 Self::ClaudeSonnet46 => "Claude Sonnet 4.6",
806 Self::ClaudeSonnet5 => "Claude Sonnet 5",
807 }
808 }
809 #[allow(clippy::too_many_lines)]
810 fn context_window(self) -> u32 {
811 match self {
812 Self::ClaudeHaiku45
813 | Self::ClaudeHaiku4520251001
814 | Self::ClaudeOpus41
815 | Self::ClaudeOpus4120250805
816 | Self::ClaudeOpus45
817 | Self::ClaudeOpus4520251101 => 200_000,
818 Self::ClaudeFable5
819 | Self::ClaudeOpus46
820 | Self::ClaudeOpus47
821 | Self::ClaudeOpus48
822 | Self::ClaudeOpus5
823 | Self::ClaudeSonnet45
824 | Self::ClaudeSonnet4520250929
825 | Self::ClaudeSonnet46
826 | Self::ClaudeSonnet5 => 1_000_000,
827 }
828 }
829 #[allow(clippy::too_many_lines)]
830 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
831 match self {
832 Self::ClaudeHaiku45
833 | Self::ClaudeHaiku4520251001
834 | Self::ClaudeOpus41
835 | Self::ClaudeOpus4120250805
836 | Self::ClaudeOpus45
837 | Self::ClaudeOpus4520251101
838 | Self::ClaudeSonnet45
839 | Self::ClaudeSonnet4520250929 => {
840 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
841 }
842 Self::ClaudeOpus46 | Self::ClaudeSonnet46 => {
843 &[
844 ReasoningEffort::Low,
845 ReasoningEffort::Medium,
846 ReasoningEffort::High,
847 ReasoningEffort::Max,
848 ]
849 }
850 Self::ClaudeFable5
851 | Self::ClaudeOpus47
852 | Self::ClaudeOpus48
853 | Self::ClaudeOpus5
854 | Self::ClaudeSonnet5 => {
855 &[
856 ReasoningEffort::Low,
857 ReasoningEffort::Medium,
858 ReasoningEffort::High,
859 ReasoningEffort::Xhigh,
860 ReasoningEffort::Max,
861 ]
862 }
863 }
864 }
865 pub fn supports_reasoning(self) -> bool {
866 !self.reasoning_levels().is_empty()
867 }
868 #[allow(clippy::too_many_lines)]
869 pub fn supports_prompt_caching(self) -> bool {
870 match self {
871 Self::ClaudeFable5
872 | Self::ClaudeHaiku45
873 | Self::ClaudeHaiku4520251001
874 | Self::ClaudeOpus41
875 | Self::ClaudeOpus4120250805
876 | Self::ClaudeOpus45
877 | Self::ClaudeOpus4520251101
878 | Self::ClaudeOpus46
879 | Self::ClaudeOpus47
880 | Self::ClaudeOpus48
881 | Self::ClaudeOpus5
882 | Self::ClaudeSonnet45
883 | Self::ClaudeSonnet4520250929
884 | Self::ClaudeSonnet46
885 | Self::ClaudeSonnet5 => true,
886 }
887 }
888 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
889 pub fn pricing(self) -> Option<ModelPricing> {
890 match self {
891 Self::ClaudeFable5 => {
892 Some(ModelPricing {
893 input_per_million: 10f64,
894 output_per_million: 50f64,
895 cache_read_per_million: Some(1f64),
896 cache_write_per_million: Some(12.5f64),
897 })
898 }
899 Self::ClaudeHaiku45 => {
900 Some(ModelPricing {
901 input_per_million: 1f64,
902 output_per_million: 5f64,
903 cache_read_per_million: Some(0.1f64),
904 cache_write_per_million: Some(1.25f64),
905 })
906 }
907 Self::ClaudeHaiku4520251001 => {
908 Some(ModelPricing {
909 input_per_million: 1f64,
910 output_per_million: 5f64,
911 cache_read_per_million: Some(0.1f64),
912 cache_write_per_million: Some(1.25f64),
913 })
914 }
915 Self::ClaudeOpus41 => {
916 Some(ModelPricing {
917 input_per_million: 15f64,
918 output_per_million: 75f64,
919 cache_read_per_million: Some(1.5f64),
920 cache_write_per_million: Some(18.75f64),
921 })
922 }
923 Self::ClaudeOpus4120250805 => {
924 Some(ModelPricing {
925 input_per_million: 15f64,
926 output_per_million: 75f64,
927 cache_read_per_million: Some(1.5f64),
928 cache_write_per_million: Some(18.75f64),
929 })
930 }
931 Self::ClaudeOpus45 => {
932 Some(ModelPricing {
933 input_per_million: 5f64,
934 output_per_million: 25f64,
935 cache_read_per_million: Some(0.5f64),
936 cache_write_per_million: Some(6.25f64),
937 })
938 }
939 Self::ClaudeOpus4520251101 => {
940 Some(ModelPricing {
941 input_per_million: 5f64,
942 output_per_million: 25f64,
943 cache_read_per_million: Some(0.5f64),
944 cache_write_per_million: Some(6.25f64),
945 })
946 }
947 Self::ClaudeOpus46 => {
948 Some(ModelPricing {
949 input_per_million: 5f64,
950 output_per_million: 25f64,
951 cache_read_per_million: Some(0.5f64),
952 cache_write_per_million: Some(6.25f64),
953 })
954 }
955 Self::ClaudeOpus47 => {
956 Some(ModelPricing {
957 input_per_million: 5f64,
958 output_per_million: 25f64,
959 cache_read_per_million: Some(0.5f64),
960 cache_write_per_million: Some(6.25f64),
961 })
962 }
963 Self::ClaudeOpus48 => {
964 Some(ModelPricing {
965 input_per_million: 5f64,
966 output_per_million: 25f64,
967 cache_read_per_million: Some(0.5f64),
968 cache_write_per_million: Some(6.25f64),
969 })
970 }
971 Self::ClaudeOpus5 => {
972 Some(ModelPricing {
973 input_per_million: 5f64,
974 output_per_million: 25f64,
975 cache_read_per_million: Some(0.5f64),
976 cache_write_per_million: Some(6.25f64),
977 })
978 }
979 Self::ClaudeSonnet45 => {
980 Some(ModelPricing {
981 input_per_million: 3f64,
982 output_per_million: 15f64,
983 cache_read_per_million: Some(0.3f64),
984 cache_write_per_million: Some(3.75f64),
985 })
986 }
987 Self::ClaudeSonnet4520250929 => {
988 Some(ModelPricing {
989 input_per_million: 3f64,
990 output_per_million: 15f64,
991 cache_read_per_million: Some(0.3f64),
992 cache_write_per_million: Some(3.75f64),
993 })
994 }
995 Self::ClaudeSonnet46 => {
996 Some(ModelPricing {
997 input_per_million: 3f64,
998 output_per_million: 15f64,
999 cache_read_per_million: Some(0.3f64),
1000 cache_write_per_million: Some(3.75f64),
1001 })
1002 }
1003 Self::ClaudeSonnet5 => {
1004 Some(ModelPricing {
1005 input_per_million: 2f64,
1006 output_per_million: 10f64,
1007 cache_read_per_million: Some(0.2f64),
1008 cache_write_per_million: Some(2.5f64),
1009 })
1010 }
1011 }
1012 }
1013 #[allow(clippy::too_many_lines)]
1014 pub fn supports_image(self) -> bool {
1015 match self {
1016 Self::ClaudeFable5
1017 | Self::ClaudeHaiku45
1018 | Self::ClaudeHaiku4520251001
1019 | Self::ClaudeOpus41
1020 | Self::ClaudeOpus4120250805
1021 | Self::ClaudeOpus45
1022 | Self::ClaudeOpus4520251101
1023 | Self::ClaudeOpus46
1024 | Self::ClaudeOpus47
1025 | Self::ClaudeOpus48
1026 | Self::ClaudeOpus5
1027 | Self::ClaudeSonnet45
1028 | Self::ClaudeSonnet4520250929
1029 | Self::ClaudeSonnet46
1030 | Self::ClaudeSonnet5 => true,
1031 }
1032 }
1033 #[allow(clippy::too_many_lines)]
1034 pub fn supports_audio(self) -> bool {
1035 match self {
1036 Self::ClaudeFable5
1037 | Self::ClaudeHaiku45
1038 | Self::ClaudeHaiku4520251001
1039 | Self::ClaudeOpus41
1040 | Self::ClaudeOpus4120250805
1041 | Self::ClaudeOpus45
1042 | Self::ClaudeOpus4520251101
1043 | Self::ClaudeOpus46
1044 | Self::ClaudeOpus47
1045 | Self::ClaudeOpus48
1046 | Self::ClaudeOpus5
1047 | Self::ClaudeSonnet45
1048 | Self::ClaudeSonnet4520250929
1049 | Self::ClaudeSonnet46
1050 | Self::ClaudeSonnet5 => false,
1051 }
1052 }
1053 #[allow(clippy::too_many_lines)]
1054 pub fn transport(self) -> Option<ModelTransport> {
1055 match self {
1056 Self::ClaudeFable5
1057 | Self::ClaudeHaiku45
1058 | Self::ClaudeHaiku4520251001
1059 | Self::ClaudeOpus41
1060 | Self::ClaudeOpus4120250805
1061 | Self::ClaudeOpus45
1062 | Self::ClaudeOpus4520251101
1063 | Self::ClaudeOpus46
1064 | Self::ClaudeOpus47
1065 | Self::ClaudeOpus48
1066 | Self::ClaudeOpus5
1067 | Self::ClaudeSonnet45
1068 | Self::ClaudeSonnet4520250929
1069 | Self::ClaudeSonnet46
1070 | Self::ClaudeSonnet5 => None,
1071 }
1072 }
1073 const ALL: &[AnthropicModel] = &[
1074 Self::ClaudeFable5,
1075 Self::ClaudeHaiku45,
1076 Self::ClaudeHaiku4520251001,
1077 Self::ClaudeOpus41,
1078 Self::ClaudeOpus4120250805,
1079 Self::ClaudeOpus45,
1080 Self::ClaudeOpus4520251101,
1081 Self::ClaudeOpus46,
1082 Self::ClaudeOpus47,
1083 Self::ClaudeOpus48,
1084 Self::ClaudeOpus5,
1085 Self::ClaudeSonnet45,
1086 Self::ClaudeSonnet4520250929,
1087 Self::ClaudeSonnet46,
1088 Self::ClaudeSonnet5,
1089 ];
1090}
1091impl std::str::FromStr for AnthropicModel {
1092 type Err = String;
1093 #[allow(clippy::too_many_lines)]
1094 fn from_str(s: &str) -> Result<Self, Self::Err> {
1095 match s {
1096 "claude-fable-5" => Ok(Self::ClaudeFable5),
1097 "claude-haiku-4-5" => Ok(Self::ClaudeHaiku45),
1098 "claude-haiku-4-5-20251001" => Ok(Self::ClaudeHaiku4520251001),
1099 "claude-opus-4-1" => Ok(Self::ClaudeOpus41),
1100 "claude-opus-4-1-20250805" => Ok(Self::ClaudeOpus4120250805),
1101 "claude-opus-4-5" => Ok(Self::ClaudeOpus45),
1102 "claude-opus-4-5-20251101" => Ok(Self::ClaudeOpus4520251101),
1103 "claude-opus-4-6" => Ok(Self::ClaudeOpus46),
1104 "claude-opus-4-7" => Ok(Self::ClaudeOpus47),
1105 "claude-opus-4-8" => Ok(Self::ClaudeOpus48),
1106 "claude-opus-5" => Ok(Self::ClaudeOpus5),
1107 "claude-sonnet-4-5" => Ok(Self::ClaudeSonnet45),
1108 "claude-sonnet-4-5-20250929" => Ok(Self::ClaudeSonnet4520250929),
1109 "claude-sonnet-4-6" => Ok(Self::ClaudeSonnet46),
1110 "claude-sonnet-5" => Ok(Self::ClaudeSonnet5),
1111 _ => Err(format!("Unknown anthropic model: '{s}'")),
1112 }
1113 }
1114}
1115impl AzureFoundryModel {
1116 #[allow(clippy::too_many_lines)]
1117 fn model_id(self) -> &'static str {
1118 match self {
1119 Self::ClaudeFable5 => "claude-fable-5",
1120 Self::ClaudeHaiku45 => "claude-haiku-4-5",
1121 Self::ClaudeOpus41 => "claude-opus-4-1",
1122 Self::ClaudeOpus45 => "claude-opus-4-5",
1123 Self::ClaudeOpus46 => "claude-opus-4-6",
1124 Self::ClaudeOpus48 => "claude-opus-4-8",
1125 Self::ClaudeOpus5 => "claude-opus-5",
1126 Self::ClaudeSonnet45 => "claude-sonnet-4-5",
1127 Self::ClaudeSonnet46 => "claude-sonnet-4-6",
1128 Self::ClaudeSonnet5 => "claude-sonnet-5",
1129 Self::Codestral2501 => "codestral-2501",
1130 Self::CodexMini => "codex-mini",
1131 Self::CohereCommandA => "cohere-command-a",
1132 Self::DeepseekV32 => "deepseek-v3.2",
1133 Self::Gpt4Turbo => "gpt-4-turbo",
1134 Self::Gpt4TurboVision => "gpt-4-turbo-vision",
1135 Self::Gpt41 => "gpt-4.1",
1136 Self::Gpt41Mini => "gpt-4.1-mini",
1137 Self::Gpt41Nano => "gpt-4.1-nano",
1138 Self::Gpt4o => "gpt-4o",
1139 Self::Gpt4oMini => "gpt-4o-mini",
1140 Self::Gpt5 => "gpt-5",
1141 Self::Gpt5Codex => "gpt-5-codex",
1142 Self::Gpt5Mini => "gpt-5-mini",
1143 Self::Gpt5Nano => "gpt-5-nano",
1144 Self::Gpt5Pro => "gpt-5-pro",
1145 Self::Gpt51 => "gpt-5.1",
1146 Self::Gpt51Codex => "gpt-5.1-codex",
1147 Self::Gpt51CodexMax => "gpt-5.1-codex-max",
1148 Self::Gpt51CodexMini => "gpt-5.1-codex-mini",
1149 Self::Gpt52 => "gpt-5.2",
1150 Self::Gpt52Codex => "gpt-5.2-codex",
1151 Self::Gpt53Codex => "gpt-5.3-codex",
1152 Self::Gpt54 => "gpt-5.4",
1153 Self::Gpt54Mini => "gpt-5.4-mini",
1154 Self::Gpt54Nano => "gpt-5.4-nano",
1155 Self::Gpt54Pro => "gpt-5.4-pro",
1156 Self::Gpt55 => "gpt-5.5",
1157 Self::Gpt56Luna => "gpt-5.6-luna",
1158 Self::Gpt56Sol => "gpt-5.6-sol",
1159 Self::Gpt56Terra => "gpt-5.6-terra",
1160 Self::Grok41FastNonReasoning => "grok-4-1-fast-non-reasoning",
1161 Self::Grok41FastReasoning => "grok-4-1-fast-reasoning",
1162 Self::Grok420NonReasoning => "grok-4-20-non-reasoning",
1163 Self::Grok420Reasoning => "grok-4-20-reasoning",
1164 Self::KimiK25 => "kimi-k2.5",
1165 Self::KimiK26 => "kimi-k2.6",
1166 Self::Llama3370bInstruct => "llama-3.3-70b-instruct",
1167 Self::Llama4Maverick17b128eInstructFp8 => {
1168 "llama-4-maverick-17b-128e-instruct-fp8"
1169 }
1170 Self::Llama4Scout17b16eInstruct => "llama-4-scout-17b-16e-instruct",
1171 Self::Ministral3b => "ministral-3b",
1172 Self::MistralMedium2505 => "mistral-medium-2505",
1173 Self::MistralSmall2503 => "mistral-small-2503",
1174 Self::ModelRouter => "model-router",
1175 Self::O1 => "o1",
1176 Self::O3 => "o3",
1177 Self::O3Mini => "o3-mini",
1178 Self::O4Mini => "o4-mini",
1179 Self::Phi4Mini => "phi-4-mini",
1180 Self::Phi4MiniReasoning => "phi-4-mini-reasoning",
1181 }
1182 }
1183 #[allow(clippy::too_many_lines)]
1184 fn display_name(self) -> &'static str {
1185 match self {
1186 Self::ClaudeFable5 => "Claude Fable 5",
1187 Self::ClaudeHaiku45 => "Claude Haiku 4.5",
1188 Self::ClaudeOpus41 => "Claude Opus 4.1",
1189 Self::ClaudeOpus45 => "Claude Opus 4.5",
1190 Self::ClaudeOpus46 => "Claude Opus 4.6",
1191 Self::ClaudeOpus48 => "Claude Opus 4.8",
1192 Self::ClaudeOpus5 => "Claude Opus 5",
1193 Self::ClaudeSonnet45 => "Claude Sonnet 4.5",
1194 Self::ClaudeSonnet46 => "Claude Sonnet 4.6",
1195 Self::ClaudeSonnet5 => "Claude Sonnet 5",
1196 Self::Codestral2501 => "Codestral 25.01",
1197 Self::CodexMini => "Codex Mini",
1198 Self::CohereCommandA => "Command A",
1199 Self::DeepseekV32 => "DeepSeek-V3.2",
1200 Self::Gpt4Turbo => "GPT-4 Turbo",
1201 Self::Gpt4TurboVision => "GPT-4 Turbo Vision",
1202 Self::Gpt41 => "GPT-4.1",
1203 Self::Gpt41Mini => "GPT-4.1 mini",
1204 Self::Gpt41Nano => "GPT-4.1 nano",
1205 Self::Gpt4o => "GPT-4o",
1206 Self::Gpt4oMini => "GPT-4o mini",
1207 Self::Gpt5 => "GPT-5",
1208 Self::Gpt5Mini => "GPT-5 Mini",
1209 Self::Gpt5Nano => "GPT-5 Nano",
1210 Self::Gpt5Pro => "GPT-5 Pro",
1211 Self::Gpt5Codex => "GPT-5-Codex",
1212 Self::Gpt51 => "GPT-5.1",
1213 Self::Gpt51Codex => "GPT-5.1 Codex",
1214 Self::Gpt51CodexMax => "GPT-5.1 Codex Max",
1215 Self::Gpt51CodexMini => "GPT-5.1 Codex Mini",
1216 Self::Gpt52 => "GPT-5.2",
1217 Self::Gpt52Codex => "GPT-5.2 Codex",
1218 Self::Gpt53Codex => "GPT-5.3 Codex",
1219 Self::Gpt54 => "GPT-5.4",
1220 Self::Gpt54Mini => "GPT-5.4 Mini",
1221 Self::Gpt54Nano => "GPT-5.4 Nano",
1222 Self::Gpt54Pro => "GPT-5.4 Pro",
1223 Self::Gpt55 => "GPT-5.5",
1224 Self::Gpt56Luna => "GPT-5.6 Luna",
1225 Self::Gpt56Sol => "GPT-5.6 Sol",
1226 Self::Gpt56Terra => "GPT-5.6 Terra",
1227 Self::Grok41FastNonReasoning => "Grok 4.1 Fast (Non-Reasoning)",
1228 Self::Grok41FastReasoning => "Grok 4.1 Fast (Reasoning)",
1229 Self::Grok420NonReasoning => "Grok 4.20 (Non-Reasoning)",
1230 Self::Grok420Reasoning => "Grok 4.20 (Reasoning)",
1231 Self::KimiK25 => "Kimi K2.5",
1232 Self::KimiK26 => "Kimi K2.6",
1233 Self::Llama4Maverick17b128eInstructFp8 => {
1234 "Llama 4 Maverick 17B 128E Instruct FP8"
1235 }
1236 Self::Llama4Scout17b16eInstruct => "Llama 4 Scout 17B 16E Instruct",
1237 Self::Llama3370bInstruct => "Llama-3.3-70B-Instruct",
1238 Self::Ministral3b => "Ministral 3B",
1239 Self::MistralMedium2505 => "Mistral Medium 3",
1240 Self::MistralSmall2503 => "Mistral Small 3.1",
1241 Self::ModelRouter => "Model Router",
1242 Self::Phi4Mini => "Phi-4-mini",
1243 Self::Phi4MiniReasoning => "Phi-4-mini-reasoning",
1244 Self::O1 => "o1",
1245 Self::O3 => "o3",
1246 Self::O3Mini => "o3-mini",
1247 Self::O4Mini => "o4-mini",
1248 }
1249 }
1250 #[allow(clippy::too_many_lines)]
1251 fn context_window(self) -> u32 {
1252 match self {
1253 Self::DeepseekV32
1254 | Self::Gpt4Turbo
1255 | Self::Gpt4TurboVision
1256 | Self::Gpt4o
1257 | Self::Gpt4oMini
1258 | Self::Grok41FastNonReasoning
1259 | Self::Grok41FastReasoning
1260 | Self::Llama3370bInstruct
1261 | Self::Llama4Scout17b16eInstruct
1262 | Self::Ministral3b
1263 | Self::MistralMedium2505
1264 | Self::MistralSmall2503
1265 | Self::Phi4Mini
1266 | Self::Phi4MiniReasoning => 128_000,
1267 Self::CohereCommandA => 131_072,
1268 Self::ClaudeHaiku45
1269 | Self::ClaudeOpus41
1270 | Self::ClaudeOpus45
1271 | Self::ClaudeSonnet45
1272 | Self::CodexMini
1273 | Self::ModelRouter
1274 | Self::O1
1275 | Self::O3
1276 | Self::O3Mini
1277 | Self::O4Mini => 200_000,
1278 Self::Codestral2501 => 256_000,
1279 Self::Grok420NonReasoning | Self::Grok420Reasoning => 262_000,
1280 Self::KimiK25 | Self::KimiK26 => 262_144,
1281 Self::Gpt5
1282 | Self::Gpt5Codex
1283 | Self::Gpt5Mini
1284 | Self::Gpt5Nano
1285 | Self::Gpt5Pro
1286 | Self::Gpt51
1287 | Self::Gpt51Codex
1288 | Self::Gpt51CodexMax
1289 | Self::Gpt51CodexMini
1290 | Self::Gpt52
1291 | Self::Gpt52Codex
1292 | Self::Gpt53Codex
1293 | Self::Gpt54Mini
1294 | Self::Gpt54Nano => 400_000,
1295 Self::ClaudeFable5
1296 | Self::ClaudeOpus46
1297 | Self::ClaudeOpus48
1298 | Self::ClaudeOpus5
1299 | Self::ClaudeSonnet46
1300 | Self::ClaudeSonnet5
1301 | Self::Llama4Maverick17b128eInstructFp8 => 1_000_000,
1302 Self::Gpt41 | Self::Gpt41Mini | Self::Gpt41Nano => 1_047_576,
1303 Self::Gpt54
1304 | Self::Gpt54Pro
1305 | Self::Gpt55
1306 | Self::Gpt56Luna
1307 | Self::Gpt56Sol
1308 | Self::Gpt56Terra => 1_050_000,
1309 }
1310 }
1311 #[allow(clippy::too_many_lines)]
1312 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
1313 match self {
1314 Self::Codestral2501
1315 | Self::Gpt4Turbo
1316 | Self::Gpt4TurboVision
1317 | Self::Gpt41
1318 | Self::Gpt41Mini
1319 | Self::Gpt41Nano
1320 | Self::Gpt4o
1321 | Self::Gpt4oMini
1322 | Self::Grok41FastNonReasoning
1323 | Self::Grok420NonReasoning
1324 | Self::Llama3370bInstruct
1325 | Self::Llama4Maverick17b128eInstructFp8
1326 | Self::Llama4Scout17b16eInstruct
1327 | Self::Ministral3b
1328 | Self::MistralMedium2505
1329 | Self::MistralSmall2503
1330 | Self::ModelRouter
1331 | Self::Phi4Mini => &[],
1332 Self::Gpt5Pro => &[ReasoningEffort::High],
1333 Self::ClaudeHaiku45
1334 | Self::ClaudeOpus41
1335 | Self::ClaudeOpus45
1336 | Self::ClaudeSonnet45
1337 | Self::CodexMini
1338 | Self::CohereCommandA
1339 | Self::DeepseekV32
1340 | Self::Gpt5Codex
1341 | Self::Gpt51
1342 | Self::Gpt51Codex
1343 | Self::Gpt51CodexMini
1344 | Self::Grok41FastReasoning
1345 | Self::Grok420Reasoning
1346 | Self::KimiK25
1347 | Self::KimiK26
1348 | Self::O1
1349 | Self::O3
1350 | Self::O3Mini
1351 | Self::O4Mini
1352 | Self::Phi4MiniReasoning => {
1353 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
1354 }
1355 Self::ClaudeOpus46 | Self::ClaudeSonnet46 => {
1356 &[
1357 ReasoningEffort::Low,
1358 ReasoningEffort::Medium,
1359 ReasoningEffort::High,
1360 ReasoningEffort::Max,
1361 ]
1362 }
1363 Self::Gpt51CodexMax
1364 | Self::Gpt52
1365 | Self::Gpt52Codex
1366 | Self::Gpt53Codex
1367 | Self::Gpt54
1368 | Self::Gpt54Mini
1369 | Self::Gpt54Nano
1370 | Self::Gpt55 => {
1371 &[
1372 ReasoningEffort::Low,
1373 ReasoningEffort::Medium,
1374 ReasoningEffort::High,
1375 ReasoningEffort::Xhigh,
1376 ]
1377 }
1378 Self::ClaudeFable5
1379 | Self::ClaudeOpus48
1380 | Self::ClaudeOpus5
1381 | Self::ClaudeSonnet5
1382 | Self::Gpt56Luna
1383 | Self::Gpt56Sol
1384 | Self::Gpt56Terra => {
1385 &[
1386 ReasoningEffort::Low,
1387 ReasoningEffort::Medium,
1388 ReasoningEffort::High,
1389 ReasoningEffort::Xhigh,
1390 ReasoningEffort::Max,
1391 ]
1392 }
1393 Self::Gpt54Pro => {
1394 &[ReasoningEffort::Medium, ReasoningEffort::High, ReasoningEffort::Xhigh]
1395 }
1396 Self::Gpt5 | Self::Gpt5Mini | Self::Gpt5Nano => {
1397 &[
1398 ReasoningEffort::Minimal,
1399 ReasoningEffort::Low,
1400 ReasoningEffort::Medium,
1401 ReasoningEffort::High,
1402 ]
1403 }
1404 }
1405 }
1406 pub fn supports_reasoning(self) -> bool {
1407 !self.reasoning_levels().is_empty()
1408 }
1409 #[allow(clippy::too_many_lines)]
1410 pub fn supports_prompt_caching(self) -> bool {
1411 match self {
1412 Self::Codestral2501
1413 | Self::CohereCommandA
1414 | Self::DeepseekV32
1415 | Self::Gpt4Turbo
1416 | Self::Gpt4TurboVision
1417 | Self::Gpt5Pro
1418 | Self::Gpt54Pro
1419 | Self::Grok420NonReasoning
1420 | Self::Grok420Reasoning
1421 | Self::KimiK25
1422 | Self::KimiK26
1423 | Self::Llama3370bInstruct
1424 | Self::Llama4Maverick17b128eInstructFp8
1425 | Self::Llama4Scout17b16eInstruct
1426 | Self::Ministral3b
1427 | Self::MistralMedium2505
1428 | Self::MistralSmall2503
1429 | Self::ModelRouter
1430 | Self::Phi4Mini
1431 | Self::Phi4MiniReasoning => false,
1432 Self::ClaudeFable5
1433 | Self::ClaudeHaiku45
1434 | Self::ClaudeOpus41
1435 | Self::ClaudeOpus45
1436 | Self::ClaudeOpus46
1437 | Self::ClaudeOpus48
1438 | Self::ClaudeOpus5
1439 | Self::ClaudeSonnet45
1440 | Self::ClaudeSonnet46
1441 | Self::ClaudeSonnet5
1442 | Self::CodexMini
1443 | Self::Gpt41
1444 | Self::Gpt41Mini
1445 | Self::Gpt41Nano
1446 | Self::Gpt4o
1447 | Self::Gpt4oMini
1448 | Self::Gpt5
1449 | Self::Gpt5Codex
1450 | Self::Gpt5Mini
1451 | Self::Gpt5Nano
1452 | Self::Gpt51
1453 | Self::Gpt51Codex
1454 | Self::Gpt51CodexMax
1455 | Self::Gpt51CodexMini
1456 | Self::Gpt52
1457 | Self::Gpt52Codex
1458 | Self::Gpt53Codex
1459 | Self::Gpt54
1460 | Self::Gpt54Mini
1461 | Self::Gpt54Nano
1462 | Self::Gpt55
1463 | Self::Gpt56Luna
1464 | Self::Gpt56Sol
1465 | Self::Gpt56Terra
1466 | Self::Grok41FastNonReasoning
1467 | Self::Grok41FastReasoning
1468 | Self::O1
1469 | Self::O3
1470 | Self::O3Mini
1471 | Self::O4Mini => true,
1472 }
1473 }
1474 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
1475 pub fn pricing(self) -> Option<ModelPricing> {
1476 match self {
1477 Self::ClaudeFable5 => {
1478 Some(ModelPricing {
1479 input_per_million: 10f64,
1480 output_per_million: 50f64,
1481 cache_read_per_million: Some(1f64),
1482 cache_write_per_million: Some(12.5f64),
1483 })
1484 }
1485 Self::ClaudeHaiku45 => {
1486 Some(ModelPricing {
1487 input_per_million: 1f64,
1488 output_per_million: 5f64,
1489 cache_read_per_million: Some(0.1f64),
1490 cache_write_per_million: Some(1.25f64),
1491 })
1492 }
1493 Self::ClaudeOpus41 => {
1494 Some(ModelPricing {
1495 input_per_million: 15f64,
1496 output_per_million: 75f64,
1497 cache_read_per_million: Some(1.5f64),
1498 cache_write_per_million: Some(18.75f64),
1499 })
1500 }
1501 Self::ClaudeOpus45 => {
1502 Some(ModelPricing {
1503 input_per_million: 5f64,
1504 output_per_million: 25f64,
1505 cache_read_per_million: Some(0.5f64),
1506 cache_write_per_million: Some(6.25f64),
1507 })
1508 }
1509 Self::ClaudeOpus46 => {
1510 Some(ModelPricing {
1511 input_per_million: 5f64,
1512 output_per_million: 25f64,
1513 cache_read_per_million: Some(0.5f64),
1514 cache_write_per_million: Some(6.25f64),
1515 })
1516 }
1517 Self::ClaudeOpus48 => {
1518 Some(ModelPricing {
1519 input_per_million: 5f64,
1520 output_per_million: 25f64,
1521 cache_read_per_million: Some(0.5f64),
1522 cache_write_per_million: Some(6.25f64),
1523 })
1524 }
1525 Self::ClaudeOpus5 => {
1526 Some(ModelPricing {
1527 input_per_million: 5f64,
1528 output_per_million: 25f64,
1529 cache_read_per_million: Some(0.5f64),
1530 cache_write_per_million: Some(6.25f64),
1531 })
1532 }
1533 Self::ClaudeSonnet45 => {
1534 Some(ModelPricing {
1535 input_per_million: 3f64,
1536 output_per_million: 15f64,
1537 cache_read_per_million: Some(0.3f64),
1538 cache_write_per_million: Some(3.75f64),
1539 })
1540 }
1541 Self::ClaudeSonnet46 => {
1542 Some(ModelPricing {
1543 input_per_million: 3f64,
1544 output_per_million: 15f64,
1545 cache_read_per_million: Some(0.3f64),
1546 cache_write_per_million: Some(3.75f64),
1547 })
1548 }
1549 Self::ClaudeSonnet5 => {
1550 Some(ModelPricing {
1551 input_per_million: 2f64,
1552 output_per_million: 10f64,
1553 cache_read_per_million: Some(0.2f64),
1554 cache_write_per_million: Some(2.5f64),
1555 })
1556 }
1557 Self::Codestral2501 => {
1558 Some(ModelPricing {
1559 input_per_million: 0.3f64,
1560 output_per_million: 0.9f64,
1561 cache_read_per_million: None,
1562 cache_write_per_million: None,
1563 })
1564 }
1565 Self::CodexMini => {
1566 Some(ModelPricing {
1567 input_per_million: 1.5f64,
1568 output_per_million: 6f64,
1569 cache_read_per_million: Some(0.375f64),
1570 cache_write_per_million: None,
1571 })
1572 }
1573 Self::CohereCommandA => {
1574 Some(ModelPricing {
1575 input_per_million: 2.5f64,
1576 output_per_million: 10f64,
1577 cache_read_per_million: None,
1578 cache_write_per_million: None,
1579 })
1580 }
1581 Self::DeepseekV32 => {
1582 Some(ModelPricing {
1583 input_per_million: 0.58f64,
1584 output_per_million: 1.68f64,
1585 cache_read_per_million: None,
1586 cache_write_per_million: None,
1587 })
1588 }
1589 Self::Gpt4Turbo => {
1590 Some(ModelPricing {
1591 input_per_million: 10f64,
1592 output_per_million: 30f64,
1593 cache_read_per_million: None,
1594 cache_write_per_million: None,
1595 })
1596 }
1597 Self::Gpt4TurboVision => {
1598 Some(ModelPricing {
1599 input_per_million: 10f64,
1600 output_per_million: 30f64,
1601 cache_read_per_million: None,
1602 cache_write_per_million: None,
1603 })
1604 }
1605 Self::Gpt41 => {
1606 Some(ModelPricing {
1607 input_per_million: 2f64,
1608 output_per_million: 8f64,
1609 cache_read_per_million: Some(0.5f64),
1610 cache_write_per_million: None,
1611 })
1612 }
1613 Self::Gpt41Mini => {
1614 Some(ModelPricing {
1615 input_per_million: 0.4f64,
1616 output_per_million: 1.6f64,
1617 cache_read_per_million: Some(0.1f64),
1618 cache_write_per_million: None,
1619 })
1620 }
1621 Self::Gpt41Nano => {
1622 Some(ModelPricing {
1623 input_per_million: 0.1f64,
1624 output_per_million: 0.4f64,
1625 cache_read_per_million: Some(0.025f64),
1626 cache_write_per_million: None,
1627 })
1628 }
1629 Self::Gpt4o => {
1630 Some(ModelPricing {
1631 input_per_million: 2.5f64,
1632 output_per_million: 10f64,
1633 cache_read_per_million: Some(1.25f64),
1634 cache_write_per_million: None,
1635 })
1636 }
1637 Self::Gpt4oMini => {
1638 Some(ModelPricing {
1639 input_per_million: 0.15f64,
1640 output_per_million: 0.6f64,
1641 cache_read_per_million: Some(0.075f64),
1642 cache_write_per_million: None,
1643 })
1644 }
1645 Self::Gpt5 => {
1646 Some(ModelPricing {
1647 input_per_million: 1.25f64,
1648 output_per_million: 10f64,
1649 cache_read_per_million: Some(0.13f64),
1650 cache_write_per_million: None,
1651 })
1652 }
1653 Self::Gpt5Codex => {
1654 Some(ModelPricing {
1655 input_per_million: 1.25f64,
1656 output_per_million: 10f64,
1657 cache_read_per_million: Some(0.13f64),
1658 cache_write_per_million: None,
1659 })
1660 }
1661 Self::Gpt5Mini => {
1662 Some(ModelPricing {
1663 input_per_million: 0.25f64,
1664 output_per_million: 2f64,
1665 cache_read_per_million: Some(0.03f64),
1666 cache_write_per_million: None,
1667 })
1668 }
1669 Self::Gpt5Nano => {
1670 Some(ModelPricing {
1671 input_per_million: 0.05f64,
1672 output_per_million: 0.4f64,
1673 cache_read_per_million: Some(0.01f64),
1674 cache_write_per_million: None,
1675 })
1676 }
1677 Self::Gpt5Pro => {
1678 Some(ModelPricing {
1679 input_per_million: 15f64,
1680 output_per_million: 120f64,
1681 cache_read_per_million: None,
1682 cache_write_per_million: None,
1683 })
1684 }
1685 Self::Gpt51 => {
1686 Some(ModelPricing {
1687 input_per_million: 1.25f64,
1688 output_per_million: 10f64,
1689 cache_read_per_million: Some(0.125f64),
1690 cache_write_per_million: None,
1691 })
1692 }
1693 Self::Gpt51Codex => {
1694 Some(ModelPricing {
1695 input_per_million: 1.25f64,
1696 output_per_million: 10f64,
1697 cache_read_per_million: Some(0.125f64),
1698 cache_write_per_million: None,
1699 })
1700 }
1701 Self::Gpt51CodexMax => {
1702 Some(ModelPricing {
1703 input_per_million: 1.25f64,
1704 output_per_million: 10f64,
1705 cache_read_per_million: Some(0.125f64),
1706 cache_write_per_million: None,
1707 })
1708 }
1709 Self::Gpt51CodexMini => {
1710 Some(ModelPricing {
1711 input_per_million: 0.25f64,
1712 output_per_million: 2f64,
1713 cache_read_per_million: Some(0.025f64),
1714 cache_write_per_million: None,
1715 })
1716 }
1717 Self::Gpt52 => {
1718 Some(ModelPricing {
1719 input_per_million: 1.75f64,
1720 output_per_million: 14f64,
1721 cache_read_per_million: Some(0.125f64),
1722 cache_write_per_million: None,
1723 })
1724 }
1725 Self::Gpt52Codex => {
1726 Some(ModelPricing {
1727 input_per_million: 1.75f64,
1728 output_per_million: 14f64,
1729 cache_read_per_million: Some(0.175f64),
1730 cache_write_per_million: None,
1731 })
1732 }
1733 Self::Gpt53Codex => {
1734 Some(ModelPricing {
1735 input_per_million: 1.75f64,
1736 output_per_million: 14f64,
1737 cache_read_per_million: Some(0.175f64),
1738 cache_write_per_million: None,
1739 })
1740 }
1741 Self::Gpt54 => {
1742 Some(ModelPricing {
1743 input_per_million: 2.5f64,
1744 output_per_million: 15f64,
1745 cache_read_per_million: Some(0.25f64),
1746 cache_write_per_million: None,
1747 })
1748 }
1749 Self::Gpt54Mini => {
1750 Some(ModelPricing {
1751 input_per_million: 0.75f64,
1752 output_per_million: 4.5f64,
1753 cache_read_per_million: Some(0.075f64),
1754 cache_write_per_million: None,
1755 })
1756 }
1757 Self::Gpt54Nano => {
1758 Some(ModelPricing {
1759 input_per_million: 0.2f64,
1760 output_per_million: 1.25f64,
1761 cache_read_per_million: Some(0.02f64),
1762 cache_write_per_million: None,
1763 })
1764 }
1765 Self::Gpt54Pro => {
1766 Some(ModelPricing {
1767 input_per_million: 30f64,
1768 output_per_million: 180f64,
1769 cache_read_per_million: None,
1770 cache_write_per_million: None,
1771 })
1772 }
1773 Self::Gpt55 => {
1774 Some(ModelPricing {
1775 input_per_million: 5f64,
1776 output_per_million: 30f64,
1777 cache_read_per_million: Some(0.5f64),
1778 cache_write_per_million: None,
1779 })
1780 }
1781 Self::Gpt56Luna => {
1782 Some(ModelPricing {
1783 input_per_million: 1f64,
1784 output_per_million: 6f64,
1785 cache_read_per_million: Some(0.1f64),
1786 cache_write_per_million: None,
1787 })
1788 }
1789 Self::Gpt56Sol => {
1790 Some(ModelPricing {
1791 input_per_million: 5f64,
1792 output_per_million: 30f64,
1793 cache_read_per_million: Some(0.5f64),
1794 cache_write_per_million: None,
1795 })
1796 }
1797 Self::Gpt56Terra => {
1798 Some(ModelPricing {
1799 input_per_million: 2.5f64,
1800 output_per_million: 15f64,
1801 cache_read_per_million: Some(0.25f64),
1802 cache_write_per_million: None,
1803 })
1804 }
1805 Self::Grok41FastNonReasoning => {
1806 Some(ModelPricing {
1807 input_per_million: 0.2f64,
1808 output_per_million: 0.5f64,
1809 cache_read_per_million: Some(0.05f64),
1810 cache_write_per_million: None,
1811 })
1812 }
1813 Self::Grok41FastReasoning => {
1814 Some(ModelPricing {
1815 input_per_million: 0.2f64,
1816 output_per_million: 0.5f64,
1817 cache_read_per_million: Some(0.05f64),
1818 cache_write_per_million: None,
1819 })
1820 }
1821 Self::Grok420NonReasoning => {
1822 Some(ModelPricing {
1823 input_per_million: 2f64,
1824 output_per_million: 6f64,
1825 cache_read_per_million: None,
1826 cache_write_per_million: None,
1827 })
1828 }
1829 Self::Grok420Reasoning => {
1830 Some(ModelPricing {
1831 input_per_million: 2f64,
1832 output_per_million: 6f64,
1833 cache_read_per_million: None,
1834 cache_write_per_million: None,
1835 })
1836 }
1837 Self::KimiK25 => {
1838 Some(ModelPricing {
1839 input_per_million: 0.6f64,
1840 output_per_million: 3f64,
1841 cache_read_per_million: None,
1842 cache_write_per_million: None,
1843 })
1844 }
1845 Self::KimiK26 => {
1846 Some(ModelPricing {
1847 input_per_million: 0.95f64,
1848 output_per_million: 4f64,
1849 cache_read_per_million: None,
1850 cache_write_per_million: None,
1851 })
1852 }
1853 Self::Llama3370bInstruct => {
1854 Some(ModelPricing {
1855 input_per_million: 0.71f64,
1856 output_per_million: 0.71f64,
1857 cache_read_per_million: None,
1858 cache_write_per_million: None,
1859 })
1860 }
1861 Self::Llama4Maverick17b128eInstructFp8 => {
1862 Some(ModelPricing {
1863 input_per_million: 0.25f64,
1864 output_per_million: 1f64,
1865 cache_read_per_million: None,
1866 cache_write_per_million: None,
1867 })
1868 }
1869 Self::Llama4Scout17b16eInstruct => {
1870 Some(ModelPricing {
1871 input_per_million: 0.2f64,
1872 output_per_million: 0.78f64,
1873 cache_read_per_million: None,
1874 cache_write_per_million: None,
1875 })
1876 }
1877 Self::Ministral3b => {
1878 Some(ModelPricing {
1879 input_per_million: 0.04f64,
1880 output_per_million: 0.04f64,
1881 cache_read_per_million: None,
1882 cache_write_per_million: None,
1883 })
1884 }
1885 Self::MistralMedium2505 => {
1886 Some(ModelPricing {
1887 input_per_million: 0.4f64,
1888 output_per_million: 2f64,
1889 cache_read_per_million: None,
1890 cache_write_per_million: None,
1891 })
1892 }
1893 Self::MistralSmall2503 => {
1894 Some(ModelPricing {
1895 input_per_million: 0.1f64,
1896 output_per_million: 0.3f64,
1897 cache_read_per_million: None,
1898 cache_write_per_million: None,
1899 })
1900 }
1901 Self::ModelRouter => {
1902 Some(ModelPricing {
1903 input_per_million: 0.14f64,
1904 output_per_million: 0f64,
1905 cache_read_per_million: None,
1906 cache_write_per_million: None,
1907 })
1908 }
1909 Self::O1 => {
1910 Some(ModelPricing {
1911 input_per_million: 15f64,
1912 output_per_million: 60f64,
1913 cache_read_per_million: Some(7.5f64),
1914 cache_write_per_million: None,
1915 })
1916 }
1917 Self::O3 => {
1918 Some(ModelPricing {
1919 input_per_million: 2f64,
1920 output_per_million: 8f64,
1921 cache_read_per_million: Some(0.5f64),
1922 cache_write_per_million: None,
1923 })
1924 }
1925 Self::O3Mini => {
1926 Some(ModelPricing {
1927 input_per_million: 1.1f64,
1928 output_per_million: 4.4f64,
1929 cache_read_per_million: Some(0.55f64),
1930 cache_write_per_million: None,
1931 })
1932 }
1933 Self::O4Mini => {
1934 Some(ModelPricing {
1935 input_per_million: 1.1f64,
1936 output_per_million: 4.4f64,
1937 cache_read_per_million: Some(0.275f64),
1938 cache_write_per_million: None,
1939 })
1940 }
1941 Self::Phi4Mini => {
1942 Some(ModelPricing {
1943 input_per_million: 0.075f64,
1944 output_per_million: 0.3f64,
1945 cache_read_per_million: None,
1946 cache_write_per_million: None,
1947 })
1948 }
1949 Self::Phi4MiniReasoning => {
1950 Some(ModelPricing {
1951 input_per_million: 0.075f64,
1952 output_per_million: 0.3f64,
1953 cache_read_per_million: None,
1954 cache_write_per_million: None,
1955 })
1956 }
1957 }
1958 }
1959 #[allow(clippy::too_many_lines)]
1960 pub fn supports_image(self) -> bool {
1961 match self {
1962 Self::Codestral2501
1963 | Self::CodexMini
1964 | Self::CohereCommandA
1965 | Self::DeepseekV32
1966 | Self::Grok420NonReasoning
1967 | Self::Grok420Reasoning
1968 | Self::Llama3370bInstruct
1969 | Self::Ministral3b
1970 | Self::O3Mini
1971 | Self::Phi4Mini
1972 | Self::Phi4MiniReasoning => false,
1973 Self::ClaudeFable5
1974 | Self::ClaudeHaiku45
1975 | Self::ClaudeOpus41
1976 | Self::ClaudeOpus45
1977 | Self::ClaudeOpus46
1978 | Self::ClaudeOpus48
1979 | Self::ClaudeOpus5
1980 | Self::ClaudeSonnet45
1981 | Self::ClaudeSonnet46
1982 | Self::ClaudeSonnet5
1983 | Self::Gpt4Turbo
1984 | Self::Gpt4TurboVision
1985 | Self::Gpt41
1986 | Self::Gpt41Mini
1987 | Self::Gpt41Nano
1988 | Self::Gpt4o
1989 | Self::Gpt4oMini
1990 | Self::Gpt5
1991 | Self::Gpt5Codex
1992 | Self::Gpt5Mini
1993 | Self::Gpt5Nano
1994 | Self::Gpt5Pro
1995 | Self::Gpt51
1996 | Self::Gpt51Codex
1997 | Self::Gpt51CodexMax
1998 | Self::Gpt51CodexMini
1999 | Self::Gpt52
2000 | Self::Gpt52Codex
2001 | Self::Gpt53Codex
2002 | Self::Gpt54
2003 | Self::Gpt54Mini
2004 | Self::Gpt54Nano
2005 | Self::Gpt54Pro
2006 | Self::Gpt55
2007 | Self::Gpt56Luna
2008 | Self::Gpt56Sol
2009 | Self::Gpt56Terra
2010 | Self::Grok41FastNonReasoning
2011 | Self::Grok41FastReasoning
2012 | Self::KimiK25
2013 | Self::KimiK26
2014 | Self::Llama4Maverick17b128eInstructFp8
2015 | Self::Llama4Scout17b16eInstruct
2016 | Self::MistralMedium2505
2017 | Self::MistralSmall2503
2018 | Self::ModelRouter
2019 | Self::O1
2020 | Self::O3
2021 | Self::O4Mini => true,
2022 }
2023 }
2024 #[allow(clippy::too_many_lines)]
2025 pub fn supports_audio(self) -> bool {
2026 match self {
2027 Self::ClaudeFable5
2028 | Self::ClaudeHaiku45
2029 | Self::ClaudeOpus41
2030 | Self::ClaudeOpus45
2031 | Self::ClaudeOpus46
2032 | Self::ClaudeOpus48
2033 | Self::ClaudeOpus5
2034 | Self::ClaudeSonnet45
2035 | Self::ClaudeSonnet46
2036 | Self::ClaudeSonnet5
2037 | Self::Codestral2501
2038 | Self::CodexMini
2039 | Self::CohereCommandA
2040 | Self::DeepseekV32
2041 | Self::Gpt4Turbo
2042 | Self::Gpt4TurboVision
2043 | Self::Gpt41
2044 | Self::Gpt41Mini
2045 | Self::Gpt41Nano
2046 | Self::Gpt4o
2047 | Self::Gpt4oMini
2048 | Self::Gpt5
2049 | Self::Gpt5Codex
2050 | Self::Gpt5Mini
2051 | Self::Gpt5Nano
2052 | Self::Gpt5Pro
2053 | Self::Gpt51CodexMax
2054 | Self::Gpt51CodexMini
2055 | Self::Gpt52
2056 | Self::Gpt52Codex
2057 | Self::Gpt53Codex
2058 | Self::Gpt54
2059 | Self::Gpt54Mini
2060 | Self::Gpt54Nano
2061 | Self::Gpt54Pro
2062 | Self::Gpt55
2063 | Self::Gpt56Luna
2064 | Self::Gpt56Sol
2065 | Self::Gpt56Terra
2066 | Self::Grok41FastNonReasoning
2067 | Self::Grok41FastReasoning
2068 | Self::Grok420NonReasoning
2069 | Self::Grok420Reasoning
2070 | Self::KimiK25
2071 | Self::KimiK26
2072 | Self::Llama3370bInstruct
2073 | Self::Llama4Maverick17b128eInstructFp8
2074 | Self::Llama4Scout17b16eInstruct
2075 | Self::Ministral3b
2076 | Self::MistralMedium2505
2077 | Self::MistralSmall2503
2078 | Self::ModelRouter
2079 | Self::O1
2080 | Self::O3
2081 | Self::O3Mini
2082 | Self::O4Mini
2083 | Self::Phi4Mini
2084 | Self::Phi4MiniReasoning => false,
2085 Self::Gpt51 | Self::Gpt51Codex => true,
2086 }
2087 }
2088 #[allow(clippy::too_many_lines)]
2089 pub fn transport(self) -> Option<ModelTransport> {
2090 match self {
2091 Self::ClaudeFable5
2092 | Self::ClaudeHaiku45
2093 | Self::ClaudeOpus41
2094 | Self::ClaudeOpus45
2095 | Self::ClaudeOpus46
2096 | Self::ClaudeOpus48
2097 | Self::ClaudeOpus5
2098 | Self::ClaudeSonnet45
2099 | Self::ClaudeSonnet46
2100 | Self::ClaudeSonnet5
2101 | Self::Codestral2501
2102 | Self::CodexMini
2103 | Self::CohereCommandA
2104 | Self::DeepseekV32
2105 | Self::Gpt4Turbo
2106 | Self::Gpt4TurboVision
2107 | Self::Gpt41
2108 | Self::Gpt41Mini
2109 | Self::Gpt41Nano
2110 | Self::Gpt4o
2111 | Self::Gpt4oMini
2112 | Self::Gpt5
2113 | Self::Gpt5Codex
2114 | Self::Gpt5Mini
2115 | Self::Gpt5Nano
2116 | Self::Gpt5Pro
2117 | Self::Gpt51
2118 | Self::Gpt51Codex
2119 | Self::Gpt51CodexMax
2120 | Self::Gpt51CodexMini
2121 | Self::Gpt52
2122 | Self::Gpt52Codex
2123 | Self::Gpt53Codex
2124 | Self::Gpt54
2125 | Self::Gpt54Mini
2126 | Self::Gpt54Nano
2127 | Self::Gpt54Pro
2128 | Self::Gpt55
2129 | Self::Gpt56Luna
2130 | Self::Gpt56Sol
2131 | Self::Gpt56Terra
2132 | Self::Grok41FastNonReasoning
2133 | Self::Grok41FastReasoning
2134 | Self::Grok420NonReasoning
2135 | Self::Grok420Reasoning
2136 | Self::KimiK25
2137 | Self::KimiK26
2138 | Self::Llama3370bInstruct
2139 | Self::Llama4Maverick17b128eInstructFp8
2140 | Self::Llama4Scout17b16eInstruct
2141 | Self::Ministral3b
2142 | Self::MistralMedium2505
2143 | Self::MistralSmall2503
2144 | Self::ModelRouter
2145 | Self::O1
2146 | Self::O3
2147 | Self::O3Mini
2148 | Self::O4Mini
2149 | Self::Phi4Mini
2150 | Self::Phi4MiniReasoning => None,
2151 }
2152 }
2153 const ALL: &[AzureFoundryModel] = &[
2154 Self::ClaudeFable5,
2155 Self::ClaudeHaiku45,
2156 Self::ClaudeOpus41,
2157 Self::ClaudeOpus45,
2158 Self::ClaudeOpus46,
2159 Self::ClaudeOpus48,
2160 Self::ClaudeOpus5,
2161 Self::ClaudeSonnet45,
2162 Self::ClaudeSonnet46,
2163 Self::ClaudeSonnet5,
2164 Self::Codestral2501,
2165 Self::CodexMini,
2166 Self::CohereCommandA,
2167 Self::DeepseekV32,
2168 Self::Gpt4Turbo,
2169 Self::Gpt4TurboVision,
2170 Self::Gpt41,
2171 Self::Gpt41Mini,
2172 Self::Gpt41Nano,
2173 Self::Gpt4o,
2174 Self::Gpt4oMini,
2175 Self::Gpt5,
2176 Self::Gpt5Codex,
2177 Self::Gpt5Mini,
2178 Self::Gpt5Nano,
2179 Self::Gpt5Pro,
2180 Self::Gpt51,
2181 Self::Gpt51Codex,
2182 Self::Gpt51CodexMax,
2183 Self::Gpt51CodexMini,
2184 Self::Gpt52,
2185 Self::Gpt52Codex,
2186 Self::Gpt53Codex,
2187 Self::Gpt54,
2188 Self::Gpt54Mini,
2189 Self::Gpt54Nano,
2190 Self::Gpt54Pro,
2191 Self::Gpt55,
2192 Self::Gpt56Luna,
2193 Self::Gpt56Sol,
2194 Self::Gpt56Terra,
2195 Self::Grok41FastNonReasoning,
2196 Self::Grok41FastReasoning,
2197 Self::Grok420NonReasoning,
2198 Self::Grok420Reasoning,
2199 Self::KimiK25,
2200 Self::KimiK26,
2201 Self::Llama3370bInstruct,
2202 Self::Llama4Maverick17b128eInstructFp8,
2203 Self::Llama4Scout17b16eInstruct,
2204 Self::Ministral3b,
2205 Self::MistralMedium2505,
2206 Self::MistralSmall2503,
2207 Self::ModelRouter,
2208 Self::O1,
2209 Self::O3,
2210 Self::O3Mini,
2211 Self::O4Mini,
2212 Self::Phi4Mini,
2213 Self::Phi4MiniReasoning,
2214 ];
2215}
2216impl std::str::FromStr for AzureFoundryModel {
2217 type Err = String;
2218 #[allow(clippy::too_many_lines)]
2219 fn from_str(s: &str) -> Result<Self, Self::Err> {
2220 match s {
2221 "claude-fable-5" => Ok(Self::ClaudeFable5),
2222 "claude-haiku-4-5" => Ok(Self::ClaudeHaiku45),
2223 "claude-opus-4-1" => Ok(Self::ClaudeOpus41),
2224 "claude-opus-4-5" => Ok(Self::ClaudeOpus45),
2225 "claude-opus-4-6" => Ok(Self::ClaudeOpus46),
2226 "claude-opus-4-8" => Ok(Self::ClaudeOpus48),
2227 "claude-opus-5" => Ok(Self::ClaudeOpus5),
2228 "claude-sonnet-4-5" => Ok(Self::ClaudeSonnet45),
2229 "claude-sonnet-4-6" => Ok(Self::ClaudeSonnet46),
2230 "claude-sonnet-5" => Ok(Self::ClaudeSonnet5),
2231 "codestral-2501" => Ok(Self::Codestral2501),
2232 "codex-mini" => Ok(Self::CodexMini),
2233 "cohere-command-a" => Ok(Self::CohereCommandA),
2234 "deepseek-v3.2" => Ok(Self::DeepseekV32),
2235 "gpt-4-turbo" => Ok(Self::Gpt4Turbo),
2236 "gpt-4-turbo-vision" => Ok(Self::Gpt4TurboVision),
2237 "gpt-4.1" => Ok(Self::Gpt41),
2238 "gpt-4.1-mini" => Ok(Self::Gpt41Mini),
2239 "gpt-4.1-nano" => Ok(Self::Gpt41Nano),
2240 "gpt-4o" => Ok(Self::Gpt4o),
2241 "gpt-4o-mini" => Ok(Self::Gpt4oMini),
2242 "gpt-5" => Ok(Self::Gpt5),
2243 "gpt-5-codex" => Ok(Self::Gpt5Codex),
2244 "gpt-5-mini" => Ok(Self::Gpt5Mini),
2245 "gpt-5-nano" => Ok(Self::Gpt5Nano),
2246 "gpt-5-pro" => Ok(Self::Gpt5Pro),
2247 "gpt-5.1" => Ok(Self::Gpt51),
2248 "gpt-5.1-codex" => Ok(Self::Gpt51Codex),
2249 "gpt-5.1-codex-max" => Ok(Self::Gpt51CodexMax),
2250 "gpt-5.1-codex-mini" => Ok(Self::Gpt51CodexMini),
2251 "gpt-5.2" => Ok(Self::Gpt52),
2252 "gpt-5.2-codex" => Ok(Self::Gpt52Codex),
2253 "gpt-5.3-codex" => Ok(Self::Gpt53Codex),
2254 "gpt-5.4" => Ok(Self::Gpt54),
2255 "gpt-5.4-mini" => Ok(Self::Gpt54Mini),
2256 "gpt-5.4-nano" => Ok(Self::Gpt54Nano),
2257 "gpt-5.4-pro" => Ok(Self::Gpt54Pro),
2258 "gpt-5.5" => Ok(Self::Gpt55),
2259 "gpt-5.6-luna" => Ok(Self::Gpt56Luna),
2260 "gpt-5.6-sol" => Ok(Self::Gpt56Sol),
2261 "gpt-5.6-terra" => Ok(Self::Gpt56Terra),
2262 "grok-4-1-fast-non-reasoning" => Ok(Self::Grok41FastNonReasoning),
2263 "grok-4-1-fast-reasoning" => Ok(Self::Grok41FastReasoning),
2264 "grok-4-20-non-reasoning" => Ok(Self::Grok420NonReasoning),
2265 "grok-4-20-reasoning" => Ok(Self::Grok420Reasoning),
2266 "kimi-k2.5" => Ok(Self::KimiK25),
2267 "kimi-k2.6" => Ok(Self::KimiK26),
2268 "llama-3.3-70b-instruct" => Ok(Self::Llama3370bInstruct),
2269 "llama-4-maverick-17b-128e-instruct-fp8" => {
2270 Ok(Self::Llama4Maverick17b128eInstructFp8)
2271 }
2272 "llama-4-scout-17b-16e-instruct" => Ok(Self::Llama4Scout17b16eInstruct),
2273 "ministral-3b" => Ok(Self::Ministral3b),
2274 "mistral-medium-2505" => Ok(Self::MistralMedium2505),
2275 "mistral-small-2503" => Ok(Self::MistralSmall2503),
2276 "model-router" => Ok(Self::ModelRouter),
2277 "o1" => Ok(Self::O1),
2278 "o3" => Ok(Self::O3),
2279 "o3-mini" => Ok(Self::O3Mini),
2280 "o4-mini" => Ok(Self::O4Mini),
2281 "phi-4-mini" => Ok(Self::Phi4Mini),
2282 "phi-4-mini-reasoning" => Ok(Self::Phi4MiniReasoning),
2283 _ => Err(format!("Unknown azure-foundry model: '{s}'")),
2284 }
2285 }
2286}
2287impl CodexModel {
2288 #[allow(clippy::too_many_lines)]
2289 fn model_id(self) -> &'static str {
2290 match self {
2291 Self::Gpt52 => "gpt-5.2",
2292 Self::Gpt54 => "gpt-5.4",
2293 Self::Gpt54Mini => "gpt-5.4-mini",
2294 Self::Gpt55 => "gpt-5.5",
2295 Self::Gpt56Luna => "gpt-5.6-luna",
2296 Self::Gpt56Sol => "gpt-5.6-sol",
2297 Self::Gpt56Terra => "gpt-5.6-terra",
2298 }
2299 }
2300 #[allow(clippy::too_many_lines)]
2301 fn display_name(self) -> &'static str {
2302 match self {
2303 Self::Gpt52 => "GPT-5.2",
2304 Self::Gpt54 => "GPT-5.4",
2305 Self::Gpt54Mini => "GPT-5.4 mini",
2306 Self::Gpt55 => "GPT-5.5",
2307 Self::Gpt56Luna => "GPT-5.6 Luna",
2308 Self::Gpt56Sol => "GPT-5.6 Sol",
2309 Self::Gpt56Terra => "GPT-5.6 Terra",
2310 }
2311 }
2312 #[allow(clippy::too_many_lines)]
2313 fn context_window(self) -> u32 {
2314 match self {
2315 Self::Gpt52 | Self::Gpt54 | Self::Gpt54Mini | Self::Gpt55 => 272_000,
2316 Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => 372_000,
2317 }
2318 }
2319 #[allow(clippy::too_many_lines)]
2320 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
2321 match self {
2322 Self::Gpt52 | Self::Gpt54 | Self::Gpt54Mini | Self::Gpt55 => {
2323 &[
2324 ReasoningEffort::Low,
2325 ReasoningEffort::Medium,
2326 ReasoningEffort::High,
2327 ReasoningEffort::Xhigh,
2328 ]
2329 }
2330 Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => {
2331 &[
2332 ReasoningEffort::Low,
2333 ReasoningEffort::Medium,
2334 ReasoningEffort::High,
2335 ReasoningEffort::Xhigh,
2336 ReasoningEffort::Max,
2337 ]
2338 }
2339 }
2340 }
2341 pub fn supports_reasoning(self) -> bool {
2342 !self.reasoning_levels().is_empty()
2343 }
2344 #[allow(clippy::too_many_lines)]
2345 pub fn supports_prompt_caching(self) -> bool {
2346 match self {
2347 Self::Gpt52
2348 | Self::Gpt54
2349 | Self::Gpt54Mini
2350 | Self::Gpt55
2351 | Self::Gpt56Luna
2352 | Self::Gpt56Sol
2353 | Self::Gpt56Terra => true,
2354 }
2355 }
2356 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
2357 pub fn pricing(self) -> Option<ModelPricing> {
2358 match self {
2359 Self::Gpt52 => None,
2360 Self::Gpt54 => None,
2361 Self::Gpt54Mini => None,
2362 Self::Gpt55 => None,
2363 Self::Gpt56Luna => None,
2364 Self::Gpt56Sol => None,
2365 Self::Gpt56Terra => None,
2366 }
2367 }
2368 #[allow(clippy::too_many_lines)]
2369 pub fn supports_image(self) -> bool {
2370 match self {
2371 Self::Gpt52
2372 | Self::Gpt54
2373 | Self::Gpt54Mini
2374 | Self::Gpt55
2375 | Self::Gpt56Luna
2376 | Self::Gpt56Sol
2377 | Self::Gpt56Terra => true,
2378 }
2379 }
2380 #[allow(clippy::too_many_lines)]
2381 pub fn supports_audio(self) -> bool {
2382 match self {
2383 Self::Gpt52
2384 | Self::Gpt54
2385 | Self::Gpt54Mini
2386 | Self::Gpt55
2387 | Self::Gpt56Luna
2388 | Self::Gpt56Sol
2389 | Self::Gpt56Terra => false,
2390 }
2391 }
2392 #[allow(clippy::too_many_lines)]
2393 pub fn transport(self) -> Option<ModelTransport> {
2394 match self {
2395 Self::Gpt52
2396 | Self::Gpt54
2397 | Self::Gpt54Mini
2398 | Self::Gpt55
2399 | Self::Gpt56Luna
2400 | Self::Gpt56Sol
2401 | Self::Gpt56Terra => None,
2402 }
2403 }
2404 const ALL: &[CodexModel] = &[
2405 Self::Gpt52,
2406 Self::Gpt54,
2407 Self::Gpt54Mini,
2408 Self::Gpt55,
2409 Self::Gpt56Luna,
2410 Self::Gpt56Sol,
2411 Self::Gpt56Terra,
2412 ];
2413}
2414impl std::str::FromStr for CodexModel {
2415 type Err = String;
2416 #[allow(clippy::too_many_lines)]
2417 fn from_str(s: &str) -> Result<Self, Self::Err> {
2418 match s {
2419 "gpt-5.2" => Ok(Self::Gpt52),
2420 "gpt-5.4" => Ok(Self::Gpt54),
2421 "gpt-5.4-mini" => Ok(Self::Gpt54Mini),
2422 "gpt-5.5" => Ok(Self::Gpt55),
2423 "gpt-5.6-luna" => Ok(Self::Gpt56Luna),
2424 "gpt-5.6-sol" => Ok(Self::Gpt56Sol),
2425 "gpt-5.6-terra" => Ok(Self::Gpt56Terra),
2426 _ => Err(format!("Unknown codex model: '{s}'")),
2427 }
2428 }
2429}
2430impl DeepSeekModel {
2431 #[allow(clippy::too_many_lines)]
2432 fn model_id(self) -> &'static str {
2433 match self {
2434 Self::DeepseekChat => "deepseek-chat",
2435 Self::DeepseekReasoner => "deepseek-reasoner",
2436 Self::DeepseekV4Flash => "deepseek-v4-flash",
2437 Self::DeepseekV4Pro => "deepseek-v4-pro",
2438 }
2439 }
2440 #[allow(clippy::too_many_lines)]
2441 fn display_name(self) -> &'static str {
2442 match self {
2443 Self::DeepseekChat => "DeepSeek Chat",
2444 Self::DeepseekReasoner => "DeepSeek Reasoner",
2445 Self::DeepseekV4Flash => "DeepSeek V4 Flash",
2446 Self::DeepseekV4Pro => "DeepSeek V4 Pro",
2447 }
2448 }
2449 #[allow(clippy::too_many_lines)]
2450 fn context_window(self) -> u32 {
2451 match self {
2452 Self::DeepseekChat
2453 | Self::DeepseekReasoner
2454 | Self::DeepseekV4Flash
2455 | Self::DeepseekV4Pro => 1_000_000,
2456 }
2457 }
2458 #[allow(clippy::too_many_lines)]
2459 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
2460 match self {
2461 Self::DeepseekChat => &[],
2462 Self::DeepseekV4Flash | Self::DeepseekV4Pro => {
2463 &[ReasoningEffort::High, ReasoningEffort::Max]
2464 }
2465 Self::DeepseekReasoner => {
2466 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
2467 }
2468 }
2469 }
2470 pub fn supports_reasoning(self) -> bool {
2471 !self.reasoning_levels().is_empty()
2472 }
2473 #[allow(clippy::too_many_lines)]
2474 pub fn supports_prompt_caching(self) -> bool {
2475 match self {
2476 Self::DeepseekChat
2477 | Self::DeepseekReasoner
2478 | Self::DeepseekV4Flash
2479 | Self::DeepseekV4Pro => true,
2480 }
2481 }
2482 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
2483 pub fn pricing(self) -> Option<ModelPricing> {
2484 match self {
2485 Self::DeepseekChat => {
2486 Some(ModelPricing {
2487 input_per_million: 0.14f64,
2488 output_per_million: 0.28f64,
2489 cache_read_per_million: Some(0.0028f64),
2490 cache_write_per_million: None,
2491 })
2492 }
2493 Self::DeepseekReasoner => {
2494 Some(ModelPricing {
2495 input_per_million: 0.14f64,
2496 output_per_million: 0.28f64,
2497 cache_read_per_million: Some(0.0028f64),
2498 cache_write_per_million: None,
2499 })
2500 }
2501 Self::DeepseekV4Flash => {
2502 Some(ModelPricing {
2503 input_per_million: 0.14f64,
2504 output_per_million: 0.28f64,
2505 cache_read_per_million: Some(0.0028f64),
2506 cache_write_per_million: None,
2507 })
2508 }
2509 Self::DeepseekV4Pro => {
2510 Some(ModelPricing {
2511 input_per_million: 0.435f64,
2512 output_per_million: 0.87f64,
2513 cache_read_per_million: Some(0.003625f64),
2514 cache_write_per_million: None,
2515 })
2516 }
2517 }
2518 }
2519 #[allow(clippy::too_many_lines)]
2520 pub fn supports_image(self) -> bool {
2521 match self {
2522 Self::DeepseekChat
2523 | Self::DeepseekReasoner
2524 | Self::DeepseekV4Flash
2525 | Self::DeepseekV4Pro => false,
2526 }
2527 }
2528 #[allow(clippy::too_many_lines)]
2529 pub fn supports_audio(self) -> bool {
2530 match self {
2531 Self::DeepseekChat
2532 | Self::DeepseekReasoner
2533 | Self::DeepseekV4Flash
2534 | Self::DeepseekV4Pro => false,
2535 }
2536 }
2537 #[allow(clippy::too_many_lines)]
2538 pub fn transport(self) -> Option<ModelTransport> {
2539 match self {
2540 Self::DeepseekChat
2541 | Self::DeepseekReasoner
2542 | Self::DeepseekV4Flash
2543 | Self::DeepseekV4Pro => None,
2544 }
2545 }
2546 const ALL: &[DeepSeekModel] = &[
2547 Self::DeepseekChat,
2548 Self::DeepseekReasoner,
2549 Self::DeepseekV4Flash,
2550 Self::DeepseekV4Pro,
2551 ];
2552}
2553impl std::str::FromStr for DeepSeekModel {
2554 type Err = String;
2555 #[allow(clippy::too_many_lines)]
2556 fn from_str(s: &str) -> Result<Self, Self::Err> {
2557 match s {
2558 "deepseek-chat" => Ok(Self::DeepseekChat),
2559 "deepseek-reasoner" => Ok(Self::DeepseekReasoner),
2560 "deepseek-v4-flash" => Ok(Self::DeepseekV4Flash),
2561 "deepseek-v4-pro" => Ok(Self::DeepseekV4Pro),
2562 _ => Err(format!("Unknown deepseek model: '{s}'")),
2563 }
2564 }
2565}
2566impl FireworksModel {
2567 #[allow(clippy::too_many_lines)]
2568 fn model_id(self) -> &'static str {
2569 match self {
2570 Self::AccountsFireworksModelsDeepseekV4Flash => {
2571 "accounts/fireworks/models/deepseek-v4-flash"
2572 }
2573 Self::AccountsFireworksModelsDeepseekV4Pro => {
2574 "accounts/fireworks/models/deepseek-v4-pro"
2575 }
2576 Self::AccountsFireworksModelsGlm5p2 => "accounts/fireworks/models/glm-5p2",
2577 Self::AccountsFireworksModelsGptOss120b => {
2578 "accounts/fireworks/models/gpt-oss-120b"
2579 }
2580 Self::AccountsFireworksModelsGptOss20b => {
2581 "accounts/fireworks/models/gpt-oss-20b"
2582 }
2583 Self::AccountsFireworksModelsKimiK2p6 => {
2584 "accounts/fireworks/models/kimi-k2p6"
2585 }
2586 Self::AccountsFireworksModelsKimiK2p7Code => {
2587 "accounts/fireworks/models/kimi-k2p7-code"
2588 }
2589 Self::AccountsFireworksModelsMinimaxM2p7 => {
2590 "accounts/fireworks/models/minimax-m2p7"
2591 }
2592 Self::AccountsFireworksModelsMinimaxM3 => {
2593 "accounts/fireworks/models/minimax-m3"
2594 }
2595 Self::AccountsFireworksModelsQwen3p7Plus => {
2596 "accounts/fireworks/models/qwen3p7-plus"
2597 }
2598 Self::AccountsFireworksRoutersGlm5p2Fast => {
2599 "accounts/fireworks/routers/glm-5p2-fast"
2600 }
2601 Self::AccountsFireworksRoutersKimiK2p6Fast => {
2602 "accounts/fireworks/routers/kimi-k2p6-fast"
2603 }
2604 Self::AccountsFireworksRoutersKimiK2p6Turbo => {
2605 "accounts/fireworks/routers/kimi-k2p6-turbo"
2606 }
2607 Self::AccountsFireworksRoutersKimiK2p7CodeFast => {
2608 "accounts/fireworks/routers/kimi-k2p7-code-fast"
2609 }
2610 }
2611 }
2612 #[allow(clippy::too_many_lines)]
2613 fn display_name(self) -> &'static str {
2614 match self {
2615 Self::AccountsFireworksModelsDeepseekV4Flash => "DeepSeek V4 Flash",
2616 Self::AccountsFireworksModelsDeepseekV4Pro => "DeepSeek V4 Pro",
2617 Self::AccountsFireworksModelsGlm5p2 => "GLM 5.2",
2618 Self::AccountsFireworksRoutersGlm5p2Fast => "GLM 5.2 Fast",
2619 Self::AccountsFireworksModelsGptOss120b => "GPT OSS 120B",
2620 Self::AccountsFireworksModelsGptOss20b => "GPT OSS 20B",
2621 Self::AccountsFireworksModelsKimiK2p6 => "Kimi K2.6",
2622 Self::AccountsFireworksRoutersKimiK2p6Fast => "Kimi K2.6 Fast",
2623 Self::AccountsFireworksRoutersKimiK2p6Turbo => "Kimi K2.6 Turbo",
2624 Self::AccountsFireworksModelsKimiK2p7Code => "Kimi K2.7 Code",
2625 Self::AccountsFireworksRoutersKimiK2p7CodeFast => "Kimi K2.7 Code Fast",
2626 Self::AccountsFireworksModelsMinimaxM2p7 => "MiniMax-M2.7",
2627 Self::AccountsFireworksModelsMinimaxM3 => "MiniMax-M3",
2628 Self::AccountsFireworksModelsQwen3p7Plus => "Qwen 3.7 Plus",
2629 }
2630 }
2631 #[allow(clippy::too_many_lines)]
2632 fn context_window(self) -> u32 {
2633 match self {
2634 Self::AccountsFireworksModelsGptOss120b
2635 | Self::AccountsFireworksModelsGptOss20b => 131_072,
2636 Self::AccountsFireworksModelsMinimaxM2p7 => 196_608,
2637 Self::AccountsFireworksModelsKimiK2p6
2638 | Self::AccountsFireworksModelsKimiK2p7Code
2639 | Self::AccountsFireworksRoutersKimiK2p6Fast
2640 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2641 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => 262_000,
2642 Self::AccountsFireworksModelsQwen3p7Plus => 262_144,
2643 Self::AccountsFireworksModelsMinimaxM3 => 512_000,
2644 Self::AccountsFireworksModelsDeepseekV4Flash
2645 | Self::AccountsFireworksModelsDeepseekV4Pro => 1_000_000,
2646 Self::AccountsFireworksModelsGlm5p2
2647 | Self::AccountsFireworksRoutersGlm5p2Fast => 1_048_575,
2648 }
2649 }
2650 #[allow(clippy::too_many_lines)]
2651 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
2652 match self {
2653 Self::AccountsFireworksModelsDeepseekV4Flash
2654 | Self::AccountsFireworksModelsDeepseekV4Pro
2655 | Self::AccountsFireworksModelsGlm5p2
2656 | Self::AccountsFireworksRoutersGlm5p2Fast => {
2657 &[ReasoningEffort::High, ReasoningEffort::Max]
2658 }
2659 Self::AccountsFireworksModelsGptOss120b
2660 | Self::AccountsFireworksModelsGptOss20b
2661 | Self::AccountsFireworksModelsKimiK2p6
2662 | Self::AccountsFireworksModelsKimiK2p7Code
2663 | Self::AccountsFireworksModelsMinimaxM2p7
2664 | Self::AccountsFireworksModelsMinimaxM3
2665 | Self::AccountsFireworksModelsQwen3p7Plus
2666 | Self::AccountsFireworksRoutersKimiK2p6Fast
2667 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2668 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => {
2669 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
2670 }
2671 }
2672 }
2673 pub fn supports_reasoning(self) -> bool {
2674 !self.reasoning_levels().is_empty()
2675 }
2676 #[allow(clippy::too_many_lines)]
2677 pub fn supports_prompt_caching(self) -> bool {
2678 match self {
2679 Self::AccountsFireworksModelsDeepseekV4Flash
2680 | Self::AccountsFireworksModelsDeepseekV4Pro
2681 | Self::AccountsFireworksModelsGlm5p2
2682 | Self::AccountsFireworksModelsGptOss120b
2683 | Self::AccountsFireworksModelsGptOss20b
2684 | Self::AccountsFireworksModelsKimiK2p6
2685 | Self::AccountsFireworksModelsKimiK2p7Code
2686 | Self::AccountsFireworksModelsMinimaxM2p7
2687 | Self::AccountsFireworksModelsMinimaxM3
2688 | Self::AccountsFireworksModelsQwen3p7Plus
2689 | Self::AccountsFireworksRoutersGlm5p2Fast
2690 | Self::AccountsFireworksRoutersKimiK2p6Fast
2691 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2692 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => true,
2693 }
2694 }
2695 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
2696 pub fn pricing(self) -> Option<ModelPricing> {
2697 match self {
2698 Self::AccountsFireworksModelsDeepseekV4Flash => {
2699 Some(ModelPricing {
2700 input_per_million: 0.14f64,
2701 output_per_million: 0.28f64,
2702 cache_read_per_million: Some(0.028f64),
2703 cache_write_per_million: None,
2704 })
2705 }
2706 Self::AccountsFireworksModelsDeepseekV4Pro => {
2707 Some(ModelPricing {
2708 input_per_million: 1.74f64,
2709 output_per_million: 3.48f64,
2710 cache_read_per_million: Some(0.145f64),
2711 cache_write_per_million: None,
2712 })
2713 }
2714 Self::AccountsFireworksModelsGlm5p2 => {
2715 Some(ModelPricing {
2716 input_per_million: 1.4f64,
2717 output_per_million: 4.4f64,
2718 cache_read_per_million: Some(0.14f64),
2719 cache_write_per_million: None,
2720 })
2721 }
2722 Self::AccountsFireworksModelsGptOss120b => {
2723 Some(ModelPricing {
2724 input_per_million: 0.15f64,
2725 output_per_million: 0.6f64,
2726 cache_read_per_million: Some(0.015f64),
2727 cache_write_per_million: None,
2728 })
2729 }
2730 Self::AccountsFireworksModelsGptOss20b => {
2731 Some(ModelPricing {
2732 input_per_million: 0.07f64,
2733 output_per_million: 0.3f64,
2734 cache_read_per_million: Some(0.035f64),
2735 cache_write_per_million: None,
2736 })
2737 }
2738 Self::AccountsFireworksModelsKimiK2p6 => {
2739 Some(ModelPricing {
2740 input_per_million: 0.95f64,
2741 output_per_million: 4f64,
2742 cache_read_per_million: Some(0.16f64),
2743 cache_write_per_million: None,
2744 })
2745 }
2746 Self::AccountsFireworksModelsKimiK2p7Code => {
2747 Some(ModelPricing {
2748 input_per_million: 0.95f64,
2749 output_per_million: 4f64,
2750 cache_read_per_million: Some(0.19f64),
2751 cache_write_per_million: None,
2752 })
2753 }
2754 Self::AccountsFireworksModelsMinimaxM2p7 => {
2755 Some(ModelPricing {
2756 input_per_million: 0.3f64,
2757 output_per_million: 1.2f64,
2758 cache_read_per_million: Some(0.06f64),
2759 cache_write_per_million: None,
2760 })
2761 }
2762 Self::AccountsFireworksModelsMinimaxM3 => {
2763 Some(ModelPricing {
2764 input_per_million: 0.3f64,
2765 output_per_million: 1.2f64,
2766 cache_read_per_million: Some(0.06f64),
2767 cache_write_per_million: None,
2768 })
2769 }
2770 Self::AccountsFireworksModelsQwen3p7Plus => {
2771 Some(ModelPricing {
2772 input_per_million: 0.4f64,
2773 output_per_million: 1.6f64,
2774 cache_read_per_million: Some(0.08f64),
2775 cache_write_per_million: None,
2776 })
2777 }
2778 Self::AccountsFireworksRoutersGlm5p2Fast => {
2779 Some(ModelPricing {
2780 input_per_million: 2.1f64,
2781 output_per_million: 6.6f64,
2782 cache_read_per_million: Some(0.21f64),
2783 cache_write_per_million: None,
2784 })
2785 }
2786 Self::AccountsFireworksRoutersKimiK2p6Fast => {
2787 Some(ModelPricing {
2788 input_per_million: 2f64,
2789 output_per_million: 8f64,
2790 cache_read_per_million: Some(0.3f64),
2791 cache_write_per_million: None,
2792 })
2793 }
2794 Self::AccountsFireworksRoutersKimiK2p6Turbo => {
2795 Some(ModelPricing {
2796 input_per_million: 2f64,
2797 output_per_million: 8f64,
2798 cache_read_per_million: Some(0.3f64),
2799 cache_write_per_million: None,
2800 })
2801 }
2802 Self::AccountsFireworksRoutersKimiK2p7CodeFast => {
2803 Some(ModelPricing {
2804 input_per_million: 1.9f64,
2805 output_per_million: 8f64,
2806 cache_read_per_million: Some(0.38f64),
2807 cache_write_per_million: None,
2808 })
2809 }
2810 }
2811 }
2812 #[allow(clippy::too_many_lines)]
2813 pub fn supports_image(self) -> bool {
2814 match self {
2815 Self::AccountsFireworksModelsDeepseekV4Flash
2816 | Self::AccountsFireworksModelsDeepseekV4Pro
2817 | Self::AccountsFireworksModelsGlm5p2
2818 | Self::AccountsFireworksModelsGptOss120b
2819 | Self::AccountsFireworksModelsGptOss20b
2820 | Self::AccountsFireworksModelsMinimaxM2p7
2821 | Self::AccountsFireworksRoutersGlm5p2Fast => false,
2822 Self::AccountsFireworksModelsKimiK2p6
2823 | Self::AccountsFireworksModelsKimiK2p7Code
2824 | Self::AccountsFireworksModelsMinimaxM3
2825 | Self::AccountsFireworksModelsQwen3p7Plus
2826 | Self::AccountsFireworksRoutersKimiK2p6Fast
2827 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2828 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => true,
2829 }
2830 }
2831 #[allow(clippy::too_many_lines)]
2832 pub fn supports_audio(self) -> bool {
2833 match self {
2834 Self::AccountsFireworksModelsDeepseekV4Flash
2835 | Self::AccountsFireworksModelsDeepseekV4Pro
2836 | Self::AccountsFireworksModelsGlm5p2
2837 | Self::AccountsFireworksModelsGptOss120b
2838 | Self::AccountsFireworksModelsGptOss20b
2839 | Self::AccountsFireworksModelsKimiK2p6
2840 | Self::AccountsFireworksModelsKimiK2p7Code
2841 | Self::AccountsFireworksModelsMinimaxM2p7
2842 | Self::AccountsFireworksModelsMinimaxM3
2843 | Self::AccountsFireworksModelsQwen3p7Plus
2844 | Self::AccountsFireworksRoutersGlm5p2Fast
2845 | Self::AccountsFireworksRoutersKimiK2p6Fast
2846 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2847 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => false,
2848 }
2849 }
2850 #[allow(clippy::too_many_lines)]
2851 pub fn transport(self) -> Option<ModelTransport> {
2852 match self {
2853 Self::AccountsFireworksModelsDeepseekV4Flash
2854 | Self::AccountsFireworksModelsDeepseekV4Pro
2855 | Self::AccountsFireworksModelsGlm5p2
2856 | Self::AccountsFireworksModelsGptOss120b
2857 | Self::AccountsFireworksModelsGptOss20b
2858 | Self::AccountsFireworksModelsKimiK2p6
2859 | Self::AccountsFireworksModelsKimiK2p7Code
2860 | Self::AccountsFireworksModelsMinimaxM2p7
2861 | Self::AccountsFireworksModelsMinimaxM3
2862 | Self::AccountsFireworksModelsQwen3p7Plus
2863 | Self::AccountsFireworksRoutersGlm5p2Fast
2864 | Self::AccountsFireworksRoutersKimiK2p6Fast
2865 | Self::AccountsFireworksRoutersKimiK2p6Turbo
2866 | Self::AccountsFireworksRoutersKimiK2p7CodeFast => None,
2867 }
2868 }
2869 const ALL: &[FireworksModel] = &[
2870 Self::AccountsFireworksModelsDeepseekV4Flash,
2871 Self::AccountsFireworksModelsDeepseekV4Pro,
2872 Self::AccountsFireworksModelsGlm5p2,
2873 Self::AccountsFireworksModelsGptOss120b,
2874 Self::AccountsFireworksModelsGptOss20b,
2875 Self::AccountsFireworksModelsKimiK2p6,
2876 Self::AccountsFireworksModelsKimiK2p7Code,
2877 Self::AccountsFireworksModelsMinimaxM2p7,
2878 Self::AccountsFireworksModelsMinimaxM3,
2879 Self::AccountsFireworksModelsQwen3p7Plus,
2880 Self::AccountsFireworksRoutersGlm5p2Fast,
2881 Self::AccountsFireworksRoutersKimiK2p6Fast,
2882 Self::AccountsFireworksRoutersKimiK2p6Turbo,
2883 Self::AccountsFireworksRoutersKimiK2p7CodeFast,
2884 ];
2885}
2886impl std::str::FromStr for FireworksModel {
2887 type Err = String;
2888 #[allow(clippy::too_many_lines)]
2889 fn from_str(s: &str) -> Result<Self, Self::Err> {
2890 match s {
2891 "accounts/fireworks/models/deepseek-v4-flash" => {
2892 Ok(Self::AccountsFireworksModelsDeepseekV4Flash)
2893 }
2894 "accounts/fireworks/models/deepseek-v4-pro" => {
2895 Ok(Self::AccountsFireworksModelsDeepseekV4Pro)
2896 }
2897 "accounts/fireworks/models/glm-5p2" => {
2898 Ok(Self::AccountsFireworksModelsGlm5p2)
2899 }
2900 "accounts/fireworks/models/gpt-oss-120b" => {
2901 Ok(Self::AccountsFireworksModelsGptOss120b)
2902 }
2903 "accounts/fireworks/models/gpt-oss-20b" => {
2904 Ok(Self::AccountsFireworksModelsGptOss20b)
2905 }
2906 "accounts/fireworks/models/kimi-k2p6" => {
2907 Ok(Self::AccountsFireworksModelsKimiK2p6)
2908 }
2909 "accounts/fireworks/models/kimi-k2p7-code" => {
2910 Ok(Self::AccountsFireworksModelsKimiK2p7Code)
2911 }
2912 "accounts/fireworks/models/minimax-m2p7" => {
2913 Ok(Self::AccountsFireworksModelsMinimaxM2p7)
2914 }
2915 "accounts/fireworks/models/minimax-m3" => {
2916 Ok(Self::AccountsFireworksModelsMinimaxM3)
2917 }
2918 "accounts/fireworks/models/qwen3p7-plus" => {
2919 Ok(Self::AccountsFireworksModelsQwen3p7Plus)
2920 }
2921 "accounts/fireworks/routers/glm-5p2-fast" => {
2922 Ok(Self::AccountsFireworksRoutersGlm5p2Fast)
2923 }
2924 "accounts/fireworks/routers/kimi-k2p6-fast" => {
2925 Ok(Self::AccountsFireworksRoutersKimiK2p6Fast)
2926 }
2927 "accounts/fireworks/routers/kimi-k2p6-turbo" => {
2928 Ok(Self::AccountsFireworksRoutersKimiK2p6Turbo)
2929 }
2930 "accounts/fireworks/routers/kimi-k2p7-code-fast" => {
2931 Ok(Self::AccountsFireworksRoutersKimiK2p7CodeFast)
2932 }
2933 _ => Err(format!("Unknown fireworks model: '{s}'")),
2934 }
2935 }
2936}
2937impl GeminiModel {
2938 #[allow(clippy::too_many_lines)]
2939 fn model_id(self) -> &'static str {
2940 match self {
2941 Self::DeepResearchMaxPreview042026 => "deep-research-max-preview-04-2026",
2942 Self::DeepResearchPreview042026 => "deep-research-preview-04-2026",
2943 Self::Gemini20Flash => "gemini-2.0-flash",
2944 Self::Gemini20FlashLite => "gemini-2.0-flash-lite",
2945 Self::Gemini25ComputerUsePreview102025 => {
2946 "gemini-2.5-computer-use-preview-10-2025"
2947 }
2948 Self::Gemini25Flash => "gemini-2.5-flash",
2949 Self::Gemini25FlashLite => "gemini-2.5-flash-lite",
2950 Self::Gemini25Pro => "gemini-2.5-pro",
2951 Self::Gemini3FlashPreview => "gemini-3-flash-preview",
2952 Self::Gemini3ProPreview => "gemini-3-pro-preview",
2953 Self::Gemini31FlashLite => "gemini-3.1-flash-lite",
2954 Self::Gemini31FlashLiteImage => "gemini-3.1-flash-lite-image",
2955 Self::Gemini31FlashLitePreview => "gemini-3.1-flash-lite-preview",
2956 Self::Gemini31FlashLivePreview => "gemini-3.1-flash-live-preview",
2957 Self::Gemini31ProPreview => "gemini-3.1-pro-preview",
2958 Self::Gemini31ProPreviewCustomtools => "gemini-3.1-pro-preview-customtools",
2959 Self::Gemini35Flash => "gemini-3.5-flash",
2960 Self::Gemini35FlashLite => "gemini-3.5-flash-lite",
2961 Self::Gemini36Flash => "gemini-3.6-flash",
2962 Self::GeminiRoboticsEr16Preview => "gemini-robotics-er-1.6-preview",
2963 Self::Gemma426bA4bIt => "gemma-4-26b-a4b-it",
2964 Self::Gemma431bIt => "gemma-4-31b-it",
2965 }
2966 }
2967 #[allow(clippy::too_many_lines)]
2968 fn display_name(self) -> &'static str {
2969 match self {
2970 Self::DeepResearchMaxPreview042026 => {
2971 "Deep Research Max Preview (Apr-21-2026)"
2972 }
2973 Self::DeepResearchPreview042026 => "Deep Research Preview (Apr-21-2026)",
2974 Self::Gemini20Flash => "Gemini 2.0 Flash",
2975 Self::Gemini20FlashLite => "Gemini 2.0 Flash-Lite",
2976 Self::Gemini25ComputerUsePreview102025 => {
2977 "Gemini 2.5 Computer Use Preview 10-2025"
2978 }
2979 Self::Gemini25Flash => "Gemini 2.5 Flash",
2980 Self::Gemini25FlashLite => "Gemini 2.5 Flash-Lite",
2981 Self::Gemini25Pro => "Gemini 2.5 Pro",
2982 Self::Gemini3FlashPreview => "Gemini 3 Flash Preview",
2983 Self::Gemini3ProPreview => "Gemini 3 Pro Preview",
2984 Self::Gemini31FlashLite => "Gemini 3.1 Flash Lite",
2985 Self::Gemini31FlashLitePreview => "Gemini 3.1 Flash Lite Preview",
2986 Self::Gemini31FlashLivePreview => "Gemini 3.1 Flash Live Preview",
2987 Self::Gemini31ProPreview => "Gemini 3.1 Pro Preview",
2988 Self::Gemini31ProPreviewCustomtools => "Gemini 3.1 Pro Preview Custom Tools",
2989 Self::Gemini35Flash => "Gemini 3.5 Flash",
2990 Self::Gemini35FlashLite => "Gemini 3.5 Flash Lite",
2991 Self::Gemini36Flash => "Gemini 3.6 Flash",
2992 Self::GeminiRoboticsEr16Preview => "Gemini Robotics-ER 1.6 Preview",
2993 Self::Gemma426bA4bIt => "Gemma 4 26B A4B IT",
2994 Self::Gemma431bIt => "Gemma 4 31B IT",
2995 Self::Gemini31FlashLiteImage => "Nano Banana 2 Lite",
2996 }
2997 }
2998 #[allow(clippy::too_many_lines)]
2999 fn context_window(self) -> u32 {
3000 match self {
3001 Self::Gemini31FlashLiteImage => 65_536,
3002 Self::DeepResearchMaxPreview042026
3003 | Self::DeepResearchPreview042026
3004 | Self::Gemini25ComputerUsePreview102025
3005 | Self::Gemini31FlashLivePreview
3006 | Self::GeminiRoboticsEr16Preview => 131_072,
3007 Self::Gemma426bA4bIt | Self::Gemma431bIt => 262_144,
3008 Self::Gemini20Flash
3009 | Self::Gemini20FlashLite
3010 | Self::Gemini25Flash
3011 | Self::Gemini25FlashLite
3012 | Self::Gemini25Pro
3013 | Self::Gemini3FlashPreview
3014 | Self::Gemini3ProPreview
3015 | Self::Gemini31FlashLite
3016 | Self::Gemini31FlashLitePreview
3017 | Self::Gemini31ProPreview
3018 | Self::Gemini31ProPreviewCustomtools
3019 | Self::Gemini35Flash
3020 | Self::Gemini35FlashLite
3021 | Self::Gemini36Flash => 1_048_576,
3022 }
3023 }
3024 #[allow(clippy::too_many_lines)]
3025 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
3026 match self {
3027 Self::Gemini20Flash | Self::Gemini20FlashLite => &[],
3028 Self::Gemini3ProPreview => &[ReasoningEffort::Low, ReasoningEffort::High],
3029 Self::DeepResearchMaxPreview042026
3030 | Self::DeepResearchPreview042026
3031 | Self::Gemini25ComputerUsePreview102025
3032 | Self::Gemini25Flash
3033 | Self::Gemini25FlashLite
3034 | Self::Gemini25Pro
3035 | Self::Gemini31ProPreview
3036 | Self::Gemini31ProPreviewCustomtools
3037 | Self::GeminiRoboticsEr16Preview
3038 | Self::Gemma426bA4bIt
3039 | Self::Gemma431bIt => {
3040 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
3041 }
3042 Self::Gemini31FlashLiteImage => {
3043 &[ReasoningEffort::Minimal, ReasoningEffort::High]
3044 }
3045 Self::Gemini3FlashPreview
3046 | Self::Gemini31FlashLite
3047 | Self::Gemini31FlashLitePreview
3048 | Self::Gemini31FlashLivePreview
3049 | Self::Gemini35Flash
3050 | Self::Gemini35FlashLite
3051 | Self::Gemini36Flash => {
3052 &[
3053 ReasoningEffort::Minimal,
3054 ReasoningEffort::Low,
3055 ReasoningEffort::Medium,
3056 ReasoningEffort::High,
3057 ]
3058 }
3059 }
3060 }
3061 pub fn supports_reasoning(self) -> bool {
3062 !self.reasoning_levels().is_empty()
3063 }
3064 #[allow(clippy::too_many_lines)]
3065 pub fn supports_prompt_caching(self) -> bool {
3066 match self {
3067 Self::Gemini20FlashLite
3068 | Self::Gemini25ComputerUsePreview102025
3069 | Self::Gemini31FlashLiteImage
3070 | Self::Gemini31FlashLivePreview
3071 | Self::GeminiRoboticsEr16Preview
3072 | Self::Gemma426bA4bIt
3073 | Self::Gemma431bIt => false,
3074 Self::DeepResearchMaxPreview042026
3075 | Self::DeepResearchPreview042026
3076 | Self::Gemini20Flash
3077 | Self::Gemini25Flash
3078 | Self::Gemini25FlashLite
3079 | Self::Gemini25Pro
3080 | Self::Gemini3FlashPreview
3081 | Self::Gemini3ProPreview
3082 | Self::Gemini31FlashLite
3083 | Self::Gemini31FlashLitePreview
3084 | Self::Gemini31ProPreview
3085 | Self::Gemini31ProPreviewCustomtools
3086 | Self::Gemini35Flash
3087 | Self::Gemini35FlashLite
3088 | Self::Gemini36Flash => true,
3089 }
3090 }
3091 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
3092 pub fn pricing(self) -> Option<ModelPricing> {
3093 match self {
3094 Self::DeepResearchMaxPreview042026 => {
3095 Some(ModelPricing {
3096 input_per_million: 2f64,
3097 output_per_million: 12f64,
3098 cache_read_per_million: Some(0.2f64),
3099 cache_write_per_million: None,
3100 })
3101 }
3102 Self::DeepResearchPreview042026 => {
3103 Some(ModelPricing {
3104 input_per_million: 2f64,
3105 output_per_million: 12f64,
3106 cache_read_per_million: Some(0.2f64),
3107 cache_write_per_million: None,
3108 })
3109 }
3110 Self::Gemini20Flash => {
3111 Some(ModelPricing {
3112 input_per_million: 0.1f64,
3113 output_per_million: 0.4f64,
3114 cache_read_per_million: Some(0.025f64),
3115 cache_write_per_million: None,
3116 })
3117 }
3118 Self::Gemini20FlashLite => {
3119 Some(ModelPricing {
3120 input_per_million: 0.075f64,
3121 output_per_million: 0.3f64,
3122 cache_read_per_million: None,
3123 cache_write_per_million: None,
3124 })
3125 }
3126 Self::Gemini25ComputerUsePreview102025 => {
3127 Some(ModelPricing {
3128 input_per_million: 1.25f64,
3129 output_per_million: 10f64,
3130 cache_read_per_million: None,
3131 cache_write_per_million: None,
3132 })
3133 }
3134 Self::Gemini25Flash => {
3135 Some(ModelPricing {
3136 input_per_million: 0.3f64,
3137 output_per_million: 2.5f64,
3138 cache_read_per_million: Some(0.03f64),
3139 cache_write_per_million: None,
3140 })
3141 }
3142 Self::Gemini25FlashLite => {
3143 Some(ModelPricing {
3144 input_per_million: 0.1f64,
3145 output_per_million: 0.4f64,
3146 cache_read_per_million: Some(0.01f64),
3147 cache_write_per_million: None,
3148 })
3149 }
3150 Self::Gemini25Pro => {
3151 Some(ModelPricing {
3152 input_per_million: 1.25f64,
3153 output_per_million: 10f64,
3154 cache_read_per_million: Some(0.125f64),
3155 cache_write_per_million: None,
3156 })
3157 }
3158 Self::Gemini3FlashPreview => {
3159 Some(ModelPricing {
3160 input_per_million: 0.5f64,
3161 output_per_million: 3f64,
3162 cache_read_per_million: Some(0.05f64),
3163 cache_write_per_million: None,
3164 })
3165 }
3166 Self::Gemini3ProPreview => {
3167 Some(ModelPricing {
3168 input_per_million: 2f64,
3169 output_per_million: 12f64,
3170 cache_read_per_million: Some(0.2f64),
3171 cache_write_per_million: None,
3172 })
3173 }
3174 Self::Gemini31FlashLite => {
3175 Some(ModelPricing {
3176 input_per_million: 0.25f64,
3177 output_per_million: 1.5f64,
3178 cache_read_per_million: Some(0.025f64),
3179 cache_write_per_million: None,
3180 })
3181 }
3182 Self::Gemini31FlashLiteImage => {
3183 Some(ModelPricing {
3184 input_per_million: 0.25f64,
3185 output_per_million: 30f64,
3186 cache_read_per_million: None,
3187 cache_write_per_million: None,
3188 })
3189 }
3190 Self::Gemini31FlashLitePreview => {
3191 Some(ModelPricing {
3192 input_per_million: 0.25f64,
3193 output_per_million: 1.5f64,
3194 cache_read_per_million: Some(0.025f64),
3195 cache_write_per_million: None,
3196 })
3197 }
3198 Self::Gemini31FlashLivePreview => {
3199 Some(ModelPricing {
3200 input_per_million: 0.75f64,
3201 output_per_million: 4.5f64,
3202 cache_read_per_million: None,
3203 cache_write_per_million: None,
3204 })
3205 }
3206 Self::Gemini31ProPreview => {
3207 Some(ModelPricing {
3208 input_per_million: 2f64,
3209 output_per_million: 12f64,
3210 cache_read_per_million: Some(0.2f64),
3211 cache_write_per_million: None,
3212 })
3213 }
3214 Self::Gemini31ProPreviewCustomtools => {
3215 Some(ModelPricing {
3216 input_per_million: 2f64,
3217 output_per_million: 12f64,
3218 cache_read_per_million: Some(0.2f64),
3219 cache_write_per_million: None,
3220 })
3221 }
3222 Self::Gemini35Flash => {
3223 Some(ModelPricing {
3224 input_per_million: 1.5f64,
3225 output_per_million: 9f64,
3226 cache_read_per_million: Some(0.15f64),
3227 cache_write_per_million: None,
3228 })
3229 }
3230 Self::Gemini35FlashLite => {
3231 Some(ModelPricing {
3232 input_per_million: 0.3f64,
3233 output_per_million: 2.5f64,
3234 cache_read_per_million: Some(0.03f64),
3235 cache_write_per_million: None,
3236 })
3237 }
3238 Self::Gemini36Flash => {
3239 Some(ModelPricing {
3240 input_per_million: 1.5f64,
3241 output_per_million: 7.5f64,
3242 cache_read_per_million: Some(0.15f64),
3243 cache_write_per_million: None,
3244 })
3245 }
3246 Self::GeminiRoboticsEr16Preview => {
3247 Some(ModelPricing {
3248 input_per_million: 1f64,
3249 output_per_million: 5f64,
3250 cache_read_per_million: None,
3251 cache_write_per_million: None,
3252 })
3253 }
3254 Self::Gemma426bA4bIt => None,
3255 Self::Gemma431bIt => None,
3256 }
3257 }
3258 #[allow(clippy::too_many_lines)]
3259 pub fn supports_image(self) -> bool {
3260 match self {
3261 Self::DeepResearchMaxPreview042026
3262 | Self::DeepResearchPreview042026
3263 | Self::Gemini20Flash
3264 | Self::Gemini20FlashLite
3265 | Self::Gemini25ComputerUsePreview102025
3266 | Self::Gemini25Flash
3267 | Self::Gemini25FlashLite
3268 | Self::Gemini25Pro
3269 | Self::Gemini3FlashPreview
3270 | Self::Gemini3ProPreview
3271 | Self::Gemini31FlashLite
3272 | Self::Gemini31FlashLiteImage
3273 | Self::Gemini31FlashLitePreview
3274 | Self::Gemini31FlashLivePreview
3275 | Self::Gemini31ProPreview
3276 | Self::Gemini31ProPreviewCustomtools
3277 | Self::Gemini35Flash
3278 | Self::Gemini35FlashLite
3279 | Self::Gemini36Flash
3280 | Self::GeminiRoboticsEr16Preview
3281 | Self::Gemma426bA4bIt
3282 | Self::Gemma431bIt => true,
3283 }
3284 }
3285 #[allow(clippy::too_many_lines)]
3286 pub fn supports_audio(self) -> bool {
3287 match self {
3288 Self::Gemini25ComputerUsePreview102025
3289 | Self::Gemini31FlashLiteImage
3290 | Self::Gemma426bA4bIt
3291 | Self::Gemma431bIt => false,
3292 Self::DeepResearchMaxPreview042026
3293 | Self::DeepResearchPreview042026
3294 | Self::Gemini20Flash
3295 | Self::Gemini20FlashLite
3296 | Self::Gemini25Flash
3297 | Self::Gemini25FlashLite
3298 | Self::Gemini25Pro
3299 | Self::Gemini3FlashPreview
3300 | Self::Gemini3ProPreview
3301 | Self::Gemini31FlashLite
3302 | Self::Gemini31FlashLitePreview
3303 | Self::Gemini31FlashLivePreview
3304 | Self::Gemini31ProPreview
3305 | Self::Gemini31ProPreviewCustomtools
3306 | Self::Gemini35Flash
3307 | Self::Gemini35FlashLite
3308 | Self::Gemini36Flash
3309 | Self::GeminiRoboticsEr16Preview => true,
3310 }
3311 }
3312 #[allow(clippy::too_many_lines)]
3313 pub fn transport(self) -> Option<ModelTransport> {
3314 match self {
3315 Self::DeepResearchMaxPreview042026
3316 | Self::DeepResearchPreview042026
3317 | Self::Gemini20Flash
3318 | Self::Gemini20FlashLite
3319 | Self::Gemini25ComputerUsePreview102025
3320 | Self::Gemini25Flash
3321 | Self::Gemini25FlashLite
3322 | Self::Gemini25Pro
3323 | Self::Gemini3FlashPreview
3324 | Self::Gemini3ProPreview
3325 | Self::Gemini31FlashLite
3326 | Self::Gemini31FlashLiteImage
3327 | Self::Gemini31FlashLitePreview
3328 | Self::Gemini31FlashLivePreview
3329 | Self::Gemini31ProPreview
3330 | Self::Gemini31ProPreviewCustomtools
3331 | Self::Gemini35Flash
3332 | Self::Gemini35FlashLite
3333 | Self::Gemini36Flash
3334 | Self::GeminiRoboticsEr16Preview
3335 | Self::Gemma426bA4bIt
3336 | Self::Gemma431bIt => None,
3337 }
3338 }
3339 const ALL: &[GeminiModel] = &[
3340 Self::DeepResearchMaxPreview042026,
3341 Self::DeepResearchPreview042026,
3342 Self::Gemini20Flash,
3343 Self::Gemini20FlashLite,
3344 Self::Gemini25ComputerUsePreview102025,
3345 Self::Gemini25Flash,
3346 Self::Gemini25FlashLite,
3347 Self::Gemini25Pro,
3348 Self::Gemini3FlashPreview,
3349 Self::Gemini3ProPreview,
3350 Self::Gemini31FlashLite,
3351 Self::Gemini31FlashLiteImage,
3352 Self::Gemini31FlashLitePreview,
3353 Self::Gemini31FlashLivePreview,
3354 Self::Gemini31ProPreview,
3355 Self::Gemini31ProPreviewCustomtools,
3356 Self::Gemini35Flash,
3357 Self::Gemini35FlashLite,
3358 Self::Gemini36Flash,
3359 Self::GeminiRoboticsEr16Preview,
3360 Self::Gemma426bA4bIt,
3361 Self::Gemma431bIt,
3362 ];
3363}
3364impl std::str::FromStr for GeminiModel {
3365 type Err = String;
3366 #[allow(clippy::too_many_lines)]
3367 fn from_str(s: &str) -> Result<Self, Self::Err> {
3368 match s {
3369 "deep-research-max-preview-04-2026" => Ok(Self::DeepResearchMaxPreview042026),
3370 "deep-research-preview-04-2026" => Ok(Self::DeepResearchPreview042026),
3371 "gemini-2.0-flash" => Ok(Self::Gemini20Flash),
3372 "gemini-2.0-flash-lite" => Ok(Self::Gemini20FlashLite),
3373 "gemini-2.5-computer-use-preview-10-2025" => {
3374 Ok(Self::Gemini25ComputerUsePreview102025)
3375 }
3376 "gemini-2.5-flash" => Ok(Self::Gemini25Flash),
3377 "gemini-2.5-flash-lite" => Ok(Self::Gemini25FlashLite),
3378 "gemini-2.5-pro" => Ok(Self::Gemini25Pro),
3379 "gemini-3-flash-preview" => Ok(Self::Gemini3FlashPreview),
3380 "gemini-3-pro-preview" => Ok(Self::Gemini3ProPreview),
3381 "gemini-3.1-flash-lite" => Ok(Self::Gemini31FlashLite),
3382 "gemini-3.1-flash-lite-image" => Ok(Self::Gemini31FlashLiteImage),
3383 "gemini-3.1-flash-lite-preview" => Ok(Self::Gemini31FlashLitePreview),
3384 "gemini-3.1-flash-live-preview" => Ok(Self::Gemini31FlashLivePreview),
3385 "gemini-3.1-pro-preview" => Ok(Self::Gemini31ProPreview),
3386 "gemini-3.1-pro-preview-customtools" => {
3387 Ok(Self::Gemini31ProPreviewCustomtools)
3388 }
3389 "gemini-3.5-flash" => Ok(Self::Gemini35Flash),
3390 "gemini-3.5-flash-lite" => Ok(Self::Gemini35FlashLite),
3391 "gemini-3.6-flash" => Ok(Self::Gemini36Flash),
3392 "gemini-robotics-er-1.6-preview" => Ok(Self::GeminiRoboticsEr16Preview),
3393 "gemma-4-26b-a4b-it" => Ok(Self::Gemma426bA4bIt),
3394 "gemma-4-31b-it" => Ok(Self::Gemma431bIt),
3395 _ => Err(format!("Unknown gemini model: '{s}'")),
3396 }
3397 }
3398}
3399impl MoonshotModel {
3400 #[allow(clippy::too_many_lines)]
3401 fn model_id(self) -> &'static str {
3402 match self {
3403 Self::KimiK20711Preview => "kimi-k2-0711-preview",
3404 Self::KimiK20905Preview => "kimi-k2-0905-preview",
3405 Self::KimiK2Thinking => "kimi-k2-thinking",
3406 Self::KimiK2ThinkingTurbo => "kimi-k2-thinking-turbo",
3407 Self::KimiK2TurboPreview => "kimi-k2-turbo-preview",
3408 Self::KimiK25 => "kimi-k2.5",
3409 Self::KimiK26 => "kimi-k2.6",
3410 Self::KimiK27Code => "kimi-k2.7-code",
3411 Self::KimiK27CodeHighspeed => "kimi-k2.7-code-highspeed",
3412 Self::KimiK3 => "kimi-k3",
3413 }
3414 }
3415 #[allow(clippy::too_many_lines)]
3416 fn display_name(self) -> &'static str {
3417 match self {
3418 Self::KimiK20711Preview => "Kimi K2 0711",
3419 Self::KimiK20905Preview => "Kimi K2 0905",
3420 Self::KimiK2Thinking => "Kimi K2 Thinking",
3421 Self::KimiK2ThinkingTurbo => "Kimi K2 Thinking Turbo",
3422 Self::KimiK2TurboPreview => "Kimi K2 Turbo",
3423 Self::KimiK25 => "Kimi K2.5",
3424 Self::KimiK26 => "Kimi K2.6",
3425 Self::KimiK27Code => "Kimi K2.7 Code",
3426 Self::KimiK27CodeHighspeed => "Kimi K2.7 Code HighSpeed",
3427 Self::KimiK3 => "Kimi K3",
3428 }
3429 }
3430 #[allow(clippy::too_many_lines)]
3431 fn context_window(self) -> u32 {
3432 match self {
3433 Self::KimiK20711Preview => 131_072,
3434 Self::KimiK20905Preview
3435 | Self::KimiK2Thinking
3436 | Self::KimiK2ThinkingTurbo
3437 | Self::KimiK2TurboPreview
3438 | Self::KimiK25
3439 | Self::KimiK26
3440 | Self::KimiK27Code
3441 | Self::KimiK27CodeHighspeed => 262_144,
3442 Self::KimiK3 => 1_048_576,
3443 }
3444 }
3445 #[allow(clippy::too_many_lines)]
3446 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
3447 match self {
3448 Self::KimiK20711Preview
3449 | Self::KimiK20905Preview
3450 | Self::KimiK2TurboPreview => &[],
3451 Self::KimiK3 => {
3452 &[ReasoningEffort::Low, ReasoningEffort::High, ReasoningEffort::Max]
3453 }
3454 Self::KimiK2Thinking
3455 | Self::KimiK2ThinkingTurbo
3456 | Self::KimiK25
3457 | Self::KimiK26
3458 | Self::KimiK27Code
3459 | Self::KimiK27CodeHighspeed => {
3460 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
3461 }
3462 }
3463 }
3464 pub fn supports_reasoning(self) -> bool {
3465 !self.reasoning_levels().is_empty()
3466 }
3467 #[allow(clippy::too_many_lines)]
3468 pub fn supports_prompt_caching(self) -> bool {
3469 match self {
3470 Self::KimiK20711Preview
3471 | Self::KimiK20905Preview
3472 | Self::KimiK2Thinking
3473 | Self::KimiK2ThinkingTurbo
3474 | Self::KimiK2TurboPreview
3475 | Self::KimiK25
3476 | Self::KimiK26
3477 | Self::KimiK27Code
3478 | Self::KimiK27CodeHighspeed
3479 | Self::KimiK3 => true,
3480 }
3481 }
3482 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
3483 pub fn pricing(self) -> Option<ModelPricing> {
3484 match self {
3485 Self::KimiK20711Preview => {
3486 Some(ModelPricing {
3487 input_per_million: 0.6f64,
3488 output_per_million: 2.5f64,
3489 cache_read_per_million: Some(0.15f64),
3490 cache_write_per_million: None,
3491 })
3492 }
3493 Self::KimiK20905Preview => {
3494 Some(ModelPricing {
3495 input_per_million: 0.6f64,
3496 output_per_million: 2.5f64,
3497 cache_read_per_million: Some(0.15f64),
3498 cache_write_per_million: None,
3499 })
3500 }
3501 Self::KimiK2Thinking => {
3502 Some(ModelPricing {
3503 input_per_million: 0.6f64,
3504 output_per_million: 2.5f64,
3505 cache_read_per_million: Some(0.15f64),
3506 cache_write_per_million: None,
3507 })
3508 }
3509 Self::KimiK2ThinkingTurbo => {
3510 Some(ModelPricing {
3511 input_per_million: 1.15f64,
3512 output_per_million: 8f64,
3513 cache_read_per_million: Some(0.15f64),
3514 cache_write_per_million: None,
3515 })
3516 }
3517 Self::KimiK2TurboPreview => {
3518 Some(ModelPricing {
3519 input_per_million: 2.4f64,
3520 output_per_million: 10f64,
3521 cache_read_per_million: Some(0.6f64),
3522 cache_write_per_million: None,
3523 })
3524 }
3525 Self::KimiK25 => {
3526 Some(ModelPricing {
3527 input_per_million: 0.6f64,
3528 output_per_million: 3f64,
3529 cache_read_per_million: Some(0.1f64),
3530 cache_write_per_million: None,
3531 })
3532 }
3533 Self::KimiK26 => {
3534 Some(ModelPricing {
3535 input_per_million: 0.95f64,
3536 output_per_million: 4f64,
3537 cache_read_per_million: Some(0.16f64),
3538 cache_write_per_million: None,
3539 })
3540 }
3541 Self::KimiK27Code => {
3542 Some(ModelPricing {
3543 input_per_million: 0.95f64,
3544 output_per_million: 4f64,
3545 cache_read_per_million: Some(0.19f64),
3546 cache_write_per_million: None,
3547 })
3548 }
3549 Self::KimiK27CodeHighspeed => {
3550 Some(ModelPricing {
3551 input_per_million: 1.9f64,
3552 output_per_million: 8f64,
3553 cache_read_per_million: Some(0.38f64),
3554 cache_write_per_million: None,
3555 })
3556 }
3557 Self::KimiK3 => {
3558 Some(ModelPricing {
3559 input_per_million: 3f64,
3560 output_per_million: 15f64,
3561 cache_read_per_million: Some(0.3f64),
3562 cache_write_per_million: None,
3563 })
3564 }
3565 }
3566 }
3567 #[allow(clippy::too_many_lines)]
3568 pub fn supports_image(self) -> bool {
3569 match self {
3570 Self::KimiK20711Preview
3571 | Self::KimiK20905Preview
3572 | Self::KimiK2Thinking
3573 | Self::KimiK2ThinkingTurbo
3574 | Self::KimiK2TurboPreview => false,
3575 Self::KimiK25
3576 | Self::KimiK26
3577 | Self::KimiK27Code
3578 | Self::KimiK27CodeHighspeed
3579 | Self::KimiK3 => true,
3580 }
3581 }
3582 #[allow(clippy::too_many_lines)]
3583 pub fn supports_audio(self) -> bool {
3584 match self {
3585 Self::KimiK20711Preview
3586 | Self::KimiK20905Preview
3587 | Self::KimiK2Thinking
3588 | Self::KimiK2ThinkingTurbo
3589 | Self::KimiK2TurboPreview
3590 | Self::KimiK25
3591 | Self::KimiK26
3592 | Self::KimiK27Code
3593 | Self::KimiK27CodeHighspeed
3594 | Self::KimiK3 => false,
3595 }
3596 }
3597 #[allow(clippy::too_many_lines)]
3598 pub fn transport(self) -> Option<ModelTransport> {
3599 match self {
3600 Self::KimiK20711Preview
3601 | Self::KimiK20905Preview
3602 | Self::KimiK2Thinking
3603 | Self::KimiK2ThinkingTurbo
3604 | Self::KimiK2TurboPreview
3605 | Self::KimiK25
3606 | Self::KimiK26
3607 | Self::KimiK27Code
3608 | Self::KimiK27CodeHighspeed
3609 | Self::KimiK3 => None,
3610 }
3611 }
3612 const ALL: &[MoonshotModel] = &[
3613 Self::KimiK20711Preview,
3614 Self::KimiK20905Preview,
3615 Self::KimiK2Thinking,
3616 Self::KimiK2ThinkingTurbo,
3617 Self::KimiK2TurboPreview,
3618 Self::KimiK25,
3619 Self::KimiK26,
3620 Self::KimiK27Code,
3621 Self::KimiK27CodeHighspeed,
3622 Self::KimiK3,
3623 ];
3624}
3625impl std::str::FromStr for MoonshotModel {
3626 type Err = String;
3627 #[allow(clippy::too_many_lines)]
3628 fn from_str(s: &str) -> Result<Self, Self::Err> {
3629 match s {
3630 "kimi-k2-0711-preview" => Ok(Self::KimiK20711Preview),
3631 "kimi-k2-0905-preview" => Ok(Self::KimiK20905Preview),
3632 "kimi-k2-thinking" => Ok(Self::KimiK2Thinking),
3633 "kimi-k2-thinking-turbo" => Ok(Self::KimiK2ThinkingTurbo),
3634 "kimi-k2-turbo-preview" => Ok(Self::KimiK2TurboPreview),
3635 "kimi-k2.5" => Ok(Self::KimiK25),
3636 "kimi-k2.6" => Ok(Self::KimiK26),
3637 "kimi-k2.7-code" => Ok(Self::KimiK27Code),
3638 "kimi-k2.7-code-highspeed" => Ok(Self::KimiK27CodeHighspeed),
3639 "kimi-k3" => Ok(Self::KimiK3),
3640 _ => Err(format!("Unknown moonshot model: '{s}'")),
3641 }
3642 }
3643}
3644impl OpenaiModel {
3645 #[allow(clippy::too_many_lines)]
3646 fn model_id(self) -> &'static str {
3647 match self {
3648 Self::Gpt4 => "gpt-4",
3649 Self::Gpt4Turbo => "gpt-4-turbo",
3650 Self::Gpt41 => "gpt-4.1",
3651 Self::Gpt41Mini => "gpt-4.1-mini",
3652 Self::Gpt41Nano => "gpt-4.1-nano",
3653 Self::Gpt4o => "gpt-4o",
3654 Self::Gpt4o20240513 => "gpt-4o-2024-05-13",
3655 Self::Gpt4o20240806 => "gpt-4o-2024-08-06",
3656 Self::Gpt4o20241120 => "gpt-4o-2024-11-20",
3657 Self::Gpt4oMini => "gpt-4o-mini",
3658 Self::Gpt5 => "gpt-5",
3659 Self::Gpt5Mini => "gpt-5-mini",
3660 Self::Gpt5Nano => "gpt-5-nano",
3661 Self::Gpt5Pro => "gpt-5-pro",
3662 Self::Gpt51 => "gpt-5.1",
3663 Self::Gpt52 => "gpt-5.2",
3664 Self::Gpt52Pro => "gpt-5.2-pro",
3665 Self::Gpt53Codex => "gpt-5.3-codex",
3666 Self::Gpt53CodexSpark => "gpt-5.3-codex-spark",
3667 Self::Gpt54 => "gpt-5.4",
3668 Self::Gpt54Mini => "gpt-5.4-mini",
3669 Self::Gpt54Nano => "gpt-5.4-nano",
3670 Self::Gpt54Pro => "gpt-5.4-pro",
3671 Self::Gpt55 => "gpt-5.5",
3672 Self::Gpt55Pro => "gpt-5.5-pro",
3673 Self::Gpt56 => "gpt-5.6",
3674 Self::Gpt56Luna => "gpt-5.6-luna",
3675 Self::Gpt56Sol => "gpt-5.6-sol",
3676 Self::Gpt56Terra => "gpt-5.6-terra",
3677 Self::GptRealtime21 => "gpt-realtime-2.1",
3678 Self::O1 => "o1",
3679 Self::O1Pro => "o1-pro",
3680 Self::O3 => "o3",
3681 Self::O3Mini => "o3-mini",
3682 Self::O3Pro => "o3-pro",
3683 Self::O4Mini => "o4-mini",
3684 }
3685 }
3686 #[allow(clippy::too_many_lines)]
3687 fn display_name(self) -> &'static str {
3688 match self {
3689 Self::Gpt4 => "GPT-4",
3690 Self::Gpt4Turbo => "GPT-4 Turbo",
3691 Self::Gpt41 => "GPT-4.1",
3692 Self::Gpt41Mini => "GPT-4.1 mini",
3693 Self::Gpt41Nano => "GPT-4.1 nano",
3694 Self::Gpt4o => "GPT-4o",
3695 Self::Gpt4o20240513 => "GPT-4o (2024-05-13)",
3696 Self::Gpt4o20240806 => "GPT-4o (2024-08-06)",
3697 Self::Gpt4o20241120 => "GPT-4o (2024-11-20)",
3698 Self::Gpt4oMini => "GPT-4o mini",
3699 Self::Gpt5 => "GPT-5",
3700 Self::Gpt5Mini => "GPT-5 Mini",
3701 Self::Gpt5Nano => "GPT-5 Nano",
3702 Self::Gpt5Pro => "GPT-5 Pro",
3703 Self::Gpt51 => "GPT-5.1",
3704 Self::Gpt52 => "GPT-5.2",
3705 Self::Gpt52Pro => "GPT-5.2 Pro",
3706 Self::Gpt53Codex => "GPT-5.3 Codex",
3707 Self::Gpt53CodexSpark => "GPT-5.3 Codex Spark",
3708 Self::Gpt54 => "GPT-5.4",
3709 Self::Gpt54Pro => "GPT-5.4 Pro",
3710 Self::Gpt54Mini => "GPT-5.4 mini",
3711 Self::Gpt54Nano => "GPT-5.4 nano",
3712 Self::Gpt55 => "GPT-5.5",
3713 Self::Gpt55Pro => "GPT-5.5 Pro",
3714 Self::Gpt56 => "GPT-5.6",
3715 Self::Gpt56Luna => "GPT-5.6 Luna",
3716 Self::Gpt56Sol => "GPT-5.6 Sol",
3717 Self::Gpt56Terra => "GPT-5.6 Terra",
3718 Self::GptRealtime21 => "GPT-Realtime-2.1",
3719 Self::O1 => "o1",
3720 Self::O1Pro => "o1-pro",
3721 Self::O3 => "o3",
3722 Self::O3Mini => "o3-mini",
3723 Self::O3Pro => "o3-pro",
3724 Self::O4Mini => "o4-mini",
3725 }
3726 }
3727 #[allow(clippy::too_many_lines)]
3728 fn context_window(self) -> u32 {
3729 match self {
3730 Self::Gpt4 => 8192,
3731 Self::Gpt4Turbo
3732 | Self::Gpt4o
3733 | Self::Gpt4o20240513
3734 | Self::Gpt4o20240806
3735 | Self::Gpt4o20241120
3736 | Self::Gpt4oMini
3737 | Self::Gpt53CodexSpark
3738 | Self::GptRealtime21 => 128_000,
3739 Self::O1
3740 | Self::O1Pro
3741 | Self::O3
3742 | Self::O3Mini
3743 | Self::O3Pro
3744 | Self::O4Mini => 200_000,
3745 Self::Gpt5
3746 | Self::Gpt5Mini
3747 | Self::Gpt5Nano
3748 | Self::Gpt5Pro
3749 | Self::Gpt51
3750 | Self::Gpt52
3751 | Self::Gpt52Pro
3752 | Self::Gpt53Codex
3753 | Self::Gpt54Mini
3754 | Self::Gpt54Nano => 400_000,
3755 Self::Gpt41 | Self::Gpt41Mini | Self::Gpt41Nano => 1_047_576,
3756 Self::Gpt54
3757 | Self::Gpt54Pro
3758 | Self::Gpt55
3759 | Self::Gpt55Pro
3760 | Self::Gpt56
3761 | Self::Gpt56Luna
3762 | Self::Gpt56Sol
3763 | Self::Gpt56Terra => 1_050_000,
3764 }
3765 }
3766 #[allow(clippy::too_many_lines)]
3767 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
3768 match self {
3769 Self::Gpt4
3770 | Self::Gpt4Turbo
3771 | Self::Gpt41
3772 | Self::Gpt41Mini
3773 | Self::Gpt41Nano
3774 | Self::Gpt4o
3775 | Self::Gpt4o20240513
3776 | Self::Gpt4o20240806
3777 | Self::Gpt4o20241120
3778 | Self::Gpt4oMini => &[],
3779 Self::Gpt5Pro => &[ReasoningEffort::High],
3780 Self::Gpt51
3781 | Self::O1
3782 | Self::O1Pro
3783 | Self::O3
3784 | Self::O3Mini
3785 | Self::O3Pro
3786 | Self::O4Mini => {
3787 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
3788 }
3789 Self::Gpt52
3790 | Self::Gpt53Codex
3791 | Self::Gpt53CodexSpark
3792 | Self::Gpt54
3793 | Self::Gpt54Mini
3794 | Self::Gpt54Nano
3795 | Self::Gpt55 => {
3796 &[
3797 ReasoningEffort::Low,
3798 ReasoningEffort::Medium,
3799 ReasoningEffort::High,
3800 ReasoningEffort::Xhigh,
3801 ]
3802 }
3803 Self::Gpt56 | Self::Gpt56Luna | Self::Gpt56Sol | Self::Gpt56Terra => {
3804 &[
3805 ReasoningEffort::Low,
3806 ReasoningEffort::Medium,
3807 ReasoningEffort::High,
3808 ReasoningEffort::Xhigh,
3809 ReasoningEffort::Max,
3810 ]
3811 }
3812 Self::Gpt52Pro | Self::Gpt54Pro | Self::Gpt55Pro => {
3813 &[ReasoningEffort::Medium, ReasoningEffort::High, ReasoningEffort::Xhigh]
3814 }
3815 Self::Gpt5 | Self::Gpt5Mini | Self::Gpt5Nano => {
3816 &[
3817 ReasoningEffort::Minimal,
3818 ReasoningEffort::Low,
3819 ReasoningEffort::Medium,
3820 ReasoningEffort::High,
3821 ]
3822 }
3823 Self::GptRealtime21 => {
3824 &[
3825 ReasoningEffort::Minimal,
3826 ReasoningEffort::Low,
3827 ReasoningEffort::Medium,
3828 ReasoningEffort::High,
3829 ReasoningEffort::Xhigh,
3830 ]
3831 }
3832 }
3833 }
3834 pub fn supports_reasoning(self) -> bool {
3835 !self.reasoning_levels().is_empty()
3836 }
3837 #[allow(clippy::too_many_lines)]
3838 pub fn supports_prompt_caching(self) -> bool {
3839 match self {
3840 Self::Gpt4
3841 | Self::Gpt4Turbo
3842 | Self::Gpt4o20240513
3843 | Self::Gpt5Pro
3844 | Self::Gpt52Pro
3845 | Self::Gpt54Pro
3846 | Self::Gpt55Pro
3847 | Self::O1Pro
3848 | Self::O3Pro => false,
3849 Self::Gpt41
3850 | Self::Gpt41Mini
3851 | Self::Gpt41Nano
3852 | Self::Gpt4o
3853 | Self::Gpt4o20240806
3854 | Self::Gpt4o20241120
3855 | Self::Gpt4oMini
3856 | Self::Gpt5
3857 | Self::Gpt5Mini
3858 | Self::Gpt5Nano
3859 | Self::Gpt51
3860 | Self::Gpt52
3861 | Self::Gpt53Codex
3862 | Self::Gpt53CodexSpark
3863 | Self::Gpt54
3864 | Self::Gpt54Mini
3865 | Self::Gpt54Nano
3866 | Self::Gpt55
3867 | Self::Gpt56
3868 | Self::Gpt56Luna
3869 | Self::Gpt56Sol
3870 | Self::Gpt56Terra
3871 | Self::GptRealtime21
3872 | Self::O1
3873 | Self::O3
3874 | Self::O3Mini
3875 | Self::O4Mini => true,
3876 }
3877 }
3878 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
3879 pub fn pricing(self) -> Option<ModelPricing> {
3880 match self {
3881 Self::Gpt4 => {
3882 Some(ModelPricing {
3883 input_per_million: 30f64,
3884 output_per_million: 60f64,
3885 cache_read_per_million: None,
3886 cache_write_per_million: None,
3887 })
3888 }
3889 Self::Gpt4Turbo => {
3890 Some(ModelPricing {
3891 input_per_million: 10f64,
3892 output_per_million: 30f64,
3893 cache_read_per_million: None,
3894 cache_write_per_million: None,
3895 })
3896 }
3897 Self::Gpt41 => {
3898 Some(ModelPricing {
3899 input_per_million: 2f64,
3900 output_per_million: 8f64,
3901 cache_read_per_million: Some(0.5f64),
3902 cache_write_per_million: None,
3903 })
3904 }
3905 Self::Gpt41Mini => {
3906 Some(ModelPricing {
3907 input_per_million: 0.4f64,
3908 output_per_million: 1.6f64,
3909 cache_read_per_million: Some(0.1f64),
3910 cache_write_per_million: None,
3911 })
3912 }
3913 Self::Gpt41Nano => {
3914 Some(ModelPricing {
3915 input_per_million: 0.1f64,
3916 output_per_million: 0.4f64,
3917 cache_read_per_million: Some(0.025f64),
3918 cache_write_per_million: None,
3919 })
3920 }
3921 Self::Gpt4o => {
3922 Some(ModelPricing {
3923 input_per_million: 2.5f64,
3924 output_per_million: 10f64,
3925 cache_read_per_million: Some(1.25f64),
3926 cache_write_per_million: None,
3927 })
3928 }
3929 Self::Gpt4o20240513 => {
3930 Some(ModelPricing {
3931 input_per_million: 5f64,
3932 output_per_million: 15f64,
3933 cache_read_per_million: None,
3934 cache_write_per_million: None,
3935 })
3936 }
3937 Self::Gpt4o20240806 => {
3938 Some(ModelPricing {
3939 input_per_million: 2.5f64,
3940 output_per_million: 10f64,
3941 cache_read_per_million: Some(1.25f64),
3942 cache_write_per_million: None,
3943 })
3944 }
3945 Self::Gpt4o20241120 => {
3946 Some(ModelPricing {
3947 input_per_million: 2.5f64,
3948 output_per_million: 10f64,
3949 cache_read_per_million: Some(1.25f64),
3950 cache_write_per_million: None,
3951 })
3952 }
3953 Self::Gpt4oMini => {
3954 Some(ModelPricing {
3955 input_per_million: 0.15f64,
3956 output_per_million: 0.6f64,
3957 cache_read_per_million: Some(0.075f64),
3958 cache_write_per_million: None,
3959 })
3960 }
3961 Self::Gpt5 => {
3962 Some(ModelPricing {
3963 input_per_million: 1.25f64,
3964 output_per_million: 10f64,
3965 cache_read_per_million: Some(0.125f64),
3966 cache_write_per_million: None,
3967 })
3968 }
3969 Self::Gpt5Mini => {
3970 Some(ModelPricing {
3971 input_per_million: 0.25f64,
3972 output_per_million: 2f64,
3973 cache_read_per_million: Some(0.025f64),
3974 cache_write_per_million: None,
3975 })
3976 }
3977 Self::Gpt5Nano => {
3978 Some(ModelPricing {
3979 input_per_million: 0.05f64,
3980 output_per_million: 0.4f64,
3981 cache_read_per_million: Some(0.005f64),
3982 cache_write_per_million: None,
3983 })
3984 }
3985 Self::Gpt5Pro => {
3986 Some(ModelPricing {
3987 input_per_million: 15f64,
3988 output_per_million: 120f64,
3989 cache_read_per_million: None,
3990 cache_write_per_million: None,
3991 })
3992 }
3993 Self::Gpt51 => {
3994 Some(ModelPricing {
3995 input_per_million: 1.25f64,
3996 output_per_million: 10f64,
3997 cache_read_per_million: Some(0.125f64),
3998 cache_write_per_million: None,
3999 })
4000 }
4001 Self::Gpt52 => {
4002 Some(ModelPricing {
4003 input_per_million: 1.75f64,
4004 output_per_million: 14f64,
4005 cache_read_per_million: Some(0.175f64),
4006 cache_write_per_million: None,
4007 })
4008 }
4009 Self::Gpt52Pro => {
4010 Some(ModelPricing {
4011 input_per_million: 21f64,
4012 output_per_million: 168f64,
4013 cache_read_per_million: None,
4014 cache_write_per_million: None,
4015 })
4016 }
4017 Self::Gpt53Codex => {
4018 Some(ModelPricing {
4019 input_per_million: 1.75f64,
4020 output_per_million: 14f64,
4021 cache_read_per_million: Some(0.175f64),
4022 cache_write_per_million: None,
4023 })
4024 }
4025 Self::Gpt53CodexSpark => {
4026 Some(ModelPricing {
4027 input_per_million: 1.75f64,
4028 output_per_million: 14f64,
4029 cache_read_per_million: Some(0.175f64),
4030 cache_write_per_million: None,
4031 })
4032 }
4033 Self::Gpt54 => {
4034 Some(ModelPricing {
4035 input_per_million: 2.5f64,
4036 output_per_million: 15f64,
4037 cache_read_per_million: Some(0.25f64),
4038 cache_write_per_million: None,
4039 })
4040 }
4041 Self::Gpt54Mini => {
4042 Some(ModelPricing {
4043 input_per_million: 0.75f64,
4044 output_per_million: 4.5f64,
4045 cache_read_per_million: Some(0.075f64),
4046 cache_write_per_million: None,
4047 })
4048 }
4049 Self::Gpt54Nano => {
4050 Some(ModelPricing {
4051 input_per_million: 0.2f64,
4052 output_per_million: 1.25f64,
4053 cache_read_per_million: Some(0.02f64),
4054 cache_write_per_million: None,
4055 })
4056 }
4057 Self::Gpt54Pro => {
4058 Some(ModelPricing {
4059 input_per_million: 30f64,
4060 output_per_million: 180f64,
4061 cache_read_per_million: None,
4062 cache_write_per_million: None,
4063 })
4064 }
4065 Self::Gpt55 => {
4066 Some(ModelPricing {
4067 input_per_million: 5f64,
4068 output_per_million: 30f64,
4069 cache_read_per_million: Some(0.5f64),
4070 cache_write_per_million: None,
4071 })
4072 }
4073 Self::Gpt55Pro => {
4074 Some(ModelPricing {
4075 input_per_million: 30f64,
4076 output_per_million: 180f64,
4077 cache_read_per_million: None,
4078 cache_write_per_million: None,
4079 })
4080 }
4081 Self::Gpt56 => {
4082 Some(ModelPricing {
4083 input_per_million: 5f64,
4084 output_per_million: 30f64,
4085 cache_read_per_million: Some(0.5f64),
4086 cache_write_per_million: Some(6.25f64),
4087 })
4088 }
4089 Self::Gpt56Luna => {
4090 Some(ModelPricing {
4091 input_per_million: 1f64,
4092 output_per_million: 6f64,
4093 cache_read_per_million: Some(0.1f64),
4094 cache_write_per_million: Some(1.25f64),
4095 })
4096 }
4097 Self::Gpt56Sol => {
4098 Some(ModelPricing {
4099 input_per_million: 5f64,
4100 output_per_million: 30f64,
4101 cache_read_per_million: Some(0.5f64),
4102 cache_write_per_million: Some(6.25f64),
4103 })
4104 }
4105 Self::Gpt56Terra => {
4106 Some(ModelPricing {
4107 input_per_million: 2.5f64,
4108 output_per_million: 15f64,
4109 cache_read_per_million: Some(0.25f64),
4110 cache_write_per_million: Some(3.125f64),
4111 })
4112 }
4113 Self::GptRealtime21 => {
4114 Some(ModelPricing {
4115 input_per_million: 4f64,
4116 output_per_million: 24f64,
4117 cache_read_per_million: Some(0.4f64),
4118 cache_write_per_million: None,
4119 })
4120 }
4121 Self::O1 => {
4122 Some(ModelPricing {
4123 input_per_million: 15f64,
4124 output_per_million: 60f64,
4125 cache_read_per_million: Some(7.5f64),
4126 cache_write_per_million: None,
4127 })
4128 }
4129 Self::O1Pro => {
4130 Some(ModelPricing {
4131 input_per_million: 150f64,
4132 output_per_million: 600f64,
4133 cache_read_per_million: None,
4134 cache_write_per_million: None,
4135 })
4136 }
4137 Self::O3 => {
4138 Some(ModelPricing {
4139 input_per_million: 2f64,
4140 output_per_million: 8f64,
4141 cache_read_per_million: Some(0.5f64),
4142 cache_write_per_million: None,
4143 })
4144 }
4145 Self::O3Mini => {
4146 Some(ModelPricing {
4147 input_per_million: 1.1f64,
4148 output_per_million: 4.4f64,
4149 cache_read_per_million: Some(0.55f64),
4150 cache_write_per_million: None,
4151 })
4152 }
4153 Self::O3Pro => {
4154 Some(ModelPricing {
4155 input_per_million: 20f64,
4156 output_per_million: 80f64,
4157 cache_read_per_million: None,
4158 cache_write_per_million: None,
4159 })
4160 }
4161 Self::O4Mini => {
4162 Some(ModelPricing {
4163 input_per_million: 1.1f64,
4164 output_per_million: 4.4f64,
4165 cache_read_per_million: Some(0.275f64),
4166 cache_write_per_million: None,
4167 })
4168 }
4169 }
4170 }
4171 #[allow(clippy::too_many_lines)]
4172 pub fn supports_image(self) -> bool {
4173 match self {
4174 Self::Gpt4 | Self::O3Mini => false,
4175 Self::Gpt4Turbo
4176 | Self::Gpt41
4177 | Self::Gpt41Mini
4178 | Self::Gpt41Nano
4179 | Self::Gpt4o
4180 | Self::Gpt4o20240513
4181 | Self::Gpt4o20240806
4182 | Self::Gpt4o20241120
4183 | Self::Gpt4oMini
4184 | Self::Gpt5
4185 | Self::Gpt5Mini
4186 | Self::Gpt5Nano
4187 | Self::Gpt5Pro
4188 | Self::Gpt51
4189 | Self::Gpt52
4190 | Self::Gpt52Pro
4191 | Self::Gpt53Codex
4192 | Self::Gpt53CodexSpark
4193 | Self::Gpt54
4194 | Self::Gpt54Mini
4195 | Self::Gpt54Nano
4196 | Self::Gpt54Pro
4197 | Self::Gpt55
4198 | Self::Gpt55Pro
4199 | Self::Gpt56
4200 | Self::Gpt56Luna
4201 | Self::Gpt56Sol
4202 | Self::Gpt56Terra
4203 | Self::GptRealtime21
4204 | Self::O1
4205 | Self::O1Pro
4206 | Self::O3
4207 | Self::O3Pro
4208 | Self::O4Mini => true,
4209 }
4210 }
4211 #[allow(clippy::too_many_lines)]
4212 pub fn supports_audio(self) -> bool {
4213 match self {
4214 Self::Gpt4
4215 | Self::Gpt4Turbo
4216 | Self::Gpt41
4217 | Self::Gpt41Mini
4218 | Self::Gpt41Nano
4219 | Self::Gpt4o
4220 | Self::Gpt4o20240513
4221 | Self::Gpt4o20240806
4222 | Self::Gpt4o20241120
4223 | Self::Gpt4oMini
4224 | Self::Gpt5
4225 | Self::Gpt5Mini
4226 | Self::Gpt5Nano
4227 | Self::Gpt5Pro
4228 | Self::Gpt51
4229 | Self::Gpt52
4230 | Self::Gpt52Pro
4231 | Self::Gpt53Codex
4232 | Self::Gpt53CodexSpark
4233 | Self::Gpt54
4234 | Self::Gpt54Mini
4235 | Self::Gpt54Nano
4236 | Self::Gpt54Pro
4237 | Self::Gpt55
4238 | Self::Gpt55Pro
4239 | Self::Gpt56
4240 | Self::Gpt56Luna
4241 | Self::Gpt56Sol
4242 | Self::Gpt56Terra
4243 | Self::O1
4244 | Self::O1Pro
4245 | Self::O3
4246 | Self::O3Mini
4247 | Self::O3Pro
4248 | Self::O4Mini => false,
4249 Self::GptRealtime21 => true,
4250 }
4251 }
4252 #[allow(clippy::too_many_lines)]
4253 pub fn transport(self) -> Option<ModelTransport> {
4254 match self {
4255 Self::Gpt4
4256 | Self::Gpt4Turbo
4257 | Self::Gpt41
4258 | Self::Gpt41Mini
4259 | Self::Gpt41Nano
4260 | Self::Gpt4o
4261 | Self::Gpt4o20240513
4262 | Self::Gpt4o20240806
4263 | Self::Gpt4o20241120
4264 | Self::Gpt4oMini
4265 | Self::Gpt5
4266 | Self::Gpt5Mini
4267 | Self::Gpt5Nano
4268 | Self::Gpt5Pro
4269 | Self::Gpt51
4270 | Self::Gpt52
4271 | Self::Gpt52Pro
4272 | Self::Gpt53Codex
4273 | Self::Gpt53CodexSpark
4274 | Self::Gpt54
4275 | Self::Gpt54Mini
4276 | Self::Gpt54Nano
4277 | Self::Gpt54Pro
4278 | Self::Gpt55
4279 | Self::Gpt55Pro
4280 | Self::Gpt56
4281 | Self::Gpt56Luna
4282 | Self::Gpt56Sol
4283 | Self::Gpt56Terra
4284 | Self::GptRealtime21
4285 | Self::O1
4286 | Self::O1Pro
4287 | Self::O3
4288 | Self::O3Mini
4289 | Self::O3Pro
4290 | Self::O4Mini => None,
4291 }
4292 }
4293 const ALL: &[OpenaiModel] = &[
4294 Self::Gpt4,
4295 Self::Gpt4Turbo,
4296 Self::Gpt41,
4297 Self::Gpt41Mini,
4298 Self::Gpt41Nano,
4299 Self::Gpt4o,
4300 Self::Gpt4o20240513,
4301 Self::Gpt4o20240806,
4302 Self::Gpt4o20241120,
4303 Self::Gpt4oMini,
4304 Self::Gpt5,
4305 Self::Gpt5Mini,
4306 Self::Gpt5Nano,
4307 Self::Gpt5Pro,
4308 Self::Gpt51,
4309 Self::Gpt52,
4310 Self::Gpt52Pro,
4311 Self::Gpt53Codex,
4312 Self::Gpt53CodexSpark,
4313 Self::Gpt54,
4314 Self::Gpt54Mini,
4315 Self::Gpt54Nano,
4316 Self::Gpt54Pro,
4317 Self::Gpt55,
4318 Self::Gpt55Pro,
4319 Self::Gpt56,
4320 Self::Gpt56Luna,
4321 Self::Gpt56Sol,
4322 Self::Gpt56Terra,
4323 Self::GptRealtime21,
4324 Self::O1,
4325 Self::O1Pro,
4326 Self::O3,
4327 Self::O3Mini,
4328 Self::O3Pro,
4329 Self::O4Mini,
4330 ];
4331}
4332impl std::str::FromStr for OpenaiModel {
4333 type Err = String;
4334 #[allow(clippy::too_many_lines)]
4335 fn from_str(s: &str) -> Result<Self, Self::Err> {
4336 match s {
4337 "gpt-4" => Ok(Self::Gpt4),
4338 "gpt-4-turbo" => Ok(Self::Gpt4Turbo),
4339 "gpt-4.1" => Ok(Self::Gpt41),
4340 "gpt-4.1-mini" => Ok(Self::Gpt41Mini),
4341 "gpt-4.1-nano" => Ok(Self::Gpt41Nano),
4342 "gpt-4o" => Ok(Self::Gpt4o),
4343 "gpt-4o-2024-05-13" => Ok(Self::Gpt4o20240513),
4344 "gpt-4o-2024-08-06" => Ok(Self::Gpt4o20240806),
4345 "gpt-4o-2024-11-20" => Ok(Self::Gpt4o20241120),
4346 "gpt-4o-mini" => Ok(Self::Gpt4oMini),
4347 "gpt-5" => Ok(Self::Gpt5),
4348 "gpt-5-mini" => Ok(Self::Gpt5Mini),
4349 "gpt-5-nano" => Ok(Self::Gpt5Nano),
4350 "gpt-5-pro" => Ok(Self::Gpt5Pro),
4351 "gpt-5.1" => Ok(Self::Gpt51),
4352 "gpt-5.2" => Ok(Self::Gpt52),
4353 "gpt-5.2-pro" => Ok(Self::Gpt52Pro),
4354 "gpt-5.3-codex" => Ok(Self::Gpt53Codex),
4355 "gpt-5.3-codex-spark" => Ok(Self::Gpt53CodexSpark),
4356 "gpt-5.4" => Ok(Self::Gpt54),
4357 "gpt-5.4-mini" => Ok(Self::Gpt54Mini),
4358 "gpt-5.4-nano" => Ok(Self::Gpt54Nano),
4359 "gpt-5.4-pro" => Ok(Self::Gpt54Pro),
4360 "gpt-5.5" => Ok(Self::Gpt55),
4361 "gpt-5.5-pro" => Ok(Self::Gpt55Pro),
4362 "gpt-5.6" => Ok(Self::Gpt56),
4363 "gpt-5.6-luna" => Ok(Self::Gpt56Luna),
4364 "gpt-5.6-sol" => Ok(Self::Gpt56Sol),
4365 "gpt-5.6-terra" => Ok(Self::Gpt56Terra),
4366 "gpt-realtime-2.1" => Ok(Self::GptRealtime21),
4367 "o1" => Ok(Self::O1),
4368 "o1-pro" => Ok(Self::O1Pro),
4369 "o3" => Ok(Self::O3),
4370 "o3-mini" => Ok(Self::O3Mini),
4371 "o3-pro" => Ok(Self::O3Pro),
4372 "o4-mini" => Ok(Self::O4Mini),
4373 _ => Err(format!("Unknown openai model: '{s}'")),
4374 }
4375 }
4376}
4377impl OpenRouterModel {
4378 #[allow(clippy::too_many_lines)]
4379 fn model_id(self) -> &'static str {
4380 match self {
4381 Self::Ai21JambaLarge17 => "ai21/jamba-large-1.7",
4382 Self::AionLabsAion20 => "aion-labs/aion-2.0",
4383 Self::AionLabsAion30 => "aion-labs/aion-3.0",
4384 Self::AionLabsAion30Mini => "aion-labs/aion-3.0-mini",
4385 Self::AmazonNova2LiteV1 => "amazon/nova-2-lite-v1",
4386 Self::AmazonNovaLiteV1 => "amazon/nova-lite-v1",
4387 Self::AmazonNovaMicroV1 => "amazon/nova-micro-v1",
4388 Self::AmazonNovaPremierV1 => "amazon/nova-premier-v1",
4389 Self::AmazonNovaProV1 => "amazon/nova-pro-v1",
4390 Self::AnthropicClaude3Haiku => "anthropic/claude-3-haiku",
4391 Self::AnthropicClaudeFable5 => "anthropic/claude-fable-5",
4392 Self::AnthropicClaudeHaiku45 => "anthropic/claude-haiku-4.5",
4393 Self::AnthropicClaudeOpus4 => "anthropic/claude-opus-4",
4394 Self::AnthropicClaudeOpus41 => "anthropic/claude-opus-4.1",
4395 Self::AnthropicClaudeOpus45 => "anthropic/claude-opus-4.5",
4396 Self::AnthropicClaudeOpus46 => "anthropic/claude-opus-4.6",
4397 Self::AnthropicClaudeOpus47 => "anthropic/claude-opus-4.7",
4398 Self::AnthropicClaudeOpus47Fast => "anthropic/claude-opus-4.7-fast",
4399 Self::AnthropicClaudeOpus48 => "anthropic/claude-opus-4.8",
4400 Self::AnthropicClaudeOpus48Fast => "anthropic/claude-opus-4.8-fast",
4401 Self::AnthropicClaudeOpus5 => "anthropic/claude-opus-5",
4402 Self::AnthropicClaudeOpus5Fast => "anthropic/claude-opus-5-fast",
4403 Self::AnthropicClaudeSonnet4 => "anthropic/claude-sonnet-4",
4404 Self::AnthropicClaudeSonnet45 => "anthropic/claude-sonnet-4.5",
4405 Self::AnthropicClaudeSonnet46 => "anthropic/claude-sonnet-4.6",
4406 Self::AnthropicClaudeSonnet5 => "anthropic/claude-sonnet-5",
4407 Self::ArceeAiTrinityLargeThinking => "arcee-ai/trinity-large-thinking",
4408 Self::ArceeAiVirtuosoLarge => "arcee-ai/virtuoso-large",
4409 Self::BytedanceSeedSeed16 => "bytedance-seed/seed-1.6",
4410 Self::BytedanceSeedSeed16Flash => "bytedance-seed/seed-1.6-flash",
4411 Self::BytedanceSeedSeed20Lite => "bytedance-seed/seed-2.0-lite",
4412 Self::BytedanceSeedSeed20Mini => "bytedance-seed/seed-2.0-mini",
4413 Self::CohereCommandR082024 => "cohere/command-r-08-2024",
4414 Self::CohereCommandRPlus082024 => "cohere/command-r-plus-08-2024",
4415 Self::CohereNorthMiniCodeFree => "cohere/north-mini-code:free",
4416 Self::DeepseekDeepseekChat => "deepseek/deepseek-chat",
4417 Self::DeepseekDeepseekChatV30324 => "deepseek/deepseek-chat-v3-0324",
4418 Self::DeepseekDeepseekChatV31 => "deepseek/deepseek-chat-v3.1",
4419 Self::DeepseekDeepseekR1 => "deepseek/deepseek-r1",
4420 Self::DeepseekDeepseekR10528 => "deepseek/deepseek-r1-0528",
4421 Self::DeepseekDeepseekV31Terminus => "deepseek/deepseek-v3.1-terminus",
4422 Self::DeepseekDeepseekV32 => "deepseek/deepseek-v3.2",
4423 Self::DeepseekDeepseekV32Exp => "deepseek/deepseek-v3.2-exp",
4424 Self::DeepseekDeepseekV4Flash => "deepseek/deepseek-v4-flash",
4425 Self::DeepseekDeepseekV4Pro => "deepseek/deepseek-v4-pro",
4426 Self::GoogleGemini25Flash => "google/gemini-2.5-flash",
4427 Self::GoogleGemini25FlashLite => "google/gemini-2.5-flash-lite",
4428 Self::GoogleGemini25Pro => "google/gemini-2.5-pro",
4429 Self::GoogleGemini25ProPreview => "google/gemini-2.5-pro-preview",
4430 Self::GoogleGemini25ProPreview0506 => "google/gemini-2.5-pro-preview-05-06",
4431 Self::GoogleGemini3FlashPreview => "google/gemini-3-flash-preview",
4432 Self::GoogleGemini3ProImage => "google/gemini-3-pro-image",
4433 Self::GoogleGemini31FlashLite => "google/gemini-3.1-flash-lite",
4434 Self::GoogleGemini31FlashLitePreview => {
4435 "google/gemini-3.1-flash-lite-preview"
4436 }
4437 Self::GoogleGemini31ProPreview => "google/gemini-3.1-pro-preview",
4438 Self::GoogleGemini31ProPreviewCustomtools => {
4439 "google/gemini-3.1-pro-preview-customtools"
4440 }
4441 Self::GoogleGemini35Flash => "google/gemini-3.5-flash",
4442 Self::GoogleGemini35FlashLite => "google/gemini-3.5-flash-lite",
4443 Self::GoogleGemini36Flash => "google/gemini-3.6-flash",
4444 Self::GoogleGemma312bIt => "google/gemma-3-12b-it",
4445 Self::GoogleGemma327bIt => "google/gemma-3-27b-it",
4446 Self::GoogleGemma426bA4bIt => "google/gemma-4-26b-a4b-it",
4447 Self::GoogleGemma426bA4bItFree => "google/gemma-4-26b-a4b-it:free",
4448 Self::GoogleGemma431bIt => "google/gemma-4-31b-it",
4449 Self::GoogleGemma431bItFree => "google/gemma-4-31b-it:free",
4450 Self::IbmGraniteGranite418b => "ibm-granite/granite-4.1-8b",
4451 Self::InceptionMercury2 => "inception/mercury-2",
4452 Self::InclusionaiLing261t => "inclusionai/ling-2.6-1t",
4453 Self::InclusionaiLing26Flash => "inclusionai/ling-2.6-flash",
4454 Self::InclusionaiLing30FlashFree => "inclusionai/ling-3.0-flash:free",
4455 Self::InclusionaiRing261t => "inclusionai/ring-2.6-1t",
4456 Self::KwaipilotKatCoderAirV25 => "kwaipilot/kat-coder-air-v2.5",
4457 Self::KwaipilotKatCoderProV2 => "kwaipilot/kat-coder-pro-v2",
4458 Self::KwaipilotKatCoderProV25 => "kwaipilot/kat-coder-pro-v2.5",
4459 Self::MeituanLongcat20 => "meituan/longcat-2.0",
4460 Self::MetaLlamaLlama3170bInstruct => "meta-llama/llama-3.1-70b-instruct",
4461 Self::MetaLlamaLlama318bInstruct => "meta-llama/llama-3.1-8b-instruct",
4462 Self::MetaLlamaLlama3370bInstruct => "meta-llama/llama-3.3-70b-instruct",
4463 Self::MetaLlamaLlama4Maverick => "meta-llama/llama-4-maverick",
4464 Self::MetaLlamaLlama4Scout => "meta-llama/llama-4-scout",
4465 Self::MetaMuseSpark11 => "meta/muse-spark-1.1",
4466 Self::MinimaxMinimaxM1 => "minimax/minimax-m1",
4467 Self::MinimaxMinimaxM2 => "minimax/minimax-m2",
4468 Self::MinimaxMinimaxM21 => "minimax/minimax-m2.1",
4469 Self::MinimaxMinimaxM25 => "minimax/minimax-m2.5",
4470 Self::MinimaxMinimaxM27 => "minimax/minimax-m2.7",
4471 Self::MinimaxMinimaxM3 => "minimax/minimax-m3",
4472 Self::MistralaiCodestral2508 => "mistralai/codestral-2508",
4473 Self::MistralaiDevstral2512 => "mistralai/devstral-2512",
4474 Self::MistralaiMinistral14b2512 => "mistralai/ministral-14b-2512",
4475 Self::MistralaiMinistral3b2512 => "mistralai/ministral-3b-2512",
4476 Self::MistralaiMinistral8b2512 => "mistralai/ministral-8b-2512",
4477 Self::MistralaiMistralLarge => "mistralai/mistral-large",
4478 Self::MistralaiMistralLarge2407 => "mistralai/mistral-large-2407",
4479 Self::MistralaiMistralLarge2512 => "mistralai/mistral-large-2512",
4480 Self::MistralaiMistralMedium3 => "mistralai/mistral-medium-3",
4481 Self::MistralaiMistralMedium35 => "mistralai/mistral-medium-3-5",
4482 Self::MistralaiMistralMedium31 => "mistralai/mistral-medium-3.1",
4483 Self::MistralaiMistralNemo => "mistralai/mistral-nemo",
4484 Self::MistralaiMistralSaba => "mistralai/mistral-saba",
4485 Self::MistralaiMistralSmall2603 => "mistralai/mistral-small-2603",
4486 Self::MistralaiMistralSmall3224bInstruct => {
4487 "mistralai/mistral-small-3.2-24b-instruct"
4488 }
4489 Self::MistralaiMixtral8x22bInstruct => "mistralai/mixtral-8x22b-instruct",
4490 Self::MistralaiVoxtralSmall24b2507 => "mistralai/voxtral-small-24b-2507",
4491 Self::MoonshotaiKimiK2 => "moonshotai/kimi-k2",
4492 Self::MoonshotaiKimiK20905 => "moonshotai/kimi-k2-0905",
4493 Self::MoonshotaiKimiK2Thinking => "moonshotai/kimi-k2-thinking",
4494 Self::MoonshotaiKimiK25 => "moonshotai/kimi-k2.5",
4495 Self::MoonshotaiKimiK26 => "moonshotai/kimi-k2.6",
4496 Self::MoonshotaiKimiK27Code => "moonshotai/kimi-k2.7-code",
4497 Self::MoonshotaiKimiK3 => "moonshotai/kimi-k3",
4498 Self::NexAgiNexN2Mini => "nex-agi/nex-n2-mini",
4499 Self::NexAgiNexN2Pro => "nex-agi/nex-n2-pro",
4500 Self::NvidiaNemotron3Nano30bA3b => "nvidia/nemotron-3-nano-30b-a3b",
4501 Self::NvidiaNemotron3Nano30bA3bFree => "nvidia/nemotron-3-nano-30b-a3b:free",
4502 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree => {
4503 "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free"
4504 }
4505 Self::NvidiaNemotron3Super120bA12b => "nvidia/nemotron-3-super-120b-a12b",
4506 Self::NvidiaNemotron3Super120bA12bFree => {
4507 "nvidia/nemotron-3-super-120b-a12b:free"
4508 }
4509 Self::NvidiaNemotron3Ultra550bA55b => "nvidia/nemotron-3-ultra-550b-a55b",
4510 Self::NvidiaNemotron3Ultra550bA55bFree => {
4511 "nvidia/nemotron-3-ultra-550b-a55b:free"
4512 }
4513 Self::NvidiaNemotronNano12bV2VlFree => "nvidia/nemotron-nano-12b-v2-vl:free",
4514 Self::NvidiaNemotronNano9bV2Free => "nvidia/nemotron-nano-9b-v2:free",
4515 Self::OpenaiGpt35Turbo => "openai/gpt-3.5-turbo",
4516 Self::OpenaiGpt35Turbo0613 => "openai/gpt-3.5-turbo-0613",
4517 Self::OpenaiGpt35Turbo16k => "openai/gpt-3.5-turbo-16k",
4518 Self::OpenaiGpt4 => "openai/gpt-4",
4519 Self::OpenaiGpt4Turbo => "openai/gpt-4-turbo",
4520 Self::OpenaiGpt4TurboPreview => "openai/gpt-4-turbo-preview",
4521 Self::OpenaiGpt41 => "openai/gpt-4.1",
4522 Self::OpenaiGpt41Mini => "openai/gpt-4.1-mini",
4523 Self::OpenaiGpt41Nano => "openai/gpt-4.1-nano",
4524 Self::OpenaiGpt4o => "openai/gpt-4o",
4525 Self::OpenaiGpt4o20240513 => "openai/gpt-4o-2024-05-13",
4526 Self::OpenaiGpt4o20240806 => "openai/gpt-4o-2024-08-06",
4527 Self::OpenaiGpt4o20241120 => "openai/gpt-4o-2024-11-20",
4528 Self::OpenaiGpt4oMini => "openai/gpt-4o-mini",
4529 Self::OpenaiGpt4oMini20240718 => "openai/gpt-4o-mini-2024-07-18",
4530 Self::OpenaiGpt5 => "openai/gpt-5",
4531 Self::OpenaiGpt5Codex => "openai/gpt-5-codex",
4532 Self::OpenaiGpt5Mini => "openai/gpt-5-mini",
4533 Self::OpenaiGpt5Nano => "openai/gpt-5-nano",
4534 Self::OpenaiGpt5Pro => "openai/gpt-5-pro",
4535 Self::OpenaiGpt51 => "openai/gpt-5.1",
4536 Self::OpenaiGpt51Chat => "openai/gpt-5.1-chat",
4537 Self::OpenaiGpt51Codex => "openai/gpt-5.1-codex",
4538 Self::OpenaiGpt51CodexMax => "openai/gpt-5.1-codex-max",
4539 Self::OpenaiGpt51CodexMini => "openai/gpt-5.1-codex-mini",
4540 Self::OpenaiGpt52 => "openai/gpt-5.2",
4541 Self::OpenaiGpt52Chat => "openai/gpt-5.2-chat",
4542 Self::OpenaiGpt52Codex => "openai/gpt-5.2-codex",
4543 Self::OpenaiGpt52Pro => "openai/gpt-5.2-pro",
4544 Self::OpenaiGpt53Chat => "openai/gpt-5.3-chat",
4545 Self::OpenaiGpt53Codex => "openai/gpt-5.3-codex",
4546 Self::OpenaiGpt54 => "openai/gpt-5.4",
4547 Self::OpenaiGpt54Mini => "openai/gpt-5.4-mini",
4548 Self::OpenaiGpt54Nano => "openai/gpt-5.4-nano",
4549 Self::OpenaiGpt54Pro => "openai/gpt-5.4-pro",
4550 Self::OpenaiGpt55 => "openai/gpt-5.5",
4551 Self::OpenaiGpt55Pro => "openai/gpt-5.5-pro",
4552 Self::OpenaiGpt56Luna => "openai/gpt-5.6-luna",
4553 Self::OpenaiGpt56LunaPro => "openai/gpt-5.6-luna-pro",
4554 Self::OpenaiGpt56Sol => "openai/gpt-5.6-sol",
4555 Self::OpenaiGpt56SolPro => "openai/gpt-5.6-sol-pro",
4556 Self::OpenaiGpt56Terra => "openai/gpt-5.6-terra",
4557 Self::OpenaiGpt56TerraPro => "openai/gpt-5.6-terra-pro",
4558 Self::OpenaiGptAudio => "openai/gpt-audio",
4559 Self::OpenaiGptAudioMini => "openai/gpt-audio-mini",
4560 Self::OpenaiGptOss120b => "openai/gpt-oss-120b",
4561 Self::OpenaiGptOss20b => "openai/gpt-oss-20b",
4562 Self::OpenaiGptOss20bFree => "openai/gpt-oss-20b:free",
4563 Self::OpenaiGptOssSafeguard20b => "openai/gpt-oss-safeguard-20b",
4564 Self::OpenaiO1 => "openai/o1",
4565 Self::OpenaiO3 => "openai/o3",
4566 Self::OpenaiO3DeepResearch => "openai/o3-deep-research",
4567 Self::OpenaiO3Mini => "openai/o3-mini",
4568 Self::OpenaiO3MiniHigh => "openai/o3-mini-high",
4569 Self::OpenaiO3Pro => "openai/o3-pro",
4570 Self::OpenaiO4Mini => "openai/o4-mini",
4571 Self::OpenaiO4MiniDeepResearch => "openai/o4-mini-deep-research",
4572 Self::OpenaiO4MiniHigh => "openai/o4-mini-high",
4573 Self::OpenrouterAuto => "openrouter/auto",
4574 Self::OpenrouterFree => "openrouter/free",
4575 Self::PoolsideLagunaM1 => "poolside/laguna-m.1",
4576 Self::PoolsideLagunaM1Free => "poolside/laguna-m.1:free",
4577 Self::PoolsideLagunaS21 => "poolside/laguna-s-2.1",
4578 Self::PoolsideLagunaS21Free => "poolside/laguna-s-2.1:free",
4579 Self::PoolsideLagunaXs21 => "poolside/laguna-xs-2.1",
4580 Self::PoolsideLagunaXs21Free => "poolside/laguna-xs-2.1:free",
4581 Self::QwenQwen2572bInstruct => "qwen/qwen-2.5-72b-instruct",
4582 Self::QwenQwen257bInstruct => "qwen/qwen-2.5-7b-instruct",
4583 Self::QwenQwenPlus => "qwen/qwen-plus",
4584 Self::QwenQwenPlus20250728 => "qwen/qwen-plus-2025-07-28",
4585 Self::QwenQwenPlus20250728Thinking => "qwen/qwen-plus-2025-07-28:thinking",
4586 Self::QwenQwen314b => "qwen/qwen3-14b",
4587 Self::QwenQwen3235bA22b => "qwen/qwen3-235b-a22b",
4588 Self::QwenQwen3235bA22b2507 => "qwen/qwen3-235b-a22b-2507",
4589 Self::QwenQwen3235bA22bThinking2507 => "qwen/qwen3-235b-a22b-thinking-2507",
4590 Self::QwenQwen330bA3b => "qwen/qwen3-30b-a3b",
4591 Self::QwenQwen330bA3bInstruct2507 => "qwen/qwen3-30b-a3b-instruct-2507",
4592 Self::QwenQwen330bA3bThinking2507 => "qwen/qwen3-30b-a3b-thinking-2507",
4593 Self::QwenQwen332b => "qwen/qwen3-32b",
4594 Self::QwenQwen38b => "qwen/qwen3-8b",
4595 Self::QwenQwen3Coder => "qwen/qwen3-coder",
4596 Self::QwenQwen3Coder30bA3bInstruct => "qwen/qwen3-coder-30b-a3b-instruct",
4597 Self::QwenQwen3CoderFlash => "qwen/qwen3-coder-flash",
4598 Self::QwenQwen3CoderNext => "qwen/qwen3-coder-next",
4599 Self::QwenQwen3CoderPlus => "qwen/qwen3-coder-plus",
4600 Self::QwenQwen3Max => "qwen/qwen3-max",
4601 Self::QwenQwen3MaxThinking => "qwen/qwen3-max-thinking",
4602 Self::QwenQwen3Next80bA3bInstruct => "qwen/qwen3-next-80b-a3b-instruct",
4603 Self::QwenQwen3Next80bA3bThinking => "qwen/qwen3-next-80b-a3b-thinking",
4604 Self::QwenQwen3Vl235bA22bInstruct => "qwen/qwen3-vl-235b-a22b-instruct",
4605 Self::QwenQwen3Vl235bA22bThinking => "qwen/qwen3-vl-235b-a22b-thinking",
4606 Self::QwenQwen3Vl30bA3bInstruct => "qwen/qwen3-vl-30b-a3b-instruct",
4607 Self::QwenQwen3Vl30bA3bThinking => "qwen/qwen3-vl-30b-a3b-thinking",
4608 Self::QwenQwen3Vl32bInstruct => "qwen/qwen3-vl-32b-instruct",
4609 Self::QwenQwen3Vl8bInstruct => "qwen/qwen3-vl-8b-instruct",
4610 Self::QwenQwen3Vl8bThinking => "qwen/qwen3-vl-8b-thinking",
4611 Self::QwenQwen35122bA10b => "qwen/qwen3.5-122b-a10b",
4612 Self::QwenQwen3527b => "qwen/qwen3.5-27b",
4613 Self::QwenQwen3535bA3b => "qwen/qwen3.5-35b-a3b",
4614 Self::QwenQwen35397bA17b => "qwen/qwen3.5-397b-a17b",
4615 Self::QwenQwen359b => "qwen/qwen3.5-9b",
4616 Self::QwenQwen35Flash0223 => "qwen/qwen3.5-flash-02-23",
4617 Self::QwenQwen35Plus0215 => "qwen/qwen3.5-plus-02-15",
4618 Self::QwenQwen35Plus20260420 => "qwen/qwen3.5-plus-20260420",
4619 Self::QwenQwen3627b => "qwen/qwen3.6-27b",
4620 Self::QwenQwen3635bA3b => "qwen/qwen3.6-35b-a3b",
4621 Self::QwenQwen36Flash => "qwen/qwen3.6-flash",
4622 Self::QwenQwen36MaxPreview => "qwen/qwen3.6-max-preview",
4623 Self::QwenQwen36Plus => "qwen/qwen3.6-plus",
4624 Self::QwenQwen37Max => "qwen/qwen3.7-max",
4625 Self::QwenQwen37Plus => "qwen/qwen3.7-plus",
4626 Self::RekaaiRekaEdge => "rekaai/reka-edge",
4627 Self::RelaceRelaceSearch => "relace/relace-search",
4628 Self::SakanaFuguUltra => "sakana/fugu-ultra",
4629 Self::Sao10kL31Euryale70b => "sao10k/l3.1-euryale-70b",
4630 Self::StepfunStep35Flash => "stepfun/step-3.5-flash",
4631 Self::StepfunStep37Flash => "stepfun/step-3.7-flash",
4632 Self::TencentHy3 => "tencent/hy3",
4633 Self::TencentHy3Preview => "tencent/hy3-preview",
4634 Self::ThedrummerUnslopnemo12b => "thedrummer/unslopnemo-12b",
4635 Self::ThinkingmachinesInkling => "thinkingmachines/inkling",
4636 Self::UpstageSolarPro3 => "upstage/solar-pro-3",
4637 Self::XAiGrok420 => "x-ai/grok-4.20",
4638 Self::XAiGrok43 => "x-ai/grok-4.3",
4639 Self::XAiGrok45 => "x-ai/grok-4.5",
4640 Self::XAiGrokBuild01 => "x-ai/grok-build-0.1",
4641 Self::XiaomiMimoV25 => "xiaomi/mimo-v2.5",
4642 Self::XiaomiMimoV25Pro => "xiaomi/mimo-v2.5-pro",
4643 Self::ZAiGlm45 => "z-ai/glm-4.5",
4644 Self::ZAiGlm45Air => "z-ai/glm-4.5-air",
4645 Self::ZAiGlm45v => "z-ai/glm-4.5v",
4646 Self::ZAiGlm46 => "z-ai/glm-4.6",
4647 Self::ZAiGlm46v => "z-ai/glm-4.6v",
4648 Self::ZAiGlm47 => "z-ai/glm-4.7",
4649 Self::ZAiGlm47Flash => "z-ai/glm-4.7-flash",
4650 Self::ZAiGlm5 => "z-ai/glm-5",
4651 Self::ZAiGlm5Turbo => "z-ai/glm-5-turbo",
4652 Self::ZAiGlm51 => "z-ai/glm-5.1",
4653 Self::ZAiGlm52 => "z-ai/glm-5.2",
4654 Self::ZAiGlm5vTurbo => "z-ai/glm-5v-turbo",
4655 }
4656 }
4657 #[allow(clippy::too_many_lines)]
4658 fn display_name(self) -> &'static str {
4659 match self {
4660 Self::AionLabsAion20 => "Aion-2.0",
4661 Self::AionLabsAion30 => "Aion-3.0",
4662 Self::AionLabsAion30Mini => "Aion-3.0-Mini",
4663 Self::OpenrouterAuto => "Auto Router",
4664 Self::AnthropicClaude3Haiku => "Claude 3 Haiku",
4665 Self::AnthropicClaudeFable5 => "Claude Fable 5",
4666 Self::AnthropicClaudeHaiku45 => "Claude Haiku 4.5 (latest)",
4667 Self::AnthropicClaudeOpus4 => "Claude Opus 4",
4668 Self::AnthropicClaudeOpus41 => "Claude Opus 4.1 (latest)",
4669 Self::AnthropicClaudeOpus45 => "Claude Opus 4.5 (latest)",
4670 Self::AnthropicClaudeOpus46 => "Claude Opus 4.6",
4671 Self::AnthropicClaudeOpus47 => "Claude Opus 4.7",
4672 Self::AnthropicClaudeOpus47Fast => "Claude Opus 4.7 (Fast)",
4673 Self::AnthropicClaudeOpus48 => "Claude Opus 4.8",
4674 Self::AnthropicClaudeOpus48Fast => "Claude Opus 4.8 (Fast)",
4675 Self::AnthropicClaudeOpus5 => "Claude Opus 5",
4676 Self::AnthropicClaudeOpus5Fast => "Claude Opus 5 (Fast)",
4677 Self::AnthropicClaudeSonnet4 => "Claude Sonnet 4",
4678 Self::AnthropicClaudeSonnet45 => "Claude Sonnet 4.5 (latest)",
4679 Self::AnthropicClaudeSonnet46 => "Claude Sonnet 4.6",
4680 Self::AnthropicClaudeSonnet5 => "Claude Sonnet 5",
4681 Self::MistralaiCodestral2508 => "Codestral 2508",
4682 Self::CohereCommandR082024 => "Command R",
4683 Self::CohereCommandRPlus082024 => "Command R+",
4684 Self::DeepseekDeepseekChat => "DeepSeek Chat",
4685 Self::DeepseekDeepseekChatV30324 => "DeepSeek V3 0324",
4686 Self::DeepseekDeepseekChatV31 => "DeepSeek V3.1",
4687 Self::DeepseekDeepseekV31Terminus => "DeepSeek V3.1 Terminus",
4688 Self::DeepseekDeepseekV32 => "DeepSeek V3.2",
4689 Self::DeepseekDeepseekV32Exp => "DeepSeek V3.2 Exp",
4690 Self::DeepseekDeepseekV4Flash => "DeepSeek V4 Flash",
4691 Self::DeepseekDeepseekV4Pro => "DeepSeek V4 Pro",
4692 Self::DeepseekDeepseekR1 => "DeepSeek-R1",
4693 Self::MistralaiDevstral2512 => "Devstral 2",
4694 Self::OpenrouterFree => "Free Models Router",
4695 Self::SakanaFuguUltra => "Fugu Ultra",
4696 Self::ZAiGlm45 => "GLM-4.5",
4697 Self::ZAiGlm45Air => "GLM-4.5-Air",
4698 Self::ZAiGlm45v => "GLM-4.5V",
4699 Self::ZAiGlm46 => "GLM-4.6",
4700 Self::ZAiGlm46v => "GLM-4.6V",
4701 Self::ZAiGlm47 => "GLM-4.7",
4702 Self::ZAiGlm47Flash => "GLM-4.7-Flash",
4703 Self::ZAiGlm5 => "GLM-5",
4704 Self::ZAiGlm5Turbo => "GLM-5-Turbo",
4705 Self::ZAiGlm51 => "GLM-5.1",
4706 Self::ZAiGlm52 => "GLM-5.2",
4707 Self::ZAiGlm5vTurbo => "GLM-5V-Turbo",
4708 Self::OpenaiGptAudio => "GPT Audio",
4709 Self::OpenaiGptAudioMini => "GPT Audio Mini",
4710 Self::OpenaiGptOss120b => "GPT OSS 120B",
4711 Self::OpenaiGptOss20b => "GPT OSS 20B",
4712 Self::OpenaiGpt35Turbo0613 => "GPT-3.5 Turbo (older v0613)",
4713 Self::OpenaiGpt35Turbo16k => "GPT-3.5 Turbo 16k",
4714 Self::OpenaiGpt35Turbo => "GPT-3.5-turbo",
4715 Self::OpenaiGpt4 => "GPT-4",
4716 Self::OpenaiGpt4Turbo => "GPT-4 Turbo",
4717 Self::OpenaiGpt4TurboPreview => "GPT-4 Turbo Preview",
4718 Self::OpenaiGpt41 => "GPT-4.1",
4719 Self::OpenaiGpt41Mini => "GPT-4.1 mini",
4720 Self::OpenaiGpt41Nano => "GPT-4.1 nano",
4721 Self::OpenaiGpt4o => "GPT-4o",
4722 Self::OpenaiGpt4o20240513 => "GPT-4o (2024-05-13)",
4723 Self::OpenaiGpt4o20240806 => "GPT-4o (2024-08-06)",
4724 Self::OpenaiGpt4o20241120 => "GPT-4o (2024-11-20)",
4725 Self::OpenaiGpt4oMini => "GPT-4o mini",
4726 Self::OpenaiGpt4oMini20240718 => "GPT-4o-mini (2024-07-18)",
4727 Self::OpenaiGpt5 => "GPT-5",
4728 Self::OpenaiGpt5Mini => "GPT-5 Mini",
4729 Self::OpenaiGpt5Nano => "GPT-5 Nano",
4730 Self::OpenaiGpt5Pro => "GPT-5 Pro",
4731 Self::OpenaiGpt5Codex => "GPT-5-Codex",
4732 Self::OpenaiGpt51 => "GPT-5.1",
4733 Self::OpenaiGpt51Chat => "GPT-5.1 Chat",
4734 Self::OpenaiGpt51Codex => "GPT-5.1 Codex",
4735 Self::OpenaiGpt51CodexMax => "GPT-5.1 Codex Max",
4736 Self::OpenaiGpt51CodexMini => "GPT-5.1 Codex mini",
4737 Self::OpenaiGpt52 => "GPT-5.2",
4738 Self::OpenaiGpt52Chat => "GPT-5.2 Chat",
4739 Self::OpenaiGpt52Codex => "GPT-5.2 Codex",
4740 Self::OpenaiGpt52Pro => "GPT-5.2 Pro",
4741 Self::OpenaiGpt53Chat => "GPT-5.3 Chat",
4742 Self::OpenaiGpt53Codex => "GPT-5.3 Codex",
4743 Self::OpenaiGpt54 => "GPT-5.4",
4744 Self::OpenaiGpt54Pro => "GPT-5.4 Pro",
4745 Self::OpenaiGpt54Mini => "GPT-5.4 mini",
4746 Self::OpenaiGpt54Nano => "GPT-5.4 nano",
4747 Self::OpenaiGpt55 => "GPT-5.5",
4748 Self::OpenaiGpt55Pro => "GPT-5.5 Pro",
4749 Self::OpenaiGpt56Luna => "GPT-5.6 Luna",
4750 Self::OpenaiGpt56LunaPro => "GPT-5.6 Luna Pro",
4751 Self::OpenaiGpt56Sol => "GPT-5.6 Sol",
4752 Self::OpenaiGpt56SolPro => "GPT-5.6 Sol Pro",
4753 Self::OpenaiGpt56Terra => "GPT-5.6 Terra",
4754 Self::OpenaiGpt56TerraPro => "GPT-5.6 Terra Pro",
4755 Self::GoogleGemini25Flash => "Gemini 2.5 Flash",
4756 Self::GoogleGemini25FlashLite => "Gemini 2.5 Flash-Lite",
4757 Self::GoogleGemini25Pro => "Gemini 2.5 Pro",
4758 Self::GoogleGemini25ProPreview0506 => "Gemini 2.5 Pro Preview 05-06",
4759 Self::GoogleGemini25ProPreview => "Gemini 2.5 Pro Preview 06-05",
4760 Self::GoogleGemini3FlashPreview => "Gemini 3 Flash Preview",
4761 Self::GoogleGemini31FlashLite => "Gemini 3.1 Flash Lite",
4762 Self::GoogleGemini31FlashLitePreview => "Gemini 3.1 Flash Lite Preview",
4763 Self::GoogleGemini31ProPreview => "Gemini 3.1 Pro Preview",
4764 Self::GoogleGemini31ProPreviewCustomtools => {
4765 "Gemini 3.1 Pro Preview Custom Tools"
4766 }
4767 Self::GoogleGemini35Flash => "Gemini 3.5 Flash",
4768 Self::GoogleGemini35FlashLite => "Gemini 3.5 Flash Lite",
4769 Self::GoogleGemini36Flash => "Gemini 3.6 Flash",
4770 Self::GoogleGemma312bIt => "Gemma 3 12B",
4771 Self::GoogleGemma327bIt => "Gemma 3 27B",
4772 Self::GoogleGemma426bA4bItFree => "Gemma 4 26B A4B (free)",
4773 Self::GoogleGemma426bA4bIt => "Gemma 4 26B A4B IT",
4774 Self::GoogleGemma431bItFree => "Gemma 4 31B (free)",
4775 Self::GoogleGemma431bIt => "Gemma 4 31B IT",
4776 Self::IbmGraniteGranite418b => "Granite 4.1 8B",
4777 Self::XAiGrok420 => "Grok 4.20",
4778 Self::XAiGrok43 => "Grok 4.3",
4779 Self::XAiGrok45 => "Grok 4.5",
4780 Self::XAiGrokBuild01 => "Grok Build 0.1",
4781 Self::TencentHy3 => "Hy3",
4782 Self::TencentHy3Preview => "Hy3 preview",
4783 Self::ThinkingmachinesInkling => "Inkling",
4784 Self::Ai21JambaLarge17 => "Jamba Large 1.7",
4785 Self::KwaipilotKatCoderAirV25 => "KAT-Coder-Air V2.5",
4786 Self::KwaipilotKatCoderProV2 => "KAT-Coder-Pro V2",
4787 Self::KwaipilotKatCoderProV25 => "KAT-Coder-Pro V2.5",
4788 Self::MoonshotaiKimiK2 => "Kimi K2 0711",
4789 Self::MoonshotaiKimiK20905 => "Kimi K2 0905",
4790 Self::MoonshotaiKimiK2Thinking => "Kimi K2 Thinking",
4791 Self::MoonshotaiKimiK25 => "Kimi K2.5",
4792 Self::MoonshotaiKimiK26 => "Kimi K2.6",
4793 Self::MoonshotaiKimiK27Code => "Kimi K2.7 Code",
4794 Self::MoonshotaiKimiK3 => "Kimi K3",
4795 Self::PoolsideLagunaM1 => "Laguna M.1",
4796 Self::PoolsideLagunaM1Free => "Laguna M.1 (free)",
4797 Self::PoolsideLagunaS21 => "Laguna S 2.1",
4798 Self::PoolsideLagunaS21Free => "Laguna S 2.1 (free)",
4799 Self::PoolsideLagunaXs21 => "Laguna XS 2.1",
4800 Self::PoolsideLagunaXs21Free => "Laguna XS 2.1 (free)",
4801 Self::InclusionaiLing261t => "Ling-2.6-1T",
4802 Self::InclusionaiLing26Flash => "Ling-2.6-flash",
4803 Self::InclusionaiLing30FlashFree => "Ling-3.0-flash (free)",
4804 Self::MetaLlamaLlama3170bInstruct => "Llama 3.1 70B Instruct",
4805 Self::MetaLlamaLlama318bInstruct => "Llama 3.1 8B Instruct",
4806 Self::Sao10kL31Euryale70b => "Llama 3.1 Euryale 70B v2.2",
4807 Self::MetaLlamaLlama4Maverick => "Llama 4 Maverick",
4808 Self::MetaLlamaLlama4Scout => "Llama 4 Scout",
4809 Self::MetaLlamaLlama3370bInstruct => "Llama-3.3-70B-Instruct",
4810 Self::MeituanLongcat20 => "LongCat 2.0",
4811 Self::InceptionMercury2 => "Mercury 2",
4812 Self::XiaomiMimoV25 => "MiMo-V2.5",
4813 Self::XiaomiMimoV25Pro => "MiMo-V2.5-Pro",
4814 Self::MinimaxMinimaxM1 => "MiniMax M1",
4815 Self::MinimaxMinimaxM2 => "MiniMax-M2",
4816 Self::MinimaxMinimaxM21 => "MiniMax-M2.1",
4817 Self::MinimaxMinimaxM25 => "MiniMax-M2.5",
4818 Self::MinimaxMinimaxM27 => "MiniMax-M2.7",
4819 Self::MinimaxMinimaxM3 => "MiniMax-M3",
4820 Self::MistralaiMinistral14b2512 => "Ministral 3 14B 2512",
4821 Self::MistralaiMinistral3b2512 => "Ministral 3 3B 2512",
4822 Self::MistralaiMinistral8b2512 => "Ministral 3 8B 2512",
4823 Self::MistralaiMistralLarge => "Mistral Large",
4824 Self::MistralaiMistralLarge2407 => "Mistral Large 2407",
4825 Self::MistralaiMistralLarge2512 => "Mistral Large 3",
4826 Self::MistralaiMistralMedium3 => "Mistral Medium 3",
4827 Self::MistralaiMistralMedium31 => "Mistral Medium 3.1",
4828 Self::MistralaiMistralMedium35 => "Mistral Medium 3.5",
4829 Self::MistralaiMistralNemo => "Mistral Nemo",
4830 Self::MistralaiMistralSmall3224bInstruct => "Mistral Small 3.2 24B",
4831 Self::MistralaiMistralSmall2603 => "Mistral Small 4",
4832 Self::MistralaiMixtral8x22bInstruct => "Mixtral 8x22B Instruct",
4833 Self::MetaMuseSpark11 => "Muse Spark 1.1",
4834 Self::GoogleGemini3ProImage => "Nano Banana Pro",
4835 Self::NvidiaNemotron3Nano30bA3b => "Nemotron 3 Nano 30B A3B",
4836 Self::NvidiaNemotron3Nano30bA3bFree => "Nemotron 3 Nano 30B A3B (free)",
4837 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree => {
4838 "Nemotron 3 Nano Omni (free)"
4839 }
4840 Self::NvidiaNemotron3Super120bA12bFree => "Nemotron 3 Super (free)",
4841 Self::NvidiaNemotron3Super120bA12b => "Nemotron 3 Super 120B A12B",
4842 Self::NvidiaNemotron3Ultra550bA55bFree => "Nemotron 3 Ultra (free)",
4843 Self::NvidiaNemotron3Ultra550bA55b => "Nemotron 3 Ultra 550B A55B",
4844 Self::NvidiaNemotronNano12bV2VlFree => "Nemotron Nano 12B 2 VL (free)",
4845 Self::NvidiaNemotronNano9bV2Free => "Nemotron Nano 9B V2 (free)",
4846 Self::NexAgiNexN2Mini => "Nex-N2-Mini",
4847 Self::NexAgiNexN2Pro => "Nex-N2-Pro",
4848 Self::CohereNorthMiniCodeFree => "North Mini Code (free)",
4849 Self::AmazonNova2LiteV1 => "Nova 2 Lite",
4850 Self::AmazonNovaLiteV1 => "Nova Lite 1.0",
4851 Self::AmazonNovaMicroV1 => "Nova Micro 1.0",
4852 Self::AmazonNovaPremierV1 => "Nova Premier 1.0",
4853 Self::AmazonNovaProV1 => "Nova Pro 1.0",
4854 Self::QwenQwenPlus => "Qwen Plus",
4855 Self::QwenQwenPlus20250728 => "Qwen Plus 0728",
4856 Self::QwenQwenPlus20250728Thinking => "Qwen Plus 0728 (thinking)",
4857 Self::QwenQwen2572bInstruct => "Qwen2.5 72B Instruct",
4858 Self::QwenQwen257bInstruct => "Qwen2.5 7B Instruct",
4859 Self::QwenQwen314b => "Qwen3 14B",
4860 Self::QwenQwen3235bA22b2507 => "Qwen3 235B A22B Instruct 2507",
4861 Self::QwenQwen3235bA22bThinking2507 => "Qwen3 235B A22B Thinking 2507",
4862 Self::QwenQwen3235bA22b => "Qwen3 235B-A22B",
4863 Self::QwenQwen330bA3b => "Qwen3 30B A3B",
4864 Self::QwenQwen330bA3bInstruct2507 => "Qwen3 30B A3B Instruct 2507",
4865 Self::QwenQwen330bA3bThinking2507 => "Qwen3 30B A3B Thinking 2507",
4866 Self::QwenQwen332b => "Qwen3 32B",
4867 Self::QwenQwen38b => "Qwen3 8B",
4868 Self::QwenQwen3Coder => "Qwen3 Coder 480B A35B",
4869 Self::QwenQwen3CoderFlash => "Qwen3 Coder Flash",
4870 Self::QwenQwen3CoderNext => "Qwen3 Coder Next",
4871 Self::QwenQwen3CoderPlus => "Qwen3 Coder Plus",
4872 Self::QwenQwen3Max => "Qwen3 Max",
4873 Self::QwenQwen3MaxThinking => "Qwen3 Max Thinking",
4874 Self::QwenQwen3Vl235bA22bInstruct => "Qwen3 VL 235B A22B Instruct",
4875 Self::QwenQwen3Vl235bA22bThinking => "Qwen3 VL 235B A22B Thinking",
4876 Self::QwenQwen3Vl30bA3bInstruct => "Qwen3 VL 30B A3B Instruct",
4877 Self::QwenQwen3Vl30bA3bThinking => "Qwen3 VL 30B A3B Thinking",
4878 Self::QwenQwen3Vl32bInstruct => "Qwen3 VL 32B Instruct",
4879 Self::QwenQwen3Vl8bInstruct => "Qwen3 VL 8B Instruct",
4880 Self::QwenQwen3Vl8bThinking => "Qwen3 VL 8B Thinking",
4881 Self::QwenQwen3Coder30bA3bInstruct => "Qwen3-Coder 30B-A3B Instruct",
4882 Self::QwenQwen3Next80bA3bThinking => "Qwen3-Next 80B-A3B (Thinking)",
4883 Self::QwenQwen3Next80bA3bInstruct => "Qwen3-Next 80B-A3B Instruct",
4884 Self::QwenQwen35122bA10b => "Qwen3.5 122B-A10B",
4885 Self::QwenQwen3527b => "Qwen3.5 27B",
4886 Self::QwenQwen3535bA3b => "Qwen3.5 35B-A3B",
4887 Self::QwenQwen35397bA17b => "Qwen3.5 397B-A17B",
4888 Self::QwenQwen359b => "Qwen3.5 9B",
4889 Self::QwenQwen35Plus0215 => "Qwen3.5 Plus 2026-02-15",
4890 Self::QwenQwen35Plus20260420 => "Qwen3.5 Plus 2026-04-20",
4891 Self::QwenQwen35Flash0223 => "Qwen3.5-Flash",
4892 Self::QwenQwen3627b => "Qwen3.6 27B",
4893 Self::QwenQwen3635bA3b => "Qwen3.6 35B-A3B",
4894 Self::QwenQwen36Flash => "Qwen3.6 Flash",
4895 Self::QwenQwen36MaxPreview => "Qwen3.6 Max Preview",
4896 Self::QwenQwen36Plus => "Qwen3.6 Plus",
4897 Self::QwenQwen37Max => "Qwen3.7 Max",
4898 Self::QwenQwen37Plus => "Qwen3.7 Plus",
4899 Self::DeepseekDeepseekR10528 => "R1 0528",
4900 Self::RekaaiRekaEdge => "Reka Edge",
4901 Self::RelaceRelaceSearch => "Relace Search",
4902 Self::InclusionaiRing261t => "Ring-2.6-1T",
4903 Self::MistralaiMistralSaba => "Saba",
4904 Self::BytedanceSeedSeed16 => "Seed 1.6",
4905 Self::BytedanceSeedSeed16Flash => "Seed 1.6 Flash",
4906 Self::BytedanceSeedSeed20Lite => "Seed-2.0-Lite",
4907 Self::BytedanceSeedSeed20Mini => "Seed-2.0-Mini",
4908 Self::UpstageSolarPro3 => "Solar Pro 3",
4909 Self::StepfunStep35Flash => "Step 3.5 Flash",
4910 Self::StepfunStep37Flash => "Step 3.7 Flash",
4911 Self::ArceeAiTrinityLargeThinking => "Trinity Large Thinking",
4912 Self::ThedrummerUnslopnemo12b => "UnslopNemo 12B",
4913 Self::ArceeAiVirtuosoLarge => "Virtuoso Large",
4914 Self::MistralaiVoxtralSmall24b2507 => "Voxtral Small 24B 2507",
4915 Self::OpenaiGptOss20bFree => "gpt-oss-20b (free)",
4916 Self::OpenaiGptOssSafeguard20b => "gpt-oss-safeguard-20b",
4917 Self::OpenaiO1 => "o1",
4918 Self::OpenaiO3 => "o3",
4919 Self::OpenaiO3MiniHigh => "o3 Mini High",
4920 Self::OpenaiO3DeepResearch => "o3-deep-research",
4921 Self::OpenaiO3Mini => "o3-mini",
4922 Self::OpenaiO3Pro => "o3-pro",
4923 Self::OpenaiO4MiniHigh => "o4 Mini High",
4924 Self::OpenaiO4Mini => "o4-mini",
4925 Self::OpenaiO4MiniDeepResearch => "o4-mini-deep-research",
4926 }
4927 }
4928 #[allow(clippy::too_many_lines)]
4929 fn context_window(self) -> u32 {
4930 match self {
4931 Self::OpenaiGpt35Turbo0613 => 4095,
4932 Self::OpenaiGpt4 => 8191,
4933 Self::RekaaiRekaEdge => 16_384,
4934 Self::OpenaiGpt35Turbo | Self::OpenaiGpt35Turbo16k => 16_385,
4935 Self::MistralaiVoxtralSmall24b2507 => 32_000,
4936 Self::MistralaiMistralSaba
4937 | Self::QwenQwen2572bInstruct
4938 | Self::QwenQwen257bInstruct
4939 | Self::ThedrummerUnslopnemo12b => 32_768,
4940 Self::MistralaiMixtral8x22bInstruct | Self::ZAiGlm45v => 65_536,
4941 Self::QwenQwen330bA3bThinking2507 => 81_920,
4942 Self::AmazonNovaMicroV1
4943 | Self::CohereCommandR082024
4944 | Self::CohereCommandRPlus082024
4945 | Self::InceptionMercury2
4946 | Self::MistralaiMistralLarge
4947 | Self::NvidiaNemotronNano12bV2VlFree
4948 | Self::NvidiaNemotronNano9bV2Free
4949 | Self::OpenaiGpt4Turbo
4950 | Self::OpenaiGpt4TurboPreview
4951 | Self::OpenaiGpt4o
4952 | Self::OpenaiGpt4o20240513
4953 | Self::OpenaiGpt4o20240806
4954 | Self::OpenaiGpt4o20241120
4955 | Self::OpenaiGpt4oMini
4956 | Self::OpenaiGpt4oMini20240718
4957 | Self::OpenaiGpt51Chat
4958 | Self::OpenaiGpt52Chat
4959 | Self::OpenaiGpt53Chat
4960 | Self::OpenaiGptAudio
4961 | Self::OpenaiGptAudioMini
4962 | Self::UpstageSolarPro3 => 128_000,
4963 Self::AionLabsAion20
4964 | Self::AionLabsAion30
4965 | Self::AionLabsAion30Mini
4966 | Self::ArceeAiVirtuosoLarge
4967 | Self::GoogleGemini3ProImage
4968 | Self::GoogleGemma312bIt
4969 | Self::IbmGraniteGranite418b
4970 | Self::MetaLlamaLlama3170bInstruct
4971 | Self::MetaLlamaLlama318bInstruct
4972 | Self::MetaLlamaLlama3370bInstruct
4973 | Self::MistralaiMinistral3b2512
4974 | Self::MistralaiMistralLarge2407
4975 | Self::MistralaiMistralMedium3
4976 | Self::MistralaiMistralMedium31
4977 | Self::MistralaiMistralNemo
4978 | Self::MoonshotaiKimiK2
4979 | Self::OpenaiGptOss120b
4980 | Self::OpenaiGptOss20b
4981 | Self::OpenaiGptOss20bFree
4982 | Self::OpenaiGptOssSafeguard20b
4983 | Self::QwenQwen314b
4984 | Self::QwenQwen3235bA22b
4985 | Self::QwenQwen330bA3b
4986 | Self::QwenQwen332b
4987 | Self::QwenQwen38b
4988 | Self::QwenQwen3Vl235bA22bThinking
4989 | Self::QwenQwen3Vl32bInstruct
4990 | Self::QwenQwen3Vl8bThinking
4991 | Self::Sao10kL31Euryale70b
4992 | Self::ZAiGlm45
4993 | Self::ZAiGlm45Air
4994 | Self::ZAiGlm46v => 131_072,
4995 Self::DeepseekDeepseekChat
4996 | Self::DeepseekDeepseekChatV30324
4997 | Self::DeepseekDeepseekChatV31
4998 | Self::DeepseekDeepseekR1
4999 | Self::DeepseekDeepseekR10528
5000 | Self::DeepseekDeepseekV31Terminus
5001 | Self::DeepseekDeepseekV32
5002 | Self::DeepseekDeepseekV32Exp => 163_840,
5003 Self::AnthropicClaude3Haiku
5004 | Self::AnthropicClaudeHaiku45
5005 | Self::AnthropicClaudeOpus4
5006 | Self::AnthropicClaudeOpus41
5007 | Self::AnthropicClaudeOpus45
5008 | Self::OpenaiO1
5009 | Self::OpenaiO3
5010 | Self::OpenaiO3DeepResearch
5011 | Self::OpenaiO3Mini
5012 | Self::OpenaiO3MiniHigh
5013 | Self::OpenaiO3Pro
5014 | Self::OpenaiO4Mini
5015 | Self::OpenaiO4MiniDeepResearch
5016 | Self::OpenaiO4MiniHigh
5017 | Self::OpenrouterFree => 200_000,
5018 Self::ZAiGlm47Flash | Self::ZAiGlm5Turbo | Self::ZAiGlm5vTurbo => 202_752,
5019 Self::MinimaxMinimaxM2
5020 | Self::MinimaxMinimaxM21
5021 | Self::MinimaxMinimaxM25
5022 | Self::MinimaxMinimaxM27
5023 | Self::ZAiGlm46
5024 | Self::ZAiGlm47
5025 | Self::ZAiGlm5
5026 | Self::ZAiGlm51 => 204_800,
5027 Self::Ai21JambaLarge17
5028 | Self::CohereNorthMiniCodeFree
5029 | Self::KwaipilotKatCoderAirV25
5030 | Self::KwaipilotKatCoderProV25
5031 | Self::MistralaiCodestral2508
5032 | Self::MistralaiMistralSmall3224bInstruct
5033 | Self::NvidiaNemotron3Nano30bA3bFree
5034 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
5035 | Self::RelaceRelaceSearch
5036 | Self::XAiGrokBuild01 => 256_000,
5037 Self::ArceeAiTrinityLargeThinking
5038 | Self::BytedanceSeedSeed16
5039 | Self::BytedanceSeedSeed16Flash
5040 | Self::BytedanceSeedSeed20Lite
5041 | Self::BytedanceSeedSeed20Mini
5042 | Self::GoogleGemma327bIt
5043 | Self::GoogleGemma426bA4bIt
5044 | Self::GoogleGemma426bA4bItFree
5045 | Self::GoogleGemma431bIt
5046 | Self::GoogleGemma431bItFree
5047 | Self::InclusionaiLing261t
5048 | Self::InclusionaiLing26Flash
5049 | Self::InclusionaiLing30FlashFree
5050 | Self::InclusionaiRing261t
5051 | Self::KwaipilotKatCoderProV2
5052 | Self::MistralaiDevstral2512
5053 | Self::MistralaiMinistral14b2512
5054 | Self::MistralaiMinistral8b2512
5055 | Self::MistralaiMistralLarge2512
5056 | Self::MistralaiMistralMedium35
5057 | Self::MistralaiMistralSmall2603
5058 | Self::MoonshotaiKimiK20905
5059 | Self::MoonshotaiKimiK2Thinking
5060 | Self::MoonshotaiKimiK25
5061 | Self::MoonshotaiKimiK26
5062 | Self::MoonshotaiKimiK27Code
5063 | Self::NexAgiNexN2Mini
5064 | Self::NexAgiNexN2Pro
5065 | Self::NvidiaNemotron3Nano30bA3b
5066 | Self::NvidiaNemotron3Super120bA12bFree
5067 | Self::PoolsideLagunaM1
5068 | Self::PoolsideLagunaM1Free
5069 | Self::PoolsideLagunaS21Free
5070 | Self::PoolsideLagunaXs21
5071 | Self::PoolsideLagunaXs21Free
5072 | Self::QwenQwen3235bA22b2507
5073 | Self::QwenQwen3235bA22bThinking2507
5074 | Self::QwenQwen330bA3bInstruct2507
5075 | Self::QwenQwen3Coder
5076 | Self::QwenQwen3Coder30bA3bInstruct
5077 | Self::QwenQwen3CoderNext
5078 | Self::QwenQwen3Max
5079 | Self::QwenQwen3MaxThinking
5080 | Self::QwenQwen3Next80bA3bInstruct
5081 | Self::QwenQwen3Next80bA3bThinking
5082 | Self::QwenQwen3Vl235bA22bInstruct
5083 | Self::QwenQwen3Vl30bA3bInstruct
5084 | Self::QwenQwen3Vl30bA3bThinking
5085 | Self::QwenQwen3Vl8bInstruct
5086 | Self::QwenQwen35122bA10b
5087 | Self::QwenQwen3527b
5088 | Self::QwenQwen3535bA3b
5089 | Self::QwenQwen35397bA17b
5090 | Self::QwenQwen359b
5091 | Self::QwenQwen3627b
5092 | Self::QwenQwen3635bA3b
5093 | Self::QwenQwen36MaxPreview
5094 | Self::StepfunStep35Flash
5095 | Self::StepfunStep37Flash
5096 | Self::TencentHy3
5097 | Self::TencentHy3Preview => 262_144,
5098 Self::AmazonNovaLiteV1 | Self::AmazonNovaProV1 => 300_000,
5099 Self::OpenaiGpt5
5100 | Self::OpenaiGpt5Codex
5101 | Self::OpenaiGpt5Mini
5102 | Self::OpenaiGpt5Nano
5103 | Self::OpenaiGpt5Pro
5104 | Self::OpenaiGpt51
5105 | Self::OpenaiGpt51Codex
5106 | Self::OpenaiGpt51CodexMax
5107 | Self::OpenaiGpt51CodexMini
5108 | Self::OpenaiGpt52
5109 | Self::OpenaiGpt52Codex
5110 | Self::OpenaiGpt52Pro
5111 | Self::OpenaiGpt53Codex
5112 | Self::OpenaiGpt54Mini
5113 | Self::OpenaiGpt54Nano => 400_000,
5114 Self::XAiGrok45 => 500_000,
5115 Self::NvidiaNemotron3Ultra550bA55b => 512_288,
5116 Self::AmazonNova2LiteV1
5117 | Self::AmazonNovaPremierV1
5118 | Self::AnthropicClaudeFable5
5119 | Self::AnthropicClaudeOpus46
5120 | Self::AnthropicClaudeOpus47
5121 | Self::AnthropicClaudeOpus47Fast
5122 | Self::AnthropicClaudeOpus48
5123 | Self::AnthropicClaudeOpus48Fast
5124 | Self::AnthropicClaudeOpus5
5125 | Self::AnthropicClaudeOpus5Fast
5126 | Self::AnthropicClaudeSonnet4
5127 | Self::AnthropicClaudeSonnet45
5128 | Self::AnthropicClaudeSonnet46
5129 | Self::AnthropicClaudeSonnet5
5130 | Self::MinimaxMinimaxM1
5131 | Self::NvidiaNemotron3Super120bA12b
5132 | Self::NvidiaNemotron3Ultra550bA55bFree
5133 | Self::QwenQwenPlus
5134 | Self::QwenQwenPlus20250728
5135 | Self::QwenQwenPlus20250728Thinking
5136 | Self::QwenQwen3CoderFlash
5137 | Self::QwenQwen3CoderPlus
5138 | Self::QwenQwen35Flash0223
5139 | Self::QwenQwen35Plus0215
5140 | Self::QwenQwen35Plus20260420
5141 | Self::QwenQwen36Flash
5142 | Self::QwenQwen36Plus
5143 | Self::QwenQwen37Max
5144 | Self::QwenQwen37Plus
5145 | Self::SakanaFuguUltra
5146 | Self::XAiGrok43 => 1_000_000,
5147 Self::OpenaiGpt41 | Self::OpenaiGpt41Mini | Self::OpenaiGpt41Nano => {
5148 1_047_576
5149 }
5150 Self::DeepseekDeepseekV4Flash
5151 | Self::DeepseekDeepseekV4Pro
5152 | Self::GoogleGemini25Flash
5153 | Self::GoogleGemini25FlashLite
5154 | Self::GoogleGemini25Pro
5155 | Self::GoogleGemini25ProPreview
5156 | Self::GoogleGemini25ProPreview0506
5157 | Self::GoogleGemini3FlashPreview
5158 | Self::GoogleGemini31FlashLite
5159 | Self::GoogleGemini31FlashLitePreview
5160 | Self::GoogleGemini31ProPreview
5161 | Self::GoogleGemini31ProPreviewCustomtools
5162 | Self::GoogleGemini35Flash
5163 | Self::GoogleGemini35FlashLite
5164 | Self::GoogleGemini36Flash
5165 | Self::MetaLlamaLlama4Maverick
5166 | Self::MetaMuseSpark11
5167 | Self::MinimaxMinimaxM3
5168 | Self::MoonshotaiKimiK3
5169 | Self::PoolsideLagunaS21
5170 | Self::ThinkingmachinesInkling
5171 | Self::ZAiGlm52 => 1_048_576,
5172 Self::MeituanLongcat20 => 1_048_756,
5173 Self::OpenaiGpt54
5174 | Self::OpenaiGpt54Pro
5175 | Self::OpenaiGpt55
5176 | Self::OpenaiGpt55Pro
5177 | Self::OpenaiGpt56Luna
5178 | Self::OpenaiGpt56LunaPro
5179 | Self::OpenaiGpt56Sol
5180 | Self::OpenaiGpt56SolPro
5181 | Self::OpenaiGpt56Terra
5182 | Self::OpenaiGpt56TerraPro
5183 | Self::XiaomiMimoV25
5184 | Self::XiaomiMimoV25Pro => 1_050_000,
5185 Self::MetaLlamaLlama4Scout => 1_310_720,
5186 Self::OpenrouterAuto | Self::XAiGrok420 => 2_000_000,
5187 }
5188 }
5189 #[allow(clippy::too_many_lines)]
5190 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
5191 match self {
5192 Self::Ai21JambaLarge17
5193 | Self::AmazonNovaLiteV1
5194 | Self::AmazonNovaMicroV1
5195 | Self::AmazonNovaPremierV1
5196 | Self::AmazonNovaProV1
5197 | Self::AnthropicClaude3Haiku
5198 | Self::ArceeAiVirtuosoLarge
5199 | Self::CohereCommandR082024
5200 | Self::CohereCommandRPlus082024
5201 | Self::DeepseekDeepseekChat
5202 | Self::DeepseekDeepseekChatV30324
5203 | Self::GoogleGemma312bIt
5204 | Self::GoogleGemma327bIt
5205 | Self::IbmGraniteGranite418b
5206 | Self::InclusionaiLing261t
5207 | Self::InclusionaiLing26Flash
5208 | Self::KwaipilotKatCoderAirV25
5209 | Self::KwaipilotKatCoderProV2
5210 | Self::KwaipilotKatCoderProV25
5211 | Self::MetaLlamaLlama3170bInstruct
5212 | Self::MetaLlamaLlama318bInstruct
5213 | Self::MetaLlamaLlama3370bInstruct
5214 | Self::MetaLlamaLlama4Maverick
5215 | Self::MetaLlamaLlama4Scout
5216 | Self::MistralaiCodestral2508
5217 | Self::MistralaiDevstral2512
5218 | Self::MistralaiMinistral14b2512
5219 | Self::MistralaiMinistral3b2512
5220 | Self::MistralaiMinistral8b2512
5221 | Self::MistralaiMistralLarge
5222 | Self::MistralaiMistralLarge2407
5223 | Self::MistralaiMistralLarge2512
5224 | Self::MistralaiMistralMedium3
5225 | Self::MistralaiMistralMedium31
5226 | Self::MistralaiMistralNemo
5227 | Self::MistralaiMistralSaba
5228 | Self::MistralaiMistralSmall3224bInstruct
5229 | Self::MistralaiMixtral8x22bInstruct
5230 | Self::MistralaiVoxtralSmall24b2507
5231 | Self::MoonshotaiKimiK2
5232 | Self::MoonshotaiKimiK20905
5233 | Self::OpenaiGpt35Turbo
5234 | Self::OpenaiGpt35Turbo0613
5235 | Self::OpenaiGpt35Turbo16k
5236 | Self::OpenaiGpt4
5237 | Self::OpenaiGpt4Turbo
5238 | Self::OpenaiGpt4TurboPreview
5239 | Self::OpenaiGpt41
5240 | Self::OpenaiGpt41Mini
5241 | Self::OpenaiGpt41Nano
5242 | Self::OpenaiGpt4o
5243 | Self::OpenaiGpt4o20240513
5244 | Self::OpenaiGpt4o20240806
5245 | Self::OpenaiGpt4o20241120
5246 | Self::OpenaiGpt4oMini
5247 | Self::OpenaiGpt4oMini20240718
5248 | Self::OpenaiGpt51Chat
5249 | Self::OpenaiGpt52Chat
5250 | Self::OpenaiGpt53Chat
5251 | Self::OpenaiGptAudio
5252 | Self::OpenaiGptAudioMini
5253 | Self::QwenQwen2572bInstruct
5254 | Self::QwenQwen257bInstruct
5255 | Self::QwenQwenPlus
5256 | Self::QwenQwenPlus20250728
5257 | Self::QwenQwen3235bA22b2507
5258 | Self::QwenQwen330bA3bInstruct2507
5259 | Self::QwenQwen3Coder
5260 | Self::QwenQwen3Coder30bA3bInstruct
5261 | Self::QwenQwen3CoderFlash
5262 | Self::QwenQwen3CoderNext
5263 | Self::QwenQwen3CoderPlus
5264 | Self::QwenQwen3Max
5265 | Self::QwenQwen3Next80bA3bInstruct
5266 | Self::QwenQwen3Vl235bA22bInstruct
5267 | Self::QwenQwen3Vl30bA3bInstruct
5268 | Self::QwenQwen3Vl32bInstruct
5269 | Self::QwenQwen3Vl8bInstruct
5270 | Self::RekaaiRekaEdge
5271 | Self::RelaceRelaceSearch
5272 | Self::Sao10kL31Euryale70b
5273 | Self::ThedrummerUnslopnemo12b => &[],
5274 Self::MistralaiMistralMedium35
5275 | Self::MistralaiMistralSmall2603
5276 | Self::OpenaiGpt5Pro
5277 | Self::OpenaiO3MiniHigh
5278 | Self::OpenaiO4MiniHigh => &[ReasoningEffort::High],
5279 Self::DeepseekDeepseekV4Flash
5280 | Self::DeepseekDeepseekV4Pro
5281 | Self::InclusionaiRing261t
5282 | Self::ZAiGlm52 => &[ReasoningEffort::High, ReasoningEffort::Xhigh],
5283 Self::TencentHy3 | Self::TencentHy3Preview => {
5284 &[ReasoningEffort::Low, ReasoningEffort::High]
5285 }
5286 Self::MoonshotaiKimiK3 => {
5287 &[ReasoningEffort::Low, ReasoningEffort::High, ReasoningEffort::Max]
5288 }
5289 Self::NvidiaNemotron3Super120bA12b
5290 | Self::NvidiaNemotron3Super120bA12bFree => {
5291 &[ReasoningEffort::Low, ReasoningEffort::Medium]
5292 }
5293 Self::AionLabsAion20
5294 | Self::AionLabsAion30
5295 | Self::AionLabsAion30Mini
5296 | Self::AmazonNova2LiteV1
5297 | Self::AnthropicClaudeHaiku45
5298 | Self::AnthropicClaudeOpus4
5299 | Self::AnthropicClaudeOpus41
5300 | Self::AnthropicClaudeOpus45
5301 | Self::AnthropicClaudeSonnet4
5302 | Self::AnthropicClaudeSonnet45
5303 | Self::ArceeAiTrinityLargeThinking
5304 | Self::BytedanceSeedSeed16
5305 | Self::BytedanceSeedSeed16Flash
5306 | Self::CohereNorthMiniCodeFree
5307 | Self::DeepseekDeepseekChatV31
5308 | Self::DeepseekDeepseekR1
5309 | Self::DeepseekDeepseekR10528
5310 | Self::DeepseekDeepseekV31Terminus
5311 | Self::DeepseekDeepseekV32
5312 | Self::DeepseekDeepseekV32Exp
5313 | Self::GoogleGemini25Flash
5314 | Self::GoogleGemini25FlashLite
5315 | Self::GoogleGemini25Pro
5316 | Self::GoogleGemini25ProPreview
5317 | Self::GoogleGemini25ProPreview0506
5318 | Self::GoogleGemini3ProImage
5319 | Self::GoogleGemini31ProPreview
5320 | Self::GoogleGemini31ProPreviewCustomtools
5321 | Self::GoogleGemma426bA4bIt
5322 | Self::GoogleGemma426bA4bItFree
5323 | Self::GoogleGemma431bIt
5324 | Self::GoogleGemma431bItFree
5325 | Self::InceptionMercury2
5326 | Self::InclusionaiLing30FlashFree
5327 | Self::MeituanLongcat20
5328 | Self::MinimaxMinimaxM1
5329 | Self::MinimaxMinimaxM2
5330 | Self::MinimaxMinimaxM21
5331 | Self::MinimaxMinimaxM25
5332 | Self::MinimaxMinimaxM27
5333 | Self::MinimaxMinimaxM3
5334 | Self::MoonshotaiKimiK2Thinking
5335 | Self::MoonshotaiKimiK25
5336 | Self::MoonshotaiKimiK26
5337 | Self::MoonshotaiKimiK27Code
5338 | Self::NexAgiNexN2Mini
5339 | Self::NexAgiNexN2Pro
5340 | Self::NvidiaNemotron3Nano30bA3b
5341 | Self::NvidiaNemotron3Nano30bA3bFree
5342 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
5343 | Self::NvidiaNemotronNano12bV2VlFree
5344 | Self::NvidiaNemotronNano9bV2Free
5345 | Self::OpenaiGpt5Codex
5346 | Self::OpenaiGpt51
5347 | Self::OpenaiGpt51Codex
5348 | Self::OpenaiGpt51CodexMini
5349 | Self::OpenaiGptOss120b
5350 | Self::OpenaiGptOss20b
5351 | Self::OpenaiGptOss20bFree
5352 | Self::OpenaiGptOssSafeguard20b
5353 | Self::OpenaiO1
5354 | Self::OpenaiO3
5355 | Self::OpenaiO3DeepResearch
5356 | Self::OpenaiO3Mini
5357 | Self::OpenaiO3Pro
5358 | Self::OpenaiO4Mini
5359 | Self::OpenaiO4MiniDeepResearch
5360 | Self::OpenrouterAuto
5361 | Self::OpenrouterFree
5362 | Self::PoolsideLagunaM1
5363 | Self::PoolsideLagunaM1Free
5364 | Self::PoolsideLagunaS21
5365 | Self::PoolsideLagunaS21Free
5366 | Self::PoolsideLagunaXs21
5367 | Self::PoolsideLagunaXs21Free
5368 | Self::QwenQwenPlus20250728Thinking
5369 | Self::QwenQwen314b
5370 | Self::QwenQwen3235bA22b
5371 | Self::QwenQwen3235bA22bThinking2507
5372 | Self::QwenQwen330bA3b
5373 | Self::QwenQwen330bA3bThinking2507
5374 | Self::QwenQwen332b
5375 | Self::QwenQwen38b
5376 | Self::QwenQwen3MaxThinking
5377 | Self::QwenQwen3Next80bA3bThinking
5378 | Self::QwenQwen3Vl235bA22bThinking
5379 | Self::QwenQwen3Vl30bA3bThinking
5380 | Self::QwenQwen3Vl8bThinking
5381 | Self::QwenQwen35122bA10b
5382 | Self::QwenQwen3527b
5383 | Self::QwenQwen3535bA3b
5384 | Self::QwenQwen35397bA17b
5385 | Self::QwenQwen359b
5386 | Self::QwenQwen35Flash0223
5387 | Self::QwenQwen35Plus0215
5388 | Self::QwenQwen35Plus20260420
5389 | Self::QwenQwen3627b
5390 | Self::QwenQwen3635bA3b
5391 | Self::QwenQwen36Flash
5392 | Self::QwenQwen36MaxPreview
5393 | Self::QwenQwen36Plus
5394 | Self::QwenQwen37Max
5395 | Self::QwenQwen37Plus
5396 | Self::StepfunStep35Flash
5397 | Self::StepfunStep37Flash
5398 | Self::UpstageSolarPro3
5399 | Self::XAiGrok420
5400 | Self::XAiGrok43
5401 | Self::XAiGrok45
5402 | Self::XAiGrokBuild01
5403 | Self::XiaomiMimoV25
5404 | Self::XiaomiMimoV25Pro
5405 | Self::ZAiGlm45
5406 | Self::ZAiGlm45Air
5407 | Self::ZAiGlm45v
5408 | Self::ZAiGlm46
5409 | Self::ZAiGlm46v
5410 | Self::ZAiGlm47
5411 | Self::ZAiGlm47Flash
5412 | Self::ZAiGlm5
5413 | Self::ZAiGlm5Turbo
5414 | Self::ZAiGlm51
5415 | Self::ZAiGlm5vTurbo => {
5416 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
5417 }
5418 Self::AnthropicClaudeOpus46 | Self::AnthropicClaudeSonnet46 => {
5419 &[
5420 ReasoningEffort::Low,
5421 ReasoningEffort::Medium,
5422 ReasoningEffort::High,
5423 ReasoningEffort::Max,
5424 ]
5425 }
5426 Self::OpenaiGpt51CodexMax
5427 | Self::OpenaiGpt52
5428 | Self::OpenaiGpt52Codex
5429 | Self::OpenaiGpt53Codex
5430 | Self::OpenaiGpt54
5431 | Self::OpenaiGpt54Mini
5432 | Self::OpenaiGpt54Nano
5433 | Self::OpenaiGpt55 => {
5434 &[
5435 ReasoningEffort::Low,
5436 ReasoningEffort::Medium,
5437 ReasoningEffort::High,
5438 ReasoningEffort::Xhigh,
5439 ]
5440 }
5441 Self::AnthropicClaudeFable5
5442 | Self::AnthropicClaudeOpus47
5443 | Self::AnthropicClaudeOpus47Fast
5444 | Self::AnthropicClaudeOpus48
5445 | Self::AnthropicClaudeOpus48Fast
5446 | Self::AnthropicClaudeOpus5
5447 | Self::AnthropicClaudeOpus5Fast
5448 | Self::AnthropicClaudeSonnet5
5449 | Self::OpenaiGpt56Luna
5450 | Self::OpenaiGpt56LunaPro
5451 | Self::OpenaiGpt56Sol
5452 | Self::OpenaiGpt56SolPro
5453 | Self::OpenaiGpt56Terra
5454 | Self::OpenaiGpt56TerraPro => {
5455 &[
5456 ReasoningEffort::Low,
5457 ReasoningEffort::Medium,
5458 ReasoningEffort::High,
5459 ReasoningEffort::Xhigh,
5460 ReasoningEffort::Max,
5461 ]
5462 }
5463 Self::SakanaFuguUltra => {
5464 &[ReasoningEffort::Max, ReasoningEffort::Xhigh, ReasoningEffort::High]
5465 }
5466 Self::NvidiaNemotron3Ultra550bA55b
5467 | Self::NvidiaNemotron3Ultra550bA55bFree => {
5468 &[ReasoningEffort::Medium, ReasoningEffort::High]
5469 }
5470 Self::OpenaiGpt52Pro | Self::OpenaiGpt54Pro | Self::OpenaiGpt55Pro => {
5471 &[ReasoningEffort::Medium, ReasoningEffort::High, ReasoningEffort::Xhigh]
5472 }
5473 Self::BytedanceSeedSeed20Lite
5474 | Self::BytedanceSeedSeed20Mini
5475 | Self::GoogleGemini3FlashPreview
5476 | Self::GoogleGemini31FlashLite
5477 | Self::GoogleGemini31FlashLitePreview
5478 | Self::GoogleGemini35Flash
5479 | Self::GoogleGemini35FlashLite
5480 | Self::GoogleGemini36Flash
5481 | Self::OpenaiGpt5
5482 | Self::OpenaiGpt5Mini
5483 | Self::OpenaiGpt5Nano => {
5484 &[
5485 ReasoningEffort::Minimal,
5486 ReasoningEffort::Low,
5487 ReasoningEffort::Medium,
5488 ReasoningEffort::High,
5489 ]
5490 }
5491 Self::ThinkingmachinesInkling => {
5492 &[
5493 ReasoningEffort::Minimal,
5494 ReasoningEffort::Low,
5495 ReasoningEffort::Medium,
5496 ReasoningEffort::High,
5497 ReasoningEffort::Max,
5498 ]
5499 }
5500 Self::MetaMuseSpark11 => {
5501 &[
5502 ReasoningEffort::Minimal,
5503 ReasoningEffort::Low,
5504 ReasoningEffort::Medium,
5505 ReasoningEffort::High,
5506 ReasoningEffort::Xhigh,
5507 ]
5508 }
5509 }
5510 }
5511 pub fn supports_reasoning(self) -> bool {
5512 !self.reasoning_levels().is_empty()
5513 }
5514 #[allow(clippy::too_many_lines)]
5515 pub fn supports_prompt_caching(self) -> bool {
5516 match self {
5517 Self::Ai21JambaLarge17
5518 | Self::AmazonNova2LiteV1
5519 | Self::AmazonNovaLiteV1
5520 | Self::AmazonNovaMicroV1
5521 | Self::AmazonNovaProV1
5522 | Self::ArceeAiVirtuosoLarge
5523 | Self::BytedanceSeedSeed16
5524 | Self::BytedanceSeedSeed16Flash
5525 | Self::BytedanceSeedSeed20Lite
5526 | Self::BytedanceSeedSeed20Mini
5527 | Self::CohereCommandR082024
5528 | Self::CohereCommandRPlus082024
5529 | Self::CohereNorthMiniCodeFree
5530 | Self::DeepseekDeepseekChat
5531 | Self::DeepseekDeepseekR1
5532 | Self::DeepseekDeepseekV32Exp
5533 | Self::GoogleGemma312bIt
5534 | Self::GoogleGemma426bA4bItFree
5535 | Self::GoogleGemma431bIt
5536 | Self::GoogleGemma431bItFree
5537 | Self::InclusionaiLing30FlashFree
5538 | Self::MetaLlamaLlama3170bInstruct
5539 | Self::MetaLlamaLlama3370bInstruct
5540 | Self::MetaLlamaLlama4Maverick
5541 | Self::MetaLlamaLlama4Scout
5542 | Self::MinimaxMinimaxM1
5543 | Self::MinimaxMinimaxM2
5544 | Self::MistralaiMistralMedium35
5545 | Self::MistralaiMistralNemo
5546 | Self::MoonshotaiKimiK2
5547 | Self::MoonshotaiKimiK20905
5548 | Self::NvidiaNemotron3Nano30bA3b
5549 | Self::NvidiaNemotron3Nano30bA3bFree
5550 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
5551 | Self::NvidiaNemotron3Super120bA12b
5552 | Self::NvidiaNemotron3Super120bA12bFree
5553 | Self::NvidiaNemotron3Ultra550bA55bFree
5554 | Self::NvidiaNemotronNano12bV2VlFree
5555 | Self::NvidiaNemotronNano9bV2Free
5556 | Self::OpenaiGpt35Turbo
5557 | Self::OpenaiGpt35Turbo0613
5558 | Self::OpenaiGpt35Turbo16k
5559 | Self::OpenaiGpt4
5560 | Self::OpenaiGpt4Turbo
5561 | Self::OpenaiGpt4TurboPreview
5562 | Self::OpenaiGpt4o20240513
5563 | Self::OpenaiGpt5Pro
5564 | Self::OpenaiGpt52Pro
5565 | Self::OpenaiGpt54Pro
5566 | Self::OpenaiGpt55Pro
5567 | Self::OpenaiGptAudio
5568 | Self::OpenaiGptAudioMini
5569 | Self::OpenaiGptOss120b
5570 | Self::OpenaiGptOss20b
5571 | Self::OpenaiGptOss20bFree
5572 | Self::OpenaiO3Pro
5573 | Self::OpenrouterAuto
5574 | Self::OpenrouterFree
5575 | Self::PoolsideLagunaM1Free
5576 | Self::PoolsideLagunaS21Free
5577 | Self::PoolsideLagunaXs21Free
5578 | Self::QwenQwen2572bInstruct
5579 | Self::QwenQwen257bInstruct
5580 | Self::QwenQwenPlus20250728
5581 | Self::QwenQwen314b
5582 | Self::QwenQwen3235bA22b
5583 | Self::QwenQwen3235bA22b2507
5584 | Self::QwenQwen3235bA22bThinking2507
5585 | Self::QwenQwen330bA3b
5586 | Self::QwenQwen330bA3bInstruct2507
5587 | Self::QwenQwen330bA3bThinking2507
5588 | Self::QwenQwen332b
5589 | Self::QwenQwen38b
5590 | Self::QwenQwen3Coder30bA3bInstruct
5591 | Self::QwenQwen3MaxThinking
5592 | Self::QwenQwen3Next80bA3bThinking
5593 | Self::QwenQwen3Vl235bA22bThinking
5594 | Self::QwenQwen3Vl30bA3bInstruct
5595 | Self::QwenQwen3Vl30bA3bThinking
5596 | Self::QwenQwen3Vl32bInstruct
5597 | Self::QwenQwen3Vl8bInstruct
5598 | Self::QwenQwen3Vl8bThinking
5599 | Self::QwenQwen35122bA10b
5600 | Self::QwenQwen3527b
5601 | Self::QwenQwen3535bA3b
5602 | Self::QwenQwen35397bA17b
5603 | Self::QwenQwen359b
5604 | Self::QwenQwen35Flash0223
5605 | Self::QwenQwen35Plus0215
5606 | Self::QwenQwen3635bA3b
5607 | Self::RekaaiRekaEdge
5608 | Self::RelaceRelaceSearch
5609 | Self::Sao10kL31Euryale70b
5610 | Self::StepfunStep35Flash
5611 | Self::ThedrummerUnslopnemo12b => false,
5612 Self::AionLabsAion20
5613 | Self::AionLabsAion30
5614 | Self::AionLabsAion30Mini
5615 | Self::AmazonNovaPremierV1
5616 | Self::AnthropicClaude3Haiku
5617 | Self::AnthropicClaudeFable5
5618 | Self::AnthropicClaudeHaiku45
5619 | Self::AnthropicClaudeOpus4
5620 | Self::AnthropicClaudeOpus41
5621 | Self::AnthropicClaudeOpus45
5622 | Self::AnthropicClaudeOpus46
5623 | Self::AnthropicClaudeOpus47
5624 | Self::AnthropicClaudeOpus47Fast
5625 | Self::AnthropicClaudeOpus48
5626 | Self::AnthropicClaudeOpus48Fast
5627 | Self::AnthropicClaudeOpus5
5628 | Self::AnthropicClaudeOpus5Fast
5629 | Self::AnthropicClaudeSonnet4
5630 | Self::AnthropicClaudeSonnet45
5631 | Self::AnthropicClaudeSonnet46
5632 | Self::AnthropicClaudeSonnet5
5633 | Self::ArceeAiTrinityLargeThinking
5634 | Self::DeepseekDeepseekChatV30324
5635 | Self::DeepseekDeepseekChatV31
5636 | Self::DeepseekDeepseekR10528
5637 | Self::DeepseekDeepseekV31Terminus
5638 | Self::DeepseekDeepseekV32
5639 | Self::DeepseekDeepseekV4Flash
5640 | Self::DeepseekDeepseekV4Pro
5641 | Self::GoogleGemini25Flash
5642 | Self::GoogleGemini25FlashLite
5643 | Self::GoogleGemini25Pro
5644 | Self::GoogleGemini25ProPreview
5645 | Self::GoogleGemini25ProPreview0506
5646 | Self::GoogleGemini3FlashPreview
5647 | Self::GoogleGemini3ProImage
5648 | Self::GoogleGemini31FlashLite
5649 | Self::GoogleGemini31FlashLitePreview
5650 | Self::GoogleGemini31ProPreview
5651 | Self::GoogleGemini31ProPreviewCustomtools
5652 | Self::GoogleGemini35Flash
5653 | Self::GoogleGemini35FlashLite
5654 | Self::GoogleGemini36Flash
5655 | Self::GoogleGemma327bIt
5656 | Self::GoogleGemma426bA4bIt
5657 | Self::IbmGraniteGranite418b
5658 | Self::InceptionMercury2
5659 | Self::InclusionaiLing261t
5660 | Self::InclusionaiLing26Flash
5661 | Self::InclusionaiRing261t
5662 | Self::KwaipilotKatCoderAirV25
5663 | Self::KwaipilotKatCoderProV2
5664 | Self::KwaipilotKatCoderProV25
5665 | Self::MeituanLongcat20
5666 | Self::MetaLlamaLlama318bInstruct
5667 | Self::MetaMuseSpark11
5668 | Self::MinimaxMinimaxM21
5669 | Self::MinimaxMinimaxM25
5670 | Self::MinimaxMinimaxM27
5671 | Self::MinimaxMinimaxM3
5672 | Self::MistralaiCodestral2508
5673 | Self::MistralaiDevstral2512
5674 | Self::MistralaiMinistral14b2512
5675 | Self::MistralaiMinistral3b2512
5676 | Self::MistralaiMinistral8b2512
5677 | Self::MistralaiMistralLarge
5678 | Self::MistralaiMistralLarge2407
5679 | Self::MistralaiMistralLarge2512
5680 | Self::MistralaiMistralMedium3
5681 | Self::MistralaiMistralMedium31
5682 | Self::MistralaiMistralSaba
5683 | Self::MistralaiMistralSmall2603
5684 | Self::MistralaiMistralSmall3224bInstruct
5685 | Self::MistralaiMixtral8x22bInstruct
5686 | Self::MistralaiVoxtralSmall24b2507
5687 | Self::MoonshotaiKimiK2Thinking
5688 | Self::MoonshotaiKimiK25
5689 | Self::MoonshotaiKimiK26
5690 | Self::MoonshotaiKimiK27Code
5691 | Self::MoonshotaiKimiK3
5692 | Self::NexAgiNexN2Mini
5693 | Self::NexAgiNexN2Pro
5694 | Self::NvidiaNemotron3Ultra550bA55b
5695 | Self::OpenaiGpt41
5696 | Self::OpenaiGpt41Mini
5697 | Self::OpenaiGpt41Nano
5698 | Self::OpenaiGpt4o
5699 | Self::OpenaiGpt4o20240806
5700 | Self::OpenaiGpt4o20241120
5701 | Self::OpenaiGpt4oMini
5702 | Self::OpenaiGpt4oMini20240718
5703 | Self::OpenaiGpt5
5704 | Self::OpenaiGpt5Codex
5705 | Self::OpenaiGpt5Mini
5706 | Self::OpenaiGpt5Nano
5707 | Self::OpenaiGpt51
5708 | Self::OpenaiGpt51Chat
5709 | Self::OpenaiGpt51Codex
5710 | Self::OpenaiGpt51CodexMax
5711 | Self::OpenaiGpt51CodexMini
5712 | Self::OpenaiGpt52
5713 | Self::OpenaiGpt52Chat
5714 | Self::OpenaiGpt52Codex
5715 | Self::OpenaiGpt53Chat
5716 | Self::OpenaiGpt53Codex
5717 | Self::OpenaiGpt54
5718 | Self::OpenaiGpt54Mini
5719 | Self::OpenaiGpt54Nano
5720 | Self::OpenaiGpt55
5721 | Self::OpenaiGpt56Luna
5722 | Self::OpenaiGpt56LunaPro
5723 | Self::OpenaiGpt56Sol
5724 | Self::OpenaiGpt56SolPro
5725 | Self::OpenaiGpt56Terra
5726 | Self::OpenaiGpt56TerraPro
5727 | Self::OpenaiGptOssSafeguard20b
5728 | Self::OpenaiO1
5729 | Self::OpenaiO3
5730 | Self::OpenaiO3DeepResearch
5731 | Self::OpenaiO3Mini
5732 | Self::OpenaiO3MiniHigh
5733 | Self::OpenaiO4Mini
5734 | Self::OpenaiO4MiniDeepResearch
5735 | Self::OpenaiO4MiniHigh
5736 | Self::PoolsideLagunaM1
5737 | Self::PoolsideLagunaS21
5738 | Self::PoolsideLagunaXs21
5739 | Self::QwenQwenPlus
5740 | Self::QwenQwenPlus20250728Thinking
5741 | Self::QwenQwen3Coder
5742 | Self::QwenQwen3CoderFlash
5743 | Self::QwenQwen3CoderNext
5744 | Self::QwenQwen3CoderPlus
5745 | Self::QwenQwen3Max
5746 | Self::QwenQwen3Next80bA3bInstruct
5747 | Self::QwenQwen3Vl235bA22bInstruct
5748 | Self::QwenQwen35Plus20260420
5749 | Self::QwenQwen3627b
5750 | Self::QwenQwen36Flash
5751 | Self::QwenQwen36MaxPreview
5752 | Self::QwenQwen36Plus
5753 | Self::QwenQwen37Max
5754 | Self::QwenQwen37Plus
5755 | Self::SakanaFuguUltra
5756 | Self::StepfunStep37Flash
5757 | Self::TencentHy3
5758 | Self::TencentHy3Preview
5759 | Self::ThinkingmachinesInkling
5760 | Self::UpstageSolarPro3
5761 | Self::XAiGrok420
5762 | Self::XAiGrok43
5763 | Self::XAiGrok45
5764 | Self::XAiGrokBuild01
5765 | Self::XiaomiMimoV25
5766 | Self::XiaomiMimoV25Pro
5767 | Self::ZAiGlm45
5768 | Self::ZAiGlm45Air
5769 | Self::ZAiGlm45v
5770 | Self::ZAiGlm46
5771 | Self::ZAiGlm46v
5772 | Self::ZAiGlm47
5773 | Self::ZAiGlm47Flash
5774 | Self::ZAiGlm5
5775 | Self::ZAiGlm5Turbo
5776 | Self::ZAiGlm51
5777 | Self::ZAiGlm52
5778 | Self::ZAiGlm5vTurbo => true,
5779 }
5780 }
5781 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
5782 pub fn pricing(self) -> Option<ModelPricing> {
5783 match self {
5784 Self::Ai21JambaLarge17 => {
5785 Some(ModelPricing {
5786 input_per_million: 2f64,
5787 output_per_million: 8f64,
5788 cache_read_per_million: None,
5789 cache_write_per_million: None,
5790 })
5791 }
5792 Self::AionLabsAion20 => {
5793 Some(ModelPricing {
5794 input_per_million: 0.8f64,
5795 output_per_million: 1.6f64,
5796 cache_read_per_million: Some(0.2f64),
5797 cache_write_per_million: None,
5798 })
5799 }
5800 Self::AionLabsAion30 => {
5801 Some(ModelPricing {
5802 input_per_million: 3f64,
5803 output_per_million: 6f64,
5804 cache_read_per_million: Some(0.75f64),
5805 cache_write_per_million: None,
5806 })
5807 }
5808 Self::AionLabsAion30Mini => {
5809 Some(ModelPricing {
5810 input_per_million: 0.7f64,
5811 output_per_million: 1.4f64,
5812 cache_read_per_million: Some(0.18f64),
5813 cache_write_per_million: None,
5814 })
5815 }
5816 Self::AmazonNova2LiteV1 => {
5817 Some(ModelPricing {
5818 input_per_million: 0.3f64,
5819 output_per_million: 2.5f64,
5820 cache_read_per_million: None,
5821 cache_write_per_million: None,
5822 })
5823 }
5824 Self::AmazonNovaLiteV1 => {
5825 Some(ModelPricing {
5826 input_per_million: 0.06f64,
5827 output_per_million: 0.24f64,
5828 cache_read_per_million: None,
5829 cache_write_per_million: None,
5830 })
5831 }
5832 Self::AmazonNovaMicroV1 => {
5833 Some(ModelPricing {
5834 input_per_million: 0.035f64,
5835 output_per_million: 0.14f64,
5836 cache_read_per_million: None,
5837 cache_write_per_million: None,
5838 })
5839 }
5840 Self::AmazonNovaPremierV1 => {
5841 Some(ModelPricing {
5842 input_per_million: 2.5f64,
5843 output_per_million: 12.5f64,
5844 cache_read_per_million: Some(0.625f64),
5845 cache_write_per_million: None,
5846 })
5847 }
5848 Self::AmazonNovaProV1 => {
5849 Some(ModelPricing {
5850 input_per_million: 0.8f64,
5851 output_per_million: 3.2f64,
5852 cache_read_per_million: None,
5853 cache_write_per_million: None,
5854 })
5855 }
5856 Self::AnthropicClaude3Haiku => {
5857 Some(ModelPricing {
5858 input_per_million: 0.25f64,
5859 output_per_million: 1.25f64,
5860 cache_read_per_million: Some(0.03f64),
5861 cache_write_per_million: Some(0.3f64),
5862 })
5863 }
5864 Self::AnthropicClaudeFable5 => {
5865 Some(ModelPricing {
5866 input_per_million: 10f64,
5867 output_per_million: 50f64,
5868 cache_read_per_million: Some(1f64),
5869 cache_write_per_million: Some(12.5f64),
5870 })
5871 }
5872 Self::AnthropicClaudeHaiku45 => {
5873 Some(ModelPricing {
5874 input_per_million: 1f64,
5875 output_per_million: 5f64,
5876 cache_read_per_million: Some(0.1f64),
5877 cache_write_per_million: Some(1.25f64),
5878 })
5879 }
5880 Self::AnthropicClaudeOpus4 => {
5881 Some(ModelPricing {
5882 input_per_million: 15f64,
5883 output_per_million: 75f64,
5884 cache_read_per_million: Some(1.5f64),
5885 cache_write_per_million: Some(18.75f64),
5886 })
5887 }
5888 Self::AnthropicClaudeOpus41 => {
5889 Some(ModelPricing {
5890 input_per_million: 15f64,
5891 output_per_million: 75f64,
5892 cache_read_per_million: Some(1.5f64),
5893 cache_write_per_million: Some(18.75f64),
5894 })
5895 }
5896 Self::AnthropicClaudeOpus45 => {
5897 Some(ModelPricing {
5898 input_per_million: 5f64,
5899 output_per_million: 25f64,
5900 cache_read_per_million: Some(0.5f64),
5901 cache_write_per_million: Some(6.25f64),
5902 })
5903 }
5904 Self::AnthropicClaudeOpus46 => {
5905 Some(ModelPricing {
5906 input_per_million: 5f64,
5907 output_per_million: 25f64,
5908 cache_read_per_million: Some(0.5f64),
5909 cache_write_per_million: Some(6.25f64),
5910 })
5911 }
5912 Self::AnthropicClaudeOpus47 => {
5913 Some(ModelPricing {
5914 input_per_million: 5f64,
5915 output_per_million: 25f64,
5916 cache_read_per_million: Some(0.5f64),
5917 cache_write_per_million: Some(6.25f64),
5918 })
5919 }
5920 Self::AnthropicClaudeOpus47Fast => {
5921 Some(ModelPricing {
5922 input_per_million: 30f64,
5923 output_per_million: 150f64,
5924 cache_read_per_million: Some(3f64),
5925 cache_write_per_million: Some(37.5f64),
5926 })
5927 }
5928 Self::AnthropicClaudeOpus48 => {
5929 Some(ModelPricing {
5930 input_per_million: 5f64,
5931 output_per_million: 25f64,
5932 cache_read_per_million: Some(0.5f64),
5933 cache_write_per_million: Some(6.25f64),
5934 })
5935 }
5936 Self::AnthropicClaudeOpus48Fast => {
5937 Some(ModelPricing {
5938 input_per_million: 10f64,
5939 output_per_million: 50f64,
5940 cache_read_per_million: Some(1f64),
5941 cache_write_per_million: Some(12.5f64),
5942 })
5943 }
5944 Self::AnthropicClaudeOpus5 => {
5945 Some(ModelPricing {
5946 input_per_million: 5f64,
5947 output_per_million: 25f64,
5948 cache_read_per_million: Some(0.5f64),
5949 cache_write_per_million: Some(6.25f64),
5950 })
5951 }
5952 Self::AnthropicClaudeOpus5Fast => {
5953 Some(ModelPricing {
5954 input_per_million: 10f64,
5955 output_per_million: 50f64,
5956 cache_read_per_million: Some(1f64),
5957 cache_write_per_million: Some(12.5f64),
5958 })
5959 }
5960 Self::AnthropicClaudeSonnet4 => {
5961 Some(ModelPricing {
5962 input_per_million: 3f64,
5963 output_per_million: 15f64,
5964 cache_read_per_million: Some(0.3f64),
5965 cache_write_per_million: Some(3.75f64),
5966 })
5967 }
5968 Self::AnthropicClaudeSonnet45 => {
5969 Some(ModelPricing {
5970 input_per_million: 3f64,
5971 output_per_million: 15f64,
5972 cache_read_per_million: Some(0.3f64),
5973 cache_write_per_million: Some(3.75f64),
5974 })
5975 }
5976 Self::AnthropicClaudeSonnet46 => {
5977 Some(ModelPricing {
5978 input_per_million: 3f64,
5979 output_per_million: 15f64,
5980 cache_read_per_million: Some(0.3f64),
5981 cache_write_per_million: Some(3.75f64),
5982 })
5983 }
5984 Self::AnthropicClaudeSonnet5 => {
5985 Some(ModelPricing {
5986 input_per_million: 2f64,
5987 output_per_million: 10f64,
5988 cache_read_per_million: Some(0.2f64),
5989 cache_write_per_million: Some(2.5f64),
5990 })
5991 }
5992 Self::ArceeAiTrinityLargeThinking => {
5993 Some(ModelPricing {
5994 input_per_million: 0.22f64,
5995 output_per_million: 0.85f64,
5996 cache_read_per_million: Some(0.06f64),
5997 cache_write_per_million: None,
5998 })
5999 }
6000 Self::ArceeAiVirtuosoLarge => {
6001 Some(ModelPricing {
6002 input_per_million: 0.75f64,
6003 output_per_million: 1.2f64,
6004 cache_read_per_million: None,
6005 cache_write_per_million: None,
6006 })
6007 }
6008 Self::BytedanceSeedSeed16 => {
6009 Some(ModelPricing {
6010 input_per_million: 0.25f64,
6011 output_per_million: 2f64,
6012 cache_read_per_million: None,
6013 cache_write_per_million: None,
6014 })
6015 }
6016 Self::BytedanceSeedSeed16Flash => {
6017 Some(ModelPricing {
6018 input_per_million: 0.075f64,
6019 output_per_million: 0.3f64,
6020 cache_read_per_million: None,
6021 cache_write_per_million: None,
6022 })
6023 }
6024 Self::BytedanceSeedSeed20Lite => {
6025 Some(ModelPricing {
6026 input_per_million: 0.25f64,
6027 output_per_million: 2f64,
6028 cache_read_per_million: None,
6029 cache_write_per_million: None,
6030 })
6031 }
6032 Self::BytedanceSeedSeed20Mini => {
6033 Some(ModelPricing {
6034 input_per_million: 0.1f64,
6035 output_per_million: 0.4f64,
6036 cache_read_per_million: None,
6037 cache_write_per_million: None,
6038 })
6039 }
6040 Self::CohereCommandR082024 => {
6041 Some(ModelPricing {
6042 input_per_million: 0.15f64,
6043 output_per_million: 0.6f64,
6044 cache_read_per_million: None,
6045 cache_write_per_million: None,
6046 })
6047 }
6048 Self::CohereCommandRPlus082024 => {
6049 Some(ModelPricing {
6050 input_per_million: 2.5f64,
6051 output_per_million: 10f64,
6052 cache_read_per_million: None,
6053 cache_write_per_million: None,
6054 })
6055 }
6056 Self::CohereNorthMiniCodeFree => {
6057 Some(ModelPricing {
6058 input_per_million: 0f64,
6059 output_per_million: 0f64,
6060 cache_read_per_million: None,
6061 cache_write_per_million: None,
6062 })
6063 }
6064 Self::DeepseekDeepseekChat => {
6065 Some(ModelPricing {
6066 input_per_million: 0.2002f64,
6067 output_per_million: 0.8001f64,
6068 cache_read_per_million: None,
6069 cache_write_per_million: None,
6070 })
6071 }
6072 Self::DeepseekDeepseekChatV30324 => {
6073 Some(ModelPricing {
6074 input_per_million: 0.27f64,
6075 output_per_million: 1.12f64,
6076 cache_read_per_million: Some(0.135f64),
6077 cache_write_per_million: None,
6078 })
6079 }
6080 Self::DeepseekDeepseekChatV31 => {
6081 Some(ModelPricing {
6082 input_per_million: 0.25f64,
6083 output_per_million: 0.95f64,
6084 cache_read_per_million: Some(0.13f64),
6085 cache_write_per_million: None,
6086 })
6087 }
6088 Self::DeepseekDeepseekR1 => {
6089 Some(ModelPricing {
6090 input_per_million: 0.7f64,
6091 output_per_million: 2.5f64,
6092 cache_read_per_million: None,
6093 cache_write_per_million: None,
6094 })
6095 }
6096 Self::DeepseekDeepseekR10528 => {
6097 Some(ModelPricing {
6098 input_per_million: 0.5f64,
6099 output_per_million: 2.15f64,
6100 cache_read_per_million: Some(0.35f64),
6101 cache_write_per_million: None,
6102 })
6103 }
6104 Self::DeepseekDeepseekV31Terminus => {
6105 Some(ModelPricing {
6106 input_per_million: 0.27f64,
6107 output_per_million: 1f64,
6108 cache_read_per_million: Some(0.135f64),
6109 cache_write_per_million: None,
6110 })
6111 }
6112 Self::DeepseekDeepseekV32 => {
6113 Some(ModelPricing {
6114 input_per_million: 0.269f64,
6115 output_per_million: 0.4f64,
6116 cache_read_per_million: Some(0.1345f64),
6117 cache_write_per_million: None,
6118 })
6119 }
6120 Self::DeepseekDeepseekV32Exp => {
6121 Some(ModelPricing {
6122 input_per_million: 0.27f64,
6123 output_per_million: 0.41f64,
6124 cache_read_per_million: None,
6125 cache_write_per_million: None,
6126 })
6127 }
6128 Self::DeepseekDeepseekV4Flash => {
6129 Some(ModelPricing {
6130 input_per_million: 0.14f64,
6131 output_per_million: 0.28f64,
6132 cache_read_per_million: Some(0.028f64),
6133 cache_write_per_million: None,
6134 })
6135 }
6136 Self::DeepseekDeepseekV4Pro => {
6137 Some(ModelPricing {
6138 input_per_million: 0.435f64,
6139 output_per_million: 0.87f64,
6140 cache_read_per_million: Some(0.003625f64),
6141 cache_write_per_million: None,
6142 })
6143 }
6144 Self::GoogleGemini25Flash => {
6145 Some(ModelPricing {
6146 input_per_million: 0.3f64,
6147 output_per_million: 2.5f64,
6148 cache_read_per_million: Some(0.03f64),
6149 cache_write_per_million: Some(0.083333f64),
6150 })
6151 }
6152 Self::GoogleGemini25FlashLite => {
6153 Some(ModelPricing {
6154 input_per_million: 0.1f64,
6155 output_per_million: 0.4f64,
6156 cache_read_per_million: Some(0.01f64),
6157 cache_write_per_million: Some(0.083333f64),
6158 })
6159 }
6160 Self::GoogleGemini25Pro => {
6161 Some(ModelPricing {
6162 input_per_million: 1.25f64,
6163 output_per_million: 10f64,
6164 cache_read_per_million: Some(0.125f64),
6165 cache_write_per_million: Some(0.375f64),
6166 })
6167 }
6168 Self::GoogleGemini25ProPreview => {
6169 Some(ModelPricing {
6170 input_per_million: 1.25f64,
6171 output_per_million: 10f64,
6172 cache_read_per_million: Some(0.125f64),
6173 cache_write_per_million: Some(0.375f64),
6174 })
6175 }
6176 Self::GoogleGemini25ProPreview0506 => {
6177 Some(ModelPricing {
6178 input_per_million: 1.25f64,
6179 output_per_million: 10f64,
6180 cache_read_per_million: Some(0.125f64),
6181 cache_write_per_million: Some(0.375f64),
6182 })
6183 }
6184 Self::GoogleGemini3FlashPreview => {
6185 Some(ModelPricing {
6186 input_per_million: 0.5f64,
6187 output_per_million: 3f64,
6188 cache_read_per_million: Some(0.05f64),
6189 cache_write_per_million: Some(0.083333f64),
6190 })
6191 }
6192 Self::GoogleGemini3ProImage => {
6193 Some(ModelPricing {
6194 input_per_million: 2f64,
6195 output_per_million: 12f64,
6196 cache_read_per_million: Some(0.2f64),
6197 cache_write_per_million: Some(0.375f64),
6198 })
6199 }
6200 Self::GoogleGemini31FlashLite => {
6201 Some(ModelPricing {
6202 input_per_million: 0.25f64,
6203 output_per_million: 1.5f64,
6204 cache_read_per_million: Some(0.025f64),
6205 cache_write_per_million: Some(0.083333f64),
6206 })
6207 }
6208 Self::GoogleGemini31FlashLitePreview => {
6209 Some(ModelPricing {
6210 input_per_million: 0.25f64,
6211 output_per_million: 1.5f64,
6212 cache_read_per_million: Some(0.025f64),
6213 cache_write_per_million: Some(0.083333f64),
6214 })
6215 }
6216 Self::GoogleGemini31ProPreview => {
6217 Some(ModelPricing {
6218 input_per_million: 2f64,
6219 output_per_million: 12f64,
6220 cache_read_per_million: Some(0.2f64),
6221 cache_write_per_million: Some(0.375f64),
6222 })
6223 }
6224 Self::GoogleGemini31ProPreviewCustomtools => {
6225 Some(ModelPricing {
6226 input_per_million: 2f64,
6227 output_per_million: 12f64,
6228 cache_read_per_million: Some(0.2f64),
6229 cache_write_per_million: Some(0.375f64),
6230 })
6231 }
6232 Self::GoogleGemini35Flash => {
6233 Some(ModelPricing {
6234 input_per_million: 1.5f64,
6235 output_per_million: 9f64,
6236 cache_read_per_million: Some(0.15f64),
6237 cache_write_per_million: Some(0.083333f64),
6238 })
6239 }
6240 Self::GoogleGemini35FlashLite => {
6241 Some(ModelPricing {
6242 input_per_million: 0.3f64,
6243 output_per_million: 2.5f64,
6244 cache_read_per_million: Some(0.03f64),
6245 cache_write_per_million: Some(0.083333f64),
6246 })
6247 }
6248 Self::GoogleGemini36Flash => {
6249 Some(ModelPricing {
6250 input_per_million: 1.5f64,
6251 output_per_million: 7.5f64,
6252 cache_read_per_million: Some(0.15f64),
6253 cache_write_per_million: Some(0.083333f64),
6254 })
6255 }
6256 Self::GoogleGemma312bIt => {
6257 Some(ModelPricing {
6258 input_per_million: 0.05f64,
6259 output_per_million: 0.15f64,
6260 cache_read_per_million: None,
6261 cache_write_per_million: None,
6262 })
6263 }
6264 Self::GoogleGemma327bIt => {
6265 Some(ModelPricing {
6266 input_per_million: 0.08f64,
6267 output_per_million: 0.45f64,
6268 cache_read_per_million: Some(0.04f64),
6269 cache_write_per_million: None,
6270 })
6271 }
6272 Self::GoogleGemma426bA4bIt => {
6273 Some(ModelPricing {
6274 input_per_million: 0.12f64,
6275 output_per_million: 0.35f64,
6276 cache_read_per_million: Some(0.05f64),
6277 cache_write_per_million: None,
6278 })
6279 }
6280 Self::GoogleGemma426bA4bItFree => {
6281 Some(ModelPricing {
6282 input_per_million: 0f64,
6283 output_per_million: 0f64,
6284 cache_read_per_million: None,
6285 cache_write_per_million: None,
6286 })
6287 }
6288 Self::GoogleGemma431bIt => {
6289 Some(ModelPricing {
6290 input_per_million: 0.14f64,
6291 output_per_million: 0.4f64,
6292 cache_read_per_million: None,
6293 cache_write_per_million: None,
6294 })
6295 }
6296 Self::GoogleGemma431bItFree => {
6297 Some(ModelPricing {
6298 input_per_million: 0f64,
6299 output_per_million: 0f64,
6300 cache_read_per_million: None,
6301 cache_write_per_million: None,
6302 })
6303 }
6304 Self::IbmGraniteGranite418b => {
6305 Some(ModelPricing {
6306 input_per_million: 0.05f64,
6307 output_per_million: 0.1f64,
6308 cache_read_per_million: Some(0.05f64),
6309 cache_write_per_million: None,
6310 })
6311 }
6312 Self::InceptionMercury2 => {
6313 Some(ModelPricing {
6314 input_per_million: 0.25f64,
6315 output_per_million: 0.75f64,
6316 cache_read_per_million: Some(0.025f64),
6317 cache_write_per_million: None,
6318 })
6319 }
6320 Self::InclusionaiLing261t => {
6321 Some(ModelPricing {
6322 input_per_million: 0.075f64,
6323 output_per_million: 0.625f64,
6324 cache_read_per_million: Some(0.015f64),
6325 cache_write_per_million: None,
6326 })
6327 }
6328 Self::InclusionaiLing26Flash => {
6329 Some(ModelPricing {
6330 input_per_million: 0.01f64,
6331 output_per_million: 0.03f64,
6332 cache_read_per_million: Some(0.002f64),
6333 cache_write_per_million: None,
6334 })
6335 }
6336 Self::InclusionaiLing30FlashFree => {
6337 Some(ModelPricing {
6338 input_per_million: 0f64,
6339 output_per_million: 0f64,
6340 cache_read_per_million: None,
6341 cache_write_per_million: None,
6342 })
6343 }
6344 Self::InclusionaiRing261t => {
6345 Some(ModelPricing {
6346 input_per_million: 0.075f64,
6347 output_per_million: 0.625f64,
6348 cache_read_per_million: Some(0.015f64),
6349 cache_write_per_million: None,
6350 })
6351 }
6352 Self::KwaipilotKatCoderAirV25 => {
6353 Some(ModelPricing {
6354 input_per_million: 0.15f64,
6355 output_per_million: 0.6f64,
6356 cache_read_per_million: Some(0.03f64),
6357 cache_write_per_million: None,
6358 })
6359 }
6360 Self::KwaipilotKatCoderProV2 => {
6361 Some(ModelPricing {
6362 input_per_million: 0.3f64,
6363 output_per_million: 1.2f64,
6364 cache_read_per_million: Some(0.06f64),
6365 cache_write_per_million: None,
6366 })
6367 }
6368 Self::KwaipilotKatCoderProV25 => {
6369 Some(ModelPricing {
6370 input_per_million: 0.74f64,
6371 output_per_million: 2.96f64,
6372 cache_read_per_million: Some(0.15f64),
6373 cache_write_per_million: None,
6374 })
6375 }
6376 Self::MeituanLongcat20 => {
6377 Some(ModelPricing {
6378 input_per_million: 0.3f64,
6379 output_per_million: 1.2f64,
6380 cache_read_per_million: Some(0.006f64),
6381 cache_write_per_million: None,
6382 })
6383 }
6384 Self::MetaLlamaLlama3170bInstruct => {
6385 Some(ModelPricing {
6386 input_per_million: 0.4f64,
6387 output_per_million: 0.4f64,
6388 cache_read_per_million: None,
6389 cache_write_per_million: None,
6390 })
6391 }
6392 Self::MetaLlamaLlama318bInstruct => {
6393 Some(ModelPricing {
6394 input_per_million: 0.05f64,
6395 output_per_million: 0.08f64,
6396 cache_read_per_million: Some(0.025f64),
6397 cache_write_per_million: None,
6398 })
6399 }
6400 Self::MetaLlamaLlama3370bInstruct => {
6401 Some(ModelPricing {
6402 input_per_million: 0.13f64,
6403 output_per_million: 0.4f64,
6404 cache_read_per_million: None,
6405 cache_write_per_million: None,
6406 })
6407 }
6408 Self::MetaLlamaLlama4Maverick => {
6409 Some(ModelPricing {
6410 input_per_million: 0.2f64,
6411 output_per_million: 0.8f64,
6412 cache_read_per_million: None,
6413 cache_write_per_million: None,
6414 })
6415 }
6416 Self::MetaLlamaLlama4Scout => {
6417 Some(ModelPricing {
6418 input_per_million: 0.1f64,
6419 output_per_million: 0.3f64,
6420 cache_read_per_million: None,
6421 cache_write_per_million: None,
6422 })
6423 }
6424 Self::MetaMuseSpark11 => {
6425 Some(ModelPricing {
6426 input_per_million: 1.25f64,
6427 output_per_million: 4.25f64,
6428 cache_read_per_million: Some(0.15f64),
6429 cache_write_per_million: None,
6430 })
6431 }
6432 Self::MinimaxMinimaxM1 => {
6433 Some(ModelPricing {
6434 input_per_million: 0.55f64,
6435 output_per_million: 2.2f64,
6436 cache_read_per_million: None,
6437 cache_write_per_million: None,
6438 })
6439 }
6440 Self::MinimaxMinimaxM2 => {
6441 Some(ModelPricing {
6442 input_per_million: 0.255f64,
6443 output_per_million: 1.02f64,
6444 cache_read_per_million: None,
6445 cache_write_per_million: None,
6446 })
6447 }
6448 Self::MinimaxMinimaxM21 => {
6449 Some(ModelPricing {
6450 input_per_million: 0.3f64,
6451 output_per_million: 1.2f64,
6452 cache_read_per_million: Some(0.03f64),
6453 cache_write_per_million: None,
6454 })
6455 }
6456 Self::MinimaxMinimaxM25 => {
6457 Some(ModelPricing {
6458 input_per_million: 0.15f64,
6459 output_per_million: 0.9f64,
6460 cache_read_per_million: Some(0.05f64),
6461 cache_write_per_million: None,
6462 })
6463 }
6464 Self::MinimaxMinimaxM27 => {
6465 Some(ModelPricing {
6466 input_per_million: 0.25f64,
6467 output_per_million: 1f64,
6468 cache_read_per_million: Some(0.05f64),
6469 cache_write_per_million: None,
6470 })
6471 }
6472 Self::MinimaxMinimaxM3 => {
6473 Some(ModelPricing {
6474 input_per_million: 0.3f64,
6475 output_per_million: 1.2f64,
6476 cache_read_per_million: Some(0.06f64),
6477 cache_write_per_million: None,
6478 })
6479 }
6480 Self::MistralaiCodestral2508 => {
6481 Some(ModelPricing {
6482 input_per_million: 0.3f64,
6483 output_per_million: 0.9f64,
6484 cache_read_per_million: Some(0.03f64),
6485 cache_write_per_million: None,
6486 })
6487 }
6488 Self::MistralaiDevstral2512 => {
6489 Some(ModelPricing {
6490 input_per_million: 0.4f64,
6491 output_per_million: 2f64,
6492 cache_read_per_million: Some(0.04f64),
6493 cache_write_per_million: None,
6494 })
6495 }
6496 Self::MistralaiMinistral14b2512 => {
6497 Some(ModelPricing {
6498 input_per_million: 0.2f64,
6499 output_per_million: 0.2f64,
6500 cache_read_per_million: Some(0.02f64),
6501 cache_write_per_million: None,
6502 })
6503 }
6504 Self::MistralaiMinistral3b2512 => {
6505 Some(ModelPricing {
6506 input_per_million: 0.1f64,
6507 output_per_million: 0.1f64,
6508 cache_read_per_million: Some(0.01f64),
6509 cache_write_per_million: None,
6510 })
6511 }
6512 Self::MistralaiMinistral8b2512 => {
6513 Some(ModelPricing {
6514 input_per_million: 0.15f64,
6515 output_per_million: 0.15f64,
6516 cache_read_per_million: Some(0.015f64),
6517 cache_write_per_million: None,
6518 })
6519 }
6520 Self::MistralaiMistralLarge => {
6521 Some(ModelPricing {
6522 input_per_million: 2f64,
6523 output_per_million: 6f64,
6524 cache_read_per_million: Some(0.2f64),
6525 cache_write_per_million: None,
6526 })
6527 }
6528 Self::MistralaiMistralLarge2407 => {
6529 Some(ModelPricing {
6530 input_per_million: 2f64,
6531 output_per_million: 6f64,
6532 cache_read_per_million: Some(0.2f64),
6533 cache_write_per_million: None,
6534 })
6535 }
6536 Self::MistralaiMistralLarge2512 => {
6537 Some(ModelPricing {
6538 input_per_million: 0.5f64,
6539 output_per_million: 1.5f64,
6540 cache_read_per_million: Some(0.05f64),
6541 cache_write_per_million: None,
6542 })
6543 }
6544 Self::MistralaiMistralMedium3 => {
6545 Some(ModelPricing {
6546 input_per_million: 0.4f64,
6547 output_per_million: 2f64,
6548 cache_read_per_million: Some(0.04f64),
6549 cache_write_per_million: None,
6550 })
6551 }
6552 Self::MistralaiMistralMedium35 => {
6553 Some(ModelPricing {
6554 input_per_million: 1.5f64,
6555 output_per_million: 7.5f64,
6556 cache_read_per_million: None,
6557 cache_write_per_million: None,
6558 })
6559 }
6560 Self::MistralaiMistralMedium31 => {
6561 Some(ModelPricing {
6562 input_per_million: 0.4f64,
6563 output_per_million: 2f64,
6564 cache_read_per_million: Some(0.04f64),
6565 cache_write_per_million: None,
6566 })
6567 }
6568 Self::MistralaiMistralNemo => {
6569 Some(ModelPricing {
6570 input_per_million: 0.019f64,
6571 output_per_million: 0.03f64,
6572 cache_read_per_million: None,
6573 cache_write_per_million: None,
6574 })
6575 }
6576 Self::MistralaiMistralSaba => {
6577 Some(ModelPricing {
6578 input_per_million: 0.2f64,
6579 output_per_million: 0.6f64,
6580 cache_read_per_million: Some(0.02f64),
6581 cache_write_per_million: None,
6582 })
6583 }
6584 Self::MistralaiMistralSmall2603 => {
6585 Some(ModelPricing {
6586 input_per_million: 0.15f64,
6587 output_per_million: 0.6f64,
6588 cache_read_per_million: Some(0.015f64),
6589 cache_write_per_million: None,
6590 })
6591 }
6592 Self::MistralaiMistralSmall3224bInstruct => {
6593 Some(ModelPricing {
6594 input_per_million: 0.1f64,
6595 output_per_million: 0.3f64,
6596 cache_read_per_million: Some(0.01f64),
6597 cache_write_per_million: None,
6598 })
6599 }
6600 Self::MistralaiMixtral8x22bInstruct => {
6601 Some(ModelPricing {
6602 input_per_million: 2f64,
6603 output_per_million: 6f64,
6604 cache_read_per_million: Some(0.2f64),
6605 cache_write_per_million: None,
6606 })
6607 }
6608 Self::MistralaiVoxtralSmall24b2507 => {
6609 Some(ModelPricing {
6610 input_per_million: 0.1f64,
6611 output_per_million: 0.3f64,
6612 cache_read_per_million: Some(0.01f64),
6613 cache_write_per_million: None,
6614 })
6615 }
6616 Self::MoonshotaiKimiK2 => {
6617 Some(ModelPricing {
6618 input_per_million: 0.57f64,
6619 output_per_million: 2.3f64,
6620 cache_read_per_million: None,
6621 cache_write_per_million: None,
6622 })
6623 }
6624 Self::MoonshotaiKimiK20905 => {
6625 Some(ModelPricing {
6626 input_per_million: 0.6f64,
6627 output_per_million: 2.5f64,
6628 cache_read_per_million: None,
6629 cache_write_per_million: None,
6630 })
6631 }
6632 Self::MoonshotaiKimiK2Thinking => {
6633 Some(ModelPricing {
6634 input_per_million: 0.6f64,
6635 output_per_million: 2.5f64,
6636 cache_read_per_million: Some(0.15f64),
6637 cache_write_per_million: None,
6638 })
6639 }
6640 Self::MoonshotaiKimiK25 => {
6641 Some(ModelPricing {
6642 input_per_million: 0.57f64,
6643 output_per_million: 2.85f64,
6644 cache_read_per_million: Some(0.095f64),
6645 cache_write_per_million: None,
6646 })
6647 }
6648 Self::MoonshotaiKimiK26 => {
6649 Some(ModelPricing {
6650 input_per_million: 0.646f64,
6651 output_per_million: 2.72f64,
6652 cache_read_per_million: Some(0.1088f64),
6653 cache_write_per_million: None,
6654 })
6655 }
6656 Self::MoonshotaiKimiK27Code => {
6657 Some(ModelPricing {
6658 input_per_million: 0.73f64,
6659 output_per_million: 3.5f64,
6660 cache_read_per_million: Some(0.15f64),
6661 cache_write_per_million: None,
6662 })
6663 }
6664 Self::MoonshotaiKimiK3 => {
6665 Some(ModelPricing {
6666 input_per_million: 3f64,
6667 output_per_million: 15f64,
6668 cache_read_per_million: Some(0.3f64),
6669 cache_write_per_million: None,
6670 })
6671 }
6672 Self::NexAgiNexN2Mini => {
6673 Some(ModelPricing {
6674 input_per_million: 0.025f64,
6675 output_per_million: 0.1f64,
6676 cache_read_per_million: Some(0.0025f64),
6677 cache_write_per_million: None,
6678 })
6679 }
6680 Self::NexAgiNexN2Pro => {
6681 Some(ModelPricing {
6682 input_per_million: 0.25f64,
6683 output_per_million: 1f64,
6684 cache_read_per_million: Some(0.025f64),
6685 cache_write_per_million: None,
6686 })
6687 }
6688 Self::NvidiaNemotron3Nano30bA3b => {
6689 Some(ModelPricing {
6690 input_per_million: 0.05f64,
6691 output_per_million: 0.2f64,
6692 cache_read_per_million: None,
6693 cache_write_per_million: None,
6694 })
6695 }
6696 Self::NvidiaNemotron3Nano30bA3bFree => {
6697 Some(ModelPricing {
6698 input_per_million: 0f64,
6699 output_per_million: 0f64,
6700 cache_read_per_million: None,
6701 cache_write_per_million: None,
6702 })
6703 }
6704 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree => {
6705 Some(ModelPricing {
6706 input_per_million: 0f64,
6707 output_per_million: 0f64,
6708 cache_read_per_million: None,
6709 cache_write_per_million: None,
6710 })
6711 }
6712 Self::NvidiaNemotron3Super120bA12b => {
6713 Some(ModelPricing {
6714 input_per_million: 0.085f64,
6715 output_per_million: 0.4f64,
6716 cache_read_per_million: None,
6717 cache_write_per_million: None,
6718 })
6719 }
6720 Self::NvidiaNemotron3Super120bA12bFree => {
6721 Some(ModelPricing {
6722 input_per_million: 0f64,
6723 output_per_million: 0f64,
6724 cache_read_per_million: None,
6725 cache_write_per_million: None,
6726 })
6727 }
6728 Self::NvidiaNemotron3Ultra550bA55b => {
6729 Some(ModelPricing {
6730 input_per_million: 0.6f64,
6731 output_per_million: 3.6f64,
6732 cache_read_per_million: Some(0.2f64),
6733 cache_write_per_million: None,
6734 })
6735 }
6736 Self::NvidiaNemotron3Ultra550bA55bFree => {
6737 Some(ModelPricing {
6738 input_per_million: 0f64,
6739 output_per_million: 0f64,
6740 cache_read_per_million: None,
6741 cache_write_per_million: None,
6742 })
6743 }
6744 Self::NvidiaNemotronNano12bV2VlFree => {
6745 Some(ModelPricing {
6746 input_per_million: 0f64,
6747 output_per_million: 0f64,
6748 cache_read_per_million: None,
6749 cache_write_per_million: None,
6750 })
6751 }
6752 Self::NvidiaNemotronNano9bV2Free => {
6753 Some(ModelPricing {
6754 input_per_million: 0f64,
6755 output_per_million: 0f64,
6756 cache_read_per_million: None,
6757 cache_write_per_million: None,
6758 })
6759 }
6760 Self::OpenaiGpt35Turbo => {
6761 Some(ModelPricing {
6762 input_per_million: 0.5f64,
6763 output_per_million: 1.5f64,
6764 cache_read_per_million: None,
6765 cache_write_per_million: None,
6766 })
6767 }
6768 Self::OpenaiGpt35Turbo0613 => {
6769 Some(ModelPricing {
6770 input_per_million: 1f64,
6771 output_per_million: 2f64,
6772 cache_read_per_million: None,
6773 cache_write_per_million: None,
6774 })
6775 }
6776 Self::OpenaiGpt35Turbo16k => {
6777 Some(ModelPricing {
6778 input_per_million: 3f64,
6779 output_per_million: 4f64,
6780 cache_read_per_million: None,
6781 cache_write_per_million: None,
6782 })
6783 }
6784 Self::OpenaiGpt4 => {
6785 Some(ModelPricing {
6786 input_per_million: 30f64,
6787 output_per_million: 60f64,
6788 cache_read_per_million: None,
6789 cache_write_per_million: None,
6790 })
6791 }
6792 Self::OpenaiGpt4Turbo => {
6793 Some(ModelPricing {
6794 input_per_million: 10f64,
6795 output_per_million: 30f64,
6796 cache_read_per_million: None,
6797 cache_write_per_million: None,
6798 })
6799 }
6800 Self::OpenaiGpt4TurboPreview => {
6801 Some(ModelPricing {
6802 input_per_million: 10f64,
6803 output_per_million: 30f64,
6804 cache_read_per_million: None,
6805 cache_write_per_million: None,
6806 })
6807 }
6808 Self::OpenaiGpt41 => {
6809 Some(ModelPricing {
6810 input_per_million: 2f64,
6811 output_per_million: 8f64,
6812 cache_read_per_million: Some(0.5f64),
6813 cache_write_per_million: None,
6814 })
6815 }
6816 Self::OpenaiGpt41Mini => {
6817 Some(ModelPricing {
6818 input_per_million: 0.4f64,
6819 output_per_million: 1.6f64,
6820 cache_read_per_million: Some(0.1f64),
6821 cache_write_per_million: None,
6822 })
6823 }
6824 Self::OpenaiGpt41Nano => {
6825 Some(ModelPricing {
6826 input_per_million: 0.1f64,
6827 output_per_million: 0.4f64,
6828 cache_read_per_million: Some(0.025f64),
6829 cache_write_per_million: None,
6830 })
6831 }
6832 Self::OpenaiGpt4o => {
6833 Some(ModelPricing {
6834 input_per_million: 2.5f64,
6835 output_per_million: 10f64,
6836 cache_read_per_million: Some(1.25f64),
6837 cache_write_per_million: None,
6838 })
6839 }
6840 Self::OpenaiGpt4o20240513 => {
6841 Some(ModelPricing {
6842 input_per_million: 5f64,
6843 output_per_million: 15f64,
6844 cache_read_per_million: None,
6845 cache_write_per_million: None,
6846 })
6847 }
6848 Self::OpenaiGpt4o20240806 => {
6849 Some(ModelPricing {
6850 input_per_million: 2.5f64,
6851 output_per_million: 10f64,
6852 cache_read_per_million: Some(1.25f64),
6853 cache_write_per_million: None,
6854 })
6855 }
6856 Self::OpenaiGpt4o20241120 => {
6857 Some(ModelPricing {
6858 input_per_million: 2.5f64,
6859 output_per_million: 10f64,
6860 cache_read_per_million: Some(1.25f64),
6861 cache_write_per_million: None,
6862 })
6863 }
6864 Self::OpenaiGpt4oMini => {
6865 Some(ModelPricing {
6866 input_per_million: 0.15f64,
6867 output_per_million: 0.6f64,
6868 cache_read_per_million: Some(0.075f64),
6869 cache_write_per_million: None,
6870 })
6871 }
6872 Self::OpenaiGpt4oMini20240718 => {
6873 Some(ModelPricing {
6874 input_per_million: 0.15f64,
6875 output_per_million: 0.6f64,
6876 cache_read_per_million: Some(0.075f64),
6877 cache_write_per_million: None,
6878 })
6879 }
6880 Self::OpenaiGpt5 => {
6881 Some(ModelPricing {
6882 input_per_million: 1.25f64,
6883 output_per_million: 10f64,
6884 cache_read_per_million: Some(0.125f64),
6885 cache_write_per_million: None,
6886 })
6887 }
6888 Self::OpenaiGpt5Codex => {
6889 Some(ModelPricing {
6890 input_per_million: 1.25f64,
6891 output_per_million: 10f64,
6892 cache_read_per_million: Some(0.125f64),
6893 cache_write_per_million: None,
6894 })
6895 }
6896 Self::OpenaiGpt5Mini => {
6897 Some(ModelPricing {
6898 input_per_million: 0.25f64,
6899 output_per_million: 2f64,
6900 cache_read_per_million: Some(0.025f64),
6901 cache_write_per_million: None,
6902 })
6903 }
6904 Self::OpenaiGpt5Nano => {
6905 Some(ModelPricing {
6906 input_per_million: 0.05f64,
6907 output_per_million: 0.4f64,
6908 cache_read_per_million: Some(0.005f64),
6909 cache_write_per_million: None,
6910 })
6911 }
6912 Self::OpenaiGpt5Pro => {
6913 Some(ModelPricing {
6914 input_per_million: 15f64,
6915 output_per_million: 120f64,
6916 cache_read_per_million: None,
6917 cache_write_per_million: None,
6918 })
6919 }
6920 Self::OpenaiGpt51 => {
6921 Some(ModelPricing {
6922 input_per_million: 1.25f64,
6923 output_per_million: 10f64,
6924 cache_read_per_million: Some(0.125f64),
6925 cache_write_per_million: None,
6926 })
6927 }
6928 Self::OpenaiGpt51Chat => {
6929 Some(ModelPricing {
6930 input_per_million: 1.25f64,
6931 output_per_million: 10f64,
6932 cache_read_per_million: Some(0.125f64),
6933 cache_write_per_million: None,
6934 })
6935 }
6936 Self::OpenaiGpt51Codex => {
6937 Some(ModelPricing {
6938 input_per_million: 1.25f64,
6939 output_per_million: 10f64,
6940 cache_read_per_million: Some(0.13f64),
6941 cache_write_per_million: None,
6942 })
6943 }
6944 Self::OpenaiGpt51CodexMax => {
6945 Some(ModelPricing {
6946 input_per_million: 1.25f64,
6947 output_per_million: 10f64,
6948 cache_read_per_million: Some(0.125f64),
6949 cache_write_per_million: None,
6950 })
6951 }
6952 Self::OpenaiGpt51CodexMini => {
6953 Some(ModelPricing {
6954 input_per_million: 0.25f64,
6955 output_per_million: 2f64,
6956 cache_read_per_million: Some(0.03f64),
6957 cache_write_per_million: None,
6958 })
6959 }
6960 Self::OpenaiGpt52 => {
6961 Some(ModelPricing {
6962 input_per_million: 1.75f64,
6963 output_per_million: 14f64,
6964 cache_read_per_million: Some(0.175f64),
6965 cache_write_per_million: None,
6966 })
6967 }
6968 Self::OpenaiGpt52Chat => {
6969 Some(ModelPricing {
6970 input_per_million: 1.75f64,
6971 output_per_million: 14f64,
6972 cache_read_per_million: Some(0.175f64),
6973 cache_write_per_million: None,
6974 })
6975 }
6976 Self::OpenaiGpt52Codex => {
6977 Some(ModelPricing {
6978 input_per_million: 1.75f64,
6979 output_per_million: 14f64,
6980 cache_read_per_million: Some(0.175f64),
6981 cache_write_per_million: None,
6982 })
6983 }
6984 Self::OpenaiGpt52Pro => {
6985 Some(ModelPricing {
6986 input_per_million: 21f64,
6987 output_per_million: 168f64,
6988 cache_read_per_million: None,
6989 cache_write_per_million: None,
6990 })
6991 }
6992 Self::OpenaiGpt53Chat => {
6993 Some(ModelPricing {
6994 input_per_million: 1.75f64,
6995 output_per_million: 14f64,
6996 cache_read_per_million: Some(0.175f64),
6997 cache_write_per_million: None,
6998 })
6999 }
7000 Self::OpenaiGpt53Codex => {
7001 Some(ModelPricing {
7002 input_per_million: 1.75f64,
7003 output_per_million: 14f64,
7004 cache_read_per_million: Some(0.175f64),
7005 cache_write_per_million: None,
7006 })
7007 }
7008 Self::OpenaiGpt54 => {
7009 Some(ModelPricing {
7010 input_per_million: 2.5f64,
7011 output_per_million: 15f64,
7012 cache_read_per_million: Some(0.25f64),
7013 cache_write_per_million: None,
7014 })
7015 }
7016 Self::OpenaiGpt54Mini => {
7017 Some(ModelPricing {
7018 input_per_million: 0.75f64,
7019 output_per_million: 4.5f64,
7020 cache_read_per_million: Some(0.075f64),
7021 cache_write_per_million: None,
7022 })
7023 }
7024 Self::OpenaiGpt54Nano => {
7025 Some(ModelPricing {
7026 input_per_million: 0.2f64,
7027 output_per_million: 1.25f64,
7028 cache_read_per_million: Some(0.02f64),
7029 cache_write_per_million: None,
7030 })
7031 }
7032 Self::OpenaiGpt54Pro => {
7033 Some(ModelPricing {
7034 input_per_million: 30f64,
7035 output_per_million: 180f64,
7036 cache_read_per_million: None,
7037 cache_write_per_million: None,
7038 })
7039 }
7040 Self::OpenaiGpt55 => {
7041 Some(ModelPricing {
7042 input_per_million: 5f64,
7043 output_per_million: 30f64,
7044 cache_read_per_million: Some(0.5f64),
7045 cache_write_per_million: None,
7046 })
7047 }
7048 Self::OpenaiGpt55Pro => {
7049 Some(ModelPricing {
7050 input_per_million: 30f64,
7051 output_per_million: 180f64,
7052 cache_read_per_million: None,
7053 cache_write_per_million: None,
7054 })
7055 }
7056 Self::OpenaiGpt56Luna => {
7057 Some(ModelPricing {
7058 input_per_million: 1f64,
7059 output_per_million: 6f64,
7060 cache_read_per_million: Some(0.1f64),
7061 cache_write_per_million: Some(1.25f64),
7062 })
7063 }
7064 Self::OpenaiGpt56LunaPro => {
7065 Some(ModelPricing {
7066 input_per_million: 1f64,
7067 output_per_million: 6f64,
7068 cache_read_per_million: Some(0.1f64),
7069 cache_write_per_million: Some(1.25f64),
7070 })
7071 }
7072 Self::OpenaiGpt56Sol => {
7073 Some(ModelPricing {
7074 input_per_million: 5f64,
7075 output_per_million: 30f64,
7076 cache_read_per_million: Some(0.5f64),
7077 cache_write_per_million: Some(6.25f64),
7078 })
7079 }
7080 Self::OpenaiGpt56SolPro => {
7081 Some(ModelPricing {
7082 input_per_million: 5f64,
7083 output_per_million: 30f64,
7084 cache_read_per_million: Some(0.5f64),
7085 cache_write_per_million: Some(6.25f64),
7086 })
7087 }
7088 Self::OpenaiGpt56Terra => {
7089 Some(ModelPricing {
7090 input_per_million: 2.5f64,
7091 output_per_million: 15f64,
7092 cache_read_per_million: Some(0.25f64),
7093 cache_write_per_million: Some(3.125f64),
7094 })
7095 }
7096 Self::OpenaiGpt56TerraPro => {
7097 Some(ModelPricing {
7098 input_per_million: 2.5f64,
7099 output_per_million: 15f64,
7100 cache_read_per_million: Some(0.25f64),
7101 cache_write_per_million: Some(3.125f64),
7102 })
7103 }
7104 Self::OpenaiGptAudio => {
7105 Some(ModelPricing {
7106 input_per_million: 2.5f64,
7107 output_per_million: 10f64,
7108 cache_read_per_million: None,
7109 cache_write_per_million: None,
7110 })
7111 }
7112 Self::OpenaiGptAudioMini => {
7113 Some(ModelPricing {
7114 input_per_million: 0.6f64,
7115 output_per_million: 2.4f64,
7116 cache_read_per_million: None,
7117 cache_write_per_million: None,
7118 })
7119 }
7120 Self::OpenaiGptOss120b => {
7121 Some(ModelPricing {
7122 input_per_million: 0.037f64,
7123 output_per_million: 0.17f64,
7124 cache_read_per_million: None,
7125 cache_write_per_million: None,
7126 })
7127 }
7128 Self::OpenaiGptOss20b => {
7129 Some(ModelPricing {
7130 input_per_million: 0.03f64,
7131 output_per_million: 0.14f64,
7132 cache_read_per_million: None,
7133 cache_write_per_million: None,
7134 })
7135 }
7136 Self::OpenaiGptOss20bFree => {
7137 Some(ModelPricing {
7138 input_per_million: 0f64,
7139 output_per_million: 0f64,
7140 cache_read_per_million: None,
7141 cache_write_per_million: None,
7142 })
7143 }
7144 Self::OpenaiGptOssSafeguard20b => {
7145 Some(ModelPricing {
7146 input_per_million: 0.075f64,
7147 output_per_million: 0.3f64,
7148 cache_read_per_million: Some(0.0375f64),
7149 cache_write_per_million: None,
7150 })
7151 }
7152 Self::OpenaiO1 => {
7153 Some(ModelPricing {
7154 input_per_million: 15f64,
7155 output_per_million: 60f64,
7156 cache_read_per_million: Some(7.5f64),
7157 cache_write_per_million: None,
7158 })
7159 }
7160 Self::OpenaiO3 => {
7161 Some(ModelPricing {
7162 input_per_million: 2f64,
7163 output_per_million: 8f64,
7164 cache_read_per_million: Some(0.5f64),
7165 cache_write_per_million: None,
7166 })
7167 }
7168 Self::OpenaiO3DeepResearch => {
7169 Some(ModelPricing {
7170 input_per_million: 10f64,
7171 output_per_million: 40f64,
7172 cache_read_per_million: Some(2.5f64),
7173 cache_write_per_million: None,
7174 })
7175 }
7176 Self::OpenaiO3Mini => {
7177 Some(ModelPricing {
7178 input_per_million: 1.1f64,
7179 output_per_million: 4.4f64,
7180 cache_read_per_million: Some(0.55f64),
7181 cache_write_per_million: None,
7182 })
7183 }
7184 Self::OpenaiO3MiniHigh => {
7185 Some(ModelPricing {
7186 input_per_million: 1.1f64,
7187 output_per_million: 4.4f64,
7188 cache_read_per_million: Some(0.55f64),
7189 cache_write_per_million: None,
7190 })
7191 }
7192 Self::OpenaiO3Pro => {
7193 Some(ModelPricing {
7194 input_per_million: 20f64,
7195 output_per_million: 80f64,
7196 cache_read_per_million: None,
7197 cache_write_per_million: None,
7198 })
7199 }
7200 Self::OpenaiO4Mini => {
7201 Some(ModelPricing {
7202 input_per_million: 1.1f64,
7203 output_per_million: 4.4f64,
7204 cache_read_per_million: Some(0.275f64),
7205 cache_write_per_million: None,
7206 })
7207 }
7208 Self::OpenaiO4MiniDeepResearch => {
7209 Some(ModelPricing {
7210 input_per_million: 2f64,
7211 output_per_million: 8f64,
7212 cache_read_per_million: Some(0.5f64),
7213 cache_write_per_million: None,
7214 })
7215 }
7216 Self::OpenaiO4MiniHigh => {
7217 Some(ModelPricing {
7218 input_per_million: 1.1f64,
7219 output_per_million: 4.4f64,
7220 cache_read_per_million: Some(0.275f64),
7221 cache_write_per_million: None,
7222 })
7223 }
7224 Self::OpenrouterAuto => None,
7225 Self::OpenrouterFree => {
7226 Some(ModelPricing {
7227 input_per_million: 0f64,
7228 output_per_million: 0f64,
7229 cache_read_per_million: None,
7230 cache_write_per_million: None,
7231 })
7232 }
7233 Self::PoolsideLagunaM1 => {
7234 Some(ModelPricing {
7235 input_per_million: 0.2f64,
7236 output_per_million: 0.4f64,
7237 cache_read_per_million: Some(0.1f64),
7238 cache_write_per_million: None,
7239 })
7240 }
7241 Self::PoolsideLagunaM1Free => {
7242 Some(ModelPricing {
7243 input_per_million: 0f64,
7244 output_per_million: 0f64,
7245 cache_read_per_million: None,
7246 cache_write_per_million: None,
7247 })
7248 }
7249 Self::PoolsideLagunaS21 => {
7250 Some(ModelPricing {
7251 input_per_million: 0.1f64,
7252 output_per_million: 0.2f64,
7253 cache_read_per_million: Some(0.01f64),
7254 cache_write_per_million: None,
7255 })
7256 }
7257 Self::PoolsideLagunaS21Free => {
7258 Some(ModelPricing {
7259 input_per_million: 0f64,
7260 output_per_million: 0f64,
7261 cache_read_per_million: None,
7262 cache_write_per_million: None,
7263 })
7264 }
7265 Self::PoolsideLagunaXs21 => {
7266 Some(ModelPricing {
7267 input_per_million: 0.06f64,
7268 output_per_million: 0.12f64,
7269 cache_read_per_million: Some(0.03f64),
7270 cache_write_per_million: None,
7271 })
7272 }
7273 Self::PoolsideLagunaXs21Free => {
7274 Some(ModelPricing {
7275 input_per_million: 0f64,
7276 output_per_million: 0f64,
7277 cache_read_per_million: None,
7278 cache_write_per_million: None,
7279 })
7280 }
7281 Self::QwenQwen2572bInstruct => {
7282 Some(ModelPricing {
7283 input_per_million: 0.36f64,
7284 output_per_million: 0.4f64,
7285 cache_read_per_million: None,
7286 cache_write_per_million: None,
7287 })
7288 }
7289 Self::QwenQwen257bInstruct => {
7290 Some(ModelPricing {
7291 input_per_million: 0.04f64,
7292 output_per_million: 0.1f64,
7293 cache_read_per_million: None,
7294 cache_write_per_million: None,
7295 })
7296 }
7297 Self::QwenQwenPlus => {
7298 Some(ModelPricing {
7299 input_per_million: 0.26f64,
7300 output_per_million: 0.78f64,
7301 cache_read_per_million: Some(0.052f64),
7302 cache_write_per_million: Some(0.325f64),
7303 })
7304 }
7305 Self::QwenQwenPlus20250728 => {
7306 Some(ModelPricing {
7307 input_per_million: 0.26f64,
7308 output_per_million: 0.78f64,
7309 cache_read_per_million: None,
7310 cache_write_per_million: None,
7311 })
7312 }
7313 Self::QwenQwenPlus20250728Thinking => {
7314 Some(ModelPricing {
7315 input_per_million: 0.26f64,
7316 output_per_million: 0.78f64,
7317 cache_read_per_million: None,
7318 cache_write_per_million: Some(0.325f64),
7319 })
7320 }
7321 Self::QwenQwen314b => {
7322 Some(ModelPricing {
7323 input_per_million: 0.2275f64,
7324 output_per_million: 0.91f64,
7325 cache_read_per_million: None,
7326 cache_write_per_million: None,
7327 })
7328 }
7329 Self::QwenQwen3235bA22b => {
7330 Some(ModelPricing {
7331 input_per_million: 0.455f64,
7332 output_per_million: 1.82f64,
7333 cache_read_per_million: None,
7334 cache_write_per_million: None,
7335 })
7336 }
7337 Self::QwenQwen3235bA22b2507 => {
7338 Some(ModelPricing {
7339 input_per_million: 0.09f64,
7340 output_per_million: 0.55f64,
7341 cache_read_per_million: None,
7342 cache_write_per_million: None,
7343 })
7344 }
7345 Self::QwenQwen3235bA22bThinking2507 => {
7346 Some(ModelPricing {
7347 input_per_million: 0.3f64,
7348 output_per_million: 3f64,
7349 cache_read_per_million: None,
7350 cache_write_per_million: None,
7351 })
7352 }
7353 Self::QwenQwen330bA3b => {
7354 Some(ModelPricing {
7355 input_per_million: 0.12f64,
7356 output_per_million: 0.5f64,
7357 cache_read_per_million: None,
7358 cache_write_per_million: None,
7359 })
7360 }
7361 Self::QwenQwen330bA3bInstruct2507 => {
7362 Some(ModelPricing {
7363 input_per_million: 0.04815f64,
7364 output_per_million: 0.19305f64,
7365 cache_read_per_million: None,
7366 cache_write_per_million: None,
7367 })
7368 }
7369 Self::QwenQwen330bA3bThinking2507 => {
7370 Some(ModelPricing {
7371 input_per_million: 0.13f64,
7372 output_per_million: 1.56f64,
7373 cache_read_per_million: None,
7374 cache_write_per_million: None,
7375 })
7376 }
7377 Self::QwenQwen332b => {
7378 Some(ModelPricing {
7379 input_per_million: 0.08f64,
7380 output_per_million: 0.28f64,
7381 cache_read_per_million: None,
7382 cache_write_per_million: None,
7383 })
7384 }
7385 Self::QwenQwen38b => {
7386 Some(ModelPricing {
7387 input_per_million: 0.117f64,
7388 output_per_million: 0.455f64,
7389 cache_read_per_million: None,
7390 cache_write_per_million: None,
7391 })
7392 }
7393 Self::QwenQwen3Coder => {
7394 Some(ModelPricing {
7395 input_per_million: 0.3f64,
7396 output_per_million: 1f64,
7397 cache_read_per_million: Some(0.1f64),
7398 cache_write_per_million: None,
7399 })
7400 }
7401 Self::QwenQwen3Coder30bA3bInstruct => {
7402 Some(ModelPricing {
7403 input_per_million: 0.07f64,
7404 output_per_million: 0.27f64,
7405 cache_read_per_million: None,
7406 cache_write_per_million: None,
7407 })
7408 }
7409 Self::QwenQwen3CoderFlash => {
7410 Some(ModelPricing {
7411 input_per_million: 0.195f64,
7412 output_per_million: 0.975f64,
7413 cache_read_per_million: Some(0.039f64),
7414 cache_write_per_million: Some(0.24375f64),
7415 })
7416 }
7417 Self::QwenQwen3CoderNext => {
7418 Some(ModelPricing {
7419 input_per_million: 0.11f64,
7420 output_per_million: 0.8f64,
7421 cache_read_per_million: Some(0.07f64),
7422 cache_write_per_million: None,
7423 })
7424 }
7425 Self::QwenQwen3CoderPlus => {
7426 Some(ModelPricing {
7427 input_per_million: 0.65f64,
7428 output_per_million: 3.25f64,
7429 cache_read_per_million: Some(0.13f64),
7430 cache_write_per_million: Some(0.8125f64),
7431 })
7432 }
7433 Self::QwenQwen3Max => {
7434 Some(ModelPricing {
7435 input_per_million: 0.78f64,
7436 output_per_million: 3.9f64,
7437 cache_read_per_million: Some(0.156f64),
7438 cache_write_per_million: Some(0.975f64),
7439 })
7440 }
7441 Self::QwenQwen3MaxThinking => {
7442 Some(ModelPricing {
7443 input_per_million: 0.78f64,
7444 output_per_million: 3.9f64,
7445 cache_read_per_million: None,
7446 cache_write_per_million: None,
7447 })
7448 }
7449 Self::QwenQwen3Next80bA3bInstruct => {
7450 Some(ModelPricing {
7451 input_per_million: 0.1f64,
7452 output_per_million: 1.1f64,
7453 cache_read_per_million: Some(0.07f64),
7454 cache_write_per_million: None,
7455 })
7456 }
7457 Self::QwenQwen3Next80bA3bThinking => {
7458 Some(ModelPricing {
7459 input_per_million: 0.0975f64,
7460 output_per_million: 0.78f64,
7461 cache_read_per_million: None,
7462 cache_write_per_million: None,
7463 })
7464 }
7465 Self::QwenQwen3Vl235bA22bInstruct => {
7466 Some(ModelPricing {
7467 input_per_million: 0.21f64,
7468 output_per_million: 1.9f64,
7469 cache_read_per_million: Some(0.1f64),
7470 cache_write_per_million: None,
7471 })
7472 }
7473 Self::QwenQwen3Vl235bA22bThinking => {
7474 Some(ModelPricing {
7475 input_per_million: 0.26f64,
7476 output_per_million: 2.6f64,
7477 cache_read_per_million: None,
7478 cache_write_per_million: None,
7479 })
7480 }
7481 Self::QwenQwen3Vl30bA3bInstruct => {
7482 Some(ModelPricing {
7483 input_per_million: 0.15f64,
7484 output_per_million: 0.6f64,
7485 cache_read_per_million: None,
7486 cache_write_per_million: None,
7487 })
7488 }
7489 Self::QwenQwen3Vl30bA3bThinking => {
7490 Some(ModelPricing {
7491 input_per_million: 0.13f64,
7492 output_per_million: 1.56f64,
7493 cache_read_per_million: None,
7494 cache_write_per_million: None,
7495 })
7496 }
7497 Self::QwenQwen3Vl32bInstruct => {
7498 Some(ModelPricing {
7499 input_per_million: 0.104f64,
7500 output_per_million: 0.416f64,
7501 cache_read_per_million: None,
7502 cache_write_per_million: None,
7503 })
7504 }
7505 Self::QwenQwen3Vl8bInstruct => {
7506 Some(ModelPricing {
7507 input_per_million: 0.117f64,
7508 output_per_million: 0.455f64,
7509 cache_read_per_million: None,
7510 cache_write_per_million: None,
7511 })
7512 }
7513 Self::QwenQwen3Vl8bThinking => {
7514 Some(ModelPricing {
7515 input_per_million: 0.117f64,
7516 output_per_million: 1.365f64,
7517 cache_read_per_million: None,
7518 cache_write_per_million: None,
7519 })
7520 }
7521 Self::QwenQwen35122bA10b => {
7522 Some(ModelPricing {
7523 input_per_million: 0.26f64,
7524 output_per_million: 2.08f64,
7525 cache_read_per_million: None,
7526 cache_write_per_million: None,
7527 })
7528 }
7529 Self::QwenQwen3527b => {
7530 Some(ModelPricing {
7531 input_per_million: 0.195f64,
7532 output_per_million: 1.56f64,
7533 cache_read_per_million: None,
7534 cache_write_per_million: None,
7535 })
7536 }
7537 Self::QwenQwen3535bA3b => {
7538 Some(ModelPricing {
7539 input_per_million: 0.14f64,
7540 output_per_million: 1f64,
7541 cache_read_per_million: None,
7542 cache_write_per_million: None,
7543 })
7544 }
7545 Self::QwenQwen35397bA17b => {
7546 Some(ModelPricing {
7547 input_per_million: 0.39f64,
7548 output_per_million: 2.34f64,
7549 cache_read_per_million: None,
7550 cache_write_per_million: None,
7551 })
7552 }
7553 Self::QwenQwen359b => {
7554 Some(ModelPricing {
7555 input_per_million: 0.1f64,
7556 output_per_million: 0.15f64,
7557 cache_read_per_million: None,
7558 cache_write_per_million: None,
7559 })
7560 }
7561 Self::QwenQwen35Flash0223 => {
7562 Some(ModelPricing {
7563 input_per_million: 0.065f64,
7564 output_per_million: 0.26f64,
7565 cache_read_per_million: None,
7566 cache_write_per_million: None,
7567 })
7568 }
7569 Self::QwenQwen35Plus0215 => {
7570 Some(ModelPricing {
7571 input_per_million: 0.26f64,
7572 output_per_million: 1.56f64,
7573 cache_read_per_million: None,
7574 cache_write_per_million: None,
7575 })
7576 }
7577 Self::QwenQwen35Plus20260420 => {
7578 Some(ModelPricing {
7579 input_per_million: 0.3f64,
7580 output_per_million: 1.8f64,
7581 cache_read_per_million: None,
7582 cache_write_per_million: Some(0.375f64),
7583 })
7584 }
7585 Self::QwenQwen3627b => {
7586 Some(ModelPricing {
7587 input_per_million: 0.3f64,
7588 output_per_million: 2f64,
7589 cache_read_per_million: Some(0.15f64),
7590 cache_write_per_million: None,
7591 })
7592 }
7593 Self::QwenQwen3635bA3b => {
7594 Some(ModelPricing {
7595 input_per_million: 0.14f64,
7596 output_per_million: 1f64,
7597 cache_read_per_million: None,
7598 cache_write_per_million: None,
7599 })
7600 }
7601 Self::QwenQwen36Flash => {
7602 Some(ModelPricing {
7603 input_per_million: 0.1875f64,
7604 output_per_million: 1.125f64,
7605 cache_read_per_million: None,
7606 cache_write_per_million: Some(0.234375f64),
7607 })
7608 }
7609 Self::QwenQwen36MaxPreview => {
7610 Some(ModelPricing {
7611 input_per_million: 1.04f64,
7612 output_per_million: 6.24f64,
7613 cache_read_per_million: None,
7614 cache_write_per_million: Some(1.3f64),
7615 })
7616 }
7617 Self::QwenQwen36Plus => {
7618 Some(ModelPricing {
7619 input_per_million: 0.325f64,
7620 output_per_million: 1.95f64,
7621 cache_read_per_million: None,
7622 cache_write_per_million: Some(0.40625f64),
7623 })
7624 }
7625 Self::QwenQwen37Max => {
7626 Some(ModelPricing {
7627 input_per_million: 1.475f64,
7628 output_per_million: 4.425f64,
7629 cache_read_per_million: Some(0.295f64),
7630 cache_write_per_million: Some(1.84375f64),
7631 })
7632 }
7633 Self::QwenQwen37Plus => {
7634 Some(ModelPricing {
7635 input_per_million: 0.32f64,
7636 output_per_million: 1.28f64,
7637 cache_read_per_million: Some(0.064f64),
7638 cache_write_per_million: Some(0.4f64),
7639 })
7640 }
7641 Self::RekaaiRekaEdge => {
7642 Some(ModelPricing {
7643 input_per_million: 0.1f64,
7644 output_per_million: 0.1f64,
7645 cache_read_per_million: None,
7646 cache_write_per_million: None,
7647 })
7648 }
7649 Self::RelaceRelaceSearch => {
7650 Some(ModelPricing {
7651 input_per_million: 1f64,
7652 output_per_million: 3f64,
7653 cache_read_per_million: None,
7654 cache_write_per_million: None,
7655 })
7656 }
7657 Self::SakanaFuguUltra => {
7658 Some(ModelPricing {
7659 input_per_million: 5f64,
7660 output_per_million: 30f64,
7661 cache_read_per_million: Some(0.5f64),
7662 cache_write_per_million: None,
7663 })
7664 }
7665 Self::Sao10kL31Euryale70b => {
7666 Some(ModelPricing {
7667 input_per_million: 0.85f64,
7668 output_per_million: 0.85f64,
7669 cache_read_per_million: None,
7670 cache_write_per_million: None,
7671 })
7672 }
7673 Self::StepfunStep35Flash => {
7674 Some(ModelPricing {
7675 input_per_million: 0.1f64,
7676 output_per_million: 0.3f64,
7677 cache_read_per_million: None,
7678 cache_write_per_million: None,
7679 })
7680 }
7681 Self::StepfunStep37Flash => {
7682 Some(ModelPricing {
7683 input_per_million: 0.2f64,
7684 output_per_million: 1.15f64,
7685 cache_read_per_million: Some(0.04f64),
7686 cache_write_per_million: None,
7687 })
7688 }
7689 Self::TencentHy3 => {
7690 Some(ModelPricing {
7691 input_per_million: 0.132f64,
7692 output_per_million: 0.528f64,
7693 cache_read_per_million: Some(0.033f64),
7694 cache_write_per_million: None,
7695 })
7696 }
7697 Self::TencentHy3Preview => {
7698 Some(ModelPricing {
7699 input_per_million: 0.063f64,
7700 output_per_million: 0.21f64,
7701 cache_read_per_million: Some(0.021f64),
7702 cache_write_per_million: None,
7703 })
7704 }
7705 Self::ThedrummerUnslopnemo12b => {
7706 Some(ModelPricing {
7707 input_per_million: 0.4f64,
7708 output_per_million: 0.4f64,
7709 cache_read_per_million: None,
7710 cache_write_per_million: None,
7711 })
7712 }
7713 Self::ThinkingmachinesInkling => {
7714 Some(ModelPricing {
7715 input_per_million: 1f64,
7716 output_per_million: 4.05f64,
7717 cache_read_per_million: Some(0.17f64),
7718 cache_write_per_million: None,
7719 })
7720 }
7721 Self::UpstageSolarPro3 => {
7722 Some(ModelPricing {
7723 input_per_million: 0.15f64,
7724 output_per_million: 0.6f64,
7725 cache_read_per_million: Some(0.015f64),
7726 cache_write_per_million: None,
7727 })
7728 }
7729 Self::XAiGrok420 => {
7730 Some(ModelPricing {
7731 input_per_million: 1.25f64,
7732 output_per_million: 2.5f64,
7733 cache_read_per_million: Some(0.2f64),
7734 cache_write_per_million: None,
7735 })
7736 }
7737 Self::XAiGrok43 => {
7738 Some(ModelPricing {
7739 input_per_million: 1.25f64,
7740 output_per_million: 2.5f64,
7741 cache_read_per_million: Some(0.2f64),
7742 cache_write_per_million: None,
7743 })
7744 }
7745 Self::XAiGrok45 => {
7746 Some(ModelPricing {
7747 input_per_million: 2f64,
7748 output_per_million: 6f64,
7749 cache_read_per_million: Some(0.3f64),
7750 cache_write_per_million: None,
7751 })
7752 }
7753 Self::XAiGrokBuild01 => {
7754 Some(ModelPricing {
7755 input_per_million: 1f64,
7756 output_per_million: 2f64,
7757 cache_read_per_million: Some(0.2f64),
7758 cache_write_per_million: None,
7759 })
7760 }
7761 Self::XiaomiMimoV25 => {
7762 Some(ModelPricing {
7763 input_per_million: 0.14f64,
7764 output_per_million: 0.28f64,
7765 cache_read_per_million: Some(0.0028f64),
7766 cache_write_per_million: None,
7767 })
7768 }
7769 Self::XiaomiMimoV25Pro => {
7770 Some(ModelPricing {
7771 input_per_million: 0.435f64,
7772 output_per_million: 0.87f64,
7773 cache_read_per_million: Some(0.0036f64),
7774 cache_write_per_million: None,
7775 })
7776 }
7777 Self::ZAiGlm45 => {
7778 Some(ModelPricing {
7779 input_per_million: 0.6f64,
7780 output_per_million: 2.2f64,
7781 cache_read_per_million: Some(0.11f64),
7782 cache_write_per_million: None,
7783 })
7784 }
7785 Self::ZAiGlm45Air => {
7786 Some(ModelPricing {
7787 input_per_million: 0.13f64,
7788 output_per_million: 0.85f64,
7789 cache_read_per_million: Some(0.025f64),
7790 cache_write_per_million: None,
7791 })
7792 }
7793 Self::ZAiGlm45v => {
7794 Some(ModelPricing {
7795 input_per_million: 0.6f64,
7796 output_per_million: 1.8f64,
7797 cache_read_per_million: Some(0.11f64),
7798 cache_write_per_million: None,
7799 })
7800 }
7801 Self::ZAiGlm46 => {
7802 Some(ModelPricing {
7803 input_per_million: 0.5f64,
7804 output_per_million: 2f64,
7805 cache_read_per_million: Some(0.1f64),
7806 cache_write_per_million: None,
7807 })
7808 }
7809 Self::ZAiGlm46v => {
7810 Some(ModelPricing {
7811 input_per_million: 0.3f64,
7812 output_per_million: 0.9f64,
7813 cache_read_per_million: Some(0.055f64),
7814 cache_write_per_million: None,
7815 })
7816 }
7817 Self::ZAiGlm47 => {
7818 Some(ModelPricing {
7819 input_per_million: 0.4f64,
7820 output_per_million: 1.75f64,
7821 cache_read_per_million: Some(0.08f64),
7822 cache_write_per_million: None,
7823 })
7824 }
7825 Self::ZAiGlm47Flash => {
7826 Some(ModelPricing {
7827 input_per_million: 0.06f64,
7828 output_per_million: 0.4f64,
7829 cache_read_per_million: Some(0.01f64),
7830 cache_write_per_million: None,
7831 })
7832 }
7833 Self::ZAiGlm5 => {
7834 Some(ModelPricing {
7835 input_per_million: 0.95f64,
7836 output_per_million: 2.55f64,
7837 cache_read_per_million: Some(0.2f64),
7838 cache_write_per_million: None,
7839 })
7840 }
7841 Self::ZAiGlm5Turbo => {
7842 Some(ModelPricing {
7843 input_per_million: 1.2f64,
7844 output_per_million: 4f64,
7845 cache_read_per_million: Some(0.24f64),
7846 cache_write_per_million: None,
7847 })
7848 }
7849 Self::ZAiGlm51 => {
7850 Some(ModelPricing {
7851 input_per_million: 0.966f64,
7852 output_per_million: 3.036f64,
7853 cache_read_per_million: Some(0.1794f64),
7854 cache_write_per_million: None,
7855 })
7856 }
7857 Self::ZAiGlm52 => {
7858 Some(ModelPricing {
7859 input_per_million: 0.6692f64,
7860 output_per_million: 2.1032f64,
7861 cache_read_per_million: Some(0.12428f64),
7862 cache_write_per_million: None,
7863 })
7864 }
7865 Self::ZAiGlm5vTurbo => {
7866 Some(ModelPricing {
7867 input_per_million: 1.2f64,
7868 output_per_million: 4f64,
7869 cache_read_per_million: Some(0.24f64),
7870 cache_write_per_million: None,
7871 })
7872 }
7873 }
7874 }
7875 #[allow(clippy::too_many_lines)]
7876 pub fn supports_image(self) -> bool {
7877 match self {
7878 Self::Ai21JambaLarge17
7879 | Self::AionLabsAion20
7880 | Self::AionLabsAion30
7881 | Self::AionLabsAion30Mini
7882 | Self::AmazonNovaMicroV1
7883 | Self::ArceeAiTrinityLargeThinking
7884 | Self::ArceeAiVirtuosoLarge
7885 | Self::CohereCommandR082024
7886 | Self::CohereCommandRPlus082024
7887 | Self::CohereNorthMiniCodeFree
7888 | Self::DeepseekDeepseekChat
7889 | Self::DeepseekDeepseekChatV30324
7890 | Self::DeepseekDeepseekChatV31
7891 | Self::DeepseekDeepseekR1
7892 | Self::DeepseekDeepseekR10528
7893 | Self::DeepseekDeepseekV31Terminus
7894 | Self::DeepseekDeepseekV32
7895 | Self::DeepseekDeepseekV32Exp
7896 | Self::DeepseekDeepseekV4Flash
7897 | Self::DeepseekDeepseekV4Pro
7898 | Self::IbmGraniteGranite418b
7899 | Self::InceptionMercury2
7900 | Self::InclusionaiLing261t
7901 | Self::InclusionaiLing26Flash
7902 | Self::InclusionaiLing30FlashFree
7903 | Self::InclusionaiRing261t
7904 | Self::KwaipilotKatCoderAirV25
7905 | Self::KwaipilotKatCoderProV2
7906 | Self::KwaipilotKatCoderProV25
7907 | Self::MeituanLongcat20
7908 | Self::MetaLlamaLlama3170bInstruct
7909 | Self::MetaLlamaLlama318bInstruct
7910 | Self::MetaLlamaLlama3370bInstruct
7911 | Self::MinimaxMinimaxM1
7912 | Self::MinimaxMinimaxM2
7913 | Self::MinimaxMinimaxM21
7914 | Self::MinimaxMinimaxM25
7915 | Self::MinimaxMinimaxM27
7916 | Self::MistralaiCodestral2508
7917 | Self::MistralaiDevstral2512
7918 | Self::MistralaiMistralLarge
7919 | Self::MistralaiMistralLarge2407
7920 | Self::MistralaiMistralNemo
7921 | Self::MistralaiMistralSaba
7922 | Self::MistralaiMixtral8x22bInstruct
7923 | Self::MistralaiVoxtralSmall24b2507
7924 | Self::MoonshotaiKimiK2
7925 | Self::MoonshotaiKimiK20905
7926 | Self::MoonshotaiKimiK2Thinking
7927 | Self::NvidiaNemotron3Nano30bA3b
7928 | Self::NvidiaNemotron3Nano30bA3bFree
7929 | Self::NvidiaNemotron3Super120bA12b
7930 | Self::NvidiaNemotron3Super120bA12bFree
7931 | Self::NvidiaNemotron3Ultra550bA55b
7932 | Self::NvidiaNemotron3Ultra550bA55bFree
7933 | Self::NvidiaNemotronNano9bV2Free
7934 | Self::OpenaiGpt35Turbo
7935 | Self::OpenaiGpt35Turbo0613
7936 | Self::OpenaiGpt35Turbo16k
7937 | Self::OpenaiGpt4
7938 | Self::OpenaiGpt4TurboPreview
7939 | Self::OpenaiGptAudio
7940 | Self::OpenaiGptAudioMini
7941 | Self::OpenaiGptOss120b
7942 | Self::OpenaiGptOss20b
7943 | Self::OpenaiGptOss20bFree
7944 | Self::OpenaiGptOssSafeguard20b
7945 | Self::OpenaiO3Mini
7946 | Self::OpenaiO3MiniHigh
7947 | Self::PoolsideLagunaM1
7948 | Self::PoolsideLagunaM1Free
7949 | Self::PoolsideLagunaS21
7950 | Self::PoolsideLagunaS21Free
7951 | Self::PoolsideLagunaXs21
7952 | Self::PoolsideLagunaXs21Free
7953 | Self::QwenQwen2572bInstruct
7954 | Self::QwenQwen257bInstruct
7955 | Self::QwenQwenPlus
7956 | Self::QwenQwenPlus20250728
7957 | Self::QwenQwenPlus20250728Thinking
7958 | Self::QwenQwen314b
7959 | Self::QwenQwen3235bA22b
7960 | Self::QwenQwen3235bA22b2507
7961 | Self::QwenQwen3235bA22bThinking2507
7962 | Self::QwenQwen330bA3b
7963 | Self::QwenQwen330bA3bInstruct2507
7964 | Self::QwenQwen330bA3bThinking2507
7965 | Self::QwenQwen332b
7966 | Self::QwenQwen38b
7967 | Self::QwenQwen3Coder
7968 | Self::QwenQwen3Coder30bA3bInstruct
7969 | Self::QwenQwen3CoderFlash
7970 | Self::QwenQwen3CoderNext
7971 | Self::QwenQwen3CoderPlus
7972 | Self::QwenQwen3Max
7973 | Self::QwenQwen3MaxThinking
7974 | Self::QwenQwen3Next80bA3bInstruct
7975 | Self::QwenQwen3Next80bA3bThinking
7976 | Self::QwenQwen36MaxPreview
7977 | Self::QwenQwen37Max
7978 | Self::RelaceRelaceSearch
7979 | Self::Sao10kL31Euryale70b
7980 | Self::StepfunStep35Flash
7981 | Self::TencentHy3
7982 | Self::TencentHy3Preview
7983 | Self::ThedrummerUnslopnemo12b
7984 | Self::UpstageSolarPro3
7985 | Self::XiaomiMimoV25Pro
7986 | Self::ZAiGlm45
7987 | Self::ZAiGlm45Air
7988 | Self::ZAiGlm46
7989 | Self::ZAiGlm47
7990 | Self::ZAiGlm47Flash
7991 | Self::ZAiGlm5
7992 | Self::ZAiGlm5Turbo
7993 | Self::ZAiGlm51
7994 | Self::ZAiGlm52 => false,
7995 Self::AmazonNova2LiteV1
7996 | Self::AmazonNovaLiteV1
7997 | Self::AmazonNovaPremierV1
7998 | Self::AmazonNovaProV1
7999 | Self::AnthropicClaude3Haiku
8000 | Self::AnthropicClaudeFable5
8001 | Self::AnthropicClaudeHaiku45
8002 | Self::AnthropicClaudeOpus4
8003 | Self::AnthropicClaudeOpus41
8004 | Self::AnthropicClaudeOpus45
8005 | Self::AnthropicClaudeOpus46
8006 | Self::AnthropicClaudeOpus47
8007 | Self::AnthropicClaudeOpus47Fast
8008 | Self::AnthropicClaudeOpus48
8009 | Self::AnthropicClaudeOpus48Fast
8010 | Self::AnthropicClaudeOpus5
8011 | Self::AnthropicClaudeOpus5Fast
8012 | Self::AnthropicClaudeSonnet4
8013 | Self::AnthropicClaudeSonnet45
8014 | Self::AnthropicClaudeSonnet46
8015 | Self::AnthropicClaudeSonnet5
8016 | Self::BytedanceSeedSeed16
8017 | Self::BytedanceSeedSeed16Flash
8018 | Self::BytedanceSeedSeed20Lite
8019 | Self::BytedanceSeedSeed20Mini
8020 | Self::GoogleGemini25Flash
8021 | Self::GoogleGemini25FlashLite
8022 | Self::GoogleGemini25Pro
8023 | Self::GoogleGemini25ProPreview
8024 | Self::GoogleGemini25ProPreview0506
8025 | Self::GoogleGemini3FlashPreview
8026 | Self::GoogleGemini3ProImage
8027 | Self::GoogleGemini31FlashLite
8028 | Self::GoogleGemini31FlashLitePreview
8029 | Self::GoogleGemini31ProPreview
8030 | Self::GoogleGemini31ProPreviewCustomtools
8031 | Self::GoogleGemini35Flash
8032 | Self::GoogleGemini35FlashLite
8033 | Self::GoogleGemini36Flash
8034 | Self::GoogleGemma312bIt
8035 | Self::GoogleGemma327bIt
8036 | Self::GoogleGemma426bA4bIt
8037 | Self::GoogleGemma426bA4bItFree
8038 | Self::GoogleGemma431bIt
8039 | Self::GoogleGemma431bItFree
8040 | Self::MetaLlamaLlama4Maverick
8041 | Self::MetaLlamaLlama4Scout
8042 | Self::MetaMuseSpark11
8043 | Self::MinimaxMinimaxM3
8044 | Self::MistralaiMinistral14b2512
8045 | Self::MistralaiMinistral3b2512
8046 | Self::MistralaiMinistral8b2512
8047 | Self::MistralaiMistralLarge2512
8048 | Self::MistralaiMistralMedium3
8049 | Self::MistralaiMistralMedium35
8050 | Self::MistralaiMistralMedium31
8051 | Self::MistralaiMistralSmall2603
8052 | Self::MistralaiMistralSmall3224bInstruct
8053 | Self::MoonshotaiKimiK25
8054 | Self::MoonshotaiKimiK26
8055 | Self::MoonshotaiKimiK27Code
8056 | Self::MoonshotaiKimiK3
8057 | Self::NexAgiNexN2Mini
8058 | Self::NexAgiNexN2Pro
8059 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
8060 | Self::NvidiaNemotronNano12bV2VlFree
8061 | Self::OpenaiGpt4Turbo
8062 | Self::OpenaiGpt41
8063 | Self::OpenaiGpt41Mini
8064 | Self::OpenaiGpt41Nano
8065 | Self::OpenaiGpt4o
8066 | Self::OpenaiGpt4o20240513
8067 | Self::OpenaiGpt4o20240806
8068 | Self::OpenaiGpt4o20241120
8069 | Self::OpenaiGpt4oMini
8070 | Self::OpenaiGpt4oMini20240718
8071 | Self::OpenaiGpt5
8072 | Self::OpenaiGpt5Codex
8073 | Self::OpenaiGpt5Mini
8074 | Self::OpenaiGpt5Nano
8075 | Self::OpenaiGpt5Pro
8076 | Self::OpenaiGpt51
8077 | Self::OpenaiGpt51Chat
8078 | Self::OpenaiGpt51Codex
8079 | Self::OpenaiGpt51CodexMax
8080 | Self::OpenaiGpt51CodexMini
8081 | Self::OpenaiGpt52
8082 | Self::OpenaiGpt52Chat
8083 | Self::OpenaiGpt52Codex
8084 | Self::OpenaiGpt52Pro
8085 | Self::OpenaiGpt53Chat
8086 | Self::OpenaiGpt53Codex
8087 | Self::OpenaiGpt54
8088 | Self::OpenaiGpt54Mini
8089 | Self::OpenaiGpt54Nano
8090 | Self::OpenaiGpt54Pro
8091 | Self::OpenaiGpt55
8092 | Self::OpenaiGpt55Pro
8093 | Self::OpenaiGpt56Luna
8094 | Self::OpenaiGpt56LunaPro
8095 | Self::OpenaiGpt56Sol
8096 | Self::OpenaiGpt56SolPro
8097 | Self::OpenaiGpt56Terra
8098 | Self::OpenaiGpt56TerraPro
8099 | Self::OpenaiO1
8100 | Self::OpenaiO3
8101 | Self::OpenaiO3DeepResearch
8102 | Self::OpenaiO3Pro
8103 | Self::OpenaiO4Mini
8104 | Self::OpenaiO4MiniDeepResearch
8105 | Self::OpenaiO4MiniHigh
8106 | Self::OpenrouterAuto
8107 | Self::OpenrouterFree
8108 | Self::QwenQwen3Vl235bA22bInstruct
8109 | Self::QwenQwen3Vl235bA22bThinking
8110 | Self::QwenQwen3Vl30bA3bInstruct
8111 | Self::QwenQwen3Vl30bA3bThinking
8112 | Self::QwenQwen3Vl32bInstruct
8113 | Self::QwenQwen3Vl8bInstruct
8114 | Self::QwenQwen3Vl8bThinking
8115 | Self::QwenQwen35122bA10b
8116 | Self::QwenQwen3527b
8117 | Self::QwenQwen3535bA3b
8118 | Self::QwenQwen35397bA17b
8119 | Self::QwenQwen359b
8120 | Self::QwenQwen35Flash0223
8121 | Self::QwenQwen35Plus0215
8122 | Self::QwenQwen35Plus20260420
8123 | Self::QwenQwen3627b
8124 | Self::QwenQwen3635bA3b
8125 | Self::QwenQwen36Flash
8126 | Self::QwenQwen36Plus
8127 | Self::QwenQwen37Plus
8128 | Self::RekaaiRekaEdge
8129 | Self::SakanaFuguUltra
8130 | Self::StepfunStep37Flash
8131 | Self::ThinkingmachinesInkling
8132 | Self::XAiGrok420
8133 | Self::XAiGrok43
8134 | Self::XAiGrok45
8135 | Self::XAiGrokBuild01
8136 | Self::XiaomiMimoV25
8137 | Self::ZAiGlm45v
8138 | Self::ZAiGlm46v
8139 | Self::ZAiGlm5vTurbo => true,
8140 }
8141 }
8142 #[allow(clippy::too_many_lines)]
8143 pub fn supports_audio(self) -> bool {
8144 match self {
8145 Self::Ai21JambaLarge17
8146 | Self::AionLabsAion20
8147 | Self::AionLabsAion30
8148 | Self::AionLabsAion30Mini
8149 | Self::AmazonNova2LiteV1
8150 | Self::AmazonNovaLiteV1
8151 | Self::AmazonNovaMicroV1
8152 | Self::AmazonNovaPremierV1
8153 | Self::AmazonNovaProV1
8154 | Self::AnthropicClaude3Haiku
8155 | Self::AnthropicClaudeFable5
8156 | Self::AnthropicClaudeHaiku45
8157 | Self::AnthropicClaudeOpus4
8158 | Self::AnthropicClaudeOpus41
8159 | Self::AnthropicClaudeOpus45
8160 | Self::AnthropicClaudeOpus46
8161 | Self::AnthropicClaudeOpus47
8162 | Self::AnthropicClaudeOpus47Fast
8163 | Self::AnthropicClaudeOpus48
8164 | Self::AnthropicClaudeOpus48Fast
8165 | Self::AnthropicClaudeOpus5
8166 | Self::AnthropicClaudeOpus5Fast
8167 | Self::AnthropicClaudeSonnet4
8168 | Self::AnthropicClaudeSonnet45
8169 | Self::AnthropicClaudeSonnet46
8170 | Self::AnthropicClaudeSonnet5
8171 | Self::ArceeAiTrinityLargeThinking
8172 | Self::ArceeAiVirtuosoLarge
8173 | Self::BytedanceSeedSeed16
8174 | Self::BytedanceSeedSeed16Flash
8175 | Self::BytedanceSeedSeed20Lite
8176 | Self::BytedanceSeedSeed20Mini
8177 | Self::CohereCommandR082024
8178 | Self::CohereCommandRPlus082024
8179 | Self::CohereNorthMiniCodeFree
8180 | Self::DeepseekDeepseekChat
8181 | Self::DeepseekDeepseekChatV30324
8182 | Self::DeepseekDeepseekChatV31
8183 | Self::DeepseekDeepseekR1
8184 | Self::DeepseekDeepseekR10528
8185 | Self::DeepseekDeepseekV31Terminus
8186 | Self::DeepseekDeepseekV32
8187 | Self::DeepseekDeepseekV32Exp
8188 | Self::DeepseekDeepseekV4Flash
8189 | Self::DeepseekDeepseekV4Pro
8190 | Self::GoogleGemini3ProImage
8191 | Self::GoogleGemma312bIt
8192 | Self::GoogleGemma327bIt
8193 | Self::GoogleGemma426bA4bIt
8194 | Self::GoogleGemma426bA4bItFree
8195 | Self::GoogleGemma431bIt
8196 | Self::GoogleGemma431bItFree
8197 | Self::IbmGraniteGranite418b
8198 | Self::InceptionMercury2
8199 | Self::InclusionaiLing261t
8200 | Self::InclusionaiLing26Flash
8201 | Self::InclusionaiLing30FlashFree
8202 | Self::InclusionaiRing261t
8203 | Self::KwaipilotKatCoderAirV25
8204 | Self::KwaipilotKatCoderProV2
8205 | Self::KwaipilotKatCoderProV25
8206 | Self::MeituanLongcat20
8207 | Self::MetaLlamaLlama3170bInstruct
8208 | Self::MetaLlamaLlama318bInstruct
8209 | Self::MetaLlamaLlama3370bInstruct
8210 | Self::MetaLlamaLlama4Maverick
8211 | Self::MetaLlamaLlama4Scout
8212 | Self::MinimaxMinimaxM1
8213 | Self::MinimaxMinimaxM2
8214 | Self::MinimaxMinimaxM21
8215 | Self::MinimaxMinimaxM25
8216 | Self::MinimaxMinimaxM27
8217 | Self::MinimaxMinimaxM3
8218 | Self::MistralaiCodestral2508
8219 | Self::MistralaiDevstral2512
8220 | Self::MistralaiMinistral14b2512
8221 | Self::MistralaiMinistral3b2512
8222 | Self::MistralaiMinistral8b2512
8223 | Self::MistralaiMistralLarge
8224 | Self::MistralaiMistralLarge2407
8225 | Self::MistralaiMistralLarge2512
8226 | Self::MistralaiMistralMedium3
8227 | Self::MistralaiMistralMedium35
8228 | Self::MistralaiMistralMedium31
8229 | Self::MistralaiMistralNemo
8230 | Self::MistralaiMistralSaba
8231 | Self::MistralaiMistralSmall2603
8232 | Self::MistralaiMistralSmall3224bInstruct
8233 | Self::MistralaiMixtral8x22bInstruct
8234 | Self::MoonshotaiKimiK2
8235 | Self::MoonshotaiKimiK20905
8236 | Self::MoonshotaiKimiK2Thinking
8237 | Self::MoonshotaiKimiK25
8238 | Self::MoonshotaiKimiK26
8239 | Self::MoonshotaiKimiK27Code
8240 | Self::MoonshotaiKimiK3
8241 | Self::NexAgiNexN2Mini
8242 | Self::NexAgiNexN2Pro
8243 | Self::NvidiaNemotron3Nano30bA3b
8244 | Self::NvidiaNemotron3Nano30bA3bFree
8245 | Self::NvidiaNemotron3Super120bA12b
8246 | Self::NvidiaNemotron3Super120bA12bFree
8247 | Self::NvidiaNemotron3Ultra550bA55b
8248 | Self::NvidiaNemotron3Ultra550bA55bFree
8249 | Self::NvidiaNemotronNano12bV2VlFree
8250 | Self::NvidiaNemotronNano9bV2Free
8251 | Self::OpenaiGpt35Turbo
8252 | Self::OpenaiGpt35Turbo0613
8253 | Self::OpenaiGpt35Turbo16k
8254 | Self::OpenaiGpt4
8255 | Self::OpenaiGpt4Turbo
8256 | Self::OpenaiGpt4TurboPreview
8257 | Self::OpenaiGpt41
8258 | Self::OpenaiGpt41Mini
8259 | Self::OpenaiGpt41Nano
8260 | Self::OpenaiGpt4o
8261 | Self::OpenaiGpt4o20240513
8262 | Self::OpenaiGpt4o20240806
8263 | Self::OpenaiGpt4o20241120
8264 | Self::OpenaiGpt4oMini
8265 | Self::OpenaiGpt4oMini20240718
8266 | Self::OpenaiGpt5
8267 | Self::OpenaiGpt5Codex
8268 | Self::OpenaiGpt5Mini
8269 | Self::OpenaiGpt5Nano
8270 | Self::OpenaiGpt5Pro
8271 | Self::OpenaiGpt51
8272 | Self::OpenaiGpt51Chat
8273 | Self::OpenaiGpt51Codex
8274 | Self::OpenaiGpt51CodexMax
8275 | Self::OpenaiGpt51CodexMini
8276 | Self::OpenaiGpt52
8277 | Self::OpenaiGpt52Chat
8278 | Self::OpenaiGpt52Codex
8279 | Self::OpenaiGpt52Pro
8280 | Self::OpenaiGpt53Chat
8281 | Self::OpenaiGpt53Codex
8282 | Self::OpenaiGpt54
8283 | Self::OpenaiGpt54Mini
8284 | Self::OpenaiGpt54Nano
8285 | Self::OpenaiGpt54Pro
8286 | Self::OpenaiGpt55
8287 | Self::OpenaiGpt55Pro
8288 | Self::OpenaiGpt56Luna
8289 | Self::OpenaiGpt56LunaPro
8290 | Self::OpenaiGpt56Sol
8291 | Self::OpenaiGpt56SolPro
8292 | Self::OpenaiGpt56Terra
8293 | Self::OpenaiGpt56TerraPro
8294 | Self::OpenaiGptOss120b
8295 | Self::OpenaiGptOss20b
8296 | Self::OpenaiGptOss20bFree
8297 | Self::OpenaiGptOssSafeguard20b
8298 | Self::OpenaiO1
8299 | Self::OpenaiO3
8300 | Self::OpenaiO3DeepResearch
8301 | Self::OpenaiO3Mini
8302 | Self::OpenaiO3MiniHigh
8303 | Self::OpenaiO3Pro
8304 | Self::OpenaiO4Mini
8305 | Self::OpenaiO4MiniDeepResearch
8306 | Self::OpenaiO4MiniHigh
8307 | Self::OpenrouterFree
8308 | Self::PoolsideLagunaM1
8309 | Self::PoolsideLagunaM1Free
8310 | Self::PoolsideLagunaS21
8311 | Self::PoolsideLagunaS21Free
8312 | Self::PoolsideLagunaXs21
8313 | Self::PoolsideLagunaXs21Free
8314 | Self::QwenQwen2572bInstruct
8315 | Self::QwenQwen257bInstruct
8316 | Self::QwenQwenPlus
8317 | Self::QwenQwenPlus20250728
8318 | Self::QwenQwenPlus20250728Thinking
8319 | Self::QwenQwen314b
8320 | Self::QwenQwen3235bA22b
8321 | Self::QwenQwen3235bA22b2507
8322 | Self::QwenQwen3235bA22bThinking2507
8323 | Self::QwenQwen330bA3b
8324 | Self::QwenQwen330bA3bInstruct2507
8325 | Self::QwenQwen330bA3bThinking2507
8326 | Self::QwenQwen332b
8327 | Self::QwenQwen38b
8328 | Self::QwenQwen3Coder
8329 | Self::QwenQwen3Coder30bA3bInstruct
8330 | Self::QwenQwen3CoderFlash
8331 | Self::QwenQwen3CoderNext
8332 | Self::QwenQwen3CoderPlus
8333 | Self::QwenQwen3Max
8334 | Self::QwenQwen3MaxThinking
8335 | Self::QwenQwen3Next80bA3bInstruct
8336 | Self::QwenQwen3Next80bA3bThinking
8337 | Self::QwenQwen3Vl235bA22bInstruct
8338 | Self::QwenQwen3Vl235bA22bThinking
8339 | Self::QwenQwen3Vl30bA3bInstruct
8340 | Self::QwenQwen3Vl30bA3bThinking
8341 | Self::QwenQwen3Vl32bInstruct
8342 | Self::QwenQwen3Vl8bInstruct
8343 | Self::QwenQwen3Vl8bThinking
8344 | Self::QwenQwen35122bA10b
8345 | Self::QwenQwen3527b
8346 | Self::QwenQwen3535bA3b
8347 | Self::QwenQwen35397bA17b
8348 | Self::QwenQwen359b
8349 | Self::QwenQwen35Flash0223
8350 | Self::QwenQwen35Plus0215
8351 | Self::QwenQwen35Plus20260420
8352 | Self::QwenQwen3627b
8353 | Self::QwenQwen3635bA3b
8354 | Self::QwenQwen36Flash
8355 | Self::QwenQwen36MaxPreview
8356 | Self::QwenQwen36Plus
8357 | Self::QwenQwen37Max
8358 | Self::QwenQwen37Plus
8359 | Self::RekaaiRekaEdge
8360 | Self::RelaceRelaceSearch
8361 | Self::SakanaFuguUltra
8362 | Self::Sao10kL31Euryale70b
8363 | Self::StepfunStep35Flash
8364 | Self::StepfunStep37Flash
8365 | Self::TencentHy3
8366 | Self::TencentHy3Preview
8367 | Self::ThedrummerUnslopnemo12b
8368 | Self::UpstageSolarPro3
8369 | Self::XAiGrok420
8370 | Self::XAiGrok43
8371 | Self::XAiGrok45
8372 | Self::XAiGrokBuild01
8373 | Self::XiaomiMimoV25Pro
8374 | Self::ZAiGlm45
8375 | Self::ZAiGlm45Air
8376 | Self::ZAiGlm45v
8377 | Self::ZAiGlm46
8378 | Self::ZAiGlm46v
8379 | Self::ZAiGlm47
8380 | Self::ZAiGlm47Flash
8381 | Self::ZAiGlm5
8382 | Self::ZAiGlm5Turbo
8383 | Self::ZAiGlm51
8384 | Self::ZAiGlm52
8385 | Self::ZAiGlm5vTurbo => false,
8386 Self::GoogleGemini25Flash
8387 | Self::GoogleGemini25FlashLite
8388 | Self::GoogleGemini25Pro
8389 | Self::GoogleGemini25ProPreview
8390 | Self::GoogleGemini25ProPreview0506
8391 | Self::GoogleGemini3FlashPreview
8392 | Self::GoogleGemini31FlashLite
8393 | Self::GoogleGemini31FlashLitePreview
8394 | Self::GoogleGemini31ProPreview
8395 | Self::GoogleGemini31ProPreviewCustomtools
8396 | Self::GoogleGemini35Flash
8397 | Self::GoogleGemini35FlashLite
8398 | Self::GoogleGemini36Flash
8399 | Self::MetaMuseSpark11
8400 | Self::MistralaiVoxtralSmall24b2507
8401 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
8402 | Self::OpenaiGptAudio
8403 | Self::OpenaiGptAudioMini
8404 | Self::OpenrouterAuto
8405 | Self::ThinkingmachinesInkling
8406 | Self::XiaomiMimoV25 => true,
8407 }
8408 }
8409 #[allow(clippy::too_many_lines)]
8410 pub fn transport(self) -> Option<ModelTransport> {
8411 match self {
8412 Self::Ai21JambaLarge17
8413 | Self::AionLabsAion20
8414 | Self::AionLabsAion30
8415 | Self::AionLabsAion30Mini
8416 | Self::AmazonNova2LiteV1
8417 | Self::AmazonNovaLiteV1
8418 | Self::AmazonNovaMicroV1
8419 | Self::AmazonNovaPremierV1
8420 | Self::AmazonNovaProV1
8421 | Self::AnthropicClaude3Haiku
8422 | Self::AnthropicClaudeFable5
8423 | Self::AnthropicClaudeHaiku45
8424 | Self::AnthropicClaudeOpus4
8425 | Self::AnthropicClaudeOpus41
8426 | Self::AnthropicClaudeOpus45
8427 | Self::AnthropicClaudeOpus46
8428 | Self::AnthropicClaudeOpus47
8429 | Self::AnthropicClaudeOpus47Fast
8430 | Self::AnthropicClaudeOpus48
8431 | Self::AnthropicClaudeOpus48Fast
8432 | Self::AnthropicClaudeOpus5
8433 | Self::AnthropicClaudeOpus5Fast
8434 | Self::AnthropicClaudeSonnet4
8435 | Self::AnthropicClaudeSonnet45
8436 | Self::AnthropicClaudeSonnet46
8437 | Self::AnthropicClaudeSonnet5
8438 | Self::ArceeAiTrinityLargeThinking
8439 | Self::ArceeAiVirtuosoLarge
8440 | Self::BytedanceSeedSeed16
8441 | Self::BytedanceSeedSeed16Flash
8442 | Self::BytedanceSeedSeed20Lite
8443 | Self::BytedanceSeedSeed20Mini
8444 | Self::CohereCommandR082024
8445 | Self::CohereCommandRPlus082024
8446 | Self::CohereNorthMiniCodeFree
8447 | Self::DeepseekDeepseekChat
8448 | Self::DeepseekDeepseekChatV30324
8449 | Self::DeepseekDeepseekChatV31
8450 | Self::DeepseekDeepseekR1
8451 | Self::DeepseekDeepseekR10528
8452 | Self::DeepseekDeepseekV31Terminus
8453 | Self::DeepseekDeepseekV32
8454 | Self::DeepseekDeepseekV32Exp
8455 | Self::DeepseekDeepseekV4Flash
8456 | Self::DeepseekDeepseekV4Pro
8457 | Self::GoogleGemini25Flash
8458 | Self::GoogleGemini25FlashLite
8459 | Self::GoogleGemini25Pro
8460 | Self::GoogleGemini25ProPreview
8461 | Self::GoogleGemini25ProPreview0506
8462 | Self::GoogleGemini3FlashPreview
8463 | Self::GoogleGemini3ProImage
8464 | Self::GoogleGemini31FlashLite
8465 | Self::GoogleGemini31FlashLitePreview
8466 | Self::GoogleGemini31ProPreview
8467 | Self::GoogleGemini31ProPreviewCustomtools
8468 | Self::GoogleGemini35Flash
8469 | Self::GoogleGemini35FlashLite
8470 | Self::GoogleGemini36Flash
8471 | Self::GoogleGemma312bIt
8472 | Self::GoogleGemma327bIt
8473 | Self::GoogleGemma426bA4bIt
8474 | Self::GoogleGemma426bA4bItFree
8475 | Self::GoogleGemma431bIt
8476 | Self::GoogleGemma431bItFree
8477 | Self::IbmGraniteGranite418b
8478 | Self::InceptionMercury2
8479 | Self::InclusionaiLing261t
8480 | Self::InclusionaiLing26Flash
8481 | Self::InclusionaiLing30FlashFree
8482 | Self::InclusionaiRing261t
8483 | Self::KwaipilotKatCoderAirV25
8484 | Self::KwaipilotKatCoderProV2
8485 | Self::KwaipilotKatCoderProV25
8486 | Self::MeituanLongcat20
8487 | Self::MetaLlamaLlama3170bInstruct
8488 | Self::MetaLlamaLlama318bInstruct
8489 | Self::MetaLlamaLlama3370bInstruct
8490 | Self::MetaLlamaLlama4Maverick
8491 | Self::MetaLlamaLlama4Scout
8492 | Self::MetaMuseSpark11
8493 | Self::MinimaxMinimaxM1
8494 | Self::MinimaxMinimaxM2
8495 | Self::MinimaxMinimaxM21
8496 | Self::MinimaxMinimaxM25
8497 | Self::MinimaxMinimaxM27
8498 | Self::MinimaxMinimaxM3
8499 | Self::MistralaiCodestral2508
8500 | Self::MistralaiDevstral2512
8501 | Self::MistralaiMinistral14b2512
8502 | Self::MistralaiMinistral3b2512
8503 | Self::MistralaiMinistral8b2512
8504 | Self::MistralaiMistralLarge
8505 | Self::MistralaiMistralLarge2407
8506 | Self::MistralaiMistralLarge2512
8507 | Self::MistralaiMistralMedium3
8508 | Self::MistralaiMistralMedium35
8509 | Self::MistralaiMistralMedium31
8510 | Self::MistralaiMistralNemo
8511 | Self::MistralaiMistralSaba
8512 | Self::MistralaiMistralSmall2603
8513 | Self::MistralaiMistralSmall3224bInstruct
8514 | Self::MistralaiMixtral8x22bInstruct
8515 | Self::MistralaiVoxtralSmall24b2507
8516 | Self::MoonshotaiKimiK2
8517 | Self::MoonshotaiKimiK20905
8518 | Self::MoonshotaiKimiK2Thinking
8519 | Self::MoonshotaiKimiK25
8520 | Self::MoonshotaiKimiK26
8521 | Self::MoonshotaiKimiK27Code
8522 | Self::MoonshotaiKimiK3
8523 | Self::NexAgiNexN2Mini
8524 | Self::NexAgiNexN2Pro
8525 | Self::NvidiaNemotron3Nano30bA3b
8526 | Self::NvidiaNemotron3Nano30bA3bFree
8527 | Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree
8528 | Self::NvidiaNemotron3Super120bA12b
8529 | Self::NvidiaNemotron3Super120bA12bFree
8530 | Self::NvidiaNemotron3Ultra550bA55b
8531 | Self::NvidiaNemotron3Ultra550bA55bFree
8532 | Self::NvidiaNemotronNano12bV2VlFree
8533 | Self::NvidiaNemotronNano9bV2Free
8534 | Self::OpenaiGpt35Turbo
8535 | Self::OpenaiGpt35Turbo0613
8536 | Self::OpenaiGpt35Turbo16k
8537 | Self::OpenaiGpt4
8538 | Self::OpenaiGpt4Turbo
8539 | Self::OpenaiGpt4TurboPreview
8540 | Self::OpenaiGpt41
8541 | Self::OpenaiGpt41Mini
8542 | Self::OpenaiGpt41Nano
8543 | Self::OpenaiGpt4o
8544 | Self::OpenaiGpt4o20240513
8545 | Self::OpenaiGpt4o20240806
8546 | Self::OpenaiGpt4o20241120
8547 | Self::OpenaiGpt4oMini
8548 | Self::OpenaiGpt4oMini20240718
8549 | Self::OpenaiGpt5
8550 | Self::OpenaiGpt5Codex
8551 | Self::OpenaiGpt5Mini
8552 | Self::OpenaiGpt5Nano
8553 | Self::OpenaiGpt5Pro
8554 | Self::OpenaiGpt51
8555 | Self::OpenaiGpt51Chat
8556 | Self::OpenaiGpt51Codex
8557 | Self::OpenaiGpt51CodexMax
8558 | Self::OpenaiGpt51CodexMini
8559 | Self::OpenaiGpt52
8560 | Self::OpenaiGpt52Chat
8561 | Self::OpenaiGpt52Codex
8562 | Self::OpenaiGpt52Pro
8563 | Self::OpenaiGpt53Chat
8564 | Self::OpenaiGpt53Codex
8565 | Self::OpenaiGpt54
8566 | Self::OpenaiGpt54Mini
8567 | Self::OpenaiGpt54Nano
8568 | Self::OpenaiGpt54Pro
8569 | Self::OpenaiGpt55
8570 | Self::OpenaiGpt55Pro
8571 | Self::OpenaiGpt56Luna
8572 | Self::OpenaiGpt56LunaPro
8573 | Self::OpenaiGpt56Sol
8574 | Self::OpenaiGpt56SolPro
8575 | Self::OpenaiGpt56Terra
8576 | Self::OpenaiGpt56TerraPro
8577 | Self::OpenaiGptAudio
8578 | Self::OpenaiGptAudioMini
8579 | Self::OpenaiGptOss120b
8580 | Self::OpenaiGptOss20b
8581 | Self::OpenaiGptOss20bFree
8582 | Self::OpenaiGptOssSafeguard20b
8583 | Self::OpenaiO1
8584 | Self::OpenaiO3
8585 | Self::OpenaiO3DeepResearch
8586 | Self::OpenaiO3Mini
8587 | Self::OpenaiO3MiniHigh
8588 | Self::OpenaiO3Pro
8589 | Self::OpenaiO4Mini
8590 | Self::OpenaiO4MiniDeepResearch
8591 | Self::OpenaiO4MiniHigh
8592 | Self::OpenrouterAuto
8593 | Self::OpenrouterFree
8594 | Self::PoolsideLagunaM1
8595 | Self::PoolsideLagunaM1Free
8596 | Self::PoolsideLagunaS21
8597 | Self::PoolsideLagunaS21Free
8598 | Self::PoolsideLagunaXs21
8599 | Self::PoolsideLagunaXs21Free
8600 | Self::QwenQwen2572bInstruct
8601 | Self::QwenQwen257bInstruct
8602 | Self::QwenQwenPlus
8603 | Self::QwenQwenPlus20250728
8604 | Self::QwenQwenPlus20250728Thinking
8605 | Self::QwenQwen314b
8606 | Self::QwenQwen3235bA22b
8607 | Self::QwenQwen3235bA22b2507
8608 | Self::QwenQwen3235bA22bThinking2507
8609 | Self::QwenQwen330bA3b
8610 | Self::QwenQwen330bA3bInstruct2507
8611 | Self::QwenQwen330bA3bThinking2507
8612 | Self::QwenQwen332b
8613 | Self::QwenQwen38b
8614 | Self::QwenQwen3Coder
8615 | Self::QwenQwen3Coder30bA3bInstruct
8616 | Self::QwenQwen3CoderFlash
8617 | Self::QwenQwen3CoderNext
8618 | Self::QwenQwen3CoderPlus
8619 | Self::QwenQwen3Max
8620 | Self::QwenQwen3MaxThinking
8621 | Self::QwenQwen3Next80bA3bInstruct
8622 | Self::QwenQwen3Next80bA3bThinking
8623 | Self::QwenQwen3Vl235bA22bInstruct
8624 | Self::QwenQwen3Vl235bA22bThinking
8625 | Self::QwenQwen3Vl30bA3bInstruct
8626 | Self::QwenQwen3Vl30bA3bThinking
8627 | Self::QwenQwen3Vl32bInstruct
8628 | Self::QwenQwen3Vl8bInstruct
8629 | Self::QwenQwen3Vl8bThinking
8630 | Self::QwenQwen35122bA10b
8631 | Self::QwenQwen3527b
8632 | Self::QwenQwen3535bA3b
8633 | Self::QwenQwen35397bA17b
8634 | Self::QwenQwen359b
8635 | Self::QwenQwen35Flash0223
8636 | Self::QwenQwen35Plus0215
8637 | Self::QwenQwen35Plus20260420
8638 | Self::QwenQwen3627b
8639 | Self::QwenQwen3635bA3b
8640 | Self::QwenQwen36Flash
8641 | Self::QwenQwen36MaxPreview
8642 | Self::QwenQwen36Plus
8643 | Self::QwenQwen37Max
8644 | Self::QwenQwen37Plus
8645 | Self::RekaaiRekaEdge
8646 | Self::RelaceRelaceSearch
8647 | Self::SakanaFuguUltra
8648 | Self::Sao10kL31Euryale70b
8649 | Self::StepfunStep35Flash
8650 | Self::StepfunStep37Flash
8651 | Self::TencentHy3
8652 | Self::TencentHy3Preview
8653 | Self::ThedrummerUnslopnemo12b
8654 | Self::ThinkingmachinesInkling
8655 | Self::UpstageSolarPro3
8656 | Self::XAiGrok420
8657 | Self::XAiGrok43
8658 | Self::XAiGrok45
8659 | Self::XAiGrokBuild01
8660 | Self::XiaomiMimoV25
8661 | Self::XiaomiMimoV25Pro
8662 | Self::ZAiGlm45
8663 | Self::ZAiGlm45Air
8664 | Self::ZAiGlm45v
8665 | Self::ZAiGlm46
8666 | Self::ZAiGlm46v
8667 | Self::ZAiGlm47
8668 | Self::ZAiGlm47Flash
8669 | Self::ZAiGlm5
8670 | Self::ZAiGlm5Turbo
8671 | Self::ZAiGlm51
8672 | Self::ZAiGlm52
8673 | Self::ZAiGlm5vTurbo => None,
8674 }
8675 }
8676 const ALL: &[OpenRouterModel] = &[
8677 Self::Ai21JambaLarge17,
8678 Self::AionLabsAion20,
8679 Self::AionLabsAion30,
8680 Self::AionLabsAion30Mini,
8681 Self::AmazonNova2LiteV1,
8682 Self::AmazonNovaLiteV1,
8683 Self::AmazonNovaMicroV1,
8684 Self::AmazonNovaPremierV1,
8685 Self::AmazonNovaProV1,
8686 Self::AnthropicClaude3Haiku,
8687 Self::AnthropicClaudeFable5,
8688 Self::AnthropicClaudeHaiku45,
8689 Self::AnthropicClaudeOpus4,
8690 Self::AnthropicClaudeOpus41,
8691 Self::AnthropicClaudeOpus45,
8692 Self::AnthropicClaudeOpus46,
8693 Self::AnthropicClaudeOpus47,
8694 Self::AnthropicClaudeOpus47Fast,
8695 Self::AnthropicClaudeOpus48,
8696 Self::AnthropicClaudeOpus48Fast,
8697 Self::AnthropicClaudeOpus5,
8698 Self::AnthropicClaudeOpus5Fast,
8699 Self::AnthropicClaudeSonnet4,
8700 Self::AnthropicClaudeSonnet45,
8701 Self::AnthropicClaudeSonnet46,
8702 Self::AnthropicClaudeSonnet5,
8703 Self::ArceeAiTrinityLargeThinking,
8704 Self::ArceeAiVirtuosoLarge,
8705 Self::BytedanceSeedSeed16,
8706 Self::BytedanceSeedSeed16Flash,
8707 Self::BytedanceSeedSeed20Lite,
8708 Self::BytedanceSeedSeed20Mini,
8709 Self::CohereCommandR082024,
8710 Self::CohereCommandRPlus082024,
8711 Self::CohereNorthMiniCodeFree,
8712 Self::DeepseekDeepseekChat,
8713 Self::DeepseekDeepseekChatV30324,
8714 Self::DeepseekDeepseekChatV31,
8715 Self::DeepseekDeepseekR1,
8716 Self::DeepseekDeepseekR10528,
8717 Self::DeepseekDeepseekV31Terminus,
8718 Self::DeepseekDeepseekV32,
8719 Self::DeepseekDeepseekV32Exp,
8720 Self::DeepseekDeepseekV4Flash,
8721 Self::DeepseekDeepseekV4Pro,
8722 Self::GoogleGemini25Flash,
8723 Self::GoogleGemini25FlashLite,
8724 Self::GoogleGemini25Pro,
8725 Self::GoogleGemini25ProPreview,
8726 Self::GoogleGemini25ProPreview0506,
8727 Self::GoogleGemini3FlashPreview,
8728 Self::GoogleGemini3ProImage,
8729 Self::GoogleGemini31FlashLite,
8730 Self::GoogleGemini31FlashLitePreview,
8731 Self::GoogleGemini31ProPreview,
8732 Self::GoogleGemini31ProPreviewCustomtools,
8733 Self::GoogleGemini35Flash,
8734 Self::GoogleGemini35FlashLite,
8735 Self::GoogleGemini36Flash,
8736 Self::GoogleGemma312bIt,
8737 Self::GoogleGemma327bIt,
8738 Self::GoogleGemma426bA4bIt,
8739 Self::GoogleGemma426bA4bItFree,
8740 Self::GoogleGemma431bIt,
8741 Self::GoogleGemma431bItFree,
8742 Self::IbmGraniteGranite418b,
8743 Self::InceptionMercury2,
8744 Self::InclusionaiLing261t,
8745 Self::InclusionaiLing26Flash,
8746 Self::InclusionaiLing30FlashFree,
8747 Self::InclusionaiRing261t,
8748 Self::KwaipilotKatCoderAirV25,
8749 Self::KwaipilotKatCoderProV2,
8750 Self::KwaipilotKatCoderProV25,
8751 Self::MeituanLongcat20,
8752 Self::MetaLlamaLlama3170bInstruct,
8753 Self::MetaLlamaLlama318bInstruct,
8754 Self::MetaLlamaLlama3370bInstruct,
8755 Self::MetaLlamaLlama4Maverick,
8756 Self::MetaLlamaLlama4Scout,
8757 Self::MetaMuseSpark11,
8758 Self::MinimaxMinimaxM1,
8759 Self::MinimaxMinimaxM2,
8760 Self::MinimaxMinimaxM21,
8761 Self::MinimaxMinimaxM25,
8762 Self::MinimaxMinimaxM27,
8763 Self::MinimaxMinimaxM3,
8764 Self::MistralaiCodestral2508,
8765 Self::MistralaiDevstral2512,
8766 Self::MistralaiMinistral14b2512,
8767 Self::MistralaiMinistral3b2512,
8768 Self::MistralaiMinistral8b2512,
8769 Self::MistralaiMistralLarge,
8770 Self::MistralaiMistralLarge2407,
8771 Self::MistralaiMistralLarge2512,
8772 Self::MistralaiMistralMedium3,
8773 Self::MistralaiMistralMedium35,
8774 Self::MistralaiMistralMedium31,
8775 Self::MistralaiMistralNemo,
8776 Self::MistralaiMistralSaba,
8777 Self::MistralaiMistralSmall2603,
8778 Self::MistralaiMistralSmall3224bInstruct,
8779 Self::MistralaiMixtral8x22bInstruct,
8780 Self::MistralaiVoxtralSmall24b2507,
8781 Self::MoonshotaiKimiK2,
8782 Self::MoonshotaiKimiK20905,
8783 Self::MoonshotaiKimiK2Thinking,
8784 Self::MoonshotaiKimiK25,
8785 Self::MoonshotaiKimiK26,
8786 Self::MoonshotaiKimiK27Code,
8787 Self::MoonshotaiKimiK3,
8788 Self::NexAgiNexN2Mini,
8789 Self::NexAgiNexN2Pro,
8790 Self::NvidiaNemotron3Nano30bA3b,
8791 Self::NvidiaNemotron3Nano30bA3bFree,
8792 Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree,
8793 Self::NvidiaNemotron3Super120bA12b,
8794 Self::NvidiaNemotron3Super120bA12bFree,
8795 Self::NvidiaNemotron3Ultra550bA55b,
8796 Self::NvidiaNemotron3Ultra550bA55bFree,
8797 Self::NvidiaNemotronNano12bV2VlFree,
8798 Self::NvidiaNemotronNano9bV2Free,
8799 Self::OpenaiGpt35Turbo,
8800 Self::OpenaiGpt35Turbo0613,
8801 Self::OpenaiGpt35Turbo16k,
8802 Self::OpenaiGpt4,
8803 Self::OpenaiGpt4Turbo,
8804 Self::OpenaiGpt4TurboPreview,
8805 Self::OpenaiGpt41,
8806 Self::OpenaiGpt41Mini,
8807 Self::OpenaiGpt41Nano,
8808 Self::OpenaiGpt4o,
8809 Self::OpenaiGpt4o20240513,
8810 Self::OpenaiGpt4o20240806,
8811 Self::OpenaiGpt4o20241120,
8812 Self::OpenaiGpt4oMini,
8813 Self::OpenaiGpt4oMini20240718,
8814 Self::OpenaiGpt5,
8815 Self::OpenaiGpt5Codex,
8816 Self::OpenaiGpt5Mini,
8817 Self::OpenaiGpt5Nano,
8818 Self::OpenaiGpt5Pro,
8819 Self::OpenaiGpt51,
8820 Self::OpenaiGpt51Chat,
8821 Self::OpenaiGpt51Codex,
8822 Self::OpenaiGpt51CodexMax,
8823 Self::OpenaiGpt51CodexMini,
8824 Self::OpenaiGpt52,
8825 Self::OpenaiGpt52Chat,
8826 Self::OpenaiGpt52Codex,
8827 Self::OpenaiGpt52Pro,
8828 Self::OpenaiGpt53Chat,
8829 Self::OpenaiGpt53Codex,
8830 Self::OpenaiGpt54,
8831 Self::OpenaiGpt54Mini,
8832 Self::OpenaiGpt54Nano,
8833 Self::OpenaiGpt54Pro,
8834 Self::OpenaiGpt55,
8835 Self::OpenaiGpt55Pro,
8836 Self::OpenaiGpt56Luna,
8837 Self::OpenaiGpt56LunaPro,
8838 Self::OpenaiGpt56Sol,
8839 Self::OpenaiGpt56SolPro,
8840 Self::OpenaiGpt56Terra,
8841 Self::OpenaiGpt56TerraPro,
8842 Self::OpenaiGptAudio,
8843 Self::OpenaiGptAudioMini,
8844 Self::OpenaiGptOss120b,
8845 Self::OpenaiGptOss20b,
8846 Self::OpenaiGptOss20bFree,
8847 Self::OpenaiGptOssSafeguard20b,
8848 Self::OpenaiO1,
8849 Self::OpenaiO3,
8850 Self::OpenaiO3DeepResearch,
8851 Self::OpenaiO3Mini,
8852 Self::OpenaiO3MiniHigh,
8853 Self::OpenaiO3Pro,
8854 Self::OpenaiO4Mini,
8855 Self::OpenaiO4MiniDeepResearch,
8856 Self::OpenaiO4MiniHigh,
8857 Self::OpenrouterAuto,
8858 Self::OpenrouterFree,
8859 Self::PoolsideLagunaM1,
8860 Self::PoolsideLagunaM1Free,
8861 Self::PoolsideLagunaS21,
8862 Self::PoolsideLagunaS21Free,
8863 Self::PoolsideLagunaXs21,
8864 Self::PoolsideLagunaXs21Free,
8865 Self::QwenQwen2572bInstruct,
8866 Self::QwenQwen257bInstruct,
8867 Self::QwenQwenPlus,
8868 Self::QwenQwenPlus20250728,
8869 Self::QwenQwenPlus20250728Thinking,
8870 Self::QwenQwen314b,
8871 Self::QwenQwen3235bA22b,
8872 Self::QwenQwen3235bA22b2507,
8873 Self::QwenQwen3235bA22bThinking2507,
8874 Self::QwenQwen330bA3b,
8875 Self::QwenQwen330bA3bInstruct2507,
8876 Self::QwenQwen330bA3bThinking2507,
8877 Self::QwenQwen332b,
8878 Self::QwenQwen38b,
8879 Self::QwenQwen3Coder,
8880 Self::QwenQwen3Coder30bA3bInstruct,
8881 Self::QwenQwen3CoderFlash,
8882 Self::QwenQwen3CoderNext,
8883 Self::QwenQwen3CoderPlus,
8884 Self::QwenQwen3Max,
8885 Self::QwenQwen3MaxThinking,
8886 Self::QwenQwen3Next80bA3bInstruct,
8887 Self::QwenQwen3Next80bA3bThinking,
8888 Self::QwenQwen3Vl235bA22bInstruct,
8889 Self::QwenQwen3Vl235bA22bThinking,
8890 Self::QwenQwen3Vl30bA3bInstruct,
8891 Self::QwenQwen3Vl30bA3bThinking,
8892 Self::QwenQwen3Vl32bInstruct,
8893 Self::QwenQwen3Vl8bInstruct,
8894 Self::QwenQwen3Vl8bThinking,
8895 Self::QwenQwen35122bA10b,
8896 Self::QwenQwen3527b,
8897 Self::QwenQwen3535bA3b,
8898 Self::QwenQwen35397bA17b,
8899 Self::QwenQwen359b,
8900 Self::QwenQwen35Flash0223,
8901 Self::QwenQwen35Plus0215,
8902 Self::QwenQwen35Plus20260420,
8903 Self::QwenQwen3627b,
8904 Self::QwenQwen3635bA3b,
8905 Self::QwenQwen36Flash,
8906 Self::QwenQwen36MaxPreview,
8907 Self::QwenQwen36Plus,
8908 Self::QwenQwen37Max,
8909 Self::QwenQwen37Plus,
8910 Self::RekaaiRekaEdge,
8911 Self::RelaceRelaceSearch,
8912 Self::SakanaFuguUltra,
8913 Self::Sao10kL31Euryale70b,
8914 Self::StepfunStep35Flash,
8915 Self::StepfunStep37Flash,
8916 Self::TencentHy3,
8917 Self::TencentHy3Preview,
8918 Self::ThedrummerUnslopnemo12b,
8919 Self::ThinkingmachinesInkling,
8920 Self::UpstageSolarPro3,
8921 Self::XAiGrok420,
8922 Self::XAiGrok43,
8923 Self::XAiGrok45,
8924 Self::XAiGrokBuild01,
8925 Self::XiaomiMimoV25,
8926 Self::XiaomiMimoV25Pro,
8927 Self::ZAiGlm45,
8928 Self::ZAiGlm45Air,
8929 Self::ZAiGlm45v,
8930 Self::ZAiGlm46,
8931 Self::ZAiGlm46v,
8932 Self::ZAiGlm47,
8933 Self::ZAiGlm47Flash,
8934 Self::ZAiGlm5,
8935 Self::ZAiGlm5Turbo,
8936 Self::ZAiGlm51,
8937 Self::ZAiGlm52,
8938 Self::ZAiGlm5vTurbo,
8939 ];
8940}
8941impl std::str::FromStr for OpenRouterModel {
8942 type Err = String;
8943 #[allow(clippy::too_many_lines)]
8944 fn from_str(s: &str) -> Result<Self, Self::Err> {
8945 match s {
8946 "ai21/jamba-large-1.7" => Ok(Self::Ai21JambaLarge17),
8947 "aion-labs/aion-2.0" => Ok(Self::AionLabsAion20),
8948 "aion-labs/aion-3.0" => Ok(Self::AionLabsAion30),
8949 "aion-labs/aion-3.0-mini" => Ok(Self::AionLabsAion30Mini),
8950 "amazon/nova-2-lite-v1" => Ok(Self::AmazonNova2LiteV1),
8951 "amazon/nova-lite-v1" => Ok(Self::AmazonNovaLiteV1),
8952 "amazon/nova-micro-v1" => Ok(Self::AmazonNovaMicroV1),
8953 "amazon/nova-premier-v1" => Ok(Self::AmazonNovaPremierV1),
8954 "amazon/nova-pro-v1" => Ok(Self::AmazonNovaProV1),
8955 "anthropic/claude-3-haiku" => Ok(Self::AnthropicClaude3Haiku),
8956 "anthropic/claude-fable-5" => Ok(Self::AnthropicClaudeFable5),
8957 "anthropic/claude-haiku-4.5" => Ok(Self::AnthropicClaudeHaiku45),
8958 "anthropic/claude-opus-4" => Ok(Self::AnthropicClaudeOpus4),
8959 "anthropic/claude-opus-4.1" => Ok(Self::AnthropicClaudeOpus41),
8960 "anthropic/claude-opus-4.5" => Ok(Self::AnthropicClaudeOpus45),
8961 "anthropic/claude-opus-4.6" => Ok(Self::AnthropicClaudeOpus46),
8962 "anthropic/claude-opus-4.7" => Ok(Self::AnthropicClaudeOpus47),
8963 "anthropic/claude-opus-4.7-fast" => Ok(Self::AnthropicClaudeOpus47Fast),
8964 "anthropic/claude-opus-4.8" => Ok(Self::AnthropicClaudeOpus48),
8965 "anthropic/claude-opus-4.8-fast" => Ok(Self::AnthropicClaudeOpus48Fast),
8966 "anthropic/claude-opus-5" => Ok(Self::AnthropicClaudeOpus5),
8967 "anthropic/claude-opus-5-fast" => Ok(Self::AnthropicClaudeOpus5Fast),
8968 "anthropic/claude-sonnet-4" => Ok(Self::AnthropicClaudeSonnet4),
8969 "anthropic/claude-sonnet-4.5" => Ok(Self::AnthropicClaudeSonnet45),
8970 "anthropic/claude-sonnet-4.6" => Ok(Self::AnthropicClaudeSonnet46),
8971 "anthropic/claude-sonnet-5" => Ok(Self::AnthropicClaudeSonnet5),
8972 "arcee-ai/trinity-large-thinking" => Ok(Self::ArceeAiTrinityLargeThinking),
8973 "arcee-ai/virtuoso-large" => Ok(Self::ArceeAiVirtuosoLarge),
8974 "bytedance-seed/seed-1.6" => Ok(Self::BytedanceSeedSeed16),
8975 "bytedance-seed/seed-1.6-flash" => Ok(Self::BytedanceSeedSeed16Flash),
8976 "bytedance-seed/seed-2.0-lite" => Ok(Self::BytedanceSeedSeed20Lite),
8977 "bytedance-seed/seed-2.0-mini" => Ok(Self::BytedanceSeedSeed20Mini),
8978 "cohere/command-r-08-2024" => Ok(Self::CohereCommandR082024),
8979 "cohere/command-r-plus-08-2024" => Ok(Self::CohereCommandRPlus082024),
8980 "cohere/north-mini-code:free" => Ok(Self::CohereNorthMiniCodeFree),
8981 "deepseek/deepseek-chat" => Ok(Self::DeepseekDeepseekChat),
8982 "deepseek/deepseek-chat-v3-0324" => Ok(Self::DeepseekDeepseekChatV30324),
8983 "deepseek/deepseek-chat-v3.1" => Ok(Self::DeepseekDeepseekChatV31),
8984 "deepseek/deepseek-r1" => Ok(Self::DeepseekDeepseekR1),
8985 "deepseek/deepseek-r1-0528" => Ok(Self::DeepseekDeepseekR10528),
8986 "deepseek/deepseek-v3.1-terminus" => Ok(Self::DeepseekDeepseekV31Terminus),
8987 "deepseek/deepseek-v3.2" => Ok(Self::DeepseekDeepseekV32),
8988 "deepseek/deepseek-v3.2-exp" => Ok(Self::DeepseekDeepseekV32Exp),
8989 "deepseek/deepseek-v4-flash" => Ok(Self::DeepseekDeepseekV4Flash),
8990 "deepseek/deepseek-v4-pro" => Ok(Self::DeepseekDeepseekV4Pro),
8991 "google/gemini-2.5-flash" => Ok(Self::GoogleGemini25Flash),
8992 "google/gemini-2.5-flash-lite" => Ok(Self::GoogleGemini25FlashLite),
8993 "google/gemini-2.5-pro" => Ok(Self::GoogleGemini25Pro),
8994 "google/gemini-2.5-pro-preview" => Ok(Self::GoogleGemini25ProPreview),
8995 "google/gemini-2.5-pro-preview-05-06" => {
8996 Ok(Self::GoogleGemini25ProPreview0506)
8997 }
8998 "google/gemini-3-flash-preview" => Ok(Self::GoogleGemini3FlashPreview),
8999 "google/gemini-3-pro-image" => Ok(Self::GoogleGemini3ProImage),
9000 "google/gemini-3.1-flash-lite" => Ok(Self::GoogleGemini31FlashLite),
9001 "google/gemini-3.1-flash-lite-preview" => {
9002 Ok(Self::GoogleGemini31FlashLitePreview)
9003 }
9004 "google/gemini-3.1-pro-preview" => Ok(Self::GoogleGemini31ProPreview),
9005 "google/gemini-3.1-pro-preview-customtools" => {
9006 Ok(Self::GoogleGemini31ProPreviewCustomtools)
9007 }
9008 "google/gemini-3.5-flash" => Ok(Self::GoogleGemini35Flash),
9009 "google/gemini-3.5-flash-lite" => Ok(Self::GoogleGemini35FlashLite),
9010 "google/gemini-3.6-flash" => Ok(Self::GoogleGemini36Flash),
9011 "google/gemma-3-12b-it" => Ok(Self::GoogleGemma312bIt),
9012 "google/gemma-3-27b-it" => Ok(Self::GoogleGemma327bIt),
9013 "google/gemma-4-26b-a4b-it" => Ok(Self::GoogleGemma426bA4bIt),
9014 "google/gemma-4-26b-a4b-it:free" => Ok(Self::GoogleGemma426bA4bItFree),
9015 "google/gemma-4-31b-it" => Ok(Self::GoogleGemma431bIt),
9016 "google/gemma-4-31b-it:free" => Ok(Self::GoogleGemma431bItFree),
9017 "ibm-granite/granite-4.1-8b" => Ok(Self::IbmGraniteGranite418b),
9018 "inception/mercury-2" => Ok(Self::InceptionMercury2),
9019 "inclusionai/ling-2.6-1t" => Ok(Self::InclusionaiLing261t),
9020 "inclusionai/ling-2.6-flash" => Ok(Self::InclusionaiLing26Flash),
9021 "inclusionai/ling-3.0-flash:free" => Ok(Self::InclusionaiLing30FlashFree),
9022 "inclusionai/ring-2.6-1t" => Ok(Self::InclusionaiRing261t),
9023 "kwaipilot/kat-coder-air-v2.5" => Ok(Self::KwaipilotKatCoderAirV25),
9024 "kwaipilot/kat-coder-pro-v2" => Ok(Self::KwaipilotKatCoderProV2),
9025 "kwaipilot/kat-coder-pro-v2.5" => Ok(Self::KwaipilotKatCoderProV25),
9026 "meituan/longcat-2.0" => Ok(Self::MeituanLongcat20),
9027 "meta-llama/llama-3.1-70b-instruct" => Ok(Self::MetaLlamaLlama3170bInstruct),
9028 "meta-llama/llama-3.1-8b-instruct" => Ok(Self::MetaLlamaLlama318bInstruct),
9029 "meta-llama/llama-3.3-70b-instruct" => Ok(Self::MetaLlamaLlama3370bInstruct),
9030 "meta-llama/llama-4-maverick" => Ok(Self::MetaLlamaLlama4Maverick),
9031 "meta-llama/llama-4-scout" => Ok(Self::MetaLlamaLlama4Scout),
9032 "meta/muse-spark-1.1" => Ok(Self::MetaMuseSpark11),
9033 "minimax/minimax-m1" => Ok(Self::MinimaxMinimaxM1),
9034 "minimax/minimax-m2" => Ok(Self::MinimaxMinimaxM2),
9035 "minimax/minimax-m2.1" => Ok(Self::MinimaxMinimaxM21),
9036 "minimax/minimax-m2.5" => Ok(Self::MinimaxMinimaxM25),
9037 "minimax/minimax-m2.7" => Ok(Self::MinimaxMinimaxM27),
9038 "minimax/minimax-m3" => Ok(Self::MinimaxMinimaxM3),
9039 "mistralai/codestral-2508" => Ok(Self::MistralaiCodestral2508),
9040 "mistralai/devstral-2512" => Ok(Self::MistralaiDevstral2512),
9041 "mistralai/ministral-14b-2512" => Ok(Self::MistralaiMinistral14b2512),
9042 "mistralai/ministral-3b-2512" => Ok(Self::MistralaiMinistral3b2512),
9043 "mistralai/ministral-8b-2512" => Ok(Self::MistralaiMinistral8b2512),
9044 "mistralai/mistral-large" => Ok(Self::MistralaiMistralLarge),
9045 "mistralai/mistral-large-2407" => Ok(Self::MistralaiMistralLarge2407),
9046 "mistralai/mistral-large-2512" => Ok(Self::MistralaiMistralLarge2512),
9047 "mistralai/mistral-medium-3" => Ok(Self::MistralaiMistralMedium3),
9048 "mistralai/mistral-medium-3-5" => Ok(Self::MistralaiMistralMedium35),
9049 "mistralai/mistral-medium-3.1" => Ok(Self::MistralaiMistralMedium31),
9050 "mistralai/mistral-nemo" => Ok(Self::MistralaiMistralNemo),
9051 "mistralai/mistral-saba" => Ok(Self::MistralaiMistralSaba),
9052 "mistralai/mistral-small-2603" => Ok(Self::MistralaiMistralSmall2603),
9053 "mistralai/mistral-small-3.2-24b-instruct" => {
9054 Ok(Self::MistralaiMistralSmall3224bInstruct)
9055 }
9056 "mistralai/mixtral-8x22b-instruct" => Ok(Self::MistralaiMixtral8x22bInstruct),
9057 "mistralai/voxtral-small-24b-2507" => Ok(Self::MistralaiVoxtralSmall24b2507),
9058 "moonshotai/kimi-k2" => Ok(Self::MoonshotaiKimiK2),
9059 "moonshotai/kimi-k2-0905" => Ok(Self::MoonshotaiKimiK20905),
9060 "moonshotai/kimi-k2-thinking" => Ok(Self::MoonshotaiKimiK2Thinking),
9061 "moonshotai/kimi-k2.5" => Ok(Self::MoonshotaiKimiK25),
9062 "moonshotai/kimi-k2.6" => Ok(Self::MoonshotaiKimiK26),
9063 "moonshotai/kimi-k2.7-code" => Ok(Self::MoonshotaiKimiK27Code),
9064 "moonshotai/kimi-k3" => Ok(Self::MoonshotaiKimiK3),
9065 "nex-agi/nex-n2-mini" => Ok(Self::NexAgiNexN2Mini),
9066 "nex-agi/nex-n2-pro" => Ok(Self::NexAgiNexN2Pro),
9067 "nvidia/nemotron-3-nano-30b-a3b" => Ok(Self::NvidiaNemotron3Nano30bA3b),
9068 "nvidia/nemotron-3-nano-30b-a3b:free" => {
9069 Ok(Self::NvidiaNemotron3Nano30bA3bFree)
9070 }
9071 "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free" => {
9072 Ok(Self::NvidiaNemotron3NanoOmni30bA3bReasoningFree)
9073 }
9074 "nvidia/nemotron-3-super-120b-a12b" => Ok(Self::NvidiaNemotron3Super120bA12b),
9075 "nvidia/nemotron-3-super-120b-a12b:free" => {
9076 Ok(Self::NvidiaNemotron3Super120bA12bFree)
9077 }
9078 "nvidia/nemotron-3-ultra-550b-a55b" => Ok(Self::NvidiaNemotron3Ultra550bA55b),
9079 "nvidia/nemotron-3-ultra-550b-a55b:free" => {
9080 Ok(Self::NvidiaNemotron3Ultra550bA55bFree)
9081 }
9082 "nvidia/nemotron-nano-12b-v2-vl:free" => {
9083 Ok(Self::NvidiaNemotronNano12bV2VlFree)
9084 }
9085 "nvidia/nemotron-nano-9b-v2:free" => Ok(Self::NvidiaNemotronNano9bV2Free),
9086 "openai/gpt-3.5-turbo" => Ok(Self::OpenaiGpt35Turbo),
9087 "openai/gpt-3.5-turbo-0613" => Ok(Self::OpenaiGpt35Turbo0613),
9088 "openai/gpt-3.5-turbo-16k" => Ok(Self::OpenaiGpt35Turbo16k),
9089 "openai/gpt-4" => Ok(Self::OpenaiGpt4),
9090 "openai/gpt-4-turbo" => Ok(Self::OpenaiGpt4Turbo),
9091 "openai/gpt-4-turbo-preview" => Ok(Self::OpenaiGpt4TurboPreview),
9092 "openai/gpt-4.1" => Ok(Self::OpenaiGpt41),
9093 "openai/gpt-4.1-mini" => Ok(Self::OpenaiGpt41Mini),
9094 "openai/gpt-4.1-nano" => Ok(Self::OpenaiGpt41Nano),
9095 "openai/gpt-4o" => Ok(Self::OpenaiGpt4o),
9096 "openai/gpt-4o-2024-05-13" => Ok(Self::OpenaiGpt4o20240513),
9097 "openai/gpt-4o-2024-08-06" => Ok(Self::OpenaiGpt4o20240806),
9098 "openai/gpt-4o-2024-11-20" => Ok(Self::OpenaiGpt4o20241120),
9099 "openai/gpt-4o-mini" => Ok(Self::OpenaiGpt4oMini),
9100 "openai/gpt-4o-mini-2024-07-18" => Ok(Self::OpenaiGpt4oMini20240718),
9101 "openai/gpt-5" => Ok(Self::OpenaiGpt5),
9102 "openai/gpt-5-codex" => Ok(Self::OpenaiGpt5Codex),
9103 "openai/gpt-5-mini" => Ok(Self::OpenaiGpt5Mini),
9104 "openai/gpt-5-nano" => Ok(Self::OpenaiGpt5Nano),
9105 "openai/gpt-5-pro" => Ok(Self::OpenaiGpt5Pro),
9106 "openai/gpt-5.1" => Ok(Self::OpenaiGpt51),
9107 "openai/gpt-5.1-chat" => Ok(Self::OpenaiGpt51Chat),
9108 "openai/gpt-5.1-codex" => Ok(Self::OpenaiGpt51Codex),
9109 "openai/gpt-5.1-codex-max" => Ok(Self::OpenaiGpt51CodexMax),
9110 "openai/gpt-5.1-codex-mini" => Ok(Self::OpenaiGpt51CodexMini),
9111 "openai/gpt-5.2" => Ok(Self::OpenaiGpt52),
9112 "openai/gpt-5.2-chat" => Ok(Self::OpenaiGpt52Chat),
9113 "openai/gpt-5.2-codex" => Ok(Self::OpenaiGpt52Codex),
9114 "openai/gpt-5.2-pro" => Ok(Self::OpenaiGpt52Pro),
9115 "openai/gpt-5.3-chat" => Ok(Self::OpenaiGpt53Chat),
9116 "openai/gpt-5.3-codex" => Ok(Self::OpenaiGpt53Codex),
9117 "openai/gpt-5.4" => Ok(Self::OpenaiGpt54),
9118 "openai/gpt-5.4-mini" => Ok(Self::OpenaiGpt54Mini),
9119 "openai/gpt-5.4-nano" => Ok(Self::OpenaiGpt54Nano),
9120 "openai/gpt-5.4-pro" => Ok(Self::OpenaiGpt54Pro),
9121 "openai/gpt-5.5" => Ok(Self::OpenaiGpt55),
9122 "openai/gpt-5.5-pro" => Ok(Self::OpenaiGpt55Pro),
9123 "openai/gpt-5.6-luna" => Ok(Self::OpenaiGpt56Luna),
9124 "openai/gpt-5.6-luna-pro" => Ok(Self::OpenaiGpt56LunaPro),
9125 "openai/gpt-5.6-sol" => Ok(Self::OpenaiGpt56Sol),
9126 "openai/gpt-5.6-sol-pro" => Ok(Self::OpenaiGpt56SolPro),
9127 "openai/gpt-5.6-terra" => Ok(Self::OpenaiGpt56Terra),
9128 "openai/gpt-5.6-terra-pro" => Ok(Self::OpenaiGpt56TerraPro),
9129 "openai/gpt-audio" => Ok(Self::OpenaiGptAudio),
9130 "openai/gpt-audio-mini" => Ok(Self::OpenaiGptAudioMini),
9131 "openai/gpt-oss-120b" => Ok(Self::OpenaiGptOss120b),
9132 "openai/gpt-oss-20b" => Ok(Self::OpenaiGptOss20b),
9133 "openai/gpt-oss-20b:free" => Ok(Self::OpenaiGptOss20bFree),
9134 "openai/gpt-oss-safeguard-20b" => Ok(Self::OpenaiGptOssSafeguard20b),
9135 "openai/o1" => Ok(Self::OpenaiO1),
9136 "openai/o3" => Ok(Self::OpenaiO3),
9137 "openai/o3-deep-research" => Ok(Self::OpenaiO3DeepResearch),
9138 "openai/o3-mini" => Ok(Self::OpenaiO3Mini),
9139 "openai/o3-mini-high" => Ok(Self::OpenaiO3MiniHigh),
9140 "openai/o3-pro" => Ok(Self::OpenaiO3Pro),
9141 "openai/o4-mini" => Ok(Self::OpenaiO4Mini),
9142 "openai/o4-mini-deep-research" => Ok(Self::OpenaiO4MiniDeepResearch),
9143 "openai/o4-mini-high" => Ok(Self::OpenaiO4MiniHigh),
9144 "openrouter/auto" => Ok(Self::OpenrouterAuto),
9145 "openrouter/free" => Ok(Self::OpenrouterFree),
9146 "poolside/laguna-m.1" => Ok(Self::PoolsideLagunaM1),
9147 "poolside/laguna-m.1:free" => Ok(Self::PoolsideLagunaM1Free),
9148 "poolside/laguna-s-2.1" => Ok(Self::PoolsideLagunaS21),
9149 "poolside/laguna-s-2.1:free" => Ok(Self::PoolsideLagunaS21Free),
9150 "poolside/laguna-xs-2.1" => Ok(Self::PoolsideLagunaXs21),
9151 "poolside/laguna-xs-2.1:free" => Ok(Self::PoolsideLagunaXs21Free),
9152 "qwen/qwen-2.5-72b-instruct" => Ok(Self::QwenQwen2572bInstruct),
9153 "qwen/qwen-2.5-7b-instruct" => Ok(Self::QwenQwen257bInstruct),
9154 "qwen/qwen-plus" => Ok(Self::QwenQwenPlus),
9155 "qwen/qwen-plus-2025-07-28" => Ok(Self::QwenQwenPlus20250728),
9156 "qwen/qwen-plus-2025-07-28:thinking" => {
9157 Ok(Self::QwenQwenPlus20250728Thinking)
9158 }
9159 "qwen/qwen3-14b" => Ok(Self::QwenQwen314b),
9160 "qwen/qwen3-235b-a22b" => Ok(Self::QwenQwen3235bA22b),
9161 "qwen/qwen3-235b-a22b-2507" => Ok(Self::QwenQwen3235bA22b2507),
9162 "qwen/qwen3-235b-a22b-thinking-2507" => {
9163 Ok(Self::QwenQwen3235bA22bThinking2507)
9164 }
9165 "qwen/qwen3-30b-a3b" => Ok(Self::QwenQwen330bA3b),
9166 "qwen/qwen3-30b-a3b-instruct-2507" => Ok(Self::QwenQwen330bA3bInstruct2507),
9167 "qwen/qwen3-30b-a3b-thinking-2507" => Ok(Self::QwenQwen330bA3bThinking2507),
9168 "qwen/qwen3-32b" => Ok(Self::QwenQwen332b),
9169 "qwen/qwen3-8b" => Ok(Self::QwenQwen38b),
9170 "qwen/qwen3-coder" => Ok(Self::QwenQwen3Coder),
9171 "qwen/qwen3-coder-30b-a3b-instruct" => Ok(Self::QwenQwen3Coder30bA3bInstruct),
9172 "qwen/qwen3-coder-flash" => Ok(Self::QwenQwen3CoderFlash),
9173 "qwen/qwen3-coder-next" => Ok(Self::QwenQwen3CoderNext),
9174 "qwen/qwen3-coder-plus" => Ok(Self::QwenQwen3CoderPlus),
9175 "qwen/qwen3-max" => Ok(Self::QwenQwen3Max),
9176 "qwen/qwen3-max-thinking" => Ok(Self::QwenQwen3MaxThinking),
9177 "qwen/qwen3-next-80b-a3b-instruct" => Ok(Self::QwenQwen3Next80bA3bInstruct),
9178 "qwen/qwen3-next-80b-a3b-thinking" => Ok(Self::QwenQwen3Next80bA3bThinking),
9179 "qwen/qwen3-vl-235b-a22b-instruct" => Ok(Self::QwenQwen3Vl235bA22bInstruct),
9180 "qwen/qwen3-vl-235b-a22b-thinking" => Ok(Self::QwenQwen3Vl235bA22bThinking),
9181 "qwen/qwen3-vl-30b-a3b-instruct" => Ok(Self::QwenQwen3Vl30bA3bInstruct),
9182 "qwen/qwen3-vl-30b-a3b-thinking" => Ok(Self::QwenQwen3Vl30bA3bThinking),
9183 "qwen/qwen3-vl-32b-instruct" => Ok(Self::QwenQwen3Vl32bInstruct),
9184 "qwen/qwen3-vl-8b-instruct" => Ok(Self::QwenQwen3Vl8bInstruct),
9185 "qwen/qwen3-vl-8b-thinking" => Ok(Self::QwenQwen3Vl8bThinking),
9186 "qwen/qwen3.5-122b-a10b" => Ok(Self::QwenQwen35122bA10b),
9187 "qwen/qwen3.5-27b" => Ok(Self::QwenQwen3527b),
9188 "qwen/qwen3.5-35b-a3b" => Ok(Self::QwenQwen3535bA3b),
9189 "qwen/qwen3.5-397b-a17b" => Ok(Self::QwenQwen35397bA17b),
9190 "qwen/qwen3.5-9b" => Ok(Self::QwenQwen359b),
9191 "qwen/qwen3.5-flash-02-23" => Ok(Self::QwenQwen35Flash0223),
9192 "qwen/qwen3.5-plus-02-15" => Ok(Self::QwenQwen35Plus0215),
9193 "qwen/qwen3.5-plus-20260420" => Ok(Self::QwenQwen35Plus20260420),
9194 "qwen/qwen3.6-27b" => Ok(Self::QwenQwen3627b),
9195 "qwen/qwen3.6-35b-a3b" => Ok(Self::QwenQwen3635bA3b),
9196 "qwen/qwen3.6-flash" => Ok(Self::QwenQwen36Flash),
9197 "qwen/qwen3.6-max-preview" => Ok(Self::QwenQwen36MaxPreview),
9198 "qwen/qwen3.6-plus" => Ok(Self::QwenQwen36Plus),
9199 "qwen/qwen3.7-max" => Ok(Self::QwenQwen37Max),
9200 "qwen/qwen3.7-plus" => Ok(Self::QwenQwen37Plus),
9201 "rekaai/reka-edge" => Ok(Self::RekaaiRekaEdge),
9202 "relace/relace-search" => Ok(Self::RelaceRelaceSearch),
9203 "sakana/fugu-ultra" => Ok(Self::SakanaFuguUltra),
9204 "sao10k/l3.1-euryale-70b" => Ok(Self::Sao10kL31Euryale70b),
9205 "stepfun/step-3.5-flash" => Ok(Self::StepfunStep35Flash),
9206 "stepfun/step-3.7-flash" => Ok(Self::StepfunStep37Flash),
9207 "tencent/hy3" => Ok(Self::TencentHy3),
9208 "tencent/hy3-preview" => Ok(Self::TencentHy3Preview),
9209 "thedrummer/unslopnemo-12b" => Ok(Self::ThedrummerUnslopnemo12b),
9210 "thinkingmachines/inkling" => Ok(Self::ThinkingmachinesInkling),
9211 "upstage/solar-pro-3" => Ok(Self::UpstageSolarPro3),
9212 "x-ai/grok-4.20" => Ok(Self::XAiGrok420),
9213 "x-ai/grok-4.3" => Ok(Self::XAiGrok43),
9214 "x-ai/grok-4.5" => Ok(Self::XAiGrok45),
9215 "x-ai/grok-build-0.1" => Ok(Self::XAiGrokBuild01),
9216 "xiaomi/mimo-v2.5" => Ok(Self::XiaomiMimoV25),
9217 "xiaomi/mimo-v2.5-pro" => Ok(Self::XiaomiMimoV25Pro),
9218 "z-ai/glm-4.5" => Ok(Self::ZAiGlm45),
9219 "z-ai/glm-4.5-air" => Ok(Self::ZAiGlm45Air),
9220 "z-ai/glm-4.5v" => Ok(Self::ZAiGlm45v),
9221 "z-ai/glm-4.6" => Ok(Self::ZAiGlm46),
9222 "z-ai/glm-4.6v" => Ok(Self::ZAiGlm46v),
9223 "z-ai/glm-4.7" => Ok(Self::ZAiGlm47),
9224 "z-ai/glm-4.7-flash" => Ok(Self::ZAiGlm47Flash),
9225 "z-ai/glm-5" => Ok(Self::ZAiGlm5),
9226 "z-ai/glm-5-turbo" => Ok(Self::ZAiGlm5Turbo),
9227 "z-ai/glm-5.1" => Ok(Self::ZAiGlm51),
9228 "z-ai/glm-5.2" => Ok(Self::ZAiGlm52),
9229 "z-ai/glm-5v-turbo" => Ok(Self::ZAiGlm5vTurbo),
9230 _ => Err(format!("Unknown openrouter model: '{s}'")),
9231 }
9232 }
9233}
9234impl ZAiModel {
9235 #[allow(clippy::too_many_lines)]
9236 fn model_id(self) -> &'static str {
9237 match self {
9238 Self::Glm45 => "glm-4.5",
9239 Self::Glm45Air => "glm-4.5-air",
9240 Self::Glm45Flash => "glm-4.5-flash",
9241 Self::Glm45v => "glm-4.5v",
9242 Self::Glm46 => "glm-4.6",
9243 Self::Glm46v => "glm-4.6v",
9244 Self::Glm47 => "glm-4.7",
9245 Self::Glm47Flash => "glm-4.7-flash",
9246 Self::Glm47Flashx => "glm-4.7-flashx",
9247 Self::Glm5 => "glm-5",
9248 Self::Glm5Turbo => "glm-5-turbo",
9249 Self::Glm51 => "glm-5.1",
9250 Self::Glm52 => "glm-5.2",
9251 Self::Glm5vTurbo => "glm-5v-turbo",
9252 }
9253 }
9254 #[allow(clippy::too_many_lines)]
9255 fn display_name(self) -> &'static str {
9256 match self {
9257 Self::Glm45 => "GLM-4.5",
9258 Self::Glm45Air => "GLM-4.5-Air",
9259 Self::Glm45Flash => "GLM-4.5-Flash",
9260 Self::Glm45v => "GLM-4.5V",
9261 Self::Glm46 => "GLM-4.6",
9262 Self::Glm46v => "GLM-4.6V",
9263 Self::Glm47 => "GLM-4.7",
9264 Self::Glm47Flash => "GLM-4.7-Flash",
9265 Self::Glm47Flashx => "GLM-4.7-FlashX",
9266 Self::Glm5 => "GLM-5",
9267 Self::Glm5Turbo => "GLM-5-Turbo",
9268 Self::Glm51 => "GLM-5.1",
9269 Self::Glm52 => "GLM-5.2",
9270 Self::Glm5vTurbo => "GLM-5V-Turbo",
9271 }
9272 }
9273 #[allow(clippy::too_many_lines)]
9274 fn context_window(self) -> u32 {
9275 match self {
9276 Self::Glm45v => 64_000,
9277 Self::Glm46v => 128_000,
9278 Self::Glm45 | Self::Glm45Air | Self::Glm45Flash => 131_072,
9279 Self::Glm47Flash
9280 | Self::Glm47Flashx
9281 | Self::Glm5Turbo
9282 | Self::Glm51
9283 | Self::Glm5vTurbo => 200_000,
9284 Self::Glm46 | Self::Glm47 | Self::Glm5 => 204_800,
9285 Self::Glm52 => 1_000_000,
9286 }
9287 }
9288 #[allow(clippy::too_many_lines)]
9289 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
9290 match self {
9291 Self::Glm52 => &[ReasoningEffort::High, ReasoningEffort::Max],
9292 Self::Glm45
9293 | Self::Glm45Air
9294 | Self::Glm45Flash
9295 | Self::Glm45v
9296 | Self::Glm46
9297 | Self::Glm46v
9298 | Self::Glm47
9299 | Self::Glm47Flash
9300 | Self::Glm47Flashx
9301 | Self::Glm5
9302 | Self::Glm5Turbo
9303 | Self::Glm51
9304 | Self::Glm5vTurbo => {
9305 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
9306 }
9307 }
9308 }
9309 pub fn supports_reasoning(self) -> bool {
9310 !self.reasoning_levels().is_empty()
9311 }
9312 #[allow(clippy::too_many_lines)]
9313 pub fn supports_prompt_caching(self) -> bool {
9314 match self {
9315 Self::Glm45v | Self::Glm46v => false,
9316 Self::Glm45
9317 | Self::Glm45Air
9318 | Self::Glm45Flash
9319 | Self::Glm46
9320 | Self::Glm47
9321 | Self::Glm47Flash
9322 | Self::Glm47Flashx
9323 | Self::Glm5
9324 | Self::Glm5Turbo
9325 | Self::Glm51
9326 | Self::Glm52
9327 | Self::Glm5vTurbo => true,
9328 }
9329 }
9330 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
9331 pub fn pricing(self) -> Option<ModelPricing> {
9332 match self {
9333 Self::Glm45 => {
9334 Some(ModelPricing {
9335 input_per_million: 0.6f64,
9336 output_per_million: 2.2f64,
9337 cache_read_per_million: Some(0.11f64),
9338 cache_write_per_million: Some(0f64),
9339 })
9340 }
9341 Self::Glm45Air => {
9342 Some(ModelPricing {
9343 input_per_million: 0.2f64,
9344 output_per_million: 1.1f64,
9345 cache_read_per_million: Some(0.03f64),
9346 cache_write_per_million: Some(0f64),
9347 })
9348 }
9349 Self::Glm45Flash => {
9350 Some(ModelPricing {
9351 input_per_million: 0f64,
9352 output_per_million: 0f64,
9353 cache_read_per_million: Some(0f64),
9354 cache_write_per_million: Some(0f64),
9355 })
9356 }
9357 Self::Glm45v => {
9358 Some(ModelPricing {
9359 input_per_million: 0.6f64,
9360 output_per_million: 1.8f64,
9361 cache_read_per_million: None,
9362 cache_write_per_million: None,
9363 })
9364 }
9365 Self::Glm46 => {
9366 Some(ModelPricing {
9367 input_per_million: 0.6f64,
9368 output_per_million: 2.2f64,
9369 cache_read_per_million: Some(0.11f64),
9370 cache_write_per_million: Some(0f64),
9371 })
9372 }
9373 Self::Glm46v => {
9374 Some(ModelPricing {
9375 input_per_million: 0.3f64,
9376 output_per_million: 0.9f64,
9377 cache_read_per_million: None,
9378 cache_write_per_million: None,
9379 })
9380 }
9381 Self::Glm47 => {
9382 Some(ModelPricing {
9383 input_per_million: 0.6f64,
9384 output_per_million: 2.2f64,
9385 cache_read_per_million: Some(0.11f64),
9386 cache_write_per_million: Some(0f64),
9387 })
9388 }
9389 Self::Glm47Flash => {
9390 Some(ModelPricing {
9391 input_per_million: 0f64,
9392 output_per_million: 0f64,
9393 cache_read_per_million: Some(0f64),
9394 cache_write_per_million: Some(0f64),
9395 })
9396 }
9397 Self::Glm47Flashx => {
9398 Some(ModelPricing {
9399 input_per_million: 0.07f64,
9400 output_per_million: 0.4f64,
9401 cache_read_per_million: Some(0.01f64),
9402 cache_write_per_million: Some(0f64),
9403 })
9404 }
9405 Self::Glm5 => {
9406 Some(ModelPricing {
9407 input_per_million: 1f64,
9408 output_per_million: 3.2f64,
9409 cache_read_per_million: Some(0.2f64),
9410 cache_write_per_million: Some(0f64),
9411 })
9412 }
9413 Self::Glm5Turbo => {
9414 Some(ModelPricing {
9415 input_per_million: 1.2f64,
9416 output_per_million: 4f64,
9417 cache_read_per_million: Some(0.24f64),
9418 cache_write_per_million: Some(0f64),
9419 })
9420 }
9421 Self::Glm51 => {
9422 Some(ModelPricing {
9423 input_per_million: 1.4f64,
9424 output_per_million: 4.4f64,
9425 cache_read_per_million: Some(0.26f64),
9426 cache_write_per_million: Some(0f64),
9427 })
9428 }
9429 Self::Glm52 => {
9430 Some(ModelPricing {
9431 input_per_million: 1.4f64,
9432 output_per_million: 4.4f64,
9433 cache_read_per_million: Some(0.26f64),
9434 cache_write_per_million: Some(0f64),
9435 })
9436 }
9437 Self::Glm5vTurbo => {
9438 Some(ModelPricing {
9439 input_per_million: 1.2f64,
9440 output_per_million: 4f64,
9441 cache_read_per_million: Some(0.24f64),
9442 cache_write_per_million: Some(0f64),
9443 })
9444 }
9445 }
9446 }
9447 #[allow(clippy::too_many_lines)]
9448 pub fn supports_image(self) -> bool {
9449 match self {
9450 Self::Glm45
9451 | Self::Glm45Air
9452 | Self::Glm45Flash
9453 | Self::Glm46
9454 | Self::Glm47
9455 | Self::Glm47Flash
9456 | Self::Glm47Flashx
9457 | Self::Glm5
9458 | Self::Glm5Turbo
9459 | Self::Glm51
9460 | Self::Glm52 => false,
9461 Self::Glm45v | Self::Glm46v | Self::Glm5vTurbo => true,
9462 }
9463 }
9464 #[allow(clippy::too_many_lines)]
9465 pub fn supports_audio(self) -> bool {
9466 match self {
9467 Self::Glm45
9468 | Self::Glm45Air
9469 | Self::Glm45Flash
9470 | Self::Glm45v
9471 | Self::Glm46
9472 | Self::Glm46v
9473 | Self::Glm47
9474 | Self::Glm47Flash
9475 | Self::Glm47Flashx
9476 | Self::Glm5
9477 | Self::Glm5Turbo
9478 | Self::Glm51
9479 | Self::Glm52
9480 | Self::Glm5vTurbo => false,
9481 }
9482 }
9483 #[allow(clippy::too_many_lines)]
9484 pub fn transport(self) -> Option<ModelTransport> {
9485 match self {
9486 Self::Glm45
9487 | Self::Glm45Air
9488 | Self::Glm45Flash
9489 | Self::Glm45v
9490 | Self::Glm46
9491 | Self::Glm46v
9492 | Self::Glm47
9493 | Self::Glm47Flash
9494 | Self::Glm47Flashx
9495 | Self::Glm5
9496 | Self::Glm5Turbo
9497 | Self::Glm51
9498 | Self::Glm52
9499 | Self::Glm5vTurbo => None,
9500 }
9501 }
9502 const ALL: &[ZAiModel] = &[
9503 Self::Glm45,
9504 Self::Glm45Air,
9505 Self::Glm45Flash,
9506 Self::Glm45v,
9507 Self::Glm46,
9508 Self::Glm46v,
9509 Self::Glm47,
9510 Self::Glm47Flash,
9511 Self::Glm47Flashx,
9512 Self::Glm5,
9513 Self::Glm5Turbo,
9514 Self::Glm51,
9515 Self::Glm52,
9516 Self::Glm5vTurbo,
9517 ];
9518}
9519impl std::str::FromStr for ZAiModel {
9520 type Err = String;
9521 #[allow(clippy::too_many_lines)]
9522 fn from_str(s: &str) -> Result<Self, Self::Err> {
9523 match s {
9524 "glm-4.5" => Ok(Self::Glm45),
9525 "glm-4.5-air" => Ok(Self::Glm45Air),
9526 "glm-4.5-flash" => Ok(Self::Glm45Flash),
9527 "glm-4.5v" => Ok(Self::Glm45v),
9528 "glm-4.6" => Ok(Self::Glm46),
9529 "glm-4.6v" => Ok(Self::Glm46v),
9530 "glm-4.7" => Ok(Self::Glm47),
9531 "glm-4.7-flash" => Ok(Self::Glm47Flash),
9532 "glm-4.7-flashx" => Ok(Self::Glm47Flashx),
9533 "glm-5" => Ok(Self::Glm5),
9534 "glm-5-turbo" => Ok(Self::Glm5Turbo),
9535 "glm-5.1" => Ok(Self::Glm51),
9536 "glm-5.2" => Ok(Self::Glm52),
9537 "glm-5v-turbo" => Ok(Self::Glm5vTurbo),
9538 _ => Err(format!("Unknown zai model: '{s}'")),
9539 }
9540 }
9541}
9542impl BedrockFoundationModel {
9543 #[allow(clippy::too_many_lines)]
9544 fn model_id(self) -> &'static str {
9545 match self {
9546 Self::AmazonNova2LiteV10 => "amazon.nova-2-lite-v1:0",
9547 Self::AmazonNovaLiteV10 => "amazon.nova-lite-v1:0",
9548 Self::AmazonNovaMicroV10 => "amazon.nova-micro-v1:0",
9549 Self::AmazonNovaProV10 => "amazon.nova-pro-v1:0",
9550 Self::AnthropicClaudeFable5 => "anthropic.claude-fable-5",
9551 Self::AnthropicClaudeHaiku4520251001V10 => {
9552 "anthropic.claude-haiku-4-5-20251001-v1:0"
9553 }
9554 Self::AnthropicClaudeOpus4120250805V10 => {
9555 "anthropic.claude-opus-4-1-20250805-v1:0"
9556 }
9557 Self::AnthropicClaudeOpus4520251101V10 => {
9558 "anthropic.claude-opus-4-5-20251101-v1:0"
9559 }
9560 Self::AnthropicClaudeOpus46V1 => "anthropic.claude-opus-4-6-v1",
9561 Self::AnthropicClaudeOpus47 => "anthropic.claude-opus-4-7",
9562 Self::AnthropicClaudeOpus48 => "anthropic.claude-opus-4-8",
9563 Self::AnthropicClaudeOpus5 => "anthropic.claude-opus-5",
9564 Self::AnthropicClaudeSonnet4520250929V10 => {
9565 "anthropic.claude-sonnet-4-5-20250929-v1:0"
9566 }
9567 Self::AnthropicClaudeSonnet46 => "anthropic.claude-sonnet-4-6",
9568 Self::AnthropicClaudeSonnet5 => "anthropic.claude-sonnet-5",
9569 Self::AuAnthropicClaudeHaiku4520251001V10 => {
9570 "au.anthropic.claude-haiku-4-5-20251001-v1:0"
9571 }
9572 Self::AuAnthropicClaudeOpus46V1 => "au.anthropic.claude-opus-4-6-v1",
9573 Self::AuAnthropicClaudeOpus48 => "au.anthropic.claude-opus-4-8",
9574 Self::AuAnthropicClaudeOpus5 => "au.anthropic.claude-opus-5",
9575 Self::AuAnthropicClaudeSonnet4520250929V10 => {
9576 "au.anthropic.claude-sonnet-4-5-20250929-v1:0"
9577 }
9578 Self::AuAnthropicClaudeSonnet46 => "au.anthropic.claude-sonnet-4-6",
9579 Self::AuAnthropicClaudeSonnet5 => "au.anthropic.claude-sonnet-5",
9580 Self::DeepseekR1V10 => "deepseek.r1-v1:0",
9581 Self::DeepseekV3V10 => "deepseek.v3-v1:0",
9582 Self::DeepseekV32 => "deepseek.v3.2",
9583 Self::EuAnthropicClaudeFable5 => "eu.anthropic.claude-fable-5",
9584 Self::EuAnthropicClaudeHaiku4520251001V10 => {
9585 "eu.anthropic.claude-haiku-4-5-20251001-v1:0"
9586 }
9587 Self::EuAnthropicClaudeOpus4520251101V10 => {
9588 "eu.anthropic.claude-opus-4-5-20251101-v1:0"
9589 }
9590 Self::EuAnthropicClaudeOpus46V1 => "eu.anthropic.claude-opus-4-6-v1",
9591 Self::EuAnthropicClaudeOpus47 => "eu.anthropic.claude-opus-4-7",
9592 Self::EuAnthropicClaudeOpus48 => "eu.anthropic.claude-opus-4-8",
9593 Self::EuAnthropicClaudeOpus5 => "eu.anthropic.claude-opus-5",
9594 Self::EuAnthropicClaudeSonnet4520250929V10 => {
9595 "eu.anthropic.claude-sonnet-4-5-20250929-v1:0"
9596 }
9597 Self::EuAnthropicClaudeSonnet46 => "eu.anthropic.claude-sonnet-4-6",
9598 Self::EuAnthropicClaudeSonnet5 => "eu.anthropic.claude-sonnet-5",
9599 Self::GlobalAnthropicClaudeFable5 => "global.anthropic.claude-fable-5",
9600 Self::GlobalAnthropicClaudeHaiku4520251001V10 => {
9601 "global.anthropic.claude-haiku-4-5-20251001-v1:0"
9602 }
9603 Self::GlobalAnthropicClaudeOpus4520251101V10 => {
9604 "global.anthropic.claude-opus-4-5-20251101-v1:0"
9605 }
9606 Self::GlobalAnthropicClaudeOpus46V1 => "global.anthropic.claude-opus-4-6-v1",
9607 Self::GlobalAnthropicClaudeOpus47 => "global.anthropic.claude-opus-4-7",
9608 Self::GlobalAnthropicClaudeOpus48 => "global.anthropic.claude-opus-4-8",
9609 Self::GlobalAnthropicClaudeOpus5 => "global.anthropic.claude-opus-5",
9610 Self::GlobalAnthropicClaudeSonnet4520250929V10 => {
9611 "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
9612 }
9613 Self::GlobalAnthropicClaudeSonnet46 => "global.anthropic.claude-sonnet-4-6",
9614 Self::GlobalAnthropicClaudeSonnet5 => "global.anthropic.claude-sonnet-5",
9615 Self::GoogleGemma327bIt => "google.gemma-3-27b-it",
9616 Self::GoogleGemma34bIt => "google.gemma-3-4b-it",
9617 Self::JpAnthropicClaudeHaiku4520251001V10 => {
9618 "jp.anthropic.claude-haiku-4-5-20251001-v1:0"
9619 }
9620 Self::JpAnthropicClaudeOpus47 => "jp.anthropic.claude-opus-4-7",
9621 Self::JpAnthropicClaudeOpus48 => "jp.anthropic.claude-opus-4-8",
9622 Self::JpAnthropicClaudeOpus5 => "jp.anthropic.claude-opus-5",
9623 Self::JpAnthropicClaudeSonnet4520250929V10 => {
9624 "jp.anthropic.claude-sonnet-4-5-20250929-v1:0"
9625 }
9626 Self::JpAnthropicClaudeSonnet46 => "jp.anthropic.claude-sonnet-4-6",
9627 Self::JpAnthropicClaudeSonnet5 => "jp.anthropic.claude-sonnet-5",
9628 Self::MetaLlama3170bInstructV10 => "meta.llama3-1-70b-instruct-v1:0",
9629 Self::MetaLlama318bInstructV10 => "meta.llama3-1-8b-instruct-v1:0",
9630 Self::MetaLlama3370bInstructV10 => "meta.llama3-3-70b-instruct-v1:0",
9631 Self::MetaLlama4Maverick17bInstructV10 => {
9632 "meta.llama4-maverick-17b-instruct-v1:0"
9633 }
9634 Self::MetaLlama4Scout17bInstructV10 => "meta.llama4-scout-17b-instruct-v1:0",
9635 Self::MinimaxMinimaxM2 => "minimax.minimax-m2",
9636 Self::MinimaxMinimaxM21 => "minimax.minimax-m2.1",
9637 Self::MinimaxMinimaxM25 => "minimax.minimax-m2.5",
9638 Self::MistralDevstral2123b => "mistral.devstral-2-123b",
9639 Self::MistralMagistralSmall2509 => "mistral.magistral-small-2509",
9640 Self::MistralMinistral314bInstruct => "mistral.ministral-3-14b-instruct",
9641 Self::MistralMinistral33bInstruct => "mistral.ministral-3-3b-instruct",
9642 Self::MistralMinistral38bInstruct => "mistral.ministral-3-8b-instruct",
9643 Self::MistralMistralLarge3675bInstruct => {
9644 "mistral.mistral-large-3-675b-instruct"
9645 }
9646 Self::MistralPixtralLarge2502V10 => "mistral.pixtral-large-2502-v1:0",
9647 Self::MistralVoxtralMini3b2507 => "mistral.voxtral-mini-3b-2507",
9648 Self::MistralVoxtralSmall24b2507 => "mistral.voxtral-small-24b-2507",
9649 Self::MoonshotKimiK2Thinking => "moonshot.kimi-k2-thinking",
9650 Self::MoonshotaiKimiK25 => "moonshotai.kimi-k2.5",
9651 Self::NvidiaNemotronNano12bV2 => "nvidia.nemotron-nano-12b-v2",
9652 Self::NvidiaNemotronNano330b => "nvidia.nemotron-nano-3-30b",
9653 Self::NvidiaNemotronNano9bV2 => "nvidia.nemotron-nano-9b-v2",
9654 Self::NvidiaNemotronSuper3120b => "nvidia.nemotron-super-3-120b",
9655 Self::OpenaiGpt54 => "openai.gpt-5.4",
9656 Self::OpenaiGpt55 => "openai.gpt-5.5",
9657 Self::OpenaiGpt56Luna => "openai.gpt-5.6-luna",
9658 Self::OpenaiGpt56Sol => "openai.gpt-5.6-sol",
9659 Self::OpenaiGpt56Terra => "openai.gpt-5.6-terra",
9660 Self::OpenaiGptOss120b => "openai.gpt-oss-120b",
9661 Self::OpenaiGptOss120b10 => "openai.gpt-oss-120b-1:0",
9662 Self::OpenaiGptOss20b => "openai.gpt-oss-20b",
9663 Self::OpenaiGptOss20b10 => "openai.gpt-oss-20b-1:0",
9664 Self::OpenaiGptOssSafeguard120b => "openai.gpt-oss-safeguard-120b",
9665 Self::OpenaiGptOssSafeguard20b => "openai.gpt-oss-safeguard-20b",
9666 Self::QwenQwen3235bA22b2507V10 => "qwen.qwen3-235b-a22b-2507-v1:0",
9667 Self::QwenQwen332bV10 => "qwen.qwen3-32b-v1:0",
9668 Self::QwenQwen3Coder30bA3bV10 => "qwen.qwen3-coder-30b-a3b-v1:0",
9669 Self::QwenQwen3Coder480bA35bV10 => "qwen.qwen3-coder-480b-a35b-v1:0",
9670 Self::QwenQwen3CoderNext => "qwen.qwen3-coder-next",
9671 Self::QwenQwen3Next80bA3b => "qwen.qwen3-next-80b-a3b",
9672 Self::QwenQwen3Vl235bA22b => "qwen.qwen3-vl-235b-a22b",
9673 Self::UsAnthropicClaudeFable5 => "us.anthropic.claude-fable-5",
9674 Self::UsAnthropicClaudeHaiku4520251001V10 => {
9675 "us.anthropic.claude-haiku-4-5-20251001-v1:0"
9676 }
9677 Self::UsAnthropicClaudeOpus4120250805V10 => {
9678 "us.anthropic.claude-opus-4-1-20250805-v1:0"
9679 }
9680 Self::UsAnthropicClaudeOpus4520251101V10 => {
9681 "us.anthropic.claude-opus-4-5-20251101-v1:0"
9682 }
9683 Self::UsAnthropicClaudeOpus46V1 => "us.anthropic.claude-opus-4-6-v1",
9684 Self::UsAnthropicClaudeOpus47 => "us.anthropic.claude-opus-4-7",
9685 Self::UsAnthropicClaudeOpus48 => "us.anthropic.claude-opus-4-8",
9686 Self::UsAnthropicClaudeOpus5 => "us.anthropic.claude-opus-5",
9687 Self::UsAnthropicClaudeSonnet4520250929V10 => {
9688 "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
9689 }
9690 Self::UsAnthropicClaudeSonnet46 => "us.anthropic.claude-sonnet-4-6",
9691 Self::UsAnthropicClaudeSonnet5 => "us.anthropic.claude-sonnet-5",
9692 Self::UsDeepseekR1V10 => "us.deepseek.r1-v1:0",
9693 Self::UsMetaLlama4Maverick17bInstructV10 => {
9694 "us.meta.llama4-maverick-17b-instruct-v1:0"
9695 }
9696 Self::UsMetaLlama4Scout17bInstructV10 => {
9697 "us.meta.llama4-scout-17b-instruct-v1:0"
9698 }
9699 Self::WriterPalmyraX4V10 => "writer.palmyra-x4-v1:0",
9700 Self::WriterPalmyraX5V10 => "writer.palmyra-x5-v1:0",
9701 Self::XaiGrok43 => "xai.grok-4.3",
9702 Self::ZaiGlm47 => "zai.glm-4.7",
9703 Self::ZaiGlm47Flash => "zai.glm-4.7-flash",
9704 Self::ZaiGlm5 => "zai.glm-5",
9705 }
9706 }
9707 #[allow(clippy::too_many_lines)]
9708 fn display_name(self) -> &'static str {
9709 match self {
9710 Self::AuAnthropicClaudeOpus46V1 => "AU Anthropic Claude Opus 4.6",
9711 Self::AuAnthropicClaudeSonnet46 => "AU Anthropic Claude Sonnet 4.6",
9712 Self::AnthropicClaudeFable5 => "Claude Fable 5",
9713 Self::EuAnthropicClaudeFable5 => "Claude Fable 5 (EU)",
9714 Self::GlobalAnthropicClaudeFable5 => "Claude Fable 5 (Global)",
9715 Self::UsAnthropicClaudeFable5 => "Claude Fable 5 (US)",
9716 Self::AnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5",
9717 Self::AuAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (AU)",
9718 Self::EuAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (EU)",
9719 Self::GlobalAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (Global)",
9720 Self::JpAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (JP)",
9721 Self::UsAnthropicClaudeHaiku4520251001V10 => "Claude Haiku 4.5 (US)",
9722 Self::AnthropicClaudeOpus4120250805V10 => "Claude Opus 4.1",
9723 Self::UsAnthropicClaudeOpus4120250805V10 => "Claude Opus 4.1 (US)",
9724 Self::AnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5",
9725 Self::EuAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (EU)",
9726 Self::GlobalAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (Global)",
9727 Self::UsAnthropicClaudeOpus4520251101V10 => "Claude Opus 4.5 (US)",
9728 Self::AnthropicClaudeOpus46V1 => "Claude Opus 4.6",
9729 Self::EuAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (EU)",
9730 Self::GlobalAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (Global)",
9731 Self::UsAnthropicClaudeOpus46V1 => "Claude Opus 4.6 (US)",
9732 Self::AnthropicClaudeOpus47 => "Claude Opus 4.7",
9733 Self::EuAnthropicClaudeOpus47 => "Claude Opus 4.7 (EU)",
9734 Self::GlobalAnthropicClaudeOpus47 => "Claude Opus 4.7 (Global)",
9735 Self::JpAnthropicClaudeOpus47 => "Claude Opus 4.7 (JP)",
9736 Self::UsAnthropicClaudeOpus47 => "Claude Opus 4.7 (US)",
9737 Self::AnthropicClaudeOpus48 => "Claude Opus 4.8",
9738 Self::AuAnthropicClaudeOpus48 => "Claude Opus 4.8 (AU)",
9739 Self::EuAnthropicClaudeOpus48 => "Claude Opus 4.8 (EU)",
9740 Self::GlobalAnthropicClaudeOpus48 => "Claude Opus 4.8 (Global)",
9741 Self::JpAnthropicClaudeOpus48 => "Claude Opus 4.8 (JP)",
9742 Self::UsAnthropicClaudeOpus48 => "Claude Opus 4.8 (US)",
9743 Self::AnthropicClaudeOpus5 => "Claude Opus 5",
9744 Self::AuAnthropicClaudeOpus5 => "Claude Opus 5 (AU)",
9745 Self::EuAnthropicClaudeOpus5 => "Claude Opus 5 (EU)",
9746 Self::GlobalAnthropicClaudeOpus5 => "Claude Opus 5 (Global)",
9747 Self::JpAnthropicClaudeOpus5 => "Claude Opus 5 (JP)",
9748 Self::UsAnthropicClaudeOpus5 => "Claude Opus 5 (US)",
9749 Self::AnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5",
9750 Self::AuAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (AU)",
9751 Self::EuAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (EU)",
9752 Self::GlobalAnthropicClaudeSonnet4520250929V10 => {
9753 "Claude Sonnet 4.5 (Global)"
9754 }
9755 Self::JpAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (JP)",
9756 Self::UsAnthropicClaudeSonnet4520250929V10 => "Claude Sonnet 4.5 (US)",
9757 Self::AnthropicClaudeSonnet46 => "Claude Sonnet 4.6",
9758 Self::EuAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (EU)",
9759 Self::GlobalAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (Global)",
9760 Self::JpAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (JP)",
9761 Self::UsAnthropicClaudeSonnet46 => "Claude Sonnet 4.6 (US)",
9762 Self::AnthropicClaudeSonnet5 => "Claude Sonnet 5",
9763 Self::AuAnthropicClaudeSonnet5 => "Claude Sonnet 5 (AU)",
9764 Self::EuAnthropicClaudeSonnet5 => "Claude Sonnet 5 (EU)",
9765 Self::GlobalAnthropicClaudeSonnet5 => "Claude Sonnet 5 (Global)",
9766 Self::JpAnthropicClaudeSonnet5 => "Claude Sonnet 5 (JP)",
9767 Self::UsAnthropicClaudeSonnet5 => "Claude Sonnet 5 (US)",
9768 Self::DeepseekR1V10 => "DeepSeek-R1",
9769 Self::UsDeepseekR1V10 => "DeepSeek-R1 (US)",
9770 Self::DeepseekV3V10 => "DeepSeek-V3.1",
9771 Self::DeepseekV32 => "DeepSeek-V3.2",
9772 Self::MistralDevstral2123b => "Devstral 2 123B",
9773 Self::ZaiGlm47 => "GLM-4.7",
9774 Self::ZaiGlm47Flash => "GLM-4.7-Flash",
9775 Self::ZaiGlm5 => "GLM-5",
9776 Self::OpenaiGptOssSafeguard120b => "GPT OSS Safeguard 120B",
9777 Self::OpenaiGptOssSafeguard20b => "GPT OSS Safeguard 20B",
9778 Self::OpenaiGpt54 => "GPT-5.4",
9779 Self::OpenaiGpt55 => "GPT-5.5",
9780 Self::OpenaiGpt56Luna => "GPT-5.6 Luna",
9781 Self::OpenaiGpt56Sol => "GPT-5.6 Sol",
9782 Self::OpenaiGpt56Terra => "GPT-5.6 Terra",
9783 Self::GoogleGemma34bIt => "Gemma 3 4B IT",
9784 Self::GoogleGemma327bIt => "Google Gemma 3 27B Instruct",
9785 Self::XaiGrok43 => "Grok 4.3",
9786 Self::MoonshotKimiK2Thinking => "Kimi K2 Thinking",
9787 Self::MoonshotaiKimiK25 => "Kimi K2.5",
9788 Self::MetaLlama3170bInstructV10 => "Llama 3.1 70B Instruct",
9789 Self::MetaLlama318bInstructV10 => "Llama 3.1 8B Instruct",
9790 Self::MetaLlama3370bInstructV10 => "Llama 3.3 70B Instruct",
9791 Self::MetaLlama4Maverick17bInstructV10 => "Llama 4 Maverick 17B Instruct",
9792 Self::UsMetaLlama4Maverick17bInstructV10 => {
9793 "Llama 4 Maverick 17B Instruct (US)"
9794 }
9795 Self::MetaLlama4Scout17bInstructV10 => "Llama 4 Scout 17B Instruct",
9796 Self::UsMetaLlama4Scout17bInstructV10 => "Llama 4 Scout 17B Instruct (US)",
9797 Self::MistralMagistralSmall2509 => "Magistral Small 1.2",
9798 Self::MinimaxMinimaxM2 => "MiniMax M2",
9799 Self::MinimaxMinimaxM21 => "MiniMax M2.1",
9800 Self::MinimaxMinimaxM25 => "MiniMax M2.5",
9801 Self::MistralMinistral314bInstruct => "Ministral 14B 3.0",
9802 Self::MistralMinistral33bInstruct => "Ministral 3 3B",
9803 Self::MistralMinistral38bInstruct => "Ministral 3 8B",
9804 Self::MistralMistralLarge3675bInstruct => "Mistral Large 3",
9805 Self::NvidiaNemotronSuper3120b => "NVIDIA Nemotron 3 Super 120B A12B",
9806 Self::NvidiaNemotronNano12bV2 => "NVIDIA Nemotron Nano 12B v2 VL BF16",
9807 Self::NvidiaNemotronNano330b => "NVIDIA Nemotron Nano 3 30B",
9808 Self::NvidiaNemotronNano9bV2 => "NVIDIA Nemotron Nano 9B v2",
9809 Self::AmazonNova2LiteV10 => "Nova 2 Lite",
9810 Self::AmazonNovaLiteV10 => "Nova Lite",
9811 Self::AmazonNovaMicroV10 => "Nova Micro",
9812 Self::AmazonNovaProV10 => "Nova Pro",
9813 Self::WriterPalmyraX4V10 => "Palmyra X4",
9814 Self::WriterPalmyraX5V10 => "Palmyra X5",
9815 Self::MistralPixtralLarge2502V10 => "Pixtral Large (25.02)",
9816 Self::QwenQwen3Next80bA3b => "Qwen/Qwen3-Next-80B-A3B-Instruct",
9817 Self::QwenQwen3Vl235bA22b => "Qwen/Qwen3-VL-235B-A22B-Instruct",
9818 Self::QwenQwen3235bA22b2507V10 => "Qwen3 235B A22B 2507",
9819 Self::QwenQwen332bV10 => "Qwen3 32B (dense)",
9820 Self::QwenQwen3Coder30bA3bV10 => "Qwen3 Coder 30B A3B Instruct",
9821 Self::QwenQwen3Coder480bA35bV10 => "Qwen3 Coder 480B A35B Instruct",
9822 Self::QwenQwen3CoderNext => "Qwen3 Coder Next",
9823 Self::MistralVoxtralMini3b2507 => "Voxtral Mini 3B 2507",
9824 Self::MistralVoxtralSmall24b2507 => "Voxtral Small 24B 2507",
9825 Self::OpenaiGptOss120b | Self::OpenaiGptOss120b10 => "gpt-oss-120b",
9826 Self::OpenaiGptOss20b | Self::OpenaiGptOss20b10 => "gpt-oss-20b",
9827 }
9828 }
9829 #[allow(clippy::too_many_lines)]
9830 fn context_window(self) -> u32 {
9831 match self {
9832 Self::QwenQwen332bV10 => 16_384,
9833 Self::MistralVoxtralSmall24b2507 => 32_000,
9834 Self::WriterPalmyraX4V10 => 122_880,
9835 Self::AmazonNova2LiteV10
9836 | Self::AmazonNovaMicroV10
9837 | Self::DeepseekR1V10
9838 | Self::GoogleGemma34bIt
9839 | Self::MetaLlama3170bInstructV10
9840 | Self::MetaLlama318bInstructV10
9841 | Self::MetaLlama3370bInstructV10
9842 | Self::MistralMagistralSmall2509
9843 | Self::MistralMinistral314bInstruct
9844 | Self::MistralMinistral38bInstruct
9845 | Self::MistralPixtralLarge2502V10
9846 | Self::MistralVoxtralMini3b2507
9847 | Self::NvidiaNemotronNano12bV2
9848 | Self::NvidiaNemotronNano330b
9849 | Self::NvidiaNemotronNano9bV2
9850 | Self::OpenaiGptOss120b
9851 | Self::OpenaiGptOss120b10
9852 | Self::OpenaiGptOss20b
9853 | Self::OpenaiGptOss20b10
9854 | Self::OpenaiGptOssSafeguard120b
9855 | Self::OpenaiGptOssSafeguard20b
9856 | Self::UsDeepseekR1V10 => 128_000,
9857 Self::QwenQwen3Coder480bA35bV10 | Self::QwenQwen3CoderNext => 131_072,
9858 Self::DeepseekV3V10 | Self::DeepseekV32 => 163_840,
9859 Self::MinimaxMinimaxM25 => 196_608,
9860 Self::AnthropicClaudeHaiku4520251001V10
9861 | Self::AnthropicClaudeOpus4120250805V10
9862 | Self::AnthropicClaudeOpus4520251101V10
9863 | Self::AnthropicClaudeSonnet4520250929V10
9864 | Self::AuAnthropicClaudeHaiku4520251001V10
9865 | Self::AuAnthropicClaudeSonnet4520250929V10
9866 | Self::EuAnthropicClaudeHaiku4520251001V10
9867 | Self::EuAnthropicClaudeOpus4520251101V10
9868 | Self::EuAnthropicClaudeSonnet4520250929V10
9869 | Self::GlobalAnthropicClaudeHaiku4520251001V10
9870 | Self::GlobalAnthropicClaudeOpus4520251101V10
9871 | Self::GlobalAnthropicClaudeSonnet4520250929V10
9872 | Self::JpAnthropicClaudeHaiku4520251001V10
9873 | Self::JpAnthropicClaudeSonnet4520250929V10
9874 | Self::UsAnthropicClaudeHaiku4520251001V10
9875 | Self::UsAnthropicClaudeOpus4120250805V10
9876 | Self::UsAnthropicClaudeOpus4520251101V10
9877 | Self::UsAnthropicClaudeSonnet4520250929V10
9878 | Self::ZaiGlm47Flash => 200_000,
9879 Self::GoogleGemma327bIt | Self::ZaiGlm5 => 202_752,
9880 Self::MinimaxMinimaxM2 => 204_608,
9881 Self::MinimaxMinimaxM21 | Self::ZaiGlm47 => 204_800,
9882 Self::MistralDevstral2123b
9883 | Self::MistralMinistral33bInstruct
9884 | Self::MistralMistralLarge3675bInstruct => 256_000,
9885 Self::QwenQwen3Next80bA3b | Self::QwenQwen3Vl235bA22b => 262_000,
9886 Self::MoonshotKimiK2Thinking | Self::MoonshotaiKimiK25 => 262_143,
9887 Self::NvidiaNemotronSuper3120b
9888 | Self::QwenQwen3235bA22b2507V10
9889 | Self::QwenQwen3Coder30bA3bV10 => 262_144,
9890 Self::OpenaiGpt54
9891 | Self::OpenaiGpt55
9892 | Self::OpenaiGpt56Luna
9893 | Self::OpenaiGpt56Sol
9894 | Self::OpenaiGpt56Terra => 272_000,
9895 Self::AmazonNovaLiteV10 | Self::AmazonNovaProV10 => 300_000,
9896 Self::AnthropicClaudeFable5
9897 | Self::AnthropicClaudeOpus46V1
9898 | Self::AnthropicClaudeOpus47
9899 | Self::AnthropicClaudeOpus48
9900 | Self::AnthropicClaudeOpus5
9901 | Self::AnthropicClaudeSonnet46
9902 | Self::AnthropicClaudeSonnet5
9903 | Self::AuAnthropicClaudeOpus46V1
9904 | Self::AuAnthropicClaudeOpus48
9905 | Self::AuAnthropicClaudeOpus5
9906 | Self::AuAnthropicClaudeSonnet46
9907 | Self::AuAnthropicClaudeSonnet5
9908 | Self::EuAnthropicClaudeFable5
9909 | Self::EuAnthropicClaudeOpus46V1
9910 | Self::EuAnthropicClaudeOpus47
9911 | Self::EuAnthropicClaudeOpus48
9912 | Self::EuAnthropicClaudeOpus5
9913 | Self::EuAnthropicClaudeSonnet46
9914 | Self::EuAnthropicClaudeSonnet5
9915 | Self::GlobalAnthropicClaudeFable5
9916 | Self::GlobalAnthropicClaudeOpus46V1
9917 | Self::GlobalAnthropicClaudeOpus47
9918 | Self::GlobalAnthropicClaudeOpus48
9919 | Self::GlobalAnthropicClaudeOpus5
9920 | Self::GlobalAnthropicClaudeSonnet46
9921 | Self::GlobalAnthropicClaudeSonnet5
9922 | Self::JpAnthropicClaudeOpus47
9923 | Self::JpAnthropicClaudeOpus48
9924 | Self::JpAnthropicClaudeOpus5
9925 | Self::JpAnthropicClaudeSonnet46
9926 | Self::JpAnthropicClaudeSonnet5
9927 | Self::MetaLlama4Maverick17bInstructV10
9928 | Self::UsAnthropicClaudeFable5
9929 | Self::UsAnthropicClaudeOpus46V1
9930 | Self::UsAnthropicClaudeOpus47
9931 | Self::UsAnthropicClaudeOpus48
9932 | Self::UsAnthropicClaudeOpus5
9933 | Self::UsAnthropicClaudeSonnet46
9934 | Self::UsAnthropicClaudeSonnet5
9935 | Self::UsMetaLlama4Maverick17bInstructV10
9936 | Self::XaiGrok43 => 1_000_000,
9937 Self::WriterPalmyraX5V10 => 1_040_000,
9938 Self::MetaLlama4Scout17bInstructV10
9939 | Self::UsMetaLlama4Scout17bInstructV10 => 3_500_000,
9940 }
9941 }
9942 #[allow(clippy::too_many_lines)]
9943 pub fn reasoning_levels(self) -> &'static [ReasoningEffort] {
9944 match self {
9945 Self::AmazonNovaLiteV10
9946 | Self::AmazonNovaMicroV10
9947 | Self::AmazonNovaProV10
9948 | Self::GoogleGemma327bIt
9949 | Self::GoogleGemma34bIt
9950 | Self::MetaLlama3170bInstructV10
9951 | Self::MetaLlama318bInstructV10
9952 | Self::MetaLlama3370bInstructV10
9953 | Self::MetaLlama4Maverick17bInstructV10
9954 | Self::MetaLlama4Scout17bInstructV10
9955 | Self::MistralDevstral2123b
9956 | Self::MistralMinistral314bInstruct
9957 | Self::MistralMinistral33bInstruct
9958 | Self::MistralMinistral38bInstruct
9959 | Self::MistralMistralLarge3675bInstruct
9960 | Self::MistralPixtralLarge2502V10
9961 | Self::MistralVoxtralMini3b2507
9962 | Self::MistralVoxtralSmall24b2507
9963 | Self::NvidiaNemotronNano12bV2
9964 | Self::NvidiaNemotronNano9bV2
9965 | Self::OpenaiGptOssSafeguard120b
9966 | Self::OpenaiGptOssSafeguard20b
9967 | Self::QwenQwen3235bA22b2507V10
9968 | Self::QwenQwen3Coder30bA3bV10
9969 | Self::QwenQwen3Coder480bA35bV10
9970 | Self::QwenQwen3Next80bA3b
9971 | Self::QwenQwen3Vl235bA22b
9972 | Self::UsMetaLlama4Maverick17bInstructV10
9973 | Self::UsMetaLlama4Scout17bInstructV10 => &[],
9974 Self::AmazonNova2LiteV10
9975 | Self::AnthropicClaudeHaiku4520251001V10
9976 | Self::AnthropicClaudeOpus4120250805V10
9977 | Self::AnthropicClaudeOpus4520251101V10
9978 | Self::AnthropicClaudeSonnet4520250929V10
9979 | Self::AuAnthropicClaudeHaiku4520251001V10
9980 | Self::AuAnthropicClaudeSonnet4520250929V10
9981 | Self::DeepseekR1V10
9982 | Self::DeepseekV3V10
9983 | Self::DeepseekV32
9984 | Self::EuAnthropicClaudeHaiku4520251001V10
9985 | Self::EuAnthropicClaudeOpus4520251101V10
9986 | Self::EuAnthropicClaudeSonnet4520250929V10
9987 | Self::GlobalAnthropicClaudeHaiku4520251001V10
9988 | Self::GlobalAnthropicClaudeOpus4520251101V10
9989 | Self::GlobalAnthropicClaudeSonnet4520250929V10
9990 | Self::JpAnthropicClaudeHaiku4520251001V10
9991 | Self::JpAnthropicClaudeSonnet4520250929V10
9992 | Self::MinimaxMinimaxM2
9993 | Self::MinimaxMinimaxM21
9994 | Self::MinimaxMinimaxM25
9995 | Self::MistralMagistralSmall2509
9996 | Self::MoonshotKimiK2Thinking
9997 | Self::MoonshotaiKimiK25
9998 | Self::NvidiaNemotronNano330b
9999 | Self::NvidiaNemotronSuper3120b
10000 | Self::OpenaiGptOss120b
10001 | Self::OpenaiGptOss120b10
10002 | Self::OpenaiGptOss20b
10003 | Self::OpenaiGptOss20b10
10004 | Self::QwenQwen332bV10
10005 | Self::QwenQwen3CoderNext
10006 | Self::UsAnthropicClaudeHaiku4520251001V10
10007 | Self::UsAnthropicClaudeOpus4120250805V10
10008 | Self::UsAnthropicClaudeOpus4520251101V10
10009 | Self::UsAnthropicClaudeSonnet4520250929V10
10010 | Self::UsDeepseekR1V10
10011 | Self::WriterPalmyraX4V10
10012 | Self::WriterPalmyraX5V10
10013 | Self::XaiGrok43
10014 | Self::ZaiGlm47
10015 | Self::ZaiGlm47Flash
10016 | Self::ZaiGlm5 => {
10017 &[ReasoningEffort::Low, ReasoningEffort::Medium, ReasoningEffort::High]
10018 }
10019 Self::AnthropicClaudeOpus46V1
10020 | Self::AnthropicClaudeSonnet46
10021 | Self::AuAnthropicClaudeOpus46V1
10022 | Self::AuAnthropicClaudeSonnet46
10023 | Self::EuAnthropicClaudeOpus46V1
10024 | Self::EuAnthropicClaudeSonnet46
10025 | Self::GlobalAnthropicClaudeOpus46V1
10026 | Self::GlobalAnthropicClaudeSonnet46
10027 | Self::JpAnthropicClaudeSonnet46
10028 | Self::UsAnthropicClaudeOpus46V1
10029 | Self::UsAnthropicClaudeSonnet46 => {
10030 &[
10031 ReasoningEffort::Low,
10032 ReasoningEffort::Medium,
10033 ReasoningEffort::High,
10034 ReasoningEffort::Max,
10035 ]
10036 }
10037 Self::OpenaiGpt54 | Self::OpenaiGpt55 => {
10038 &[
10039 ReasoningEffort::Low,
10040 ReasoningEffort::Medium,
10041 ReasoningEffort::High,
10042 ReasoningEffort::Xhigh,
10043 ]
10044 }
10045 Self::AnthropicClaudeFable5
10046 | Self::AnthropicClaudeOpus47
10047 | Self::AnthropicClaudeOpus48
10048 | Self::AnthropicClaudeOpus5
10049 | Self::AnthropicClaudeSonnet5
10050 | Self::AuAnthropicClaudeOpus48
10051 | Self::AuAnthropicClaudeOpus5
10052 | Self::AuAnthropicClaudeSonnet5
10053 | Self::EuAnthropicClaudeFable5
10054 | Self::EuAnthropicClaudeOpus47
10055 | Self::EuAnthropicClaudeOpus48
10056 | Self::EuAnthropicClaudeOpus5
10057 | Self::EuAnthropicClaudeSonnet5
10058 | Self::GlobalAnthropicClaudeFable5
10059 | Self::GlobalAnthropicClaudeOpus47
10060 | Self::GlobalAnthropicClaudeOpus48
10061 | Self::GlobalAnthropicClaudeOpus5
10062 | Self::GlobalAnthropicClaudeSonnet5
10063 | Self::JpAnthropicClaudeOpus47
10064 | Self::JpAnthropicClaudeOpus48
10065 | Self::JpAnthropicClaudeOpus5
10066 | Self::JpAnthropicClaudeSonnet5
10067 | Self::OpenaiGpt56Luna
10068 | Self::OpenaiGpt56Sol
10069 | Self::OpenaiGpt56Terra
10070 | Self::UsAnthropicClaudeFable5
10071 | Self::UsAnthropicClaudeOpus47
10072 | Self::UsAnthropicClaudeOpus48
10073 | Self::UsAnthropicClaudeOpus5
10074 | Self::UsAnthropicClaudeSonnet5 => {
10075 &[
10076 ReasoningEffort::Low,
10077 ReasoningEffort::Medium,
10078 ReasoningEffort::High,
10079 ReasoningEffort::Xhigh,
10080 ReasoningEffort::Max,
10081 ]
10082 }
10083 }
10084 }
10085 pub fn supports_reasoning(self) -> bool {
10086 !self.reasoning_levels().is_empty()
10087 }
10088 #[allow(clippy::too_many_lines)]
10089 pub fn supports_prompt_caching(self) -> bool {
10090 match self {
10091 Self::AmazonNova2LiteV10
10092 | Self::DeepseekR1V10
10093 | Self::DeepseekV3V10
10094 | Self::DeepseekV32
10095 | Self::GoogleGemma327bIt
10096 | Self::GoogleGemma34bIt
10097 | Self::MetaLlama3170bInstructV10
10098 | Self::MetaLlama318bInstructV10
10099 | Self::MetaLlama3370bInstructV10
10100 | Self::MetaLlama4Maverick17bInstructV10
10101 | Self::MetaLlama4Scout17bInstructV10
10102 | Self::MinimaxMinimaxM2
10103 | Self::MinimaxMinimaxM21
10104 | Self::MinimaxMinimaxM25
10105 | Self::MistralDevstral2123b
10106 | Self::MistralMagistralSmall2509
10107 | Self::MistralMinistral314bInstruct
10108 | Self::MistralMinistral33bInstruct
10109 | Self::MistralMinistral38bInstruct
10110 | Self::MistralMistralLarge3675bInstruct
10111 | Self::MistralPixtralLarge2502V10
10112 | Self::MistralVoxtralMini3b2507
10113 | Self::MistralVoxtralSmall24b2507
10114 | Self::MoonshotKimiK2Thinking
10115 | Self::MoonshotaiKimiK25
10116 | Self::NvidiaNemotronNano12bV2
10117 | Self::NvidiaNemotronNano330b
10118 | Self::NvidiaNemotronNano9bV2
10119 | Self::NvidiaNemotronSuper3120b
10120 | Self::OpenaiGptOss120b
10121 | Self::OpenaiGptOss120b10
10122 | Self::OpenaiGptOss20b
10123 | Self::OpenaiGptOss20b10
10124 | Self::OpenaiGptOssSafeguard120b
10125 | Self::OpenaiGptOssSafeguard20b
10126 | Self::QwenQwen3235bA22b2507V10
10127 | Self::QwenQwen332bV10
10128 | Self::QwenQwen3Coder30bA3bV10
10129 | Self::QwenQwen3Coder480bA35bV10
10130 | Self::QwenQwen3CoderNext
10131 | Self::QwenQwen3Next80bA3b
10132 | Self::QwenQwen3Vl235bA22b
10133 | Self::UsDeepseekR1V10
10134 | Self::UsMetaLlama4Maverick17bInstructV10
10135 | Self::UsMetaLlama4Scout17bInstructV10
10136 | Self::WriterPalmyraX4V10
10137 | Self::WriterPalmyraX5V10
10138 | Self::ZaiGlm47
10139 | Self::ZaiGlm47Flash
10140 | Self::ZaiGlm5 => false,
10141 Self::AmazonNovaLiteV10
10142 | Self::AmazonNovaMicroV10
10143 | Self::AmazonNovaProV10
10144 | Self::AnthropicClaudeFable5
10145 | Self::AnthropicClaudeHaiku4520251001V10
10146 | Self::AnthropicClaudeOpus4120250805V10
10147 | Self::AnthropicClaudeOpus4520251101V10
10148 | Self::AnthropicClaudeOpus46V1
10149 | Self::AnthropicClaudeOpus47
10150 | Self::AnthropicClaudeOpus48
10151 | Self::AnthropicClaudeOpus5
10152 | Self::AnthropicClaudeSonnet4520250929V10
10153 | Self::AnthropicClaudeSonnet46
10154 | Self::AnthropicClaudeSonnet5
10155 | Self::AuAnthropicClaudeHaiku4520251001V10
10156 | Self::AuAnthropicClaudeOpus46V1
10157 | Self::AuAnthropicClaudeOpus48
10158 | Self::AuAnthropicClaudeOpus5
10159 | Self::AuAnthropicClaudeSonnet4520250929V10
10160 | Self::AuAnthropicClaudeSonnet46
10161 | Self::AuAnthropicClaudeSonnet5
10162 | Self::EuAnthropicClaudeFable5
10163 | Self::EuAnthropicClaudeHaiku4520251001V10
10164 | Self::EuAnthropicClaudeOpus4520251101V10
10165 | Self::EuAnthropicClaudeOpus46V1
10166 | Self::EuAnthropicClaudeOpus47
10167 | Self::EuAnthropicClaudeOpus48
10168 | Self::EuAnthropicClaudeOpus5
10169 | Self::EuAnthropicClaudeSonnet4520250929V10
10170 | Self::EuAnthropicClaudeSonnet46
10171 | Self::EuAnthropicClaudeSonnet5
10172 | Self::GlobalAnthropicClaudeFable5
10173 | Self::GlobalAnthropicClaudeHaiku4520251001V10
10174 | Self::GlobalAnthropicClaudeOpus4520251101V10
10175 | Self::GlobalAnthropicClaudeOpus46V1
10176 | Self::GlobalAnthropicClaudeOpus47
10177 | Self::GlobalAnthropicClaudeOpus48
10178 | Self::GlobalAnthropicClaudeOpus5
10179 | Self::GlobalAnthropicClaudeSonnet4520250929V10
10180 | Self::GlobalAnthropicClaudeSonnet46
10181 | Self::GlobalAnthropicClaudeSonnet5
10182 | Self::JpAnthropicClaudeHaiku4520251001V10
10183 | Self::JpAnthropicClaudeOpus47
10184 | Self::JpAnthropicClaudeOpus48
10185 | Self::JpAnthropicClaudeOpus5
10186 | Self::JpAnthropicClaudeSonnet4520250929V10
10187 | Self::JpAnthropicClaudeSonnet46
10188 | Self::JpAnthropicClaudeSonnet5
10189 | Self::OpenaiGpt54
10190 | Self::OpenaiGpt55
10191 | Self::OpenaiGpt56Luna
10192 | Self::OpenaiGpt56Sol
10193 | Self::OpenaiGpt56Terra
10194 | Self::UsAnthropicClaudeFable5
10195 | Self::UsAnthropicClaudeHaiku4520251001V10
10196 | Self::UsAnthropicClaudeOpus4120250805V10
10197 | Self::UsAnthropicClaudeOpus4520251101V10
10198 | Self::UsAnthropicClaudeOpus46V1
10199 | Self::UsAnthropicClaudeOpus47
10200 | Self::UsAnthropicClaudeOpus48
10201 | Self::UsAnthropicClaudeOpus5
10202 | Self::UsAnthropicClaudeSonnet4520250929V10
10203 | Self::UsAnthropicClaudeSonnet46
10204 | Self::UsAnthropicClaudeSonnet5
10205 | Self::XaiGrok43 => true,
10206 }
10207 }
10208 #[allow(clippy::too_many_lines, clippy::match_same_arms, clippy::unreadable_literal)]
10209 pub fn pricing(self) -> Option<ModelPricing> {
10210 match self {
10211 Self::AmazonNova2LiteV10 => {
10212 Some(ModelPricing {
10213 input_per_million: 0.33f64,
10214 output_per_million: 2.75f64,
10215 cache_read_per_million: None,
10216 cache_write_per_million: None,
10217 })
10218 }
10219 Self::AmazonNovaLiteV10 => {
10220 Some(ModelPricing {
10221 input_per_million: 0.06f64,
10222 output_per_million: 0.24f64,
10223 cache_read_per_million: Some(0.015f64),
10224 cache_write_per_million: None,
10225 })
10226 }
10227 Self::AmazonNovaMicroV10 => {
10228 Some(ModelPricing {
10229 input_per_million: 0.035f64,
10230 output_per_million: 0.14f64,
10231 cache_read_per_million: Some(0.00875f64),
10232 cache_write_per_million: None,
10233 })
10234 }
10235 Self::AmazonNovaProV10 => {
10236 Some(ModelPricing {
10237 input_per_million: 0.8f64,
10238 output_per_million: 3.2f64,
10239 cache_read_per_million: Some(0.2f64),
10240 cache_write_per_million: None,
10241 })
10242 }
10243 Self::AnthropicClaudeFable5 => {
10244 Some(ModelPricing {
10245 input_per_million: 10f64,
10246 output_per_million: 50f64,
10247 cache_read_per_million: Some(1f64),
10248 cache_write_per_million: Some(12.5f64),
10249 })
10250 }
10251 Self::AnthropicClaudeHaiku4520251001V10 => {
10252 Some(ModelPricing {
10253 input_per_million: 1f64,
10254 output_per_million: 5f64,
10255 cache_read_per_million: Some(0.1f64),
10256 cache_write_per_million: Some(1.25f64),
10257 })
10258 }
10259 Self::AnthropicClaudeOpus4120250805V10 => {
10260 Some(ModelPricing {
10261 input_per_million: 15f64,
10262 output_per_million: 75f64,
10263 cache_read_per_million: Some(1.5f64),
10264 cache_write_per_million: Some(18.75f64),
10265 })
10266 }
10267 Self::AnthropicClaudeOpus4520251101V10 => {
10268 Some(ModelPricing {
10269 input_per_million: 5f64,
10270 output_per_million: 25f64,
10271 cache_read_per_million: Some(0.5f64),
10272 cache_write_per_million: Some(6.25f64),
10273 })
10274 }
10275 Self::AnthropicClaudeOpus46V1 => {
10276 Some(ModelPricing {
10277 input_per_million: 5f64,
10278 output_per_million: 25f64,
10279 cache_read_per_million: Some(0.5f64),
10280 cache_write_per_million: Some(6.25f64),
10281 })
10282 }
10283 Self::AnthropicClaudeOpus47 => {
10284 Some(ModelPricing {
10285 input_per_million: 5f64,
10286 output_per_million: 25f64,
10287 cache_read_per_million: Some(0.5f64),
10288 cache_write_per_million: Some(6.25f64),
10289 })
10290 }
10291 Self::AnthropicClaudeOpus48 => {
10292 Some(ModelPricing {
10293 input_per_million: 5f64,
10294 output_per_million: 25f64,
10295 cache_read_per_million: Some(0.5f64),
10296 cache_write_per_million: Some(6.25f64),
10297 })
10298 }
10299 Self::AnthropicClaudeOpus5 => {
10300 Some(ModelPricing {
10301 input_per_million: 5f64,
10302 output_per_million: 25f64,
10303 cache_read_per_million: Some(0.5f64),
10304 cache_write_per_million: Some(6.25f64),
10305 })
10306 }
10307 Self::AnthropicClaudeSonnet4520250929V10 => {
10308 Some(ModelPricing {
10309 input_per_million: 3f64,
10310 output_per_million: 15f64,
10311 cache_read_per_million: Some(0.3f64),
10312 cache_write_per_million: Some(3.75f64),
10313 })
10314 }
10315 Self::AnthropicClaudeSonnet46 => {
10316 Some(ModelPricing {
10317 input_per_million: 3f64,
10318 output_per_million: 15f64,
10319 cache_read_per_million: Some(0.3f64),
10320 cache_write_per_million: Some(3.75f64),
10321 })
10322 }
10323 Self::AnthropicClaudeSonnet5 => {
10324 Some(ModelPricing {
10325 input_per_million: 2f64,
10326 output_per_million: 10f64,
10327 cache_read_per_million: Some(0.2f64),
10328 cache_write_per_million: Some(2.5f64),
10329 })
10330 }
10331 Self::AuAnthropicClaudeHaiku4520251001V10 => {
10332 Some(ModelPricing {
10333 input_per_million: 1f64,
10334 output_per_million: 5f64,
10335 cache_read_per_million: Some(0.1f64),
10336 cache_write_per_million: Some(1.25f64),
10337 })
10338 }
10339 Self::AuAnthropicClaudeOpus46V1 => {
10340 Some(ModelPricing {
10341 input_per_million: 16.5f64,
10342 output_per_million: 82.5f64,
10343 cache_read_per_million: Some(1.65f64),
10344 cache_write_per_million: Some(20.625f64),
10345 })
10346 }
10347 Self::AuAnthropicClaudeOpus48 => {
10348 Some(ModelPricing {
10349 input_per_million: 5f64,
10350 output_per_million: 25f64,
10351 cache_read_per_million: Some(0.5f64),
10352 cache_write_per_million: Some(6.25f64),
10353 })
10354 }
10355 Self::AuAnthropicClaudeOpus5 => {
10356 Some(ModelPricing {
10357 input_per_million: 5f64,
10358 output_per_million: 25f64,
10359 cache_read_per_million: Some(0.5f64),
10360 cache_write_per_million: Some(6.25f64),
10361 })
10362 }
10363 Self::AuAnthropicClaudeSonnet4520250929V10 => {
10364 Some(ModelPricing {
10365 input_per_million: 3f64,
10366 output_per_million: 15f64,
10367 cache_read_per_million: Some(0.3f64),
10368 cache_write_per_million: Some(3.75f64),
10369 })
10370 }
10371 Self::AuAnthropicClaudeSonnet46 => {
10372 Some(ModelPricing {
10373 input_per_million: 3.3f64,
10374 output_per_million: 16.5f64,
10375 cache_read_per_million: Some(0.33f64),
10376 cache_write_per_million: Some(4.125f64),
10377 })
10378 }
10379 Self::AuAnthropicClaudeSonnet5 => {
10380 Some(ModelPricing {
10381 input_per_million: 2f64,
10382 output_per_million: 10f64,
10383 cache_read_per_million: Some(0.2f64),
10384 cache_write_per_million: Some(2.5f64),
10385 })
10386 }
10387 Self::DeepseekR1V10 => {
10388 Some(ModelPricing {
10389 input_per_million: 1.35f64,
10390 output_per_million: 5.4f64,
10391 cache_read_per_million: None,
10392 cache_write_per_million: None,
10393 })
10394 }
10395 Self::DeepseekV3V10 => {
10396 Some(ModelPricing {
10397 input_per_million: 0.58f64,
10398 output_per_million: 1.68f64,
10399 cache_read_per_million: None,
10400 cache_write_per_million: None,
10401 })
10402 }
10403 Self::DeepseekV32 => {
10404 Some(ModelPricing {
10405 input_per_million: 0.62f64,
10406 output_per_million: 1.85f64,
10407 cache_read_per_million: None,
10408 cache_write_per_million: None,
10409 })
10410 }
10411 Self::EuAnthropicClaudeFable5 => {
10412 Some(ModelPricing {
10413 input_per_million: 11f64,
10414 output_per_million: 55f64,
10415 cache_read_per_million: Some(1.1f64),
10416 cache_write_per_million: Some(13.75f64),
10417 })
10418 }
10419 Self::EuAnthropicClaudeHaiku4520251001V10 => {
10420 Some(ModelPricing {
10421 input_per_million: 1.1f64,
10422 output_per_million: 5.5f64,
10423 cache_read_per_million: Some(0.11f64),
10424 cache_write_per_million: Some(1.375f64),
10425 })
10426 }
10427 Self::EuAnthropicClaudeOpus4520251101V10 => {
10428 Some(ModelPricing {
10429 input_per_million: 5.5f64,
10430 output_per_million: 27.5f64,
10431 cache_read_per_million: Some(0.55f64),
10432 cache_write_per_million: Some(6.875f64),
10433 })
10434 }
10435 Self::EuAnthropicClaudeOpus46V1 => {
10436 Some(ModelPricing {
10437 input_per_million: 5.5f64,
10438 output_per_million: 27.5f64,
10439 cache_read_per_million: Some(0.55f64),
10440 cache_write_per_million: Some(6.875f64),
10441 })
10442 }
10443 Self::EuAnthropicClaudeOpus47 => {
10444 Some(ModelPricing {
10445 input_per_million: 5.5f64,
10446 output_per_million: 27.5f64,
10447 cache_read_per_million: Some(0.55f64),
10448 cache_write_per_million: Some(6.875f64),
10449 })
10450 }
10451 Self::EuAnthropicClaudeOpus48 => {
10452 Some(ModelPricing {
10453 input_per_million: 5.5f64,
10454 output_per_million: 27.5f64,
10455 cache_read_per_million: Some(0.55f64),
10456 cache_write_per_million: Some(6.875f64),
10457 })
10458 }
10459 Self::EuAnthropicClaudeOpus5 => {
10460 Some(ModelPricing {
10461 input_per_million: 5.5f64,
10462 output_per_million: 27.5f64,
10463 cache_read_per_million: Some(0.55f64),
10464 cache_write_per_million: Some(6.875f64),
10465 })
10466 }
10467 Self::EuAnthropicClaudeSonnet4520250929V10 => {
10468 Some(ModelPricing {
10469 input_per_million: 3.3f64,
10470 output_per_million: 16.5f64,
10471 cache_read_per_million: Some(0.33f64),
10472 cache_write_per_million: Some(4.125f64),
10473 })
10474 }
10475 Self::EuAnthropicClaudeSonnet46 => {
10476 Some(ModelPricing {
10477 input_per_million: 3.3f64,
10478 output_per_million: 16.5f64,
10479 cache_read_per_million: Some(0.33f64),
10480 cache_write_per_million: Some(4.125f64),
10481 })
10482 }
10483 Self::EuAnthropicClaudeSonnet5 => {
10484 Some(ModelPricing {
10485 input_per_million: 2.2f64,
10486 output_per_million: 11f64,
10487 cache_read_per_million: Some(0.22f64),
10488 cache_write_per_million: Some(2.75f64),
10489 })
10490 }
10491 Self::GlobalAnthropicClaudeFable5 => {
10492 Some(ModelPricing {
10493 input_per_million: 10f64,
10494 output_per_million: 50f64,
10495 cache_read_per_million: Some(1f64),
10496 cache_write_per_million: Some(12.5f64),
10497 })
10498 }
10499 Self::GlobalAnthropicClaudeHaiku4520251001V10 => {
10500 Some(ModelPricing {
10501 input_per_million: 1f64,
10502 output_per_million: 5f64,
10503 cache_read_per_million: Some(0.1f64),
10504 cache_write_per_million: Some(1.25f64),
10505 })
10506 }
10507 Self::GlobalAnthropicClaudeOpus4520251101V10 => {
10508 Some(ModelPricing {
10509 input_per_million: 5f64,
10510 output_per_million: 25f64,
10511 cache_read_per_million: Some(0.5f64),
10512 cache_write_per_million: Some(6.25f64),
10513 })
10514 }
10515 Self::GlobalAnthropicClaudeOpus46V1 => {
10516 Some(ModelPricing {
10517 input_per_million: 5f64,
10518 output_per_million: 25f64,
10519 cache_read_per_million: Some(0.5f64),
10520 cache_write_per_million: Some(6.25f64),
10521 })
10522 }
10523 Self::GlobalAnthropicClaudeOpus47 => {
10524 Some(ModelPricing {
10525 input_per_million: 5f64,
10526 output_per_million: 25f64,
10527 cache_read_per_million: Some(0.5f64),
10528 cache_write_per_million: Some(6.25f64),
10529 })
10530 }
10531 Self::GlobalAnthropicClaudeOpus48 => {
10532 Some(ModelPricing {
10533 input_per_million: 5f64,
10534 output_per_million: 25f64,
10535 cache_read_per_million: Some(0.5f64),
10536 cache_write_per_million: Some(6.25f64),
10537 })
10538 }
10539 Self::GlobalAnthropicClaudeOpus5 => {
10540 Some(ModelPricing {
10541 input_per_million: 5f64,
10542 output_per_million: 25f64,
10543 cache_read_per_million: Some(0.5f64),
10544 cache_write_per_million: Some(6.25f64),
10545 })
10546 }
10547 Self::GlobalAnthropicClaudeSonnet4520250929V10 => {
10548 Some(ModelPricing {
10549 input_per_million: 3f64,
10550 output_per_million: 15f64,
10551 cache_read_per_million: Some(0.3f64),
10552 cache_write_per_million: Some(3.75f64),
10553 })
10554 }
10555 Self::GlobalAnthropicClaudeSonnet46 => {
10556 Some(ModelPricing {
10557 input_per_million: 3f64,
10558 output_per_million: 15f64,
10559 cache_read_per_million: Some(0.3f64),
10560 cache_write_per_million: Some(3.75f64),
10561 })
10562 }
10563 Self::GlobalAnthropicClaudeSonnet5 => {
10564 Some(ModelPricing {
10565 input_per_million: 2f64,
10566 output_per_million: 10f64,
10567 cache_read_per_million: Some(0.2f64),
10568 cache_write_per_million: Some(2.5f64),
10569 })
10570 }
10571 Self::GoogleGemma327bIt => {
10572 Some(ModelPricing {
10573 input_per_million: 0.12f64,
10574 output_per_million: 0.2f64,
10575 cache_read_per_million: None,
10576 cache_write_per_million: None,
10577 })
10578 }
10579 Self::GoogleGemma34bIt => {
10580 Some(ModelPricing {
10581 input_per_million: 0.04f64,
10582 output_per_million: 0.08f64,
10583 cache_read_per_million: None,
10584 cache_write_per_million: None,
10585 })
10586 }
10587 Self::JpAnthropicClaudeHaiku4520251001V10 => {
10588 Some(ModelPricing {
10589 input_per_million: 1f64,
10590 output_per_million: 5f64,
10591 cache_read_per_million: Some(0.1f64),
10592 cache_write_per_million: Some(1.25f64),
10593 })
10594 }
10595 Self::JpAnthropicClaudeOpus47 => {
10596 Some(ModelPricing {
10597 input_per_million: 5f64,
10598 output_per_million: 25f64,
10599 cache_read_per_million: Some(0.5f64),
10600 cache_write_per_million: Some(6.25f64),
10601 })
10602 }
10603 Self::JpAnthropicClaudeOpus48 => {
10604 Some(ModelPricing {
10605 input_per_million: 5f64,
10606 output_per_million: 25f64,
10607 cache_read_per_million: Some(0.5f64),
10608 cache_write_per_million: Some(6.25f64),
10609 })
10610 }
10611 Self::JpAnthropicClaudeOpus5 => {
10612 Some(ModelPricing {
10613 input_per_million: 5f64,
10614 output_per_million: 25f64,
10615 cache_read_per_million: Some(0.5f64),
10616 cache_write_per_million: Some(6.25f64),
10617 })
10618 }
10619 Self::JpAnthropicClaudeSonnet4520250929V10 => {
10620 Some(ModelPricing {
10621 input_per_million: 3f64,
10622 output_per_million: 15f64,
10623 cache_read_per_million: Some(0.3f64),
10624 cache_write_per_million: Some(3.75f64),
10625 })
10626 }
10627 Self::JpAnthropicClaudeSonnet46 => {
10628 Some(ModelPricing {
10629 input_per_million: 3f64,
10630 output_per_million: 15f64,
10631 cache_read_per_million: Some(0.3f64),
10632 cache_write_per_million: Some(3.75f64),
10633 })
10634 }
10635 Self::JpAnthropicClaudeSonnet5 => {
10636 Some(ModelPricing {
10637 input_per_million: 2f64,
10638 output_per_million: 10f64,
10639 cache_read_per_million: Some(0.2f64),
10640 cache_write_per_million: Some(2.5f64),
10641 })
10642 }
10643 Self::MetaLlama3170bInstructV10 => {
10644 Some(ModelPricing {
10645 input_per_million: 0.72f64,
10646 output_per_million: 0.72f64,
10647 cache_read_per_million: None,
10648 cache_write_per_million: None,
10649 })
10650 }
10651 Self::MetaLlama318bInstructV10 => {
10652 Some(ModelPricing {
10653 input_per_million: 0.22f64,
10654 output_per_million: 0.22f64,
10655 cache_read_per_million: None,
10656 cache_write_per_million: None,
10657 })
10658 }
10659 Self::MetaLlama3370bInstructV10 => {
10660 Some(ModelPricing {
10661 input_per_million: 0.72f64,
10662 output_per_million: 0.72f64,
10663 cache_read_per_million: None,
10664 cache_write_per_million: None,
10665 })
10666 }
10667 Self::MetaLlama4Maverick17bInstructV10 => {
10668 Some(ModelPricing {
10669 input_per_million: 0.24f64,
10670 output_per_million: 0.97f64,
10671 cache_read_per_million: None,
10672 cache_write_per_million: None,
10673 })
10674 }
10675 Self::MetaLlama4Scout17bInstructV10 => {
10676 Some(ModelPricing {
10677 input_per_million: 0.17f64,
10678 output_per_million: 0.66f64,
10679 cache_read_per_million: None,
10680 cache_write_per_million: None,
10681 })
10682 }
10683 Self::MinimaxMinimaxM2 => {
10684 Some(ModelPricing {
10685 input_per_million: 0.3f64,
10686 output_per_million: 1.2f64,
10687 cache_read_per_million: None,
10688 cache_write_per_million: None,
10689 })
10690 }
10691 Self::MinimaxMinimaxM21 => {
10692 Some(ModelPricing {
10693 input_per_million: 0.3f64,
10694 output_per_million: 1.2f64,
10695 cache_read_per_million: None,
10696 cache_write_per_million: None,
10697 })
10698 }
10699 Self::MinimaxMinimaxM25 => {
10700 Some(ModelPricing {
10701 input_per_million: 0.3f64,
10702 output_per_million: 1.2f64,
10703 cache_read_per_million: None,
10704 cache_write_per_million: None,
10705 })
10706 }
10707 Self::MistralDevstral2123b => {
10708 Some(ModelPricing {
10709 input_per_million: 0.4f64,
10710 output_per_million: 2f64,
10711 cache_read_per_million: None,
10712 cache_write_per_million: None,
10713 })
10714 }
10715 Self::MistralMagistralSmall2509 => {
10716 Some(ModelPricing {
10717 input_per_million: 0.5f64,
10718 output_per_million: 1.5f64,
10719 cache_read_per_million: None,
10720 cache_write_per_million: None,
10721 })
10722 }
10723 Self::MistralMinistral314bInstruct => {
10724 Some(ModelPricing {
10725 input_per_million: 0.2f64,
10726 output_per_million: 0.2f64,
10727 cache_read_per_million: None,
10728 cache_write_per_million: None,
10729 })
10730 }
10731 Self::MistralMinistral33bInstruct => {
10732 Some(ModelPricing {
10733 input_per_million: 0.1f64,
10734 output_per_million: 0.1f64,
10735 cache_read_per_million: None,
10736 cache_write_per_million: None,
10737 })
10738 }
10739 Self::MistralMinistral38bInstruct => {
10740 Some(ModelPricing {
10741 input_per_million: 0.15f64,
10742 output_per_million: 0.15f64,
10743 cache_read_per_million: None,
10744 cache_write_per_million: None,
10745 })
10746 }
10747 Self::MistralMistralLarge3675bInstruct => {
10748 Some(ModelPricing {
10749 input_per_million: 0.5f64,
10750 output_per_million: 1.5f64,
10751 cache_read_per_million: None,
10752 cache_write_per_million: None,
10753 })
10754 }
10755 Self::MistralPixtralLarge2502V10 => {
10756 Some(ModelPricing {
10757 input_per_million: 2f64,
10758 output_per_million: 6f64,
10759 cache_read_per_million: None,
10760 cache_write_per_million: None,
10761 })
10762 }
10763 Self::MistralVoxtralMini3b2507 => {
10764 Some(ModelPricing {
10765 input_per_million: 0.04f64,
10766 output_per_million: 0.04f64,
10767 cache_read_per_million: None,
10768 cache_write_per_million: None,
10769 })
10770 }
10771 Self::MistralVoxtralSmall24b2507 => {
10772 Some(ModelPricing {
10773 input_per_million: 0.15f64,
10774 output_per_million: 0.35f64,
10775 cache_read_per_million: None,
10776 cache_write_per_million: None,
10777 })
10778 }
10779 Self::MoonshotKimiK2Thinking => {
10780 Some(ModelPricing {
10781 input_per_million: 0.6f64,
10782 output_per_million: 2.5f64,
10783 cache_read_per_million: None,
10784 cache_write_per_million: None,
10785 })
10786 }
10787 Self::MoonshotaiKimiK25 => {
10788 Some(ModelPricing {
10789 input_per_million: 0.6f64,
10790 output_per_million: 3f64,
10791 cache_read_per_million: None,
10792 cache_write_per_million: None,
10793 })
10794 }
10795 Self::NvidiaNemotronNano12bV2 => {
10796 Some(ModelPricing {
10797 input_per_million: 0.2f64,
10798 output_per_million: 0.6f64,
10799 cache_read_per_million: None,
10800 cache_write_per_million: None,
10801 })
10802 }
10803 Self::NvidiaNemotronNano330b => {
10804 Some(ModelPricing {
10805 input_per_million: 0.06f64,
10806 output_per_million: 0.24f64,
10807 cache_read_per_million: None,
10808 cache_write_per_million: None,
10809 })
10810 }
10811 Self::NvidiaNemotronNano9bV2 => {
10812 Some(ModelPricing {
10813 input_per_million: 0.06f64,
10814 output_per_million: 0.23f64,
10815 cache_read_per_million: None,
10816 cache_write_per_million: None,
10817 })
10818 }
10819 Self::NvidiaNemotronSuper3120b => {
10820 Some(ModelPricing {
10821 input_per_million: 0.15f64,
10822 output_per_million: 0.65f64,
10823 cache_read_per_million: None,
10824 cache_write_per_million: None,
10825 })
10826 }
10827 Self::OpenaiGpt54 => {
10828 Some(ModelPricing {
10829 input_per_million: 2.75f64,
10830 output_per_million: 16.5f64,
10831 cache_read_per_million: Some(0.275f64),
10832 cache_write_per_million: None,
10833 })
10834 }
10835 Self::OpenaiGpt55 => {
10836 Some(ModelPricing {
10837 input_per_million: 5.5f64,
10838 output_per_million: 33f64,
10839 cache_read_per_million: Some(0.55f64),
10840 cache_write_per_million: None,
10841 })
10842 }
10843 Self::OpenaiGpt56Luna => {
10844 Some(ModelPricing {
10845 input_per_million: 1f64,
10846 output_per_million: 6f64,
10847 cache_read_per_million: Some(0.1f64),
10848 cache_write_per_million: Some(1.25f64),
10849 })
10850 }
10851 Self::OpenaiGpt56Sol => {
10852 Some(ModelPricing {
10853 input_per_million: 5f64,
10854 output_per_million: 30f64,
10855 cache_read_per_million: Some(0.5f64),
10856 cache_write_per_million: Some(6.25f64),
10857 })
10858 }
10859 Self::OpenaiGpt56Terra => {
10860 Some(ModelPricing {
10861 input_per_million: 2.5f64,
10862 output_per_million: 15f64,
10863 cache_read_per_million: Some(0.25f64),
10864 cache_write_per_million: Some(3.125f64),
10865 })
10866 }
10867 Self::OpenaiGptOss120b => {
10868 Some(ModelPricing {
10869 input_per_million: 0.15f64,
10870 output_per_million: 0.6f64,
10871 cache_read_per_million: None,
10872 cache_write_per_million: None,
10873 })
10874 }
10875 Self::OpenaiGptOss120b10 => {
10876 Some(ModelPricing {
10877 input_per_million: 0.15f64,
10878 output_per_million: 0.6f64,
10879 cache_read_per_million: None,
10880 cache_write_per_million: None,
10881 })
10882 }
10883 Self::OpenaiGptOss20b => {
10884 Some(ModelPricing {
10885 input_per_million: 0.07f64,
10886 output_per_million: 0.3f64,
10887 cache_read_per_million: None,
10888 cache_write_per_million: None,
10889 })
10890 }
10891 Self::OpenaiGptOss20b10 => {
10892 Some(ModelPricing {
10893 input_per_million: 0.07f64,
10894 output_per_million: 0.3f64,
10895 cache_read_per_million: None,
10896 cache_write_per_million: None,
10897 })
10898 }
10899 Self::OpenaiGptOssSafeguard120b => {
10900 Some(ModelPricing {
10901 input_per_million: 0.15f64,
10902 output_per_million: 0.6f64,
10903 cache_read_per_million: None,
10904 cache_write_per_million: None,
10905 })
10906 }
10907 Self::OpenaiGptOssSafeguard20b => {
10908 Some(ModelPricing {
10909 input_per_million: 0.07f64,
10910 output_per_million: 0.2f64,
10911 cache_read_per_million: None,
10912 cache_write_per_million: None,
10913 })
10914 }
10915 Self::QwenQwen3235bA22b2507V10 => {
10916 Some(ModelPricing {
10917 input_per_million: 0.22f64,
10918 output_per_million: 0.88f64,
10919 cache_read_per_million: None,
10920 cache_write_per_million: None,
10921 })
10922 }
10923 Self::QwenQwen332bV10 => {
10924 Some(ModelPricing {
10925 input_per_million: 0.15f64,
10926 output_per_million: 0.6f64,
10927 cache_read_per_million: None,
10928 cache_write_per_million: None,
10929 })
10930 }
10931 Self::QwenQwen3Coder30bA3bV10 => {
10932 Some(ModelPricing {
10933 input_per_million: 0.15f64,
10934 output_per_million: 0.6f64,
10935 cache_read_per_million: None,
10936 cache_write_per_million: None,
10937 })
10938 }
10939 Self::QwenQwen3Coder480bA35bV10 => {
10940 Some(ModelPricing {
10941 input_per_million: 0.22f64,
10942 output_per_million: 1.8f64,
10943 cache_read_per_million: None,
10944 cache_write_per_million: None,
10945 })
10946 }
10947 Self::QwenQwen3CoderNext => {
10948 Some(ModelPricing {
10949 input_per_million: 0.22f64,
10950 output_per_million: 1.8f64,
10951 cache_read_per_million: None,
10952 cache_write_per_million: None,
10953 })
10954 }
10955 Self::QwenQwen3Next80bA3b => {
10956 Some(ModelPricing {
10957 input_per_million: 0.14f64,
10958 output_per_million: 1.4f64,
10959 cache_read_per_million: None,
10960 cache_write_per_million: None,
10961 })
10962 }
10963 Self::QwenQwen3Vl235bA22b => {
10964 Some(ModelPricing {
10965 input_per_million: 0.3f64,
10966 output_per_million: 1.5f64,
10967 cache_read_per_million: None,
10968 cache_write_per_million: None,
10969 })
10970 }
10971 Self::UsAnthropicClaudeFable5 => {
10972 Some(ModelPricing {
10973 input_per_million: 10f64,
10974 output_per_million: 50f64,
10975 cache_read_per_million: Some(1f64),
10976 cache_write_per_million: Some(12.5f64),
10977 })
10978 }
10979 Self::UsAnthropicClaudeHaiku4520251001V10 => {
10980 Some(ModelPricing {
10981 input_per_million: 1f64,
10982 output_per_million: 5f64,
10983 cache_read_per_million: Some(0.1f64),
10984 cache_write_per_million: Some(1.25f64),
10985 })
10986 }
10987 Self::UsAnthropicClaudeOpus4120250805V10 => {
10988 Some(ModelPricing {
10989 input_per_million: 15f64,
10990 output_per_million: 75f64,
10991 cache_read_per_million: Some(1.5f64),
10992 cache_write_per_million: Some(18.75f64),
10993 })
10994 }
10995 Self::UsAnthropicClaudeOpus4520251101V10 => {
10996 Some(ModelPricing {
10997 input_per_million: 5f64,
10998 output_per_million: 25f64,
10999 cache_read_per_million: Some(0.5f64),
11000 cache_write_per_million: Some(6.25f64),
11001 })
11002 }
11003 Self::UsAnthropicClaudeOpus46V1 => {
11004 Some(ModelPricing {
11005 input_per_million: 5f64,
11006 output_per_million: 25f64,
11007 cache_read_per_million: Some(0.5f64),
11008 cache_write_per_million: Some(6.25f64),
11009 })
11010 }
11011 Self::UsAnthropicClaudeOpus47 => {
11012 Some(ModelPricing {
11013 input_per_million: 5f64,
11014 output_per_million: 25f64,
11015 cache_read_per_million: Some(0.5f64),
11016 cache_write_per_million: Some(6.25f64),
11017 })
11018 }
11019 Self::UsAnthropicClaudeOpus48 => {
11020 Some(ModelPricing {
11021 input_per_million: 5f64,
11022 output_per_million: 25f64,
11023 cache_read_per_million: Some(0.5f64),
11024 cache_write_per_million: Some(6.25f64),
11025 })
11026 }
11027 Self::UsAnthropicClaudeOpus5 => {
11028 Some(ModelPricing {
11029 input_per_million: 5f64,
11030 output_per_million: 25f64,
11031 cache_read_per_million: Some(0.5f64),
11032 cache_write_per_million: Some(6.25f64),
11033 })
11034 }
11035 Self::UsAnthropicClaudeSonnet4520250929V10 => {
11036 Some(ModelPricing {
11037 input_per_million: 3f64,
11038 output_per_million: 15f64,
11039 cache_read_per_million: Some(0.3f64),
11040 cache_write_per_million: Some(3.75f64),
11041 })
11042 }
11043 Self::UsAnthropicClaudeSonnet46 => {
11044 Some(ModelPricing {
11045 input_per_million: 3f64,
11046 output_per_million: 15f64,
11047 cache_read_per_million: Some(0.3f64),
11048 cache_write_per_million: Some(3.75f64),
11049 })
11050 }
11051 Self::UsAnthropicClaudeSonnet5 => {
11052 Some(ModelPricing {
11053 input_per_million: 2f64,
11054 output_per_million: 10f64,
11055 cache_read_per_million: Some(0.2f64),
11056 cache_write_per_million: Some(2.5f64),
11057 })
11058 }
11059 Self::UsDeepseekR1V10 => {
11060 Some(ModelPricing {
11061 input_per_million: 1.35f64,
11062 output_per_million: 5.4f64,
11063 cache_read_per_million: None,
11064 cache_write_per_million: None,
11065 })
11066 }
11067 Self::UsMetaLlama4Maverick17bInstructV10 => {
11068 Some(ModelPricing {
11069 input_per_million: 0.24f64,
11070 output_per_million: 0.97f64,
11071 cache_read_per_million: None,
11072 cache_write_per_million: None,
11073 })
11074 }
11075 Self::UsMetaLlama4Scout17bInstructV10 => {
11076 Some(ModelPricing {
11077 input_per_million: 0.17f64,
11078 output_per_million: 0.66f64,
11079 cache_read_per_million: None,
11080 cache_write_per_million: None,
11081 })
11082 }
11083 Self::WriterPalmyraX4V10 => {
11084 Some(ModelPricing {
11085 input_per_million: 2.5f64,
11086 output_per_million: 10f64,
11087 cache_read_per_million: None,
11088 cache_write_per_million: None,
11089 })
11090 }
11091 Self::WriterPalmyraX5V10 => {
11092 Some(ModelPricing {
11093 input_per_million: 0.6f64,
11094 output_per_million: 6f64,
11095 cache_read_per_million: None,
11096 cache_write_per_million: None,
11097 })
11098 }
11099 Self::XaiGrok43 => {
11100 Some(ModelPricing {
11101 input_per_million: 1.25f64,
11102 output_per_million: 2.5f64,
11103 cache_read_per_million: Some(0.2f64),
11104 cache_write_per_million: None,
11105 })
11106 }
11107 Self::ZaiGlm47 => {
11108 Some(ModelPricing {
11109 input_per_million: 0.6f64,
11110 output_per_million: 2.2f64,
11111 cache_read_per_million: None,
11112 cache_write_per_million: None,
11113 })
11114 }
11115 Self::ZaiGlm47Flash => {
11116 Some(ModelPricing {
11117 input_per_million: 0.07f64,
11118 output_per_million: 0.4f64,
11119 cache_read_per_million: None,
11120 cache_write_per_million: None,
11121 })
11122 }
11123 Self::ZaiGlm5 => {
11124 Some(ModelPricing {
11125 input_per_million: 1f64,
11126 output_per_million: 3.2f64,
11127 cache_read_per_million: None,
11128 cache_write_per_million: None,
11129 })
11130 }
11131 }
11132 }
11133 #[allow(clippy::too_many_lines)]
11134 pub fn supports_image(self) -> bool {
11135 match self {
11136 Self::AmazonNovaMicroV10
11137 | Self::DeepseekR1V10
11138 | Self::DeepseekV3V10
11139 | Self::DeepseekV32
11140 | Self::MetaLlama3170bInstructV10
11141 | Self::MetaLlama318bInstructV10
11142 | Self::MetaLlama3370bInstructV10
11143 | Self::MinimaxMinimaxM2
11144 | Self::MinimaxMinimaxM21
11145 | Self::MinimaxMinimaxM25
11146 | Self::MistralDevstral2123b
11147 | Self::MistralMinistral314bInstruct
11148 | Self::MistralMinistral38bInstruct
11149 | Self::MistralVoxtralMini3b2507
11150 | Self::MistralVoxtralSmall24b2507
11151 | Self::MoonshotKimiK2Thinking
11152 | Self::NvidiaNemotronNano330b
11153 | Self::NvidiaNemotronNano9bV2
11154 | Self::NvidiaNemotronSuper3120b
11155 | Self::OpenaiGptOss120b
11156 | Self::OpenaiGptOss120b10
11157 | Self::OpenaiGptOss20b
11158 | Self::OpenaiGptOss20b10
11159 | Self::OpenaiGptOssSafeguard120b
11160 | Self::OpenaiGptOssSafeguard20b
11161 | Self::QwenQwen3235bA22b2507V10
11162 | Self::QwenQwen332bV10
11163 | Self::QwenQwen3Coder30bA3bV10
11164 | Self::QwenQwen3Coder480bA35bV10
11165 | Self::QwenQwen3CoderNext
11166 | Self::QwenQwen3Next80bA3b
11167 | Self::UsDeepseekR1V10
11168 | Self::WriterPalmyraX4V10
11169 | Self::WriterPalmyraX5V10
11170 | Self::ZaiGlm47
11171 | Self::ZaiGlm47Flash
11172 | Self::ZaiGlm5 => false,
11173 Self::AmazonNova2LiteV10
11174 | Self::AmazonNovaLiteV10
11175 | Self::AmazonNovaProV10
11176 | Self::AnthropicClaudeFable5
11177 | Self::AnthropicClaudeHaiku4520251001V10
11178 | Self::AnthropicClaudeOpus4120250805V10
11179 | Self::AnthropicClaudeOpus4520251101V10
11180 | Self::AnthropicClaudeOpus46V1
11181 | Self::AnthropicClaudeOpus47
11182 | Self::AnthropicClaudeOpus48
11183 | Self::AnthropicClaudeOpus5
11184 | Self::AnthropicClaudeSonnet4520250929V10
11185 | Self::AnthropicClaudeSonnet46
11186 | Self::AnthropicClaudeSonnet5
11187 | Self::AuAnthropicClaudeHaiku4520251001V10
11188 | Self::AuAnthropicClaudeOpus46V1
11189 | Self::AuAnthropicClaudeOpus48
11190 | Self::AuAnthropicClaudeOpus5
11191 | Self::AuAnthropicClaudeSonnet4520250929V10
11192 | Self::AuAnthropicClaudeSonnet46
11193 | Self::AuAnthropicClaudeSonnet5
11194 | Self::EuAnthropicClaudeFable5
11195 | Self::EuAnthropicClaudeHaiku4520251001V10
11196 | Self::EuAnthropicClaudeOpus4520251101V10
11197 | Self::EuAnthropicClaudeOpus46V1
11198 | Self::EuAnthropicClaudeOpus47
11199 | Self::EuAnthropicClaudeOpus48
11200 | Self::EuAnthropicClaudeOpus5
11201 | Self::EuAnthropicClaudeSonnet4520250929V10
11202 | Self::EuAnthropicClaudeSonnet46
11203 | Self::EuAnthropicClaudeSonnet5
11204 | Self::GlobalAnthropicClaudeFable5
11205 | Self::GlobalAnthropicClaudeHaiku4520251001V10
11206 | Self::GlobalAnthropicClaudeOpus4520251101V10
11207 | Self::GlobalAnthropicClaudeOpus46V1
11208 | Self::GlobalAnthropicClaudeOpus47
11209 | Self::GlobalAnthropicClaudeOpus48
11210 | Self::GlobalAnthropicClaudeOpus5
11211 | Self::GlobalAnthropicClaudeSonnet4520250929V10
11212 | Self::GlobalAnthropicClaudeSonnet46
11213 | Self::GlobalAnthropicClaudeSonnet5
11214 | Self::GoogleGemma327bIt
11215 | Self::GoogleGemma34bIt
11216 | Self::JpAnthropicClaudeHaiku4520251001V10
11217 | Self::JpAnthropicClaudeOpus47
11218 | Self::JpAnthropicClaudeOpus48
11219 | Self::JpAnthropicClaudeOpus5
11220 | Self::JpAnthropicClaudeSonnet4520250929V10
11221 | Self::JpAnthropicClaudeSonnet46
11222 | Self::JpAnthropicClaudeSonnet5
11223 | Self::MetaLlama4Maverick17bInstructV10
11224 | Self::MetaLlama4Scout17bInstructV10
11225 | Self::MistralMagistralSmall2509
11226 | Self::MistralMinistral33bInstruct
11227 | Self::MistralMistralLarge3675bInstruct
11228 | Self::MistralPixtralLarge2502V10
11229 | Self::MoonshotaiKimiK25
11230 | Self::NvidiaNemotronNano12bV2
11231 | Self::OpenaiGpt54
11232 | Self::OpenaiGpt55
11233 | Self::OpenaiGpt56Luna
11234 | Self::OpenaiGpt56Sol
11235 | Self::OpenaiGpt56Terra
11236 | Self::QwenQwen3Vl235bA22b
11237 | Self::UsAnthropicClaudeFable5
11238 | Self::UsAnthropicClaudeHaiku4520251001V10
11239 | Self::UsAnthropicClaudeOpus4120250805V10
11240 | Self::UsAnthropicClaudeOpus4520251101V10
11241 | Self::UsAnthropicClaudeOpus46V1
11242 | Self::UsAnthropicClaudeOpus47
11243 | Self::UsAnthropicClaudeOpus48
11244 | Self::UsAnthropicClaudeOpus5
11245 | Self::UsAnthropicClaudeSonnet4520250929V10
11246 | Self::UsAnthropicClaudeSonnet46
11247 | Self::UsAnthropicClaudeSonnet5
11248 | Self::UsMetaLlama4Maverick17bInstructV10
11249 | Self::UsMetaLlama4Scout17bInstructV10
11250 | Self::XaiGrok43 => true,
11251 }
11252 }
11253 #[allow(clippy::too_many_lines)]
11254 pub fn supports_audio(self) -> bool {
11255 match self {
11256 Self::AmazonNova2LiteV10
11257 | Self::AmazonNovaLiteV10
11258 | Self::AmazonNovaMicroV10
11259 | Self::AmazonNovaProV10
11260 | Self::AnthropicClaudeFable5
11261 | Self::AnthropicClaudeHaiku4520251001V10
11262 | Self::AnthropicClaudeOpus4120250805V10
11263 | Self::AnthropicClaudeOpus4520251101V10
11264 | Self::AnthropicClaudeOpus46V1
11265 | Self::AnthropicClaudeOpus47
11266 | Self::AnthropicClaudeOpus48
11267 | Self::AnthropicClaudeOpus5
11268 | Self::AnthropicClaudeSonnet4520250929V10
11269 | Self::AnthropicClaudeSonnet46
11270 | Self::AnthropicClaudeSonnet5
11271 | Self::AuAnthropicClaudeHaiku4520251001V10
11272 | Self::AuAnthropicClaudeOpus46V1
11273 | Self::AuAnthropicClaudeOpus48
11274 | Self::AuAnthropicClaudeOpus5
11275 | Self::AuAnthropicClaudeSonnet4520250929V10
11276 | Self::AuAnthropicClaudeSonnet46
11277 | Self::AuAnthropicClaudeSonnet5
11278 | Self::DeepseekR1V10
11279 | Self::DeepseekV3V10
11280 | Self::DeepseekV32
11281 | Self::EuAnthropicClaudeFable5
11282 | Self::EuAnthropicClaudeHaiku4520251001V10
11283 | Self::EuAnthropicClaudeOpus4520251101V10
11284 | Self::EuAnthropicClaudeOpus46V1
11285 | Self::EuAnthropicClaudeOpus47
11286 | Self::EuAnthropicClaudeOpus48
11287 | Self::EuAnthropicClaudeOpus5
11288 | Self::EuAnthropicClaudeSonnet4520250929V10
11289 | Self::EuAnthropicClaudeSonnet46
11290 | Self::EuAnthropicClaudeSonnet5
11291 | Self::GlobalAnthropicClaudeFable5
11292 | Self::GlobalAnthropicClaudeHaiku4520251001V10
11293 | Self::GlobalAnthropicClaudeOpus4520251101V10
11294 | Self::GlobalAnthropicClaudeOpus46V1
11295 | Self::GlobalAnthropicClaudeOpus47
11296 | Self::GlobalAnthropicClaudeOpus48
11297 | Self::GlobalAnthropicClaudeOpus5
11298 | Self::GlobalAnthropicClaudeSonnet4520250929V10
11299 | Self::GlobalAnthropicClaudeSonnet46
11300 | Self::GlobalAnthropicClaudeSonnet5
11301 | Self::GoogleGemma327bIt
11302 | Self::GoogleGemma34bIt
11303 | Self::JpAnthropicClaudeHaiku4520251001V10
11304 | Self::JpAnthropicClaudeOpus47
11305 | Self::JpAnthropicClaudeOpus48
11306 | Self::JpAnthropicClaudeOpus5
11307 | Self::JpAnthropicClaudeSonnet4520250929V10
11308 | Self::JpAnthropicClaudeSonnet46
11309 | Self::JpAnthropicClaudeSonnet5
11310 | Self::MetaLlama3170bInstructV10
11311 | Self::MetaLlama318bInstructV10
11312 | Self::MetaLlama3370bInstructV10
11313 | Self::MetaLlama4Maverick17bInstructV10
11314 | Self::MetaLlama4Scout17bInstructV10
11315 | Self::MinimaxMinimaxM2
11316 | Self::MinimaxMinimaxM21
11317 | Self::MinimaxMinimaxM25
11318 | Self::MistralDevstral2123b
11319 | Self::MistralMagistralSmall2509
11320 | Self::MistralMinistral314bInstruct
11321 | Self::MistralMinistral33bInstruct
11322 | Self::MistralMinistral38bInstruct
11323 | Self::MistralMistralLarge3675bInstruct
11324 | Self::MistralPixtralLarge2502V10
11325 | Self::MoonshotKimiK2Thinking
11326 | Self::MoonshotaiKimiK25
11327 | Self::NvidiaNemotronNano12bV2
11328 | Self::NvidiaNemotronNano330b
11329 | Self::NvidiaNemotronNano9bV2
11330 | Self::NvidiaNemotronSuper3120b
11331 | Self::OpenaiGpt54
11332 | Self::OpenaiGpt55
11333 | Self::OpenaiGpt56Luna
11334 | Self::OpenaiGpt56Sol
11335 | Self::OpenaiGpt56Terra
11336 | Self::OpenaiGptOss120b
11337 | Self::OpenaiGptOss120b10
11338 | Self::OpenaiGptOss20b
11339 | Self::OpenaiGptOss20b10
11340 | Self::OpenaiGptOssSafeguard120b
11341 | Self::OpenaiGptOssSafeguard20b
11342 | Self::QwenQwen3235bA22b2507V10
11343 | Self::QwenQwen332bV10
11344 | Self::QwenQwen3Coder30bA3bV10
11345 | Self::QwenQwen3Coder480bA35bV10
11346 | Self::QwenQwen3CoderNext
11347 | Self::QwenQwen3Next80bA3b
11348 | Self::QwenQwen3Vl235bA22b
11349 | Self::UsAnthropicClaudeFable5
11350 | Self::UsAnthropicClaudeHaiku4520251001V10
11351 | Self::UsAnthropicClaudeOpus4120250805V10
11352 | Self::UsAnthropicClaudeOpus4520251101V10
11353 | Self::UsAnthropicClaudeOpus46V1
11354 | Self::UsAnthropicClaudeOpus47
11355 | Self::UsAnthropicClaudeOpus48
11356 | Self::UsAnthropicClaudeOpus5
11357 | Self::UsAnthropicClaudeSonnet4520250929V10
11358 | Self::UsAnthropicClaudeSonnet46
11359 | Self::UsAnthropicClaudeSonnet5
11360 | Self::UsDeepseekR1V10
11361 | Self::UsMetaLlama4Maverick17bInstructV10
11362 | Self::UsMetaLlama4Scout17bInstructV10
11363 | Self::WriterPalmyraX4V10
11364 | Self::WriterPalmyraX5V10
11365 | Self::XaiGrok43
11366 | Self::ZaiGlm47
11367 | Self::ZaiGlm47Flash
11368 | Self::ZaiGlm5 => false,
11369 Self::MistralVoxtralMini3b2507 | Self::MistralVoxtralSmall24b2507 => true,
11370 }
11371 }
11372 #[allow(clippy::too_many_lines)]
11373 pub fn transport(self) -> Option<ModelTransport> {
11374 match self {
11375 Self::AmazonNova2LiteV10
11376 | Self::AmazonNovaLiteV10
11377 | Self::AmazonNovaMicroV10
11378 | Self::AmazonNovaProV10
11379 | Self::AnthropicClaudeFable5
11380 | Self::AnthropicClaudeHaiku4520251001V10
11381 | Self::AnthropicClaudeOpus4120250805V10
11382 | Self::AnthropicClaudeOpus4520251101V10
11383 | Self::AnthropicClaudeOpus46V1
11384 | Self::AnthropicClaudeOpus47
11385 | Self::AnthropicClaudeOpus48
11386 | Self::AnthropicClaudeOpus5
11387 | Self::AnthropicClaudeSonnet4520250929V10
11388 | Self::AnthropicClaudeSonnet46
11389 | Self::AnthropicClaudeSonnet5
11390 | Self::AuAnthropicClaudeHaiku4520251001V10
11391 | Self::AuAnthropicClaudeOpus46V1
11392 | Self::AuAnthropicClaudeOpus48
11393 | Self::AuAnthropicClaudeOpus5
11394 | Self::AuAnthropicClaudeSonnet4520250929V10
11395 | Self::AuAnthropicClaudeSonnet46
11396 | Self::AuAnthropicClaudeSonnet5
11397 | Self::DeepseekR1V10
11398 | Self::DeepseekV3V10
11399 | Self::DeepseekV32
11400 | Self::EuAnthropicClaudeFable5
11401 | Self::EuAnthropicClaudeHaiku4520251001V10
11402 | Self::EuAnthropicClaudeOpus4520251101V10
11403 | Self::EuAnthropicClaudeOpus46V1
11404 | Self::EuAnthropicClaudeOpus47
11405 | Self::EuAnthropicClaudeOpus48
11406 | Self::EuAnthropicClaudeOpus5
11407 | Self::EuAnthropicClaudeSonnet4520250929V10
11408 | Self::EuAnthropicClaudeSonnet46
11409 | Self::EuAnthropicClaudeSonnet5
11410 | Self::GlobalAnthropicClaudeFable5
11411 | Self::GlobalAnthropicClaudeHaiku4520251001V10
11412 | Self::GlobalAnthropicClaudeOpus4520251101V10
11413 | Self::GlobalAnthropicClaudeOpus46V1
11414 | Self::GlobalAnthropicClaudeOpus47
11415 | Self::GlobalAnthropicClaudeOpus48
11416 | Self::GlobalAnthropicClaudeOpus5
11417 | Self::GlobalAnthropicClaudeSonnet4520250929V10
11418 | Self::GlobalAnthropicClaudeSonnet46
11419 | Self::GlobalAnthropicClaudeSonnet5
11420 | Self::GoogleGemma327bIt
11421 | Self::GoogleGemma34bIt
11422 | Self::JpAnthropicClaudeHaiku4520251001V10
11423 | Self::JpAnthropicClaudeOpus47
11424 | Self::JpAnthropicClaudeOpus48
11425 | Self::JpAnthropicClaudeOpus5
11426 | Self::JpAnthropicClaudeSonnet4520250929V10
11427 | Self::JpAnthropicClaudeSonnet46
11428 | Self::JpAnthropicClaudeSonnet5
11429 | Self::MetaLlama3170bInstructV10
11430 | Self::MetaLlama318bInstructV10
11431 | Self::MetaLlama3370bInstructV10
11432 | Self::MetaLlama4Maverick17bInstructV10
11433 | Self::MetaLlama4Scout17bInstructV10
11434 | Self::MinimaxMinimaxM2
11435 | Self::MinimaxMinimaxM21
11436 | Self::MinimaxMinimaxM25
11437 | Self::MistralDevstral2123b
11438 | Self::MistralMagistralSmall2509
11439 | Self::MistralMinistral314bInstruct
11440 | Self::MistralMinistral33bInstruct
11441 | Self::MistralMinistral38bInstruct
11442 | Self::MistralMistralLarge3675bInstruct
11443 | Self::MistralPixtralLarge2502V10
11444 | Self::MistralVoxtralMini3b2507
11445 | Self::MistralVoxtralSmall24b2507
11446 | Self::MoonshotKimiK2Thinking
11447 | Self::MoonshotaiKimiK25
11448 | Self::NvidiaNemotronNano12bV2
11449 | Self::NvidiaNemotronNano330b
11450 | Self::NvidiaNemotronNano9bV2
11451 | Self::NvidiaNemotronSuper3120b
11452 | Self::OpenaiGptOss120b10
11453 | Self::OpenaiGptOss20b10
11454 | Self::OpenaiGptOssSafeguard120b
11455 | Self::OpenaiGptOssSafeguard20b
11456 | Self::QwenQwen3235bA22b2507V10
11457 | Self::QwenQwen332bV10
11458 | Self::QwenQwen3Coder30bA3bV10
11459 | Self::QwenQwen3Coder480bA35bV10
11460 | Self::QwenQwen3CoderNext
11461 | Self::QwenQwen3Next80bA3b
11462 | Self::QwenQwen3Vl235bA22b
11463 | Self::UsAnthropicClaudeFable5
11464 | Self::UsAnthropicClaudeHaiku4520251001V10
11465 | Self::UsAnthropicClaudeOpus4120250805V10
11466 | Self::UsAnthropicClaudeOpus4520251101V10
11467 | Self::UsAnthropicClaudeOpus46V1
11468 | Self::UsAnthropicClaudeOpus47
11469 | Self::UsAnthropicClaudeOpus48
11470 | Self::UsAnthropicClaudeOpus5
11471 | Self::UsAnthropicClaudeSonnet4520250929V10
11472 | Self::UsAnthropicClaudeSonnet46
11473 | Self::UsAnthropicClaudeSonnet5
11474 | Self::UsDeepseekR1V10
11475 | Self::UsMetaLlama4Maverick17bInstructV10
11476 | Self::UsMetaLlama4Scout17bInstructV10
11477 | Self::WriterPalmyraX4V10
11478 | Self::WriterPalmyraX5V10
11479 | Self::ZaiGlm47
11480 | Self::ZaiGlm47Flash
11481 | Self::ZaiGlm5 => None,
11482 Self::OpenaiGpt54
11483 | Self::OpenaiGpt55
11484 | Self::OpenaiGpt56Luna
11485 | Self::OpenaiGpt56Sol
11486 | Self::OpenaiGpt56Terra
11487 | Self::XaiGrok43 => {
11488 Some(ModelTransport::OpenAiResponses {
11489 base_url_template: "https://bedrock-mantle.${AWS_REGION}.api.aws/openai/v1",
11490 })
11491 }
11492 Self::OpenaiGptOss120b | Self::OpenaiGptOss20b => {
11493 Some(ModelTransport::OpenAiResponses {
11494 base_url_template: "https://bedrock-mantle.${AWS_REGION}.api.aws/v1",
11495 })
11496 }
11497 }
11498 }
11499 const ALL: &[BedrockFoundationModel] = &[
11500 Self::AmazonNova2LiteV10,
11501 Self::AmazonNovaLiteV10,
11502 Self::AmazonNovaMicroV10,
11503 Self::AmazonNovaProV10,
11504 Self::AnthropicClaudeFable5,
11505 Self::AnthropicClaudeHaiku4520251001V10,
11506 Self::AnthropicClaudeOpus4120250805V10,
11507 Self::AnthropicClaudeOpus4520251101V10,
11508 Self::AnthropicClaudeOpus46V1,
11509 Self::AnthropicClaudeOpus47,
11510 Self::AnthropicClaudeOpus48,
11511 Self::AnthropicClaudeOpus5,
11512 Self::AnthropicClaudeSonnet4520250929V10,
11513 Self::AnthropicClaudeSonnet46,
11514 Self::AnthropicClaudeSonnet5,
11515 Self::AuAnthropicClaudeHaiku4520251001V10,
11516 Self::AuAnthropicClaudeOpus46V1,
11517 Self::AuAnthropicClaudeOpus48,
11518 Self::AuAnthropicClaudeOpus5,
11519 Self::AuAnthropicClaudeSonnet4520250929V10,
11520 Self::AuAnthropicClaudeSonnet46,
11521 Self::AuAnthropicClaudeSonnet5,
11522 Self::DeepseekR1V10,
11523 Self::DeepseekV3V10,
11524 Self::DeepseekV32,
11525 Self::EuAnthropicClaudeFable5,
11526 Self::EuAnthropicClaudeHaiku4520251001V10,
11527 Self::EuAnthropicClaudeOpus4520251101V10,
11528 Self::EuAnthropicClaudeOpus46V1,
11529 Self::EuAnthropicClaudeOpus47,
11530 Self::EuAnthropicClaudeOpus48,
11531 Self::EuAnthropicClaudeOpus5,
11532 Self::EuAnthropicClaudeSonnet4520250929V10,
11533 Self::EuAnthropicClaudeSonnet46,
11534 Self::EuAnthropicClaudeSonnet5,
11535 Self::GlobalAnthropicClaudeFable5,
11536 Self::GlobalAnthropicClaudeHaiku4520251001V10,
11537 Self::GlobalAnthropicClaudeOpus4520251101V10,
11538 Self::GlobalAnthropicClaudeOpus46V1,
11539 Self::GlobalAnthropicClaudeOpus47,
11540 Self::GlobalAnthropicClaudeOpus48,
11541 Self::GlobalAnthropicClaudeOpus5,
11542 Self::GlobalAnthropicClaudeSonnet4520250929V10,
11543 Self::GlobalAnthropicClaudeSonnet46,
11544 Self::GlobalAnthropicClaudeSonnet5,
11545 Self::GoogleGemma327bIt,
11546 Self::GoogleGemma34bIt,
11547 Self::JpAnthropicClaudeHaiku4520251001V10,
11548 Self::JpAnthropicClaudeOpus47,
11549 Self::JpAnthropicClaudeOpus48,
11550 Self::JpAnthropicClaudeOpus5,
11551 Self::JpAnthropicClaudeSonnet4520250929V10,
11552 Self::JpAnthropicClaudeSonnet46,
11553 Self::JpAnthropicClaudeSonnet5,
11554 Self::MetaLlama3170bInstructV10,
11555 Self::MetaLlama318bInstructV10,
11556 Self::MetaLlama3370bInstructV10,
11557 Self::MetaLlama4Maverick17bInstructV10,
11558 Self::MetaLlama4Scout17bInstructV10,
11559 Self::MinimaxMinimaxM2,
11560 Self::MinimaxMinimaxM21,
11561 Self::MinimaxMinimaxM25,
11562 Self::MistralDevstral2123b,
11563 Self::MistralMagistralSmall2509,
11564 Self::MistralMinistral314bInstruct,
11565 Self::MistralMinistral33bInstruct,
11566 Self::MistralMinistral38bInstruct,
11567 Self::MistralMistralLarge3675bInstruct,
11568 Self::MistralPixtralLarge2502V10,
11569 Self::MistralVoxtralMini3b2507,
11570 Self::MistralVoxtralSmall24b2507,
11571 Self::MoonshotKimiK2Thinking,
11572 Self::MoonshotaiKimiK25,
11573 Self::NvidiaNemotronNano12bV2,
11574 Self::NvidiaNemotronNano330b,
11575 Self::NvidiaNemotronNano9bV2,
11576 Self::NvidiaNemotronSuper3120b,
11577 Self::OpenaiGpt54,
11578 Self::OpenaiGpt55,
11579 Self::OpenaiGpt56Luna,
11580 Self::OpenaiGpt56Sol,
11581 Self::OpenaiGpt56Terra,
11582 Self::OpenaiGptOss120b,
11583 Self::OpenaiGptOss120b10,
11584 Self::OpenaiGptOss20b,
11585 Self::OpenaiGptOss20b10,
11586 Self::OpenaiGptOssSafeguard120b,
11587 Self::OpenaiGptOssSafeguard20b,
11588 Self::QwenQwen3235bA22b2507V10,
11589 Self::QwenQwen332bV10,
11590 Self::QwenQwen3Coder30bA3bV10,
11591 Self::QwenQwen3Coder480bA35bV10,
11592 Self::QwenQwen3CoderNext,
11593 Self::QwenQwen3Next80bA3b,
11594 Self::QwenQwen3Vl235bA22b,
11595 Self::UsAnthropicClaudeFable5,
11596 Self::UsAnthropicClaudeHaiku4520251001V10,
11597 Self::UsAnthropicClaudeOpus4120250805V10,
11598 Self::UsAnthropicClaudeOpus4520251101V10,
11599 Self::UsAnthropicClaudeOpus46V1,
11600 Self::UsAnthropicClaudeOpus47,
11601 Self::UsAnthropicClaudeOpus48,
11602 Self::UsAnthropicClaudeOpus5,
11603 Self::UsAnthropicClaudeSonnet4520250929V10,
11604 Self::UsAnthropicClaudeSonnet46,
11605 Self::UsAnthropicClaudeSonnet5,
11606 Self::UsDeepseekR1V10,
11607 Self::UsMetaLlama4Maverick17bInstructV10,
11608 Self::UsMetaLlama4Scout17bInstructV10,
11609 Self::WriterPalmyraX4V10,
11610 Self::WriterPalmyraX5V10,
11611 Self::XaiGrok43,
11612 Self::ZaiGlm47,
11613 Self::ZaiGlm47Flash,
11614 Self::ZaiGlm5,
11615 ];
11616}
11617impl std::str::FromStr for BedrockFoundationModel {
11618 type Err = String;
11619 #[allow(clippy::too_many_lines)]
11620 fn from_str(s: &str) -> Result<Self, Self::Err> {
11621 match s {
11622 "amazon.nova-2-lite-v1:0" => Ok(Self::AmazonNova2LiteV10),
11623 "amazon.nova-lite-v1:0" => Ok(Self::AmazonNovaLiteV10),
11624 "amazon.nova-micro-v1:0" => Ok(Self::AmazonNovaMicroV10),
11625 "amazon.nova-pro-v1:0" => Ok(Self::AmazonNovaProV10),
11626 "anthropic.claude-fable-5" => Ok(Self::AnthropicClaudeFable5),
11627 "anthropic.claude-haiku-4-5-20251001-v1:0" => {
11628 Ok(Self::AnthropicClaudeHaiku4520251001V10)
11629 }
11630 "anthropic.claude-opus-4-1-20250805-v1:0" => {
11631 Ok(Self::AnthropicClaudeOpus4120250805V10)
11632 }
11633 "anthropic.claude-opus-4-5-20251101-v1:0" => {
11634 Ok(Self::AnthropicClaudeOpus4520251101V10)
11635 }
11636 "anthropic.claude-opus-4-6-v1" => Ok(Self::AnthropicClaudeOpus46V1),
11637 "anthropic.claude-opus-4-7" => Ok(Self::AnthropicClaudeOpus47),
11638 "anthropic.claude-opus-4-8" => Ok(Self::AnthropicClaudeOpus48),
11639 "anthropic.claude-opus-5" => Ok(Self::AnthropicClaudeOpus5),
11640 "anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11641 Ok(Self::AnthropicClaudeSonnet4520250929V10)
11642 }
11643 "anthropic.claude-sonnet-4-6" => Ok(Self::AnthropicClaudeSonnet46),
11644 "anthropic.claude-sonnet-5" => Ok(Self::AnthropicClaudeSonnet5),
11645 "au.anthropic.claude-haiku-4-5-20251001-v1:0" => {
11646 Ok(Self::AuAnthropicClaudeHaiku4520251001V10)
11647 }
11648 "au.anthropic.claude-opus-4-6-v1" => Ok(Self::AuAnthropicClaudeOpus46V1),
11649 "au.anthropic.claude-opus-4-8" => Ok(Self::AuAnthropicClaudeOpus48),
11650 "au.anthropic.claude-opus-5" => Ok(Self::AuAnthropicClaudeOpus5),
11651 "au.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11652 Ok(Self::AuAnthropicClaudeSonnet4520250929V10)
11653 }
11654 "au.anthropic.claude-sonnet-4-6" => Ok(Self::AuAnthropicClaudeSonnet46),
11655 "au.anthropic.claude-sonnet-5" => Ok(Self::AuAnthropicClaudeSonnet5),
11656 "deepseek.r1-v1:0" => Ok(Self::DeepseekR1V10),
11657 "deepseek.v3-v1:0" => Ok(Self::DeepseekV3V10),
11658 "deepseek.v3.2" => Ok(Self::DeepseekV32),
11659 "eu.anthropic.claude-fable-5" => Ok(Self::EuAnthropicClaudeFable5),
11660 "eu.anthropic.claude-haiku-4-5-20251001-v1:0" => {
11661 Ok(Self::EuAnthropicClaudeHaiku4520251001V10)
11662 }
11663 "eu.anthropic.claude-opus-4-5-20251101-v1:0" => {
11664 Ok(Self::EuAnthropicClaudeOpus4520251101V10)
11665 }
11666 "eu.anthropic.claude-opus-4-6-v1" => Ok(Self::EuAnthropicClaudeOpus46V1),
11667 "eu.anthropic.claude-opus-4-7" => Ok(Self::EuAnthropicClaudeOpus47),
11668 "eu.anthropic.claude-opus-4-8" => Ok(Self::EuAnthropicClaudeOpus48),
11669 "eu.anthropic.claude-opus-5" => Ok(Self::EuAnthropicClaudeOpus5),
11670 "eu.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11671 Ok(Self::EuAnthropicClaudeSonnet4520250929V10)
11672 }
11673 "eu.anthropic.claude-sonnet-4-6" => Ok(Self::EuAnthropicClaudeSonnet46),
11674 "eu.anthropic.claude-sonnet-5" => Ok(Self::EuAnthropicClaudeSonnet5),
11675 "global.anthropic.claude-fable-5" => Ok(Self::GlobalAnthropicClaudeFable5),
11676 "global.anthropic.claude-haiku-4-5-20251001-v1:0" => {
11677 Ok(Self::GlobalAnthropicClaudeHaiku4520251001V10)
11678 }
11679 "global.anthropic.claude-opus-4-5-20251101-v1:0" => {
11680 Ok(Self::GlobalAnthropicClaudeOpus4520251101V10)
11681 }
11682 "global.anthropic.claude-opus-4-6-v1" => {
11683 Ok(Self::GlobalAnthropicClaudeOpus46V1)
11684 }
11685 "global.anthropic.claude-opus-4-7" => Ok(Self::GlobalAnthropicClaudeOpus47),
11686 "global.anthropic.claude-opus-4-8" => Ok(Self::GlobalAnthropicClaudeOpus48),
11687 "global.anthropic.claude-opus-5" => Ok(Self::GlobalAnthropicClaudeOpus5),
11688 "global.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11689 Ok(Self::GlobalAnthropicClaudeSonnet4520250929V10)
11690 }
11691 "global.anthropic.claude-sonnet-4-6" => {
11692 Ok(Self::GlobalAnthropicClaudeSonnet46)
11693 }
11694 "global.anthropic.claude-sonnet-5" => Ok(Self::GlobalAnthropicClaudeSonnet5),
11695 "google.gemma-3-27b-it" => Ok(Self::GoogleGemma327bIt),
11696 "google.gemma-3-4b-it" => Ok(Self::GoogleGemma34bIt),
11697 "jp.anthropic.claude-haiku-4-5-20251001-v1:0" => {
11698 Ok(Self::JpAnthropicClaudeHaiku4520251001V10)
11699 }
11700 "jp.anthropic.claude-opus-4-7" => Ok(Self::JpAnthropicClaudeOpus47),
11701 "jp.anthropic.claude-opus-4-8" => Ok(Self::JpAnthropicClaudeOpus48),
11702 "jp.anthropic.claude-opus-5" => Ok(Self::JpAnthropicClaudeOpus5),
11703 "jp.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11704 Ok(Self::JpAnthropicClaudeSonnet4520250929V10)
11705 }
11706 "jp.anthropic.claude-sonnet-4-6" => Ok(Self::JpAnthropicClaudeSonnet46),
11707 "jp.anthropic.claude-sonnet-5" => Ok(Self::JpAnthropicClaudeSonnet5),
11708 "meta.llama3-1-70b-instruct-v1:0" => Ok(Self::MetaLlama3170bInstructV10),
11709 "meta.llama3-1-8b-instruct-v1:0" => Ok(Self::MetaLlama318bInstructV10),
11710 "meta.llama3-3-70b-instruct-v1:0" => Ok(Self::MetaLlama3370bInstructV10),
11711 "meta.llama4-maverick-17b-instruct-v1:0" => {
11712 Ok(Self::MetaLlama4Maverick17bInstructV10)
11713 }
11714 "meta.llama4-scout-17b-instruct-v1:0" => {
11715 Ok(Self::MetaLlama4Scout17bInstructV10)
11716 }
11717 "minimax.minimax-m2" => Ok(Self::MinimaxMinimaxM2),
11718 "minimax.minimax-m2.1" => Ok(Self::MinimaxMinimaxM21),
11719 "minimax.minimax-m2.5" => Ok(Self::MinimaxMinimaxM25),
11720 "mistral.devstral-2-123b" => Ok(Self::MistralDevstral2123b),
11721 "mistral.magistral-small-2509" => Ok(Self::MistralMagistralSmall2509),
11722 "mistral.ministral-3-14b-instruct" => Ok(Self::MistralMinistral314bInstruct),
11723 "mistral.ministral-3-3b-instruct" => Ok(Self::MistralMinistral33bInstruct),
11724 "mistral.ministral-3-8b-instruct" => Ok(Self::MistralMinistral38bInstruct),
11725 "mistral.mistral-large-3-675b-instruct" => {
11726 Ok(Self::MistralMistralLarge3675bInstruct)
11727 }
11728 "mistral.pixtral-large-2502-v1:0" => Ok(Self::MistralPixtralLarge2502V10),
11729 "mistral.voxtral-mini-3b-2507" => Ok(Self::MistralVoxtralMini3b2507),
11730 "mistral.voxtral-small-24b-2507" => Ok(Self::MistralVoxtralSmall24b2507),
11731 "moonshot.kimi-k2-thinking" => Ok(Self::MoonshotKimiK2Thinking),
11732 "moonshotai.kimi-k2.5" => Ok(Self::MoonshotaiKimiK25),
11733 "nvidia.nemotron-nano-12b-v2" => Ok(Self::NvidiaNemotronNano12bV2),
11734 "nvidia.nemotron-nano-3-30b" => Ok(Self::NvidiaNemotronNano330b),
11735 "nvidia.nemotron-nano-9b-v2" => Ok(Self::NvidiaNemotronNano9bV2),
11736 "nvidia.nemotron-super-3-120b" => Ok(Self::NvidiaNemotronSuper3120b),
11737 "openai.gpt-5.4" => Ok(Self::OpenaiGpt54),
11738 "openai.gpt-5.5" => Ok(Self::OpenaiGpt55),
11739 "openai.gpt-5.6-luna" => Ok(Self::OpenaiGpt56Luna),
11740 "openai.gpt-5.6-sol" => Ok(Self::OpenaiGpt56Sol),
11741 "openai.gpt-5.6-terra" => Ok(Self::OpenaiGpt56Terra),
11742 "openai.gpt-oss-120b" => Ok(Self::OpenaiGptOss120b),
11743 "openai.gpt-oss-120b-1:0" => Ok(Self::OpenaiGptOss120b10),
11744 "openai.gpt-oss-20b" => Ok(Self::OpenaiGptOss20b),
11745 "openai.gpt-oss-20b-1:0" => Ok(Self::OpenaiGptOss20b10),
11746 "openai.gpt-oss-safeguard-120b" => Ok(Self::OpenaiGptOssSafeguard120b),
11747 "openai.gpt-oss-safeguard-20b" => Ok(Self::OpenaiGptOssSafeguard20b),
11748 "qwen.qwen3-235b-a22b-2507-v1:0" => Ok(Self::QwenQwen3235bA22b2507V10),
11749 "qwen.qwen3-32b-v1:0" => Ok(Self::QwenQwen332bV10),
11750 "qwen.qwen3-coder-30b-a3b-v1:0" => Ok(Self::QwenQwen3Coder30bA3bV10),
11751 "qwen.qwen3-coder-480b-a35b-v1:0" => Ok(Self::QwenQwen3Coder480bA35bV10),
11752 "qwen.qwen3-coder-next" => Ok(Self::QwenQwen3CoderNext),
11753 "qwen.qwen3-next-80b-a3b" => Ok(Self::QwenQwen3Next80bA3b),
11754 "qwen.qwen3-vl-235b-a22b" => Ok(Self::QwenQwen3Vl235bA22b),
11755 "us.anthropic.claude-fable-5" => Ok(Self::UsAnthropicClaudeFable5),
11756 "us.anthropic.claude-haiku-4-5-20251001-v1:0" => {
11757 Ok(Self::UsAnthropicClaudeHaiku4520251001V10)
11758 }
11759 "us.anthropic.claude-opus-4-1-20250805-v1:0" => {
11760 Ok(Self::UsAnthropicClaudeOpus4120250805V10)
11761 }
11762 "us.anthropic.claude-opus-4-5-20251101-v1:0" => {
11763 Ok(Self::UsAnthropicClaudeOpus4520251101V10)
11764 }
11765 "us.anthropic.claude-opus-4-6-v1" => Ok(Self::UsAnthropicClaudeOpus46V1),
11766 "us.anthropic.claude-opus-4-7" => Ok(Self::UsAnthropicClaudeOpus47),
11767 "us.anthropic.claude-opus-4-8" => Ok(Self::UsAnthropicClaudeOpus48),
11768 "us.anthropic.claude-opus-5" => Ok(Self::UsAnthropicClaudeOpus5),
11769 "us.anthropic.claude-sonnet-4-5-20250929-v1:0" => {
11770 Ok(Self::UsAnthropicClaudeSonnet4520250929V10)
11771 }
11772 "us.anthropic.claude-sonnet-4-6" => Ok(Self::UsAnthropicClaudeSonnet46),
11773 "us.anthropic.claude-sonnet-5" => Ok(Self::UsAnthropicClaudeSonnet5),
11774 "us.deepseek.r1-v1:0" => Ok(Self::UsDeepseekR1V10),
11775 "us.meta.llama4-maverick-17b-instruct-v1:0" => {
11776 Ok(Self::UsMetaLlama4Maverick17bInstructV10)
11777 }
11778 "us.meta.llama4-scout-17b-instruct-v1:0" => {
11779 Ok(Self::UsMetaLlama4Scout17bInstructV10)
11780 }
11781 "writer.palmyra-x4-v1:0" => Ok(Self::WriterPalmyraX4V10),
11782 "writer.palmyra-x5-v1:0" => Ok(Self::WriterPalmyraX5V10),
11783 "xai.grok-4.3" => Ok(Self::XaiGrok43),
11784 "zai.glm-4.7" => Ok(Self::ZaiGlm47),
11785 "zai.glm-4.7-flash" => Ok(Self::ZaiGlm47Flash),
11786 "zai.glm-5" => Ok(Self::ZaiGlm5),
11787 _ => Err(format!("Unknown bedrock model: '{s}'")),
11788 }
11789 }
11790}
11791#[derive(Debug, Clone, PartialEq, Eq, Hash)]
11793pub enum LlmModel {
11794 Anthropic(AnthropicModel),
11795 AzureFoundry(AzureFoundryModel),
11796 Codex(CodexModel),
11797 DeepSeek(DeepSeekModel),
11798 Fireworks(FireworksModel),
11799 Gemini(GeminiModel),
11800 Moonshot(MoonshotModel),
11801 Openai(OpenaiModel),
11802 OpenRouter(OpenRouterModel),
11803 ZAi(ZAiModel),
11804 Bedrock(BedrockModel),
11805 Ollama(String),
11806 LlamaCpp(String),
11807}
11808impl From<AnthropicModel> for LlmModel {
11809 fn from(m: AnthropicModel) -> Self {
11810 LlmModel::Anthropic(m)
11811 }
11812}
11813impl From<AzureFoundryModel> for LlmModel {
11814 fn from(m: AzureFoundryModel) -> Self {
11815 LlmModel::AzureFoundry(m)
11816 }
11817}
11818impl From<CodexModel> for LlmModel {
11819 fn from(m: CodexModel) -> Self {
11820 LlmModel::Codex(m)
11821 }
11822}
11823impl From<DeepSeekModel> for LlmModel {
11824 fn from(m: DeepSeekModel) -> Self {
11825 LlmModel::DeepSeek(m)
11826 }
11827}
11828impl From<FireworksModel> for LlmModel {
11829 fn from(m: FireworksModel) -> Self {
11830 LlmModel::Fireworks(m)
11831 }
11832}
11833impl From<GeminiModel> for LlmModel {
11834 fn from(m: GeminiModel) -> Self {
11835 LlmModel::Gemini(m)
11836 }
11837}
11838impl From<MoonshotModel> for LlmModel {
11839 fn from(m: MoonshotModel) -> Self {
11840 LlmModel::Moonshot(m)
11841 }
11842}
11843impl From<OpenaiModel> for LlmModel {
11844 fn from(m: OpenaiModel) -> Self {
11845 LlmModel::Openai(m)
11846 }
11847}
11848impl From<OpenRouterModel> for LlmModel {
11849 fn from(m: OpenRouterModel) -> Self {
11850 LlmModel::OpenRouter(m)
11851 }
11852}
11853impl From<ZAiModel> for LlmModel {
11854 fn from(m: ZAiModel) -> Self {
11855 LlmModel::ZAi(m)
11856 }
11857}
11858impl From<BedrockModel> for LlmModel {
11859 fn from(m: BedrockModel) -> Self {
11860 LlmModel::Bedrock(m)
11861 }
11862}
11863impl LlmModel {
11864 pub fn model_id(&self) -> Cow<'static, str> {
11866 match self {
11867 Self::Anthropic(m) => Cow::Borrowed(m.model_id()),
11868 Self::AzureFoundry(m) => Cow::Borrowed(m.model_id()),
11869 Self::Codex(m) => Cow::Borrowed(m.model_id()),
11870 Self::DeepSeek(m) => Cow::Borrowed(m.model_id()),
11871 Self::Fireworks(m) => Cow::Borrowed(m.model_id()),
11872 Self::Gemini(m) => Cow::Borrowed(m.model_id()),
11873 Self::Moonshot(m) => Cow::Borrowed(m.model_id()),
11874 Self::Openai(m) => Cow::Borrowed(m.model_id()),
11875 Self::OpenRouter(m) => Cow::Borrowed(m.model_id()),
11876 Self::ZAi(m) => Cow::Borrowed(m.model_id()),
11877 Self::Bedrock(m) => m.model_id(),
11878 Self::Ollama(s) | Self::LlamaCpp(s) => Cow::Owned(s.clone()),
11879 }
11880 }
11881 pub fn display_name(&self) -> Cow<'static, str> {
11883 match self {
11884 Self::Anthropic(m) => Cow::Borrowed(m.display_name()),
11885 Self::AzureFoundry(m) => Cow::Borrowed(m.display_name()),
11886 Self::Codex(m) => Cow::Borrowed(m.display_name()),
11887 Self::DeepSeek(m) => Cow::Borrowed(m.display_name()),
11888 Self::Fireworks(m) => Cow::Borrowed(m.display_name()),
11889 Self::Gemini(m) => Cow::Borrowed(m.display_name()),
11890 Self::Moonshot(m) => Cow::Borrowed(m.display_name()),
11891 Self::Openai(m) => Cow::Borrowed(m.display_name()),
11892 Self::OpenRouter(m) => Cow::Borrowed(m.display_name()),
11893 Self::ZAi(m) => Cow::Borrowed(m.display_name()),
11894 Self::Bedrock(m) => m.display_name(),
11895 Self::Ollama(s) => Cow::Owned(format!("Ollama {s}")),
11896 Self::LlamaCpp(s) => Cow::Owned(format!("LlamaCpp {s}")),
11897 }
11898 }
11899 pub fn provider(&self) -> &'static str {
11901 match self {
11902 Self::Anthropic(_) => "anthropic",
11903 Self::AzureFoundry(_) => "azure-foundry",
11904 Self::Codex(_) => "codex",
11905 Self::DeepSeek(_) => "deepseek",
11906 Self::Fireworks(_) => "fireworks",
11907 Self::Gemini(_) => "gemini",
11908 Self::Moonshot(_) => "moonshot",
11909 Self::Openai(_) => "openai",
11910 Self::OpenRouter(_) => "openrouter",
11911 Self::ZAi(_) => "zai",
11912 Self::Bedrock(_) => "bedrock",
11913 Self::Ollama(_) => "ollama",
11914 Self::LlamaCpp(_) => "llamacpp",
11915 }
11916 }
11917 pub fn provider_enum(&self) -> Provider {
11919 match self {
11920 Self::Anthropic(_) => Provider::Anthropic,
11921 Self::AzureFoundry(_) => Provider::AzureFoundry,
11922 Self::Codex(_) => Provider::Codex,
11923 Self::DeepSeek(_) => Provider::DeepSeek,
11924 Self::Fireworks(_) => Provider::Fireworks,
11925 Self::Gemini(_) => Provider::Gemini,
11926 Self::Moonshot(_) => Provider::Moonshot,
11927 Self::Openai(_) => Provider::Openai,
11928 Self::OpenRouter(_) => Provider::OpenRouter,
11929 Self::ZAi(_) => Provider::ZAi,
11930 Self::Bedrock(_) => Provider::Bedrock,
11931 Self::Ollama(_) => Provider::Ollama,
11932 Self::LlamaCpp(_) => Provider::LlamaCpp,
11933 }
11934 }
11935 pub fn provider_display_name(&self) -> &'static str {
11937 match self {
11938 Self::Anthropic(_) => "Anthropic",
11939 Self::AzureFoundry(_) => "Microsoft Foundry",
11940 Self::Codex(_) => "Codex",
11941 Self::DeepSeek(_) => "DeepSeek",
11942 Self::Fireworks(_) => "Fireworks AI",
11943 Self::Gemini(_) => "Gemini",
11944 Self::Moonshot(_) => "Moonshot",
11945 Self::Openai(_) => "OpenAI",
11946 Self::OpenRouter(_) => "OpenRouter",
11947 Self::ZAi(_) => "ZAI",
11948 Self::Bedrock(_) => "AWS Bedrock",
11949 Self::Ollama(_) => "Ollama",
11950 Self::LlamaCpp(_) => "LlamaCpp",
11951 }
11952 }
11953 pub fn context_window(&self) -> Option<u32> {
11955 match self {
11956 Self::Anthropic(m) => Some(m.context_window()),
11957 Self::AzureFoundry(m) => Some(m.context_window()),
11958 Self::Codex(m) => Some(m.context_window()),
11959 Self::DeepSeek(m) => Some(m.context_window()),
11960 Self::Fireworks(m) => Some(m.context_window()),
11961 Self::Gemini(m) => Some(m.context_window()),
11962 Self::Moonshot(m) => Some(m.context_window()),
11963 Self::Openai(m) => Some(m.context_window()),
11964 Self::OpenRouter(m) => Some(m.context_window()),
11965 Self::ZAi(m) => Some(m.context_window()),
11966 Self::Bedrock(m) => m.context_window(),
11967 Self::Ollama(_) | Self::LlamaCpp(_) => None,
11968 }
11969 }
11970 pub fn required_env_var(&self) -> Option<&'static str> {
11972 match self {
11973 Self::Anthropic(_) => Some("ANTHROPIC_API_KEY"),
11974 Self::AzureFoundry(_) => Some("AZURE_OPENAI_API_KEY"),
11975 Self::DeepSeek(_) => Some("DEEPSEEK_API_KEY"),
11976 Self::Fireworks(_) => Some("FIREWORKS_API_KEY"),
11977 Self::Gemini(_) => Some("GEMINI_API_KEY"),
11978 Self::Moonshot(_) => Some("MOONSHOT_API_KEY"),
11979 Self::Openai(_) => Some("OPENAI_API_KEY"),
11980 Self::OpenRouter(_) => Some("OPENROUTER_API_KEY"),
11981 Self::ZAi(_) => Some("ZAI_API_KEY"),
11982 Self::Codex(_) | Self::Bedrock(_) | Self::Ollama(_) | Self::LlamaCpp(_) => {
11983 None
11984 }
11985 }
11986 }
11987 pub const ALL_REQUIRED_ENV_VARS: &[&str] = &[
11989 "ANTHROPIC_API_KEY",
11990 "AZURE_OPENAI_API_KEY",
11991 "DEEPSEEK_API_KEY",
11992 "FIREWORKS_API_KEY",
11993 "GEMINI_API_KEY",
11994 "MOONSHOT_API_KEY",
11995 "OPENAI_API_KEY",
11996 "OPENROUTER_API_KEY",
11997 "ZAI_API_KEY",
11998 ];
11999 pub fn oauth_provider_id(&self) -> Option<&'static str> {
12001 match self {
12002 Self::Codex(_) => Some("codex"),
12003 Self::Anthropic(_)
12004 | Self::AzureFoundry(_)
12005 | Self::DeepSeek(_)
12006 | Self::Fireworks(_)
12007 | Self::Gemini(_)
12008 | Self::Moonshot(_)
12009 | Self::Openai(_)
12010 | Self::OpenRouter(_)
12011 | Self::ZAi(_)
12012 | Self::Bedrock(_)
12013 | Self::Ollama(_)
12014 | Self::LlamaCpp(_) => None,
12015 }
12016 }
12017 pub fn reasoning_levels(&self) -> &'static [ReasoningEffort] {
12019 match self {
12020 Self::Anthropic(m) => m.reasoning_levels(),
12021 Self::AzureFoundry(m) => m.reasoning_levels(),
12022 Self::Codex(m) => m.reasoning_levels(),
12023 Self::DeepSeek(m) => m.reasoning_levels(),
12024 Self::Fireworks(m) => m.reasoning_levels(),
12025 Self::Gemini(m) => m.reasoning_levels(),
12026 Self::Moonshot(m) => m.reasoning_levels(),
12027 Self::Openai(m) => m.reasoning_levels(),
12028 Self::OpenRouter(m) => m.reasoning_levels(),
12029 Self::ZAi(m) => m.reasoning_levels(),
12030 Self::Bedrock(m) => m.reasoning_levels(),
12031 Self::Ollama(_) | Self::LlamaCpp(_) => &[],
12032 }
12033 }
12034 pub fn supports_reasoning(&self) -> bool {
12036 !self.reasoning_levels().is_empty()
12037 }
12038 pub fn supports_prompt_caching(&self) -> bool {
12040 match self {
12041 Self::Anthropic(m) => m.supports_prompt_caching(),
12042 Self::AzureFoundry(m) => m.supports_prompt_caching(),
12043 Self::Codex(m) => m.supports_prompt_caching(),
12044 Self::DeepSeek(m) => m.supports_prompt_caching(),
12045 Self::Fireworks(m) => m.supports_prompt_caching(),
12046 Self::Gemini(m) => m.supports_prompt_caching(),
12047 Self::Moonshot(m) => m.supports_prompt_caching(),
12048 Self::Openai(m) => m.supports_prompt_caching(),
12049 Self::OpenRouter(m) => m.supports_prompt_caching(),
12050 Self::ZAi(m) => m.supports_prompt_caching(),
12051 Self::Bedrock(m) => m.supports_prompt_caching(),
12052 Self::Ollama(_) | Self::LlamaCpp(_) => false,
12053 }
12054 }
12055 pub fn pricing(&self) -> Option<ModelPricing> {
12056 match self {
12057 Self::Anthropic(m) => m.pricing(),
12058 Self::AzureFoundry(m) => m.pricing(),
12059 Self::Codex(m) => m.pricing(),
12060 Self::DeepSeek(m) => m.pricing(),
12061 Self::Fireworks(m) => m.pricing(),
12062 Self::Gemini(m) => m.pricing(),
12063 Self::Moonshot(m) => m.pricing(),
12064 Self::Openai(m) => m.pricing(),
12065 Self::OpenRouter(m) => m.pricing(),
12066 Self::ZAi(m) => m.pricing(),
12067 Self::Bedrock(m) => m.pricing(),
12068 Self::Ollama(_) | Self::LlamaCpp(_) => None,
12069 }
12070 }
12071 pub fn supports_image(&self) -> bool {
12073 match self {
12074 Self::Anthropic(m) => m.supports_image(),
12075 Self::AzureFoundry(m) => m.supports_image(),
12076 Self::Codex(m) => m.supports_image(),
12077 Self::DeepSeek(m) => m.supports_image(),
12078 Self::Fireworks(m) => m.supports_image(),
12079 Self::Gemini(m) => m.supports_image(),
12080 Self::Moonshot(m) => m.supports_image(),
12081 Self::Openai(m) => m.supports_image(),
12082 Self::OpenRouter(m) => m.supports_image(),
12083 Self::ZAi(m) => m.supports_image(),
12084 Self::Bedrock(m) => m.supports_image(),
12085 Self::Ollama(_) | Self::LlamaCpp(_) => false,
12086 }
12087 }
12088 pub fn supports_audio(&self) -> bool {
12090 match self {
12091 Self::Anthropic(m) => m.supports_audio(),
12092 Self::AzureFoundry(m) => m.supports_audio(),
12093 Self::Codex(m) => m.supports_audio(),
12094 Self::DeepSeek(m) => m.supports_audio(),
12095 Self::Fireworks(m) => m.supports_audio(),
12096 Self::Gemini(m) => m.supports_audio(),
12097 Self::Moonshot(m) => m.supports_audio(),
12098 Self::Openai(m) => m.supports_audio(),
12099 Self::OpenRouter(m) => m.supports_audio(),
12100 Self::ZAi(m) => m.supports_audio(),
12101 Self::Bedrock(m) => m.supports_audio(),
12102 Self::Ollama(_) | Self::LlamaCpp(_) => false,
12103 }
12104 }
12105 pub fn transport(&self) -> Option<ModelTransport> {
12108 match self {
12109 Self::Anthropic(m) => m.transport(),
12110 Self::AzureFoundry(m) => m.transport(),
12111 Self::Codex(m) => m.transport(),
12112 Self::DeepSeek(m) => m.transport(),
12113 Self::Fireworks(m) => m.transport(),
12114 Self::Gemini(m) => m.transport(),
12115 Self::Moonshot(m) => m.transport(),
12116 Self::Openai(m) => m.transport(),
12117 Self::OpenRouter(m) => m.transport(),
12118 Self::ZAi(m) => m.transport(),
12119 Self::Bedrock(m) => m.transport(),
12120 Self::Ollama(_) | Self::LlamaCpp(_) => None,
12121 }
12122 }
12123 pub fn all() -> &'static [LlmModel] {
12125 static ALL: LazyLock<Vec<LlmModel>> = LazyLock::new(|| {
12126 let mut v = Vec::new();
12127 v.extend(AnthropicModel::ALL.iter().copied().map(LlmModel::Anthropic));
12128 v.extend(AzureFoundryModel::ALL.iter().copied().map(LlmModel::AzureFoundry));
12129 v.extend(CodexModel::ALL.iter().copied().map(LlmModel::Codex));
12130 v.extend(DeepSeekModel::ALL.iter().copied().map(LlmModel::DeepSeek));
12131 v.extend(FireworksModel::ALL.iter().copied().map(LlmModel::Fireworks));
12132 v.extend(GeminiModel::ALL.iter().copied().map(LlmModel::Gemini));
12133 v.extend(MoonshotModel::ALL.iter().copied().map(LlmModel::Moonshot));
12134 v.extend(OpenaiModel::ALL.iter().copied().map(LlmModel::Openai));
12135 v.extend(OpenRouterModel::ALL.iter().copied().map(LlmModel::OpenRouter));
12136 v.extend(ZAiModel::ALL.iter().copied().map(LlmModel::ZAi));
12137 v.extend(
12138 BedrockFoundationModel::ALL
12139 .iter()
12140 .copied()
12141 .map(BedrockModel::Foundation)
12142 .map(LlmModel::Bedrock),
12143 );
12144 v
12145 });
12146 &ALL
12147 }
12148}
12149impl std::fmt::Display for LlmModel {
12150 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12151 write!(f, "{}:{}", self.provider(), self.model_id())
12152 }
12153}
12154impl std::str::FromStr for LlmModel {
12155 type Err = String;
12156 fn from_str(s: &str) -> Result<Self, Self::Err> {
12158 let (provider_str, model_str) = s.split_once(':').unwrap_or((s, ""));
12159 match provider_str {
12160 "anthropic" => model_str.parse::<AnthropicModel>().map(Self::Anthropic),
12161 "azure-foundry" => {
12162 model_str.parse::<AzureFoundryModel>().map(Self::AzureFoundry)
12163 }
12164 "codex" => model_str.parse::<CodexModel>().map(Self::Codex),
12165 "deepseek" => model_str.parse::<DeepSeekModel>().map(Self::DeepSeek),
12166 "fireworks" => model_str.parse::<FireworksModel>().map(Self::Fireworks),
12167 "gemini" => model_str.parse::<GeminiModel>().map(Self::Gemini),
12168 "moonshot" => model_str.parse::<MoonshotModel>().map(Self::Moonshot),
12169 "openai" => model_str.parse::<OpenaiModel>().map(Self::Openai),
12170 "openrouter" => model_str.parse::<OpenRouterModel>().map(Self::OpenRouter),
12171 "zai" => model_str.parse::<ZAiModel>().map(Self::ZAi),
12172 "bedrock" => model_str.parse::<BedrockModel>().map(Self::Bedrock),
12173 "ollama" => Ok(Self::Ollama(model_str.to_string())),
12174 "llamacpp" => Ok(Self::LlamaCpp(model_str.to_string())),
12175 _ => Err(format!("Unknown provider: '{provider_str}'")),
12176 }
12177 }
12178}