Configure DreamOS with API keys to unlock all features. This guide covers getting keys for Google Gemini AI, Wolfram Alpha, and YouTube Data API.
DreamOS requires three API keys for full functionality:
API
Purpose
Required?
Free Tier
Luna AI chat, topic extraction
Knowledge validation, homework help
Playlist import, video metadata
1. Create .env File
In your DreamOS project root:
Copy # Copy example file
cp .env.example .env 2. Add Your Keys
Open .env in a text editor and add:
Copy # Google Gemini AI
VITE_GEMINI_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Wolfram Alpha
VITE_WOLFRAM_APP_ID=XXXXXX-XXXXXXXXXX
# YouTube Data API v3
VITE_YOUTUBE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
VITE_YOUTUBE_CLIENT_ID=XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com 3. Restart Development Server
That's it! DreamOS will now use your API keys.
Detailed API Setup
Google Gemini AI (Luna AI + Topic Extraction)
What you get:
Conversational Luna AI assistant
Automatic topic extraction from YouTube videos
Step 1: Get API Key
Copy the key (starts with AIzaSy...)
circle-check
Free Tier : 60 requests per minute, no credit card required!
Step 2: Add to .env
You should get a response ✅
Not working? Check:
Key is copied correctly (no spaces)
Check browser console for errors
Wolfram Alpha (Knowledge Validation)
What you get:
Validate manually added topics
Homework helper with step-by-step solutions
Scientific/mathematical computations
Step 1: Create Account
Step 2: Create App
Fill in:
Application name : DreamOS
Application description : Personal learning assistant
Copy the AppID (looks like XXXXXX-XXXXXXXXXX)
circle-check
Free Tier : 2,000 queries per month (about 65 per day)
Step 3: Add to .env
Click "Add Topic Manually"
Enter: "Quantum Computing"
Should show "✓ Validated by Wolfram" ✅
YouTube Data API v3 (Playlist Import)
What you get:
Import Watch Later playlist
Video thumbnails and metadata
Automatic topic extraction from videos
Step 1: Create Google Cloud Project
Name: DreamOS (or anything)
Step 2: Enable YouTube Data API
In your project, go to "APIs & Services" → "Library"
Search: "YouTube Data API v3"
Click on it → Click "Enable"
Step 3: Create API Key
Go to "APIs & Services" → "Credentials"
Click "Create Credentials" → "API Key"
Copy the key (starts with AIzaSy...)
Optional : Click "Restrict Key" → Select "YouTube Data API v3"
Step 4: Create OAuth Client ID
Still in "Credentials" , click "Create Credentials" → "OAuth client ID"
If prompted, configure OAuth consent screen :
User support email: Your email
Developer contact: Your email
Save and Continue (skip scopes)
Back to "Credentials" , create OAuth client:
Application type: Web application
Authorized JavaScript origins: http://localhost:5173
Authorized redirect URIs: http://localhost:5173
Copy Client ID (ends with .apps.googleusercontent.com)
circle-exclamation
Production : For deployed apps, add your production URL to authorized origins!
Step 5: Add to .env
Click "Import from YouTube"
Videos should import with thumbnails ✅
circle-check
Free Tier : 10,000 quota units per day (enough for ~200 video imports)
Environment Variables Reference
Complete .env File
Variable Descriptions
Variable
Description
Default
Google Gemini AI for chat and analysis
Wolfram Alpha for computations
YouTube API for video metadata
OAuth for YouTube sign-in
Security Best Practices
⚠️ Never Commit .env to Git
The .gitignore already excludes .env, but verify:
🔒 Restrict API Keys
For Gemini AI:
Set HTTP referrer restrictions in Google AI Studio
Limit to your domain only
For YouTube API:
Restrict to YouTube Data API v3 only
Set application restrictions (HTTP referrers)
For Wolfram Alpha:
No restrictions needed (has built-in rate limiting)
🌐 Production Deployment
When deploying to Vercel/Netlify/etc:
Don't include .env in repository
Do add environment variables in platform dashboard
Update OAuth redirect URIs to production domain
Example: Vercel
Testing Your Configuration
Verify All APIs
Run this test script:
Troubleshooting
Issue: API key not recognized
Symptoms : Features not working, errors in console
Solutions :
Restart dev server after adding keys
Check for typos or extra spaces in .env
Verify variable names start with VITE_
Check file is named exactly .env (not .env.txt)
Issue: YouTube OAuth not working
Symptoms : Sign-in popup fails, redirect errors
Solutions :
Verify OAuth consent screen is configured
Add http://localhost:5173 to authorized origins
Check client ID is correct (ends with .apps.googleusercontent.com)
Enable YouTube Data API v3 in Cloud Console
Issue: Gemini API quota exceeded
Symptoms : "429 Too Many Requests" errors
Solutions :
Free tier: Wait 1 minute (60 requests/minute limit)
Implement request batching in code
Consider upgrading to paid tier for higher limits
Issue: Wolfram Alpha timeout
Symptoms : Queries take >30 seconds or fail
Solutions :
Verify you haven't exceeded 2,000 queries/month
Try simpler queries (complex computations take longer)
✅ APIs configured! Now learn the basics:
https://github.com/Ananya1464/DreamOS/blob/main/docs/getting-started/first-steps.md chevron-right Or dive into specific features:
https://github.com/Ananya1464/DreamOS/blob/main/docs/features/luna-ai.md chevron-right https://github.com/Ananya1464/DreamOS/blob/main/docs/features/youtube.md chevron-right Last updated 3 months ago