Skip to content

Latest commit

 

History

History
169 lines (121 loc) · 3.85 KB

File metadata and controls

169 lines (121 loc) · 3.85 KB

🔑 API Keys Setup Guide

This guide will help you obtain and configure the required API keys for the Modern LinkedIn Profile Analyzer.

📋 Required API Keys

You need only 2 API keys to run this application:

  1. OpenAI API Key - For AI-powered profile analysis
  2. Tavily API Key - For LinkedIn profile search

🔧 Step-by-Step Setup

1. OpenAI API Key

Getting Your Key:

  1. Visit: OpenAI Platform
  2. Sign Up/Login: Create account or sign in
  3. Navigate: Go to "API Keys" section
  4. Create: Click "Create new secret key"
  5. Copy: Save the key (starts with sk-)

Pricing:

  • Pay-per-use: Only pay for what you use
  • GPT-4: ~$0.03 per 1K tokens (very affordable)
  • Free Credits: New accounts often get free credits

2. Tavily API Key

Getting Your Key:

  1. Visit: Tavily
  2. Sign Up: Create a free account
  3. Dashboard: Go to your dashboard
  4. API Key: Find and copy your API key

Pricing:

  • Free Tier: 1,000 searches per month
  • Paid Plans: Available for higher usage

📝 Configuration

Create .env File

Create a file named .env in your project root:

# OpenAI API Key (Required)
OPENAI_API_KEY=sk-your-openai-key-here

# Tavily API Key (Required)
TAVILY_API_KEY=tvly-your-tavily-key-here

# LangSmith API Key (Optional - for monitoring)
LANGSMITH_API_KEY=your-langsmith-key-here

Important Notes:

  • No quotes needed around the keys
  • No spaces around the = sign
  • Keep it secure - don't share your .env file
  • Add to .gitignore to avoid committing keys

✅ Verification

Test Your Setup:

python quick_test.py

Expected Output:

✅ .env file found
✅ All required API keys found

💰 Cost Estimation

Typical Usage Costs:

Light Usage (10 profiles/day):

  • OpenAI: ~$0.50/month
  • Tavily: Free tier sufficient
  • Total: ~$0.50/month

Heavy Usage (100 profiles/day):

  • OpenAI: ~$5.00/month
  • Tavily: ~$10.00/month
  • Total: ~$15.00/month

🔒 Security Best Practices

Protecting Your Keys:

  1. Never commit .env files to version control
  2. Use environment variables in production
  3. Rotate keys regularly if compromised
  4. Monitor usage to detect unauthorized access
  5. Set spending limits on OpenAI account

.gitignore Entry:

.env
*.env
.env.local
.env.production

🚨 Troubleshooting

Common Issues:

"API Key Not Found"

  • Check .env file exists in project root
  • Verify key names match exactly
  • Ensure no extra spaces or characters

"Invalid API Key"

  • Verify keys are copied correctly
  • Check for expired or revoked keys
  • Ensure sufficient credits/quota

"Rate Limit Exceeded"

  • Wait before retrying
  • Check your usage limits
  • Consider upgrading your plan

Testing Individual Keys:

Test OpenAI Key:

import openai
openai.api_key = "your-key-here"
# Try a simple completion

Test Tavily Key:

import requests
headers = {"Authorization": "Bearer your-key-here"}
# Try a simple search

🆘 Getting Help

If You Need Support:

  1. Check this guide for common solutions
  2. Run diagnostics: python quick_test.py
  3. Verify key format and validity
  4. Check account status on provider websites

Key Format Examples:

  • OpenAI: sk-proj-abc123... (starts with sk-)
  • Tavily: tvly-abc123... (starts with tvly-)

🎯 Ready to Go!

Once your keys are configured:

  1. Run the quick test: python quick_test.py
  2. Start the application: python frontend_modern.py
  3. Open your browser: http://127.0.0.1:8050
  4. Analyze profiles: Enter any name and click "Analyze"

🔐 Keep Your Keys Safe! These keys provide access to paid services, so treat them like passwords and never share them publicly.