Skip to main content

Overview

The Google Gen AI SDK provides access to various Gemini models through both the Gemini Developer API and Vertex AI. Each model has different capabilities, performance characteristics, and pricing.

Model Naming Convention

When calling models, use the model name string:

Available Models

Gemini 2.5 Flash

Model ID: gemini-2.5-flash The latest and most capable Gemini model for fast, versatile performance.
  • Best for: Most use cases, balanced performance and cost
  • Strengths: Fast response times, high-quality outputs, multimodal capabilities
  • Context Window: Large context window for long documents
  • Modalities: Text, images, audio, video

Gemini 2.0 Flash

Model ID: gemini-2.0-flash Previous generation flash model, still highly capable.
  • Best for: General purpose tasks
  • Strengths: Fast inference, good quality
  • Context Window: Large
  • Modalities: Text, images, audio, video

Gemini 2.5 Pro (Preview)

Model ID: gemini-2.5-pro Advanced model with enhanced reasoning capabilities.
  • Best for: Complex reasoning, analysis, and specialized tasks
  • Strengths: Superior reasoning, deep analysis
  • Context Window: Very large
  • Modalities: Text, images, audio, video

Gemini 2.5 Flash Image

Model ID: gemini-2.5-flash-image Specialized model for image generation.
  • Best for: Generating images from text descriptions
  • Strengths: High-quality image generation
  • Input: Text prompts
  • Output: Images

Embedding Models

Text Embedding

Model ID: text-embedding-004 Latest text embedding model for semantic search and retrieval.

Multimodal Embedding

Model ID: multimodalembedding@001 (Vertex AI only) Embed text, images, and video for multimodal applications.

Image Generation Models

Imagen 4.0

Model ID: imagen-4.0-generate-001 Latest image generation model with improved quality and control.

Imagen 4.0 Upscale (Vertex AI only)

Model ID: imagen-4.0-upscale-preview Upscale images to higher resolutions.

Imagen 3.0 Edit (Vertex AI only)

Model ID: imagen-3.0-capability-001 Edit existing images with text prompts.

Video Generation Models

Veo 3.1

Model ID: veo-3.1-generate-preview State-of-the-art video generation model.

Model Selection Guide

By Use Case

By Performance Characteristics

Flash models prioritize speed and cost-efficiency while maintaining high quality. They’re ideal for most production use cases.
Pro models prioritize quality and reasoning capabilities. Use them for complex analytical tasks, research, and scenarios requiring deep understanding.

Listing Available Models

Retrieve a list of available base models:
With pagination:

Async Listing

Getting Model Information

Retrieve details about a specific model:

Tuned Models

Creating a Tuned Model (Vertex AI only)

Fine-tune a base model on your own data:

Using a Tuned Model

Once training is complete, use your tuned model:

Listing Tuned Models

Retrieve your custom tuned models:

Updating a Tuned Model

Model Capabilities

Multimodal Input

Most Gemini models support multiple input modalities:

Multimodal Output

Some models can generate multimodal outputs:

Function Calling

All Gemini text models support function calling:

Model Configuration

Generation Parameters

Control model behavior with generation parameters:
float
default:"1.0"
Controls randomness. Higher values (e.g., 1.5) make output more creative and varied. Lower values (e.g., 0.2) make output more deterministic and focused. Range: 0.0-2.0.
float
default:"0.95"
Nucleus sampling threshold. Considers tokens with cumulative probability up to top_p. Range: 0.0-1.0. Lower values make output more focused.
int
default:"40"
Limits sampling to top K tokens by probability. Lower values make output more deterministic.
int
Maximum number of tokens to generate. Models have different maximum limits.

Model-Specific Documentation

For detailed capabilities and parameters of each model:

Best Practices

Start with gemini-2.5-flash for most use cases. It provides excellent performance at a lower cost than pro models.
Use pro models when you need:
  • Complex reasoning and analysis
  • Deep understanding of nuanced topics
  • Highest quality outputs for critical applications
Model availability varies between Gemini Developer API and Vertex AI. Some models (like tuned models and certain Imagen/Veo variants) are only available on Vertex AI.
For embeddings, always use the latest embedding model (text-embedding-004) for best results unless you need backward compatibility.