Set Up Multiple Gemini AI API Keys
This guide will help you set up multiple Gemini AI API keys in your Google Spreadsheet. With multiple keys, you can take advantage of different rate limits, cost savings, or use fine-tuned models for various tasks. Each time an API is called, the system will automatically rotate through the available keys, ensuring efficient usage and load distribution.
Prerequisites
Note: Only the owner of the spreadsheet can set the API keys. If you are not the owner, you will need to request access or create a new spreadsheet
Steps to Set Up Multiple API Keys
-
Open Your Google Spreadsheet.
-
Select Extensions >AI Assist for Gemini in Sheets™, Docs™ & Forms™ > Set API Keys.
-
The Sidebar Appears
- You will see an input area where you can add your Gemini API keys.
- Enter Your API Keys:
- Paste each Gemini API key into the designated input fields. Ensure that each key is correctly formatted and valid.
- Save Your API Keys:
- After entering the keys, click Save to store them securely.
Notes
- API Key Management: Users with Editor’s access to this spreadsheet can now execute GEMINI functions using any of the API keys you have set up.
- Usage Monitoring: Keep track of your API usage to ensure you do not exceed any rate limits associated with each key.
- Key Rotation: The add-on implements a key rotation strategy to balance the usage among multiple keys, maximizing your cost savings and performance.
Troubleshooting
- Error Messages: If you encounter any issues when calling the GEMINI function, ensure that the API keys are correctly entered and saved.
- Permissions Issues: Verify your permissions if you are unable to access the API key settings.