Skip to content

Latest commit

 

History

History
369 lines (276 loc) · 8.31 KB

File metadata and controls

369 lines (276 loc) · 8.31 KB

🔑 API Keys & Credentials Guide

This guide will help you obtain all the necessary API keys and credentials for VideoGen Messenger.


🎯 Required Services (At Least One AI Provider)

1. AI Video Generation Providers

You need at least ONE of these providers to generate videos:

Option A: Google Veo 3 (Recommended for HD/4K)

How to Get:

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new project or select existing one
  4. Navigate to "API Keys" section
  5. Click "Create API Key"
  6. Copy the API key

Environment Variables:

GOOGLE_VEO_API_KEY=your_api_key_here
GOOGLE_VEO_PROJECT_ID=your_project_id

Pricing: Pay-per-use (varies by region and quality)


Option B: Runway Gen-3 (Premium Quality)

How to Get:

  1. Visit Runway
  2. Sign up for an account
  3. Navigate to Account Settings → API Keys
  4. Generate new API key
  5. Copy the API key

Environment Variables:

RUNWAY_API_KEY=your_api_key_here

Pricing: ~$0.05 per second of video (check current pricing)


Option C: Minimax Video-01 (Fast & Cost-Effective)

How to Get:

  1. Visit Minimax
  2. Create an account
  3. Go to API section
  4. Generate API key
  5. Note your Group ID

Environment Variables:

MINIMAX_API_KEY=your_api_key_here
MINIMAX_GROUP_ID=your_group_id

Pricing: Most cost-effective option


2. AWS Services (Required)

AWS Account Setup

How to Get:

  1. Visit AWS Console
  2. Create an account (requires credit card)
  3. Navigate to IAM → Users
  4. Create new user with programmatic access
  5. Attach policies:
    • AmazonS3FullAccess
    • CloudFrontFullAccess (optional)
  6. Download credentials

Create S3 Bucket:

  1. Go to S3 console
  2. Click "Create bucket"
  3. Name it (e.g., videogen-messenger-videos)
  4. Choose region (e.g., us-east-1)
  5. Keep default settings
  6. Create bucket

Environment Variables:

AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_S3_BUCKET=your-bucket-name

Pricing:

  • S3: ~$0.023/GB storage + $0.09/GB transfer
  • CloudFront: ~$0.085/GB (first 10 TB)

3. Database & Cache (Handled by Docker)

If using Docker Compose (recommended), these are automatically configured:

  • ✅ PostgreSQL (port 5432)
  • ✅ Redis (port 6379)
  • ✅ Elasticsearch (port 9200)

Environment Variables (pre-configured):

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/videogen_messenger
REDIS_URL=redis://localhost:6379
ELASTICSEARCH_NODE=http://localhost:9200

🔒 Optional but Recommended Services

4. Content Moderation (Azure AI Content Safety)

How to Get:

  1. Visit Azure Portal
  2. Create Azure account (free tier available)
  3. Search for "Content Safety"
  4. Create new resource
  5. Go to "Keys and Endpoint"
  6. Copy Key and Endpoint URL

Environment Variables:

AZURE_CONTENT_SAFETY_ENDPOINT=https://your-resource.cognitiveservices.azure.com/
AZURE_CONTENT_SAFETY_KEY=your_key_here
MODERATION_STRICTNESS=medium

Pricing: Free tier: 5,000 transactions/month


5. OAuth2 Providers (Social Login)

Google OAuth

How to Get:

  1. Visit Google Cloud Console
  2. Create new project
  3. Navigate to "APIs & Services" → "Credentials"
  4. Click "Create Credentials" → "OAuth client ID"
  5. Choose "Web application"
  6. Add authorized redirect URI: http://localhost:3000/api/v1/auth/oauth/google/callback
  7. Copy Client ID and Secret

Environment Variables:

OAUTH_GOOGLE_CLIENT_ID=your_client_id
OAUTH_GOOGLE_CLIENT_SECRET=your_client_secret

GitHub OAuth

How to Get:

  1. Visit GitHub Settings
  2. Click "New OAuth App"
  3. Fill in application details
  4. Authorization callback URL: http://localhost:3000/api/v1/auth/oauth/github/callback
  5. Copy Client ID and generate Client Secret

Environment Variables:

OAUTH_GITHUB_CLIENT_ID=your_client_id
OAUTH_GITHUB_CLIENT_SECRET=your_client_secret

6. Error Tracking (Sentry)

