This guide walks you through obtaining a Gemini API key from Google AI Studio, understanding the Free vs. Paid tiers, and setting up Google Cloud billing to unlock the $300 free credit.
- Go to Google AI Studio: Visit aistudio.google.com.
- Sign In: Log in with your Google account.
- Get API Key:
- Click on the "Get API key" button in the top-left corner or sidebar.
- Click "Create API key".
- Select "Create API key in new project" (recommended for a fresh start) or choose an existing project if you have one.
- Copy Key: Copy the generated key immediately and store it securely (e.g., in a password manager or
.envfile). Do not commit this key to public repositories.
Google AI Studio offers two primary modes for the Gemini API.
- Cost: Free of charge.
- Usage: Great for development, testing, and personal projects.
- Data Privacy: Important: Prompts and responses in the free tier may be used by Google to improve their products. Do not use this for sensitive or production data.
- Rate Limits (Examples, subject to change):
- Gemini 1.5 Flash: ~15 requests per minute (RPM).
- Gemini 1.5 Pro: ~2 requests per minute (RPM).
- Note: Limits are lower than the paid tier and usage is capped daily.
- Cost: You pay only for what you use (per 1k characters/images). View Pricing.
- Data Privacy: Enterprise-grade privacy. Your inputs and outputs are NOT used to train Google's models.
- Rate Limits: Significantly higher limits suitable for production applications (e.g., 1000+ RPM).
- Features: access to higher limits and Scalability.
To use the Paid Tier (and ensure data privacy), you need to enable billing on your Google Cloud Project.
New Google Cloud customers automatically receive $300 in free credits valid for 90 days.
- Risk-Free: You won't be charged actual money until you use up the $300 credit or the 90 days expire.
- Production Testing: This allows you to test the API with "Paid Tier" privacy and rate limits without spending your own money initially.
- Go to API Keys in AI Studio: Navigate back to the "Get API key" usage page in Google AI Studio.
- Edit Key / Project: Click on the project name associated with your API key.
- Set Up Billing:
- You will see an option to "Set up billing" or "Link to Google Cloud project".
- Click it to complete the setup in the Google Cloud Console.
- Create Billing Account:
- Follow the prompts to create a new Billing Account.
- You will need to enter a credit/debit card for identity verification.
- Verify the $300 Credit: During signup, you should see a banner confirming the $300 free trial credit.
- Link Project: Ensure your API Key project is linked to this new Billing Account.
- Data Privacy: As mentioned, data is not used for model training.
- Higher Rate Limits: Avoid "429 Too Many Requests" errors during heavy testing.
- Scalability: Your app can grow without hitting free-tier ceilings.
Tip
Recommendation: Start with the Free Tier to run your first "Hello World" test. Once you are comfortable and ready to process real data or run larger jobs (like a full competitor scan), switch to the Paid Tier to utilize the $300 credit and ensure data privacy.