Skip to content

Gemini Setup

Google Gemini Setup

Getting Your API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click Create API Key
  4. Copy the generated key

Free Tier

  • 60 requests per minute for Gemini 2.0 Flash
  • 2 requests per minute for Gemini 2.5 Pro
  • No credit card required to start

Environment Variables

Set one of these environment variables:

Terminal window
# Option 1 (preferred)
export GEMINI_API_KEY="your-api-key-here"
# Option 2 (alternative)
export GOOGLE_API_KEY="your-api-key-here"

Add to your shell profile (~/.bashrc, ~/.zshrc) to persist:

Terminal window
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc

Verify Your Setup

Test your API key:

Terminal window
curl "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY"

A successful response lists available models. If you get an error, verify your key is correct and active.