-
Visit Google AI Studio
- Go to https://makersuite.google.com/app/apikey
- Sign in with your Google account
-
Create API Key
- Click "Create API Key" button
- Choose "Create API Key in new project" or select an existing project
- Copy the generated API key (it starts with "AIza...")
-
Set Up in Extension
- Open the DSA Hints Coach extension
- Enter your API key in the prompt that appears
- Click "Save & Test API Key"
- The extension will test the key and save it securely
For development purposes, you can also set the API key using environment variables:
-
Create a .env file in the project root:
GEMINI_API_KEY=your_actual_api_key_here GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent -
Replace
your_actual_api_key_herewith your actual Gemini API key
- The API key is stored securely in Chrome's sync storage
- Never commit your actual API key to version control
- The .env file is included in .gitignore to prevent accidental commits
- API keys are encrypted when stored in Chrome storage
If you're getting this error:
- Check API Key: Make sure your API key is valid and properly saved
- Test Connection: The extension will test your API key when you save it
- Check Quotas: Ensure you haven't exceeded your API usage limits
- Network Issues: Check your internet connection
- "Invalid API key": Your API key is incorrect or expired
- "Rate limit exceeded": You've hit the API usage limit, try again later
- "Network error": Check your internet connection
- "Server error": Google's servers are having issues, try again later
The extension uses the Gemini 1.5 Flash model for generating hints. Each hint generation:
- Uses approximately 100-200 tokens
- Costs around $0.0001-0.0002 per request
- Has a rate limit of 15 requests per minute
If you continue to have issues:
- Check the browser console for detailed error messages
- Verify your API key is working in the Google AI Studio
- Ensure you have sufficient API quota remaining