Gemini AI Setup
Enable Gemini-powered AI content generation in the eClassify Admin Panel. This guide covers both a quick development setup (free API key) and a production setup (restricted key with billing enabled).
What These Settings Control
The Gemini AI Settings page lets you:
- Toggle AI features on/off
- Configure the Gemini API key used by the server
- Select the Gemini model (e.g.
gemini-2.5-flash-lite) - Set Global daily rate limits (per day, across all users)
- Set Per User daily rate limits
- Clear cached AI-generated content
Prerequisites
- A Google account with access to Google AI Studio or Google Cloud Console
- For production: a Google Cloud project with billing enabled
Option A — Development Setup (Free Key)
Use this for testing or evaluation. Free tier has lower quotas.
- Open https://aistudio.google.com/app/apikey
- Sign in with your Google account
- Click Create API key and copy the generated key
- In Admin Panel, go to Settings → Gemini AI
- Enable the Enable Gemini AI toggle
- Paste the key into Gemini API Key
- Click Fetch Models and choose a model (default:
gemini-2.5-flash-lite) - Set rate limits (use
0for unlimited) - Click Save Settings
Use the API key only from the backend. Never expose it in the browser or commit it to a public repo.
Option B — Production Setup (Restricted Key)
Use this for live deployments. Restrict the key by API and IP to prevent abuse.
Step 1 — Enable the Generative Language API
- Open Google Cloud Console
- Select (or create) your project and enable billing
- Go to APIs & Services → Library
- Search for Generative Language API and click Enable
Step 2 — Create a Restricted API Key
- Go to APIs & Services → Credentials
- Click Create Credentials → API key
- Open the new key and click Edit API key
- Under API restrictions, select Restrict key and pick Generative Language API only
- Under Application restrictions, choose IP addresses and add your server's egress IPs (IPv4 and IPv6)
- Save
Step 3 — Configure Admin Panel
- In Admin Panel, go to Settings → Gemini AI
- Enable the Enable Gemini AI toggle
- Paste the restricted key into Gemini API Key
- Click Fetch Models and select a model
- Configure rate limits:
- Global Rate Limits (per day) — total daily quota across all users
- Description Limit — max ad-description generations per day
- Meta Details Limit — max meta-detail generations per day
- Per User Rate Limits (per day) — same fields, applied per individual user
0= unlimited
- Global Rate Limits (per day) — total daily quota across all users
- Click Save Settings
If your server's egress IP changes, update the key's allowed IPs — otherwise requests will fail with 403.
Cache Management
Cached AI content speeds up repeated requests. To force regeneration, click Clear AI Cache under the Cache Management section at the bottom of the Gemini AI Settings page.
Field Reference
| Field | Description |
|---|---|
| Enable Gemini AI | Master toggle for all AI content generation |
| Gemini API Key | Server-side key from AI Studio or Cloud Console |
| Gemini Model | Model identifier (use Fetch Models to list available ones) |
| Global Description Limit | Daily cap on description generations across all users |
| Global Meta Details Limit | Daily cap on meta-detail generations across all users |
| Per User Description Limit | Daily cap on description generations per user |
| Per User Meta Details Limit | Daily cap on meta-detail generations per user |
| Clear AI Cache | Deletes cached AI responses; next request regenerates |