Skip to main content

Overview

Google Gemini integration provides access to Gemini 1.5 Pro, Flash, and 2.5 models through the Generative AI API. Supports multimodal inputs (text, images, video), large context windows, and advanced reasoning.

Setup

1

Get API Key

Visit Google AI Studio and create an API key
2

Add Credential

In Flowise, create a new Google Generative AI credential with your API key
3

Add to Canvas

Drag the ChatGoogleGenerativeAI node from Chat Models to your canvas

Configuration

Basic Parameters

credential
credential
required
Google Generative AI API key credential
modelName
string
default:"gemini-1.5-flash-latest"
The Gemini model to use:
  • gemini-2.5-pro - Most capable, latest generation
  • gemini-2.5-flash - Fast and efficient
  • gemini-1.5-pro-latest - Previous generation pro
  • gemini-1.5-flash-latest - Previous generation flash
  • gemini-1.0-pro - Legacy model
customModelName
string
Override with a custom model name (e.g., experimental models like gemini-1.5-pro-exp-0801)
temperature
number
Controls randomness (0.0 to 1.0). Lower = more deterministic
streaming
boolean
default:true
Enable streaming responses

Advanced Parameters

maxOutputTokens
number
Maximum tokens to generate. Gemini 1.5 supports up to 8192 output tokens
topP
number
Nucleus sampling threshold (0.0 to 1.0)
topK
number
Sample from top K most probable tokens. Must be positive

Safety Settings

safetySettings
array
Configure content filtering for different harm categories:Harm Categories:
  • HARM_CATEGORY_DANGEROUS_CONTENT - Violence, dangerous acts
  • HARM_CATEGORY_HARASSMENT - Harassment, bullying
  • HARM_CATEGORY_HATE_SPEECH - Hate speech
  • HARM_CATEGORY_SEXUALLY_EXPLICIT - Sexual content
  • HARM_CATEGORY_CIVIC_INTEGRITY - Election-related content
Block Thresholds:
  • BLOCK_NONE - Don’t block any content
  • BLOCK_ONLY_HIGH - Block only high-probability harmful content
  • BLOCK_MEDIUM_AND_ABOVE - Block medium and high
  • BLOCK_LOW_AND_ABOVE - Block low, medium, and high
  • HARM_BLOCK_THRESHOLD_UNSPECIFIED - Use default

Thinking Budget (Gemini 2.5)

Thinking budget is available for Gemini 2.5 models to guide internal reasoning.
thinkingBudget
number
Guide the number of thinking tokens:
  • -1 - Dynamic budget (recommended)
  • 0 - Disable thinking
  • Positive integer - Fixed thinking token budget

Multimodal Support

allowImageUploads
boolean
default:false
Enable image input for multimodal analysis
baseUrl
string
Custom API base URL (for Vertex AI or custom endpoints)

Usage Examples

Basic Text Chat

// Standard configuration
Model Name: gemini-1.5-flash-latest
Temperature: 0.7
Max Output Tokens: 2048
Streaming: true

Multimodal Image Analysis

// Analyze images with text
Model Name: gemini-1.5-pro-latest
Allow Image Uploads: true
Max Output Tokens: 4096
Temperature: 0.4

With Safety Settings

// Configure content filtering
{
  "safetySettings": [
    {
      "harmCategory": "HARM_CATEGORY_HARASSMENT",
      "harmBlockThreshold": "BLOCK_MEDIUM_AND_ABOVE"
    },
    {
      "harmCategory": "HARM_CATEGORY_HATE_SPEECH",
      "harmBlockThreshold": "BLOCK_LOW_AND_ABOVE"
    }
  ]
}

Gemini 2.5 with Thinking

// Advanced reasoning
Model Name: gemini-2.5-pro
Thinking Budget: -1  // Dynamic
Temperature: 0.3
Max Output Tokens: 8192

Using Custom Model

// Try experimental models
Model Name: gemini-1.5-pro-latest
Custom Model Name: gemini-1.5-pro-exp-0827

Model Comparison

ModelContext WindowOutput TokensBest ForSpeed
Gemini 2.5 Pro2M tokens8KComplex reasoningMedium
Gemini 2.5 Flash1M tokens8KFast responsesFast
Gemini 1.5 Pro1M tokens8KMultimodal tasksMedium
Gemini 1.5 Flash1M tokens8KHigh volumeVery Fast

Best Practices

Model Selection

  • Use Flash for most production tasks
  • Use Pro for complex analysis
  • Use 2.5 for latest capabilities
  • Test experimental models in dev

Safety Configuration

  • Set appropriate safety thresholds
  • Test with your content
  • Monitor blocked responses
  • Adjust per use case

Multimodal

  • Enable image uploads only when needed
  • Consider image size and format
  • Use clear text prompts
  • Test with sample images

Performance

  • Enable streaming for UX
  • Use Flash for speed
  • Set appropriate token limits
  • Monitor latency

Long Context Windows

Gemini models support extremely large contexts:
  • Gemini 2.5 Pro: Up to 2 million tokens
  • Gemini 1.5 Pro/Flash: Up to 1 million tokens
Use cases:
  • Analyze entire codebases
  • Process lengthy documents
  • Long conversation history
  • Multi-turn complex tasks
Large contexts increase latency and cost. Use only when necessary.

Common Issues

If responses are blocked:
  • Check safety settings configuration
  • Review harm categories and thresholds
  • Consider using BLOCK_NONE for dev/test
  • Rephrase prompts to be less ambiguous
Google AI has rate limits based on your tier:
  • Free tier: 15 RPM, 1M TPM
  • Paid tier: 360 RPM, 4M TPM
Solutions:
  • Implement exponential backoff
  • Batch requests when possible
  • Consider paid tier for production
Some models require allowlist access:
  • Use generally available models
  • Check model availability by region
  • Request access for experimental models
For multimodal inputs:
  • Ensure allowImageUploads is enabled
  • Check image format (JPEG, PNG, WebP)
  • Verify image size limits
  • Use supported MIME types

Pricing

Gemini uses input/output token pricing:
ModelInput (per 1M tokens)Output (per 1M tokens)
Gemini 1.5 Flash$0.075$0.30
Gemini 1.5 Pro$1.25$5.00
Gemini 2.5 Pro$2.50$10.00
Prices as of 2024. Check Google AI Pricing for current rates.

Build docs developers (and LLMs) love