Verily uses Google's Gemini 2.0 Flash model to verify video submissions. This guide walks through setting up the Gemini API for your development environment.
gcloud projects create verily-app --name="Verily"
gcloud config set project verily-appOr via the GCP Console.
gcloud services enable generativelanguage.googleapis.com- Go to API Credentials
- Click "Create Credentials" > "API Key"
- Restrict the key to "Generative Language API" only
- Copy the key
Add the API key to verily_server/config/passwords.yaml:
development:
# ... existing keys ...
geminiApiKey: "YOUR_API_KEY_HERE"- Free tier: 60 requests/minute, 1500 requests/day
- Paid tier: Higher limits with pay-per-use
- Set up billing alerts to avoid unexpected charges
The server gracefully handles a missing Gemini API key:
- Action browsing, creation, and all non-verification features work normally
- Video submissions will return a "verification service unavailable" error
- The submission status will show as
errorwith an appropriate message
To verify your setup:
- Start the server:
server:start - Submit a video through the app
- Check server logs for Gemini API responses
We use gemini-2.0-flash for:
- Fast response times (< 5 seconds for most videos)
- Good accuracy for visual content analysis
- Cost-effective for high-volume verification
For higher accuracy needs, you can change the model in gemini_service.dart to gemini-2.0-pro, though this will increase latency and cost.