Gemini Setup
Google Gemini Setup
Getting Your API Key
- Visit Google AI Studio
- Sign in with your Google account
- Click Create API Key
- 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:
# 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:
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrcsource ~/.bashrcVerify Your Setup
Test your API key:
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.