Required API Keys
You must obtain the following API keys to run the YouTube Automation Agent:- YouTube Data API - For uploading and managing videos
- OpenAI API - For content generation, DALL-E images, and TTS
Optional API Keys
These services enhance functionality but are not required:- Google Gemini API - Alternative AI provider for content generation
- Azure Speech Services - High-quality text-to-speech
- ElevenLabs API - Premium voice generation
- Replicate API - Advanced video generation
YouTube Data API Setup
1
Create a Google Cloud Project
- Visit the Google Cloud Console
- Click “Select a project” → “New Project”
- Enter a project name (e.g., “YouTube Automation”)
- Click “Create”
2
Enable YouTube Data API v3
- In your project, navigate to “APIs & Services” → “Library”
- Search for “YouTube Data API v3”
- Click on it and press “Enable”
- Also enable “YouTube Analytics API” for analytics features
3
Create OAuth 2.0 Credentials
- Go to “APIs & Services” → “Credentials”
- Click “Create Credentials” → “OAuth client ID”
- Configure the consent screen:
- User Type: External
- App name: Your channel name
- User support email: Your email
- Add scopes:
../auth/youtube.upload,../auth/youtube,../auth/youtube.readonly
- Application type: Web application
- Add authorized redirect URI:
http://localhost:8080/oauth2callback - Click “Create”
4
Save Your Credentials
- Download the JSON file or copy the Client ID and Client Secret
- Add them to
config/credentials.json:
5
Authenticate Your Channel
Run the authentication script:Follow the prompts to authorize the application with your YouTube channel.
The OAuth consent screen may need verification if you plan to use the app publicly. For personal use, you can keep it in testing mode.
OpenAI API Setup
1
Create an OpenAI Account
Visit OpenAI Platform and sign up or log in.
2
Add Billing Information
- Navigate to “Settings” → “Billing”
- Add a payment method
- Set up billing limits to control costs
3
Generate API Key
- Go to API Keys
- Click “Create new secret key”
- Name it (e.g., “YouTube Automation”)
- Copy the key immediately (it won’t be shown again)
4
Add to Environment Variables
Add the API key to your Or add to
.env file:config/credentials.json:What does OpenAI provide?
What does OpenAI provide?
The YouTube Automation Agent uses OpenAI for:
- GPT-4/GPT-3.5: Content generation, script writing, SEO optimization
- DALL-E 3: Thumbnail generation and visual assets
- TTS (Text-to-Speech): Voice narration for videos
Google Gemini API Setup (Optional)
1
Get Gemini API Key
- Visit Google AI Studio
- Click “Get API Key”
- Select your Google Cloud project or create a new one
- Copy the generated API key
2
Add to Credentials
Gemini can be used as an alternative or fallback to OpenAI for content generation.
Azure Speech Services Setup (Optional)
1
Create Azure Account
Sign up at Azure Portal
2
Create Speech Service
- Click “Create a resource”
- Search for “Speech”
- Click “Create”
- Configure:
- Subscription: Your Azure subscription
- Resource group: Create new or select existing
- Region: Choose closest region (e.g.,
eastus) - Pricing tier: F0 (free) or S0 (standard)
- Click “Review + create”
3
Get Keys
- Go to your Speech resource
- Navigate to “Keys and Endpoint”
- Copy Key 1 and Region
4
Add to Configuration
ElevenLabs API Setup (Optional)
1
Sign Up
Create an account at ElevenLabs
2
Get API Key
- Navigate to your Profile Settings
- Copy your API key from the “API Key” section
3
Select Voice ID
- Go to Voice Library
- Choose a voice and copy its Voice ID
4
Configure
Replicate API Setup (Optional)
1
Create Account
Sign up at Replicate
2
Get API Token
- Go to Account Settings
- Copy your API token
3
Add to Environment
Replicate provides access to advanced AI models for video generation using Stable Video Diffusion.
Verification
After obtaining all API keys, verify your setup:Cost Estimates
Cost Estimates
Typical monthly costs for moderate usage:
- YouTube API: Free (with quota limits)
- OpenAI: $20-100 depending on video frequency
- Azure Speech: $0-20 (generous free tier)
- ElevenLabs: $5-99 based on plan
- Replicate: Pay per use, ~$0.01-0.50 per video