What you’ll need
Before you begin, make sure you have:- A Google account
- Access to Google AI Studio
The Gemini API offers a generous free tier with 15 requests per minute and 1,500 requests per day. Perfect for personal use.
Step-by-step guide
Navigate to Google AI Studio
Go to Google AI Studio in your web browser.You’ll be directed to the API key management page.
Sign in to your Google account
If you’re not already signed in, you’ll need to authenticate with your Google account.Use the same account you want to associate with the API usage.
Create a new API key
On the API key page, click the Create API Key button.You’ll be prompted to:
If this is your first time, you may need to accept Google’s terms of service for the Generative AI API.
- Select an existing Google Cloud project or create a new one
- Click Create API key in existing project (or Create API key in new project)
Copy your API key
Once created, your API key will be displayed. It will look something like:Click the Copy icon next to the key to copy it to your clipboard.
Add the API key to Screen Answerer
Now that you have your API key:
- Open Screen Answerer in your browser
- Click the ⚙️ Settings icon in the top right corner
- Select the API Key tab
- Paste your API key into the input field
- Click Save Settings
API key format
Valid Gemini API keys follow this format:- Start with
AIza - Followed by 35 alphanumeric characters, hyphens, or underscores
- Total length: 39 characters
AIzaSyAbCdEfGhIjKlMnOpQrStUvWxYz1234567
Security best practices
Keep your API key private
Keep your API key private
Your API key is like a password. Never share it publicly or commit it to version control. Anyone with access to your key can use your Gemini API quota.
Monitor your usage
Monitor your usage
Visit the Google Cloud Console to monitor your API usage and ensure you’re staying within the free tier limits.
Regenerate if compromised
Regenerate if compromised
If you believe your API key has been exposed, go back to Google AI Studio and regenerate it immediately. Remember to update Screen Answerer with the new key.
Use API restrictions
Use API restrictions
For added security, you can restrict your API key to specific websites or IP addresses in the Google Cloud Console. This prevents unauthorized use even if the key is leaked.
Troubleshooting
”Invalid API key” error
If Screen Answerer reports an invalid API key:- Verify the key format matches the pattern described above
- Check for extra spaces or characters when copying
- Ensure the API is enabled in your Google Cloud project
- Try regenerating the key in Google AI Studio
”API quota exceeded” error
If you hit quota limits:- Wait for the quota to reset (quotas reset every minute/day)
- Reduce your monitoring frequency in Screen Answerer
- Consider upgrading to a paid plan in Google Cloud if needed
Test API key manually
You can verify your API key works by making a test request using curl:YOUR_API_KEY with your actual key. A successful response confirms the key is valid.
Next steps
Using screen monitor
Learn how to monitor your screen for quiz questions
Best practices
Optimize API usage and improve performance