Open History to see the last commit
1import type {
2 GeminiCachedContentOptions,
3 GeminiCommonConfigOptions,
4 GeminiSafetyOptions,
5 GeminiStructuredOutputOptions,
6 GeminiThinkingOptions,
7 GeminiToolConfigOptions,
8} from './text/text-provider-options'
9import type { GeminiEmbeddingProviderOptions } from './embedding/embedding-provider-options'
10
11interface ModelMeta<TProviderOptions = unknown> {
12 name: string
13 supports: {
14 input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>
15 output: Array<'text' | 'image' | 'audio' | 'video'>
16 capabilities?: Array<
17 | 'agentic_video'
18 | 'audio_generation'
19 | 'batch_api'
20 | 'caching'
21 | 'function_calling'
22 | 'live_api'
23 | 'structured_output'
24 | 'thinking'
25 >
26 tools?: Array<
27 | 'code_execution'
28 | 'file_search'
29 | 'google_search'
30 | 'google_search_retrieval'
31 | 'google_maps'
32 | 'url_context'
33 | 'computer_use'
34 >
35 }
36 max_input_tokens?: number
37 max_output_tokens?: number
38 knowledge_cutoff?: string
39 pricing?: {
40 input: {
41 normal: number
42 cached?: number
43 }
44 output: {
45 normal: number
46 }
47 }
48 /**
49 * Type-level description of which provider options this model supports.
50 */
51 providerOptions?: TProviderOptions
52}
53
54const GEMINI_3_1_PRO = {
55 name: 'gemini-3.1-pro-preview',
56 max_input_tokens: 1_048_576,
57 max_output_tokens: 65_536,
58 knowledge_cutoff: '2025-01-01',
59 supports: {
60 input: ['text', 'image', 'audio', 'video', 'document'],
61 output: ['text'],
62 capabilities: [
63 'batch_api',
64 'caching',
65 'function_calling',
66 'structured_output',
67 'thinking',
68 ],
69 tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
70 },
71 pricing: {
72 input: {
73 normal: 2.5,
74 },
75 output: {
76 normal: 15,
77 },
78 },
79} as const satisfies ModelMeta<
80 GeminiToolConfigOptions &
81 GeminiSafetyOptions &
82 GeminiCommonConfigOptions &
83 GeminiCachedContentOptions &
84 GeminiStructuredOutputOptions &
85 GeminiThinkingOptions
86>
87
88const GEMINI_3_FLASH = {
89 name: 'gemini-3-flash-preview',
90 max_input_tokens: 1_048_576,
91 max_output_tokens: 65_536,
92 knowledge_cutoff: '2025-01-01',
93 supports: {
94 input: ['text', 'image', 'audio', 'video', 'document'],
95 output: ['text'],
96 capabilities: [
97 'batch_api',
98 'caching',
99 'function_calling',
100 'structured_output',
101 'thinking',
102 ],
103 tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
104 },
105 pricing: {
106 input: {
107 normal: 0.5,
108 },
109 output: {
110 normal: 3,
111 },
112 },
113} as const satisfies ModelMeta<
114 GeminiToolConfigOptions &
115 GeminiSafetyOptions &
116 GeminiCommonConfigOptions &
117 GeminiCachedContentOptions &
118 GeminiStructuredOutputOptions &
119 GeminiThinkingOptions
120>
121
122/**
123 * Gemini 3 Pro Image ("Nano Banana Pro") — GA. Accepts the ten standard
124 * aspect ratios at 1K / 2K / 4K.
125 * @see https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image
126 */
127const GEMINI_3_PRO_IMAGE = {
128 name: 'gemini-3-pro-image',
129 max_input_tokens: 65_536,
130 max_output_tokens: 32_768,
131 knowledge_cutoff: '2025-01-01',
132 supports: {
133 input: ['text', 'image'],
134 output: ['text', 'image'],
135 capabilities: ['batch_api', 'structured_output', 'thinking'],
136 tools: ['google_search'],
137 },
138 pricing: {
139 input: {
140 normal: 2,
141 },
142 output: {
143 normal: 0.134,
144 },
145 },
146} as const satisfies ModelMeta<
147 GeminiToolConfigOptions &
148 GeminiSafetyOptions &
149 GeminiCommonConfigOptions &
150 GeminiCachedContentOptions &
151 GeminiStructuredOutputOptions &
152 GeminiThinkingOptions
153>
154
155/**
156 * @deprecated `gemini-3-pro-image-preview` was shut down on 2026-06-25. Use
157 * the GA id `gemini-3-pro-image` instead — the preview id now 404s.
158 * Kept in the model union so existing code still compiles.
159 * @see https://ai.google.dev/gemini-api/docs/deprecations
160 */
161const GEMINI_3_PRO_IMAGE_PREVIEW = {
162 name: 'gemini-3-pro-image-preview',
163 max_input_tokens: 65_536,
164 max_output_tokens: 32_768,
165 knowledge_cutoff: '2025-01-01',
166 supports: {
167 input: ['text', 'image'],
168 output: ['text', 'image'],
169 capabilities: ['batch_api', 'structured_output', 'thinking'],
170 tools: ['google_search'],
171 },
172 pricing: {
173 input: {
174 normal: 2,
175 },
176 output: {
177 normal: 0.134,
178 },
179 },
180} as const satisfies ModelMeta<
181 GeminiToolConfigOptions &
182 GeminiSafetyOptions &
183 GeminiCommonConfigOptions &
184 GeminiCachedContentOptions &
185 GeminiStructuredOutputOptions &
186 GeminiThinkingOptions
187>
188
189/**
190 * Gemini 3.1 Flash Image ("Nano Banana 2") — GA. The only native image model
191 * that accepts the four extreme banner ratios (1:4, 4:1, 1:8, 8:1) and the
192 * 512 (0.5K) resolution tier.
193 * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image
194 */
195const GEMINI_3_1_FLASH_IMAGE = {
196 name: 'gemini-3.1-flash-image',
197 max_input_tokens: 131_072,
198 max_output_tokens: 32_768,
199 knowledge_cutoff: '2025-01-01',
200 supports: {
201 input: ['text', 'image'],
202 output: ['text', 'image'],
203 capabilities: ['batch_api', 'thinking'],
204 tools: ['google_search'],
205 },
206 pricing: {
207 input: {
208 normal: 0.5,
209 },
210 output: {
211 normal: 3,
212 },
213 },
214} as const satisfies ModelMeta<
215 GeminiToolConfigOptions &
216 GeminiSafetyOptions &
217 GeminiCommonConfigOptions &
218 GeminiCachedContentOptions &
219 GeminiThinkingOptions
220>
221
222/**
223 * @deprecated `gemini-3.1-flash-image-preview` was shut down on 2026-06-25.
224 * Use the GA id `gemini-3.1-flash-image` instead — the preview id now 404s.
225 * Kept in the model union so existing code still compiles.
226 * @see https://ai.google.dev/gemini-api/docs/deprecations
227 */
228const GEMINI_3_1_FLASH_IMAGE_PREVIEW = {
229 name: 'gemini-3.1-flash-image-preview',
230 max_input_tokens: 65_536,
231 max_output_tokens: 65_536,
232 knowledge_cutoff: '2025-01-01',
233 supports: {
234 input: ['text', 'image'],
235 output: ['text', 'image'],
236 capabilities: ['batch_api', 'structured_output', 'thinking'],
237 tools: ['google_search'],
238 },
239 pricing: {
240 input: {
241 normal: 0.25,
242 },
243 output: {
244 normal: 1.5,
245 },
246 },
247} as const satisfies ModelMeta<
248 GeminiToolConfigOptions &
249 GeminiSafetyOptions &
250 GeminiCommonConfigOptions &
251 GeminiCachedContentOptions &
252 GeminiStructuredOutputOptions &
253 GeminiThinkingOptions
254>
255
256/**
257 * Gemini 3.1 Flash Lite Image ("Nano Banana 2 Lite") — GA. 1K output only.
258 * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-image
259 */
260const GEMINI_3_1_FLASH_LITE_IMAGE = {
261 name: 'gemini-3.1-flash-lite-image',
262 max_input_tokens: 65_536,
263 max_output_tokens: 65_536,
264 knowledge_cutoff: '2025-01-01',
265 supports: {
266 input: ['text', 'image'],
267 output: ['text', 'image'],
268 capabilities: ['batch_api', 'structured_output', 'thinking'],
269 tools: ['google_search'],
270 },
271 pricing: {
272 input: {
273 normal: 0.25,
274 },
275 output: {
276 normal: 1.5,
277 },
278 },
279} as const satisfies ModelMeta<
280 GeminiToolConfigOptions &
281 GeminiSafetyOptions &
282 GeminiCommonConfigOptions &
283 GeminiCachedContentOptions &
284 GeminiStructuredOutputOptions &
285 GeminiThinkingOptions
286>
287
288const GEMINI_3_1_FLASH_LITE = {
289 name: 'gemini-3.1-flash-lite',
290 max_input_tokens: 1_048_576,
291 max_output_tokens: 65_536,
292 knowledge_cutoff: '2025-01-01',
293 supports: {
294 input: ['text', 'image', 'audio', 'video', 'document'],
295 output: ['text'],
296 capabilities: [
297 'batch_api',
298 'caching',
299 'function_calling',
300 'structured_output',
301 'thinking',
302 ],
303 tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
304 },
305 pricing: {
306 input: {
307 normal: 0.25,
308 },
309 output: {
310 normal: 1.5,
311 },
312 },
313} as const satisfies ModelMeta<
314 GeminiToolConfigOptions &
315 GeminiSafetyOptions &
316 GeminiCommonConfigOptions &
317 GeminiCachedContentOptions &
318 GeminiStructuredOutputOptions &
319 GeminiThinkingOptions
320>
321
322const GEMINI_3_1_FLASH_LITE_PREVIEW = {
323 name: 'gemini-3.1-flash-lite-preview',
324 max_input_tokens: 1_048_576,
325 max_output_tokens: 65_536,
326 knowledge_cutoff: '2025-01-01',
327 supports: {
328 input: ['text', 'image', 'audio', 'video', 'document'],
329 output: ['text'],
330 capabilities: [
331 'batch_api',
332 'caching',
333 'function_calling',
334 'structured_output',
335 'thinking',
336 ],
337 tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
338 },
339 pricing: {
340 input: {
341 normal: 0.25,
342 },
343 output: {
344 normal: 1.5,
345 },
346 },
347} as const satisfies ModelMeta<
348 GeminiToolConfigOptions &
349 GeminiSafetyOptions &
350 GeminiCommonConfigOptions &
351 GeminiCachedContentOptions &
352 GeminiStructuredOutputOptions &
353 GeminiThinkingOptions
354>
355
356const GEMINI_2_5_PRO = {
357 name: 'gemini-2.5-pro',
358 max_input_tokens: 1_048_576,
359 max_output_tokens: 65_536,
360 knowledge_cutoff: '2025-01-01',
361 supports: {
362 input: ['text', 'image', 'audio', 'video', 'document'],
363 output: ['text'],
364 capabilities: [
365 'batch_api',
366 'caching',
367 'function_calling',
368 'structured_output',
369 'thinking',
370 ],
371 tools: [
372 'code_execution',
373 'file_search',
374 'google_maps',
375 'google_search',
376 'url_context',
377 ],
378 },
379 pricing: {
380 input: {
381 normal: 2.5,
382 },
383 output: {
384 normal: 15,
385 },
386 },
387} as const satisfies ModelMeta<
388 GeminiToolConfigOptions &
389 GeminiSafetyOptions &
390 GeminiCommonConfigOptions &
391 GeminiCachedContentOptions &
392 GeminiStructuredOutputOptions &
393 GeminiThinkingOptions
394>
395
396const GEMINI_2_5_PRO_TTS = {
397 name: 'gemini-2.5-pro-preview-tts',
398 max_input_tokens: 8_192,
399 max_output_tokens: 16_384,
400 knowledge_cutoff: '2025-05-01',
401 supports: {
402 input: ['text'],
403 output: ['audio'],
404 capabilities: ['audio_generation'],
405 },
406 pricing: {
407 input: {
408 normal: 2.5,
409 },
410 output: {
411 normal: 15,
412 },
413 },
414} as const satisfies ModelMeta<
415 GeminiToolConfigOptions &
416 GeminiSafetyOptions &
417 GeminiCommonConfigOptions &
418 GeminiCachedContentOptions
419>
420
421const GEMINI_2_5_FLASH = {
422 name: 'gemini-2.5-flash',
423 max_input_tokens: 1_048_576,
424 max_output_tokens: 65_536,
425 knowledge_cutoff: '2025-01-01',
426 supports: {
427 input: ['text', 'image', 'audio', 'video'],
428 output: ['text'],
429 capabilities: [
430 'batch_api',
431 'caching',
432 'function_calling',
433 'structured_output',
434 'thinking',
435 ],
436 tools: [
437 'code_execution',
438 'file_search',
439 'google_maps',
440 'google_search',
441 'url_context',
442 ],
443 },
444 pricing: {
445 input: {
446 normal: 1,
447 },
448 output: {
449 normal: 2.5,
450 },
451 },
452} as const satisfies ModelMeta<
453 GeminiToolConfigOptions &
454 GeminiSafetyOptions &
455 GeminiCommonConfigOptions &
456 GeminiCachedContentOptions &
457 GeminiStructuredOutputOptions &
458 GeminiThinkingOptions
459>
460
461/**
462 * Gemini 2.5 Flash Image ("Nano Banana") — still GA, but documented as the
463 * legacy member of the family. Google publishes no `image_size` value for it,
464 * so its size type is a bare aspect ratio and the adapter sends no
465 * `imageConfig.imageSize`.
466 * @deprecated `gemini-2.5-flash-image` shuts down on 2026-10-02. Migrate to
467 * `gemini-3.1-flash-lite-image` (cheapest successor) or
468 * `gemini-3.1-flash-image`. Google's deprecations table still names the
469 * already-dead `gemini-3.1-flash-image-preview` as the replacement.
470 * @see https://ai.google.dev/gemini-api/docs/deprecations
471 */
472const GEMINI_2_5_FLASH_IMAGE = {
473 name: 'gemini-2.5-flash-image',
474 max_input_tokens: 1_048_576,
475 max_output_tokens: 65_536,
476 knowledge_cutoff: '2025-06-01',
477 supports: {
478 input: ['text', 'image'],
479 output: ['text', 'image'],
480 capabilities: ['batch_api', 'caching', 'structured_output'],
481 tools: ['file_search'],
482 },
483 pricing: {
484 input: {
485 normal: 0.3,
486 },
487 output: {
488 normal: 0.4,
489 },
490 },
491} as const satisfies ModelMeta<
492 GeminiToolConfigOptions &
493 GeminiSafetyOptions &
494 GeminiCommonConfigOptions &
495 GeminiCachedContentOptions
496>
497/**
498const GEMINI_2_5_FLASH_LIVE = {
499 name: 'gemini-2.5-flash-native-audio-preview-09-2025',
500 max_input_tokens: 141_072,
501 max_output_tokens: 8_192,
502 knowledge_cutoff: '2025-01-01',
503 supports: {
504 input: ['text', 'audio', 'video'],
505 output: ['text', 'audio'],
506 capabilities: [
507 'audio_generation',
508 'file_search',
509 'function_calling',
510 'live_api',
511 'search_grounding',
512 'thinking',
513 ],
514 },
515 pricing: {
516 // todo find this info
517 input: {
518 normal: 0,
519 },
520 output: {
521 normal: 0,
522 },
523 },
524} as const satisfies ModelMeta<
525 GeminiToolConfigOptions &
526 GeminiSafetyOptions &
527 GeminiGenerationConfigOptions &
528 GeminiCachedContentOptions &
529 GeminiThinkingOptions
530>
531*/
532const GEMINI_2_5_FLASH_TTS = {
533 name: 'gemini-2.5-flash-preview-tts',
534 max_input_tokens: 8_192,
535 max_output_tokens: 16_384,
536 knowledge_cutoff: '2025-05-01',
537 supports: {
538 input: ['text'],
539 output: ['audio'],
540 capabilities: ['audio_generation', 'batch_api'],
541 },
542 pricing: {
543 input: {
544 normal: 1,
545 },
546 output: {
547 normal: 2.5,
548 },
549 },
550} as const satisfies ModelMeta<
551 GeminiToolConfigOptions &
552 GeminiSafetyOptions &
553 GeminiCommonConfigOptions &
554 GeminiCachedContentOptions
555>
556
557/**
558 * Gemini 3.1 Flash TTS Preview - latest expressive TTS model with
559 * 200+ audio tags, 70+ languages, and multi-speaker dialogue support.
560 * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-tts-preview
561 */
562const GEMINI_3_1_FLASH_TTS = {
563 name: 'gemini-3.1-flash-tts-preview',
564 max_input_tokens: 32_768,
565 max_output_tokens: 16_384,
566 knowledge_cutoff: '2025-05-01',
567 supports: {
568 input: ['text'],
569 output: ['audio'],
570 capabilities: ['audio_generation', 'batch_api'],
571 },
572 pricing: {
573 input: {
574 normal: 0.5,
575 },
576 output: {
577 normal: 10,
578 },
579 },
580} as const satisfies ModelMeta<
581 GeminiToolConfigOptions &
582 GeminiSafetyOptions &
583 GeminiCommonConfigOptions &
584 GeminiCachedContentOptions
585>
586
587/**
588 * Lyria 3 Pro Preview — Google's flagship music generation model.
589 * Generates full-length songs with multiple verses, choruses, and bridges.
590 * Outputs MP3 or WAV at 48 kHz stereo.
591 * @see https://ai.google.dev/gemini-api/docs/models/lyria-3-pro-preview
592 */
593const LYRIA_3_PRO = {
594 name: 'lyria-3-pro-preview',
595 max_input_tokens: 131_072,
596 supports: {
597 input: ['text', 'image'],
598 output: ['audio'],
599 capabilities: ['audio_generation'],
600 },
601 pricing: {
602 input: {
603 normal: 0,
604 },
605 output: {
606 normal: 0,
607 },
608 },
609} as const satisfies ModelMeta
610
611/**
612 * Lyria 3 Clip Preview — 30-second music clips in MP3 format.
613 * @see https://ai.google.dev/gemini-api/docs/music-generation
614 */
615const LYRIA_3_CLIP = {
616 name: 'lyria-3-clip-preview',
617 max_input_tokens: 131_072,
618 supports: {
619 input: ['text', 'image'],
620 output: ['audio'],
621 capabilities: ['audio_generation'],
622 },
623 pricing: {
624 input: {
625 normal: 0,
626 },
627 output: {
628 normal: 0,
629 },
630 },
631} as const satisfies ModelMeta
632
633const GEMINI_2_5_FLASH_LITE = {
634 name: 'gemini-2.5-flash-lite',
635 max_input_tokens: 1_048_576,
636 max_output_tokens: 65_536,
637 knowledge_cutoff: '2025-01-01',
638 supports: {
639 input: ['text', 'image', 'audio', 'video', 'document'],
640 output: ['text'],
641 capabilities: [
642 'batch_api',
643 'caching',
644 'function_calling',
645 'structured_output',
646 'thinking',
647 ],
648 tools: ['code_execution', 'google_maps', 'google_search', 'url_context'],
649 },
650 pricing: {
651 input: {
652 normal: 0.1,
653 },
654 output: {
655 normal: 0.4,
656 },
657 },
658} as const satisfies ModelMeta<
659 GeminiToolConfigOptions &
660 GeminiSafetyOptions &
661 GeminiCommonConfigOptions &
662 GeminiCachedContentOptions &
663 GeminiStructuredOutputOptions &
664 GeminiThinkingOptions
665>
666
667const IMAGEN_4_GENERATE = {
668 name: 'imagen-4.0-generate-001',
669 max_input_tokens: 480,
670 max_output_tokens: 4,
671 supports: {
672 input: ['text'],
673 output: ['image'],
674 },
675 pricing: {
676 input: {
677 normal: 0,
678 },
679 output: {
680 normal: 0.4,
681 },
682 },
683} as const satisfies ModelMeta<
684 GeminiToolConfigOptions &
685 GeminiSafetyOptions &
686 GeminiCommonConfigOptions &
687 GeminiCachedContentOptions
688>
689
690const IMAGEN_4_GENERATE_ULTRA = {
691 name: 'imagen-4.0-ultra-generate-001',
692 max_input_tokens: 480,
693 max_output_tokens: 4,
694 supports: {
695 input: ['text'],
696 output: ['image'],
697 },
698 pricing: {
699 input: {
700 normal: 0,
701 },
702 output: {
703 normal: 0.6,
704 },
705 },
706} as const satisfies ModelMeta<
707 GeminiToolConfigOptions &
708 GeminiSafetyOptions &
709 GeminiCommonConfigOptions &
710 GeminiCachedContentOptions
711>
712
713const IMAGEN_4_GENERATE_FAST = {
714 name: 'imagen-4.0-fast-generate-001',
715 max_input_tokens: 480,
716 max_output_tokens: 4,
717 supports: {
718 input: ['text'],
719 output: ['image'],
720 },
721 pricing: {
722 input: {
723 normal: 0,
724 },
725 output: {
726 normal: 0.2,
727 },
728 },
729} as const satisfies ModelMeta<
730 GeminiToolConfigOptions &
731 GeminiSafetyOptions &
732 GeminiCommonConfigOptions &
733 GeminiCachedContentOptions
734>
735
736/**
737 * Veo video generation models. Pricing is per second of generated video
738 * (audio+video rate where the model supports audio).
739 * @experimental Veo video generation is an experimental feature and may change.
740 */
741const VEO_3_1_PREVIEW = {
742 name: 'veo-3.1-generate-preview',
743 max_input_tokens: 1024,
744 max_output_tokens: 1,
745 supports: {
746 input: ['text', 'image'],
747 output: ['video', 'audio'],
748 },
749 pricing: {
750 input: {
751 normal: 0,
752 },
753 output: {
754 normal: 0.4,
755 },
756 },
757} as const satisfies ModelMeta<
758 GeminiToolConfigOptions &
759 GeminiSafetyOptions &
760 GeminiCommonConfigOptions &
761 GeminiCachedContentOptions
762>
763
764const VEO_3_1_FAST_PREVIEW = {
765 name: 'veo-3.1-fast-generate-preview',
766 max_input_tokens: 1024,
767 max_output_tokens: 1,
768 supports: {
769 input: ['text', 'image'],
770 output: ['video', 'audio'],
771 },
772 pricing: {
773 input: {
774 normal: 0,
775 },
776 output: {
777 normal: 0.15,
778 },
779 },
780} as const satisfies ModelMeta<
781 GeminiToolConfigOptions &
782 GeminiSafetyOptions &
783 GeminiCommonConfigOptions &
784 GeminiCachedContentOptions
785>
786
787const VEO_3_1_LITE_PREVIEW = {
788 name: 'veo-3.1-lite-generate-preview',
789 max_input_tokens: 1024,
790 max_output_tokens: 1,
791 supports: {
792 input: ['text', 'image'],
793 output: ['video', 'audio'],
794 },
795 pricing: {
796 input: {
797 normal: 0,
798 },
799 output: {
800 normal: 0.05,
801 },
802 },
803} as const satisfies ModelMeta<
804 GeminiToolConfigOptions &
805 GeminiSafetyOptions &
806 GeminiCommonConfigOptions &
807 GeminiCachedContentOptions
808>
809
810/**
811 * Gemini Omni 1.1 Flash — GA. Multimodal video generation with
812 * conversational editing. Serves only the Interactions API
813 * (`generateContent` rejects it), so it routes through the
814 * interactions-based path of the video adapter, not Veo's
815 * `:predictLongRunning` flow. Pricing is per second of generated video
816 * ($0.10/sec). 360p / 720p (default) / 1080p / 4k at 24 FPS, 3–10 second
817 * clips (default 10s).
818 * @see https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash
819 * @experimental Omni video generation is an experimental feature and may change.
820 */
821const GEMINI_OMNI_1_1_FLASH = {
822 name: 'gemini-omni-1.1-flash',
823 max_input_tokens: 1_048_576,
824 max_output_tokens: 1,
825 supports: {
826 input: ['text', 'image', 'video'],
827 output: ['video', 'audio'],
828 },
829 pricing: {
830 input: {
831 normal: 0,
832 },
833 output: {
834 normal: 0.1,
835 },
836 },
837} as const satisfies ModelMeta<
838 GeminiToolConfigOptions &
839 GeminiSafetyOptions &
840 GeminiCommonConfigOptions &
841 GeminiCachedContentOptions
842>
843
844/**
845 * @deprecated `gemini-omni-flash-preview` shuts down on 2026-09-30. Use the
846 * GA id `gemini-omni-1.1-flash` instead. Kept in the model union so existing
847 * code still compiles until shutdown.
848 * @see https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash
849 * @experimental Omni video generation is an experimental feature and may change.
850 */
851const GEMINI_OMNI_FLASH_PREVIEW = {
852 name: 'gemini-omni-flash-preview',
853 max_input_tokens: 1_048_576,
854 max_output_tokens: 1,
855 supports: {
856 input: ['text', 'image', 'video'],
857 output: ['video', 'audio'],
858 },
859 pricing: {
860 input: {
861 normal: 0,
862 },
863 output: {
864 normal: 0.1,
865 },
866 },
867} as const satisfies ModelMeta<
868 GeminiToolConfigOptions &
869 GeminiSafetyOptions &
870 GeminiCommonConfigOptions &
871 GeminiCachedContentOptions
872>
873
874const GEMINI_3_8_FLASH = {
875 name: 'gemini-3.8-flash',
876 max_input_tokens: 1_048_576,
877 max_output_tokens: 65_536,
878 knowledge_cutoff: '2026-03-01',
879 supports: {
880 input: ['text', 'image', 'video', 'audio', 'document'],
881 output: ['text'],
882 capabilities: [
883 'agentic_video',
884 'batch_api',
885 'caching',
886 'function_calling',
887 'structured_output',
888 'thinking',
889 ],
890 tools: [
891 'code_execution',
892 'file_search',
893 'google_search',
894 'google_maps',
895 'url_context',
896 'computer_use',
897 ],
898 },
899 pricing: {
900 input: {
901 normal: 0.75,
902 cached: 0.075,
903 },
904 output: {
905 normal: 3.75,
906 },
907 },
908} as const satisfies ModelMeta<
909 GeminiToolConfigOptions &
910 GeminiSafetyOptions &
911 GeminiCommonConfigOptions &
912 GeminiCachedContentOptions &
913 GeminiStructuredOutputOptions &
914 GeminiThinkingOptions<'LOW' | 'MEDIUM' | 'HIGH'>
915>
916
917const GEMINI_3_7_FLASH = {
918 name: 'gemini-3.7-flash',
919 max_input_tokens: 1_048_576,
920 max_output_tokens: 65_536,
921 knowledge_cutoff: '2026-03-01',
922 supports: {
923 input: ['text', 'image', 'video', 'audio', 'document'],
924 output: ['text'],
925 capabilities: [
926 'agentic_video',
927 'batch_api',
928 'caching',
929 'function_calling',
930 'structured_output',
931 'thinking',
932 ],
933 tools: [
934 'code_execution',
935 'file_search',
936 'google_search',
937 'google_maps',
938 'url_context',
939 'computer_use',
940 ],
941 },
942 // Currently 50% off through the end of 2026.
943 // https://ai.google.dev/gemini-api/docs/pricing#gemini-3.7-flash
944 pricing: {
945 input: {
946 normal: 0.75,
947 cached: 0.075,
948 },
949 output: {
950 normal: 3.75,
951 },
952 },
953} as const satisfies ModelMeta<
954 GeminiToolConfigOptions &
955 GeminiSafetyOptions &
956 GeminiCommonConfigOptions &
957 GeminiCachedContentOptions &
958 GeminiStructuredOutputOptions &
959 GeminiThinkingOptions
960>
961
962const GEMINI_3_6_FLASH = {
963 name: 'gemini-3.6-flash',
964 max_input_tokens: 1_048_576,
965 max_output_tokens: 65_536,
966 knowledge_cutoff: '2026-03-01',
967 supports: {
968 input: ['text', 'image', 'video', 'audio', 'document'],
969 output: ['text'],
970 capabilities: [
971 'agentic_video',
972 'batch_api',
973 'caching',
974 'function_calling',
975 'structured_output',
976 'thinking',
977 ],
978 tools: [
979 'code_execution',
980 'file_search',
981 'google_search',
982 'google_maps',
983 'url_context',
984 'computer_use',
985 ],
986 },
987 pricing: {
988 input: {
989 normal: 1.5,
990 cached: 0.15,
991 },
992 output: {
993 normal: 7.5,
994 },
995 },
996} as const satisfies ModelMeta<
997 GeminiToolConfigOptions &
998 GeminiSafetyOptions &
999 GeminiCommonConfigOptions &
1000 GeminiCachedContentOptions &
1001 GeminiStructuredOutputOptions &
1002 GeminiThinkingOptions
1003>
1004
1005const GEMINI_3_5_FLASH = {
1006 name: 'gemini-3.5-flash',
1007 max_input_tokens: 1_048_576,
1008 max_output_tokens: 65_536,
1009 supports: {
1010 input: ['text', 'image', 'video', 'document', 'audio'],
1011 output: ['text'],
1012 capabilities: [
1013 'batch_api',
1014 'caching',
1015 'function_calling',
1016 'structured_output',
1017 'thinking',
1018 ],
1019 tools: [
1020 'code_execution',
1021 'file_search',
1022 'google_search',
1023 'google_maps',
1024 'url_context',
1025 'computer_use',
1026 ],
1027 },
1028 pricing: {
1029 input: {
1030 normal: 1.5,
1031 cached: 0.15,
1032 },
1033 output: {
1034 normal: 9,
1035 },
1036 },
1037} as const satisfies ModelMeta<
1038 GeminiToolConfigOptions &
1039 GeminiSafetyOptions &
1040 GeminiCommonConfigOptions &
1041 GeminiCachedContentOptions &
1042 GeminiStructuredOutputOptions &
1043 GeminiThinkingOptions
1044>
1045
1046const GEMINI_3_5_FLASH_LITE = {
1047 name: 'gemini-3.5-flash-lite',
1048 max_input_tokens: 1_048_576,
1049 max_output_tokens: 65_536,
1050 knowledge_cutoff: '2025-01-01',
1051 supports: {
1052 input: ['text', 'image', 'video', 'audio', 'document'],
1053 output: ['text'],
1054 capabilities: [
1055 'agentic_video',
1056 'batch_api',
1057 'caching',
1058 'function_calling',
1059 'structured_output',
1060 'thinking',
1061 ],
1062 tools: [
1063 'code_execution',
1064 'file_search',
1065 'google_search',
1066 'google_maps',
1067 'url_context',
1068 ],
1069 },
1070 pricing: {
1071 input: {
1072 normal: 0.3,
1073 cached: 0.03,
1074 },
1075 output: {
1076 normal: 2.5,
1077 },
1078 },
1079} as const satisfies ModelMeta<
1080 GeminiToolConfigOptions &
1081 GeminiSafetyOptions &
1082 GeminiCommonConfigOptions &
1083 GeminiCachedContentOptions &
1084 GeminiStructuredOutputOptions &
1085 GeminiThinkingOptions
1086>
1087
1088export const GEMINI_MODELS = [
1089 GEMINI_3_8_FLASH.name,
1090 GEMINI_3_7_FLASH.name,
1091 GEMINI_3_6_FLASH.name,
1092 GEMINI_3_5_FLASH.name,
1093 GEMINI_3_5_FLASH_LITE.name,
1094 GEMINI_3_1_PRO.name,
1095 GEMINI_3_FLASH.name,
1096 GEMINI_3_1_FLASH_LITE.name,
1097 GEMINI_3_1_FLASH_LITE_PREVIEW.name,
1098 GEMINI_2_5_PRO.name,
1099 GEMINI_2_5_FLASH.name,
1100 GEMINI_2_5_FLASH_LITE.name,
1101] as const
1102
1103/**
1104 * Gemini models that support combining `tools` + `responseSchema` in a
1105 * single streaming `generateContent` call (per issue #605). Per the
1106 * provider matrix, Gemini 3.x natively interleaves the schema-constrained
1107 * answer with function-calling on one pass; Gemini 2.x is unsupported /
1108 * brittle and keeps the engine's legacy finalization fallback.
1109 */
1110export const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
1111 GEMINI_3_8_FLASH.name,
1112 GEMINI_3_7_FLASH.name,
1113 GEMINI_3_6_FLASH.name,
1114 GEMINI_3_5_FLASH.name,
1115 GEMINI_3_5_FLASH_LITE.name,
1116 GEMINI_3_1_PRO.name,
1117 GEMINI_3_FLASH.name,
1118 GEMINI_3_1_FLASH_LITE.name,
1119 GEMINI_3_1_FLASH_LITE_PREVIEW.name,
1120])
1121
1122export type GeminiModels = (typeof GEMINI_MODELS)[number]
1123
1124/**
1125 * @deprecated Shut down 2026-06-25. Use `gemini-3.1-flash-image`.
1126 */
1127type Gemini31FlashImagePreviewModel = 'gemini-3.1-flash-image-preview'
1128
1129/**
1130 * @deprecated Shut down 2026-06-25. Use `gemini-3-pro-image`.
1131 */
1132type Gemini3ProImagePreviewModel = 'gemini-3-pro-image-preview'
1133
1134export type GeminiImageModels =
1135 | Exclude<
1136 (typeof GEMINI_IMAGE_MODELS)[number],
1137 Gemini31FlashImagePreviewModel | Gemini3ProImagePreviewModel
1138 >
1139 | Gemini31FlashImagePreviewModel
1140 | Gemini3ProImagePreviewModel
1141
1142/**
1143 * Image generation models. GA ids come first; the trailing `-preview` ids are
1144 * shut-down aliases kept only so existing code keeps compiling — new code
1145 * should use the GA id above its alias.
1146 */
1147export const GEMINI_IMAGE_MODELS = [
1148 GEMINI_3_1_FLASH_IMAGE.name,
1149 GEMINI_3_1_FLASH_LITE_IMAGE.name,
1150 GEMINI_3_PRO_IMAGE.name,
1151 GEMINI_2_5_FLASH_IMAGE.name,
1152 IMAGEN_4_GENERATE.name,
1153 IMAGEN_4_GENERATE_FAST.name,
1154 IMAGEN_4_GENERATE_ULTRA.name,
1155 // Deprecated aliases — shut down 2026-06-25.
1156 GEMINI_3_1_FLASH_IMAGE_PREVIEW.name,
1157 GEMINI_3_PRO_IMAGE_PREVIEW.name,
1158] as const
1159
1160/**
1161 * Text-to-speech models
1162 * @experimental Gemini TTS is an experimental feature and may change.
1163 */
1164export const GEMINI_TTS_MODELS = [
1165 GEMINI_3_1_FLASH_TTS.name,
1166 GEMINI_2_5_FLASH_TTS.name,
1167 GEMINI_2_5_PRO_TTS.name,
1168] as const
1169
1170/**
1171 * Audio generation models (Lyria music generation).
1172 * @experimental Lyria music generation is an experimental feature and may change.
1173 */
1174export const GEMINI_AUDIO_MODELS = [
1175 LYRIA_3_PRO.name,
1176 LYRIA_3_CLIP.name,
1177] as const
1178
1179/**
1180 * Available voice names for Gemini TTS
1181 * @see https://ai.google.dev/gemini-api/docs/speech-generation
1182 */
1183export const GEMINI_TTS_VOICES = [
1184 'Zephyr',
1185 'Puck',
1186 'Charon',
1187 'Kore',
1188 'Fenrir',
1189 'Leda',
1190 'Orus',
1191 'Aoede',
1192 'Callirrhoe',
1193 'Autonoe',
1194 'Enceladus',
1195 'Iapetus',
1196 'Umbriel',
1197 'Algieba',
1198 'Despina',
1199 'Erinome',
1200 'Algenib',
1201 'Rasalgethi',
1202 'Laomedeia',
1203 'Achernar',
1204 'Alnilam',
1205 'Schedar',
1206 'Gacrux',
1207 'Pulcherrima',
1208 'Achird',
1209 'Zubenelgenubi',
1210 'Vindemiatrix',
1211 'Sadachbia',
1212 'Sadaltager',
1213 'Sulafat',
1214] as const
1215
1216export type GeminiTTSVoice = (typeof GEMINI_TTS_VOICES)[number]
1217
1218/**
1219 * Video generation models. Veo models run on the long-running
1220 * `:predictLongRunning` flow; Gemini Omni Flash runs on the Interactions
1221 * API — the video adapter routes by model.
1222 * @experimental Video generation is an experimental feature and may change.
1223 */
1224export const GEMINI_VIDEO_MODELS = [
1225 VEO_3_1_PREVIEW.name,
1226 VEO_3_1_FAST_PREVIEW.name,
1227 VEO_3_1_LITE_PREVIEW.name,
1228 GEMINI_OMNI_1_1_FLASH.name,
1229 // Deprecated alias — shuts down 2026-09-30.
1230 GEMINI_OMNI_FLASH_PREVIEW.name,
1231] as const
1232
1233/**
1234 * Video models served by the Interactions API rather than Veo's
1235 * `:predictLongRunning` operations flow. GA id first; the trailing
1236 * `-preview` id is a shutdown alias kept so existing code compiles.
1237 * @experimental Omni video generation is an experimental feature and may change.
1238 */
1239export const GEMINI_INTERACTIONS_VIDEO_MODELS = [
1240 GEMINI_OMNI_1_1_FLASH.name,
1241 GEMINI_OMNI_FLASH_PREVIEW.name,
1242] as const
1243
1244/**
1245 * Embedding models
1246 */
1247export const GEMINI_EMBEDDING_MODELS = ['gemini-embedding-001'] as const
1248
1249export type GeminiEmbeddingModel = (typeof GEMINI_EMBEDDING_MODELS)[number]
1250
1251/**
1252 * Type-only map from embedding model name to its provider options type.
1253 */
1254export type GeminiEmbeddingModelProviderOptionsByName = {
1255 'gemini-embedding-001': GeminiEmbeddingProviderOptions
1256}
1257
1258/**
1259 * Per-model input modalities for embedding models. Gemini embedding models
1260 * are text-only, so image inputs fail at compile time.
1261 */
1262export type GeminiEmbeddingModelInputModalitiesByName = {
1263 'gemini-embedding-001': readonly ['text']
1264}
1265
1266// Manual type map for per-model provider options
1267export type GeminiChatModelProviderOptionsByName = {
1268 // Models with thinking and structured output support
1269 [GEMINI_3_8_FLASH.name]: GeminiToolConfigOptions &
1270 GeminiSafetyOptions &
1271 GeminiCommonConfigOptions &
1272 GeminiCachedContentOptions &
1273 GeminiStructuredOutputOptions &
1274 GeminiThinkingOptions<'LOW' | 'MEDIUM' | 'HIGH'>
1275 [GEMINI_3_7_FLASH.name]: GeminiToolConfigOptions &
1276 GeminiSafetyOptions &
1277 GeminiCommonConfigOptions &
1278 GeminiCachedContentOptions &
1279 GeminiStructuredOutputOptions &
1280 GeminiThinkingOptions
1281 [GEMINI_3_6_FLASH.name]: GeminiToolConfigOptions &
1282 GeminiSafetyOptions &
1283 GeminiCommonConfigOptions &
1284 GeminiCachedContentOptions &
1285 GeminiStructuredOutputOptions &
1286 GeminiThinkingOptions
1287 [GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &
1288 GeminiSafetyOptions &
1289 GeminiCommonConfigOptions &
1290 GeminiCachedContentOptions &
1291 GeminiStructuredOutputOptions &
1292 GeminiThinkingOptions
1293 [GEMINI_3_5_FLASH_LITE.name]: GeminiToolConfigOptions &
1294 GeminiSafetyOptions &
1295 GeminiCommonConfigOptions &
1296 GeminiCachedContentOptions &
1297 GeminiStructuredOutputOptions &
1298 GeminiThinkingOptions
1299 [GEMINI_3_1_PRO.name]: GeminiToolConfigOptions &
1300 GeminiSafetyOptions &
1301 GeminiCommonConfigOptions &
1302 GeminiCachedContentOptions &
1303 GeminiStructuredOutputOptions &
1304 GeminiThinkingOptions
1305 [GEMINI_3_FLASH.name]: GeminiToolConfigOptions &
1306 GeminiSafetyOptions &
1307 GeminiCommonConfigOptions &
1308 GeminiCachedContentOptions &
1309 GeminiStructuredOutputOptions &
1310 GeminiThinkingOptions
1311 [GEMINI_3_1_FLASH_LITE.name]: GeminiToolConfigOptions &
1312 GeminiSafetyOptions &
1313 GeminiCommonConfigOptions &
1314 GeminiCachedContentOptions &
1315 GeminiStructuredOutputOptions &
1316 GeminiThinkingOptions
1317 [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &
1318 GeminiSafetyOptions &
1319 GeminiCommonConfigOptions &
1320 GeminiCachedContentOptions &
1321 GeminiStructuredOutputOptions &
1322 GeminiThinkingOptions
1323 [GEMINI_2_5_PRO.name]: GeminiToolConfigOptions &
1324 GeminiSafetyOptions &
1325 GeminiCommonConfigOptions &
1326 GeminiCachedContentOptions &
1327 GeminiStructuredOutputOptions &
1328 GeminiThinkingOptions
1329 [GEMINI_2_5_FLASH.name]: GeminiToolConfigOptions &
1330 GeminiSafetyOptions &
1331 GeminiCommonConfigOptions &
1332 GeminiCachedContentOptions &
1333 GeminiStructuredOutputOptions &
1334 GeminiThinkingOptions
1335 [GEMINI_2_5_FLASH_LITE.name]: GeminiToolConfigOptions &
1336 GeminiSafetyOptions &
1337 GeminiCommonConfigOptions &
1338 GeminiCachedContentOptions &
1339 GeminiStructuredOutputOptions &
1340 GeminiThinkingOptions
1341}
1342
1343/**
1344 * Type-only map from chat model name to its supported tool capabilities.
1345 * Based on the 'supports.tools' arrays defined for each model.
1346 */
1347export type GeminiChatModelToolCapabilitiesByName = {
1348 [GEMINI_3_8_FLASH.name]: typeof GEMINI_3_8_FLASH.supports.tools
1349 [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.tools
1350 [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.tools
1351 [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools
1352 [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.tools
1353 [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools
1354 [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools
1355 [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools
1356 [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.tools
1357 [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools
1358 [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools
1359 [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools
1360}
1361
1362/**
1363 * Type-only map from chat model name to its supported input modalities.
1364 * Based on the 'supports.input' arrays defined for each model.
1365 * Note: 'document' in the model meta is mapped to 'document' modality.
1366 * Used by the core AI types to constrain ContentPart types based on the selected model.
1367 * Note: These must be inlined as readonly arrays (not typeof) because the model
1368 * constants are not exported and typeof references don't work in .d.ts files
1369 * when consumed by external packages.
1370 *
1371 * @see https://ai.google.dev/gemini-api/docs/vision
1372 * @see https://ai.google.dev/gemini-api/docs/audio
1373 * @see https://ai.google.dev/gemini-api/docs/document-processing
1374 */
1375export type GeminiModelInputModalitiesByName = {
1376 // Models with full multimodal support (text, image, audio, video, document)
1377 [GEMINI_3_8_FLASH.name]: typeof GEMINI_3_8_FLASH.supports.input
1378 [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.input
1379 [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.input
1380 [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input
1381 [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.input
1382 [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input
1383 [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input
1384 [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input
1385 [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input
1386 [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input
1387 [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input
1388
1389 // Models with text, image, audio, video (no document)
1390 [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input
1391}