Skip to main content

Overview

Google’s Gemini is a powerful, fast AI model with an incredibly generous free tier and massive context windows. Perfect for experimentation, rapid iteration, and cost-conscious development.
Gemini 2.0 Flash offers the best speed-to-quality ratio and includes a free tier!

Quick Start

1

Get API Key

  1. Go to aistudio.google.com
  2. Click “Get API Key”
  3. Create new project (or select existing)
  4. Click “Create API Key”
  5. Copy your API key (starts with AIza)
2

Configure Forge

Edit .forge/config.json:
3

Test Connection


Available Models

model
Fastest model with experimental features
  • Context: 1M tokens
  • Speed: ⚡ Blazing fast
  • Cost: FREE (rate limited)
  • Best for: Quick iterations, experimentation
This is the recommended model for most tasks!

Gemini 1.5 (Stable)

model
Most capable, largest context
  • Context: 2M tokens (!)
  • Speed: Fast
  • Cost: 1.25/MTokinput,1.25/MTok input, 5/MTok output
  • Best for: Large codebase analysis
2 million token context = ~50,000 lines of code!
model
Balanced speed and quality
  • Context: 1M tokens
  • Speed: Very fast
  • Cost: 0.075/MTokinput,0.075/MTok input, 0.30/MTok output
  • Best for: Most coding tasks

Model Comparison


Configuration

Basic Setup

Advanced Configuration

number
default:"1.0"
Randomness (0-2)
  • 0 = Deterministic
  • 1 = Balanced (default)
  • 2 = Creative
number
default:"2048"
Maximum response length
  • Max: 8192 tokens
number
default:"0.95"
Nucleus sampling parameter
number
default:"40"
Top-K sampling parameter

Gemini’s Strengths

Blazing Fast ⚡

Gemini is the fastest major coding agent:
Perfect for rapid iteration:

Free Tier! 💰

Unlike Claude/GPT-4, Gemini has a generous free tier:
Start every project with Gemini’s free tier. Upgrade to paid models only when needed!

Massive Context Windows

Gemini 1.5 Pro: 2 million tokens
Can fit:
  • ~50,000 lines of code
  • ~1.5 million words
  • Entire small-to-medium codebases

Multimodal

Gemini can process images:

Gemini’s Weaknesses

Less Sophisticated Reasoning

For complex architecture, use Claude:

May Miss Edge Cases

Gemini optimizes for speed, sometimes at the cost of thoroughness:

Shorter Explanations

Gemini provides concise code, less explanation: Gemini ✅:
Claude 📝:

Pricing

Free Tier

20x cheaper than Claude Sonnet, 50x cheaper than GPT-4!

Best Use Cases

Rapid Prototyping

Simple Features

Bug Fixes

Large Codebase Analysis


Cost Optimization Strategy

Start with Free Tier

Use for Iteration


Integration with Forge

Default Agent

Set Gemini as default for cost savings:

Fallback Strategy

Use Gemini first, fallback to Claude:
.forge/strategies.yaml

Troubleshooting

Error: “API key not valid”Solutions:
  • Verify API key from aistudio.google.com
  • Check key hasn’t been deleted
  • Ensure no extra spaces
  • Generate new key if needed
Error: “Resource exhausted”You’ve hit free tier limits:Options:
  1. Wait for reset (15 RPM, 1500 RPD)
  2. Switch to paid tier (add billing)
  3. Use different agent temporarily:
Issue: Gemini gives brief responsesSolution: Increase max output tokens
Issue: Code works but misses edge casesThis is expected - Gemini optimizes for speedSolution: Two-pass approach

Rate Limits

Free Tier Limits

Check limits: ai.google.dev/pricing

Best Practices

Use Free Tier First

Save money on simple tasks

Leverage Speed

Gemini’s speed enables rapid iteration:
All done in minutes, all free!

Use for Exploration

Perfect for trying ideas:

Large Context Tasks

Use Pro for codebase-wide tasks:
2M context = entire codebase

Gemini vs Other Agents

Choose Gemini for: Speed, cost, experimentation, large context Choose Claude for: Quality, reasoning, architecture Choose GPT-4 for: Consistency, documentation Choose Cursor for: UI/UX, rapid frontend work

Real-World Examples

Example 1: Quick Bug Fix (Free!)

Example 2: Rapid Prototyping (Free!)


Next Steps

Get Started

Create your first Gemini task (free!)

Other Agents

Compare with other AI agents

Cost Optimization

Maximize free tier usage

Google AI Studio

Get your API key