How to Get:

  1. Visit Sentry.io
  2. Sign up for free account
  3. Create new project (Node.js)
  4. Copy DSN from project settings

Environment Variables:

SENTRY_DSN=your_dsn_here

Pricing: Free tier: 5,000 errors/month


7. CloudFront CDN (Production)

How to Get:

  1. In AWS Console, go to CloudFront
  2. Click "Create Distribution"
  3. Set origin to your S3 bucket
  4. Configure cache behaviors
  5. Copy Distribution Domain Name

Environment Variables:

AWS_CLOUDFRONT_DOMAIN=https://d123456789.cloudfront.net
AWS_CLOUDFRONT_DISTRIBUTION_ID=E1234567890ABC

📝 Minimum Viable Configuration

To get started quickly, you only need:

Absolutely Required

# Database (Docker Compose handles this)
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/videogen_messenger
REDIS_URL=redis://localhost:6379
ELASTICSEARCH_NODE=http://localhost:9200

# Security (auto-generated by setup script)
JWT_SECRET=<auto-generated>
JWT_REFRESH_SECRET=<auto-generated>
API_KEY_SALT=<auto-generated>

# At least ONE AI provider
GOOGLE_VEO_API_KEY=your_key
# OR
RUNWAY_API_KEY=your_key
# OR
MINIMAX_API_KEY=your_key

# AWS S3 (for video storage)
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_S3_BUCKET=your-bucket

Recommended for Testing

# Content Moderation
AZURE_CONTENT_SAFETY_KEY=your_key
AZURE_CONTENT_SAFETY_ENDPOINT=your_endpoint

Production Only

# CDN
AWS_CLOUDFRONT_DOMAIN=your_domain

# OAuth
OAUTH_GOOGLE_CLIENT_ID=your_id
OAUTH_GITHUB_CLIENT_ID=your_id

# Monitoring
SENTRY_DSN=your_dsn

💰 Cost Estimates (Development)

Service Free Tier Development Cost
Google Veo No ~$10-50/month (light testing)
Runway No ~$20-100/month
Minimax No ~$5-20/month
AWS S3 5GB free (12 months) ~$1-5/month
PostgreSQL (Docker) Free $0
Redis (Docker) Free $0
Elasticsearch (Docker) Free $0
Azure Content Safety 5K free/month $0-5/month
Sentry 5K errors/month $0
Total ~$36-180/month

🔐 Security Best Practices

  1. Never commit API keys to Git

    • .env is in .gitignore by default
    • Use .env.example as template only
  2. Use different keys for dev/prod

    • Create separate AWS IAM users
    • Use different API keys per environment
  3. Rotate keys regularly

    • Change keys every 90 days
    • Use AWS Secrets Manager in production
  4. Limit permissions

    • Use least-privilege IAM policies
    • Create service-specific API keys
  5. Monitor usage

    • Set up billing alerts in AWS
    • Monitor API usage in provider dashboards

🆘 Troubleshooting

"Invalid API Key" Errors

  1. Check key is copied correctly (no spaces)
  2. Verify key hasn't expired
  3. Check account has sufficient credits
  4. Verify IP restrictions if any

AWS S3 "Access Denied"

  1. Check IAM user has S3 permissions
  2. Verify bucket name is correct
  3. Check bucket region matches AWS_REGION
  4. Ensure bucket policy allows your IAM user

Rate Limiting Issues

  1. Most providers have rate limits
  2. Implement retry logic (already done)
  3. Consider upgrading to paid tiers
  4. Space out development testing

📞 Provider Support

Provider Support
Google Veo https://ai.google.dev/support
Runway support@runwayml.com
Minimax https://www.minimaxi.com/support
AWS https://aws.amazon.com/contact-us/
Azure https://azure.microsoft.com/support/

✅ Verification Checklist

After getting your API keys, verify they work:

# Test Google Veo
curl -H "Authorization: Bearer $GOOGLE_VEO_API_KEY" \
  https://generativelanguage.googleapis.com/v1/models

# Test AWS S3
aws s3 ls s3://your-bucket-name --profile your-profile

# Test Azure Content Safety
curl -X POST "$AZURE_CONTENT_SAFETY_ENDPOINT/contentsafety/text:analyze?api-version=2023-10-01" \
  -H "Ocp-Apim-Subscription-Key: $AZURE_CONTENT_SAFETY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "test"}'

Ready to start? Run the setup script:

cd backend
node scripts/setup.js