The Professor Peter video generation system requires real API keys for both script generation and voice synthesis. No fallbacks or mock responses are provided.
Purpose: Script generation using AI
Environment Variable: GEMINI_API_KEY
How to get it:
- Go to Google AI Studio
- Create a new API key
- Copy the key
Purpose: Text-to-speech (Peter Griffin voice)
Environment Variable: TTS_API_KEY
How to get it:
- Sign up at ElevenLabs
- Go to your Profile Settings
- Copy your API key
Purpose: Specify which voice to use for Peter Griffin
Environment Variable: DEFAULT_VOICE_ID
Default Value: EXAVITQu4vr4xnSDxMaL (Sample voice)
How to find voice IDs:
- Use ElevenLabs Voice Library
- Or use the API:
GET https://api.elevenlabs.io/v1/voices
Create a .env file in the backend/ directory:
# Copy from env.example and fill in your keys
cp backend/env.example backend/.envEdit backend/.env:
GEMINI_API_KEY=your_gemini_api_key_here
TTS_API_KEY=your_elevenlabs_api_key_here
DEFAULT_VOICE_ID=EXAVITQu4vr4xnSDxMaLexport GEMINI_API_KEY="your_gemini_api_key_here"
export TTS_API_KEY="your_elevenlabs_api_key_here"
export DEFAULT_VOICE_ID="EXAVITQu4vr4xnSDxMaL"$env:GEMINI_API_KEY="your_gemini_api_key_here"
$env:TTS_API_KEY="your_elevenlabs_api_key_here"
$env:DEFAULT_VOICE_ID="EXAVITQu4vr4xnSDxMaL"After setting up the keys, verify they're working:
-
Check API status:
curl http://localhost:8000/health
-
Expected response:
{ "status": "healthy", "dependencies": { "gemini_api": true, "tts_api": true } } -
Check available templates:
curl http://localhost:8000/api/templates
If API keys are not configured, you'll see clear error messages:
- ❌
Gemini API key not configured. Please set GEMINI_API_KEY environment variable. - ❌
TTS API key not configured. Please set TTS_API_KEY environment variable. - ❌
Default voice ID not configured. Please set DEFAULT_VOICE_ID environment variable.
- Free tier: 15 requests per minute
- Paid: $0.125 per 1K characters (input)
- Free tier: 10,000 characters per month
- Starter: $5/month for 30,000 characters
- Creator: $22/month for 100,000 characters
⚠️ Never commit API keys to version control- ✅ Use
.envfiles (already in.gitignore) - ✅ Use environment variables in production
- ✅ Rotate keys regularly
- ✅ Monitor usage and billing
-
"Invalid API key"
- Verify the key is correct
- Check if the key has proper permissions
- Ensure no extra spaces or characters
-
"Voice ID not found"
- Use a valid ElevenLabs voice ID
- Check available voices in your account
-
"Rate limit exceeded"
- Wait and retry
- Upgrade your API plan
- Implement proper retry logic
Test Gemini:
curl -X POST http://localhost:8000/api/generate-script \
-H "Content-Type: application/json" \
-d '{"prompt": "test prompt"}'Test ElevenLabs:
curl -X POST http://localhost:8000/api/generate-tts \
-H "Content-Type: application/json" \
-d '{"script": "Hello, this is a test."}'If you encounter issues:
- Check the logs:
tail -f backend/logs/app.log - Verify API key configuration
- Test individual API endpoints
- Check network connectivity
- Review API documentation
Remember: This system now requires real API keys - no mock responses or fallbacks are provided to ensure you get actual AI-generated content and voice synthesis.