How to Generate Google Gemini API Key

Learn how to create and configure your custom Google Gemini API key for use with VoxWrite.

Getting Your API Key

Step 1: Access Google AI Studio

  1. Visit aistudio.google.com
  2. Sign in with your Google account
  3. If you don't have a Google account, create one first

Step 2: Generate API Key

  1. Click "Get API Key" in the left sidebar (or navigate to API Keys section)
  2. Click "Create API Key"
  3. Select an existing Google Cloud project or create a new one
  4. Important: Copy the key immediately - store it securely!

Step 3: Add Key to VoxWrite

  1. Open VoxWrite settings.
  2. Navigate to "API Keys" section
VoxWrite API Keys settings panel
  1. Paste your Google Gemini API key in the designated field
Input for Google Gemini API Key
  1. Click "Save"

API Key Format

Google Gemini API keys follow this format:

AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Make sure to copy the entire key including the AIza prefix.

Key Security

Best Practices

  • Never share your API key publicly
  • Store securely: Keep it in a password manager
  • Use unique keys: Create different keys for different apps
  • Monitor usage: Check your Google Cloud Console regularly
  • Set quotas: Configure usage limits in Google Cloud

What to Do If Compromised

  1. Delete immediately: Remove the compromised key in Google AI Studio
  2. Create new key: Generate a fresh API key
  3. Update VoxWrite: Add the new key to your settings
  4. Check billing: Review your Google Cloud usage for any unusual activity

Usage & Billing

  • Google charges based on tokens used (input + output)
  • Pricing varies by model
  • Free tier available with limited requests per minute
  • View detailed usage in Google Cloud Console

Troubleshooting

"Invalid API Key" Error

  • Verify you copied the entire key (starts with AIza)
  • Check for extra spaces or characters
  • Ensure the key hasn't been deleted
  • Verify the API is enabled in your Google Cloud project
  • Try generating a new key

"Quota Exceeded" Error

  • Check your free tier limits
  • Wait for the rate limit to reset (usually per minute)
  • Consider enabling billing for higher limits
  • Upgrade your quota in Google Cloud Console

Connection Issues

  • Check your internet connection
  • Verify Google AI services status
  • Ensure the Generative Language API is enabled in your project
  • Check if you need to enable billing for your project

<< How to generate custom Anthropic API key | How to set up the custom rules >>