This guide will help you configure Google Gemini for this project.
Gemini serves as the fallback AI inference provider. If Groq is unavailable, encounters an error, or cannot process a request, the application will automatically use Gemini to continue AI inference.
By the end of this guide, you will have:
- ✅ Created (or signed in to) a Google AI Studio account
- ✅ Generated a Gemini API key
- ✅ Configured the project's environment variables
- ✅ Enabled Gemini as the fallback AI provider
- Open Google AI Studio
- Sign In
- Open the API Keys Page
- Create an API Key
- Configure the API Key
- Create a Google Cloud Project (If Needed)
- Generate the API Key
- Copy the API Key
- Configure the Project
- Setup Complete
Click Get Started.
After clicking Get Started, one of two things will happen:
- If you are not signed in, you'll be prompted to sign in with your Google account.
- If you are already signed in, you'll be taken directly to the Google AI Studio playground.
If you wish to use a different Google account, click your email in the bottom-left corner, sign out, and then sign back in with your preferred account.
| Sign In | Already Signed In |
|---|---|
![]() |
![]() |
Once you're inside Google AI Studio, click the key icon located on the bottom-left sidebar.
This opens the Get an API Key page.
On the API Keys page, click Create API Key.
A dialog titled Create a new key will appear.
It contains the following options.
Give your API key any name you prefer.
Examples include:
- VoucherBot
- Development
- Production
- Personal Laptop
If you already have a Google Cloud project, simply select it from the dropdown.
If you don't have one yet, choose Create Project from the dropdown instead.
If you selected Create Project, another dialog titled Create a new project will appear.
Enter any project name you like.
Then click Create Project.
Google AI Studio will automatically create the project for you and select it in the Choose an imported project dropdown.
Once your project has been selected, click Create Key.
Google AI Studio will generate your Gemini API key.
A dialog titled API Key Details will appear.
It contains information such as:
- API Key
- Key Name
- Project Name
- Project Number
Copy the API key, or simply click Copy Key.
Open your project's .env file and locate the following variable:
GEMINI_API_KEY="your_gemini_api_key"Replace:
your_gemini_api_keywith the API key you copied from Google AI Studio.
Example:
GEMINI_API_KEY="AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXX"Save the file.
Your project is now configured to use Gemini as its fallback AI provider.
If Groq is unavailable or cannot complete an inference request, the application can automatically use Gemini instead.
If you wish, you can also configure additional Google AI Studio features, such as:
- Billing
- Usage limits
- Additional API keys
- Project management
- Model configuration
- Safety settings
These are optional and are not required for this project.








