Prj2 / set_api_key.ps1
iitmbs24f's picture
Upload 37 files
2f95553 verified
# Quick script to set OpenAI API key
# Usage: .\set_api_key.ps1
$apiKey = "eyJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6IjI0ZjIwMDU3NTNAZHMuc3R1ZHkuaWl0bS5hYy5pbiJ9.eji7L5I62M9YHoeEKE8ao6eTw8dFjgDIMP9C3lOUXc4"
Write-Host "Setting OPENAI_API_KEY for current session..." -ForegroundColor Cyan
$env:OPENAI_API_KEY = $apiKey
Write-Host "✓ OPENAI_API_KEY set" -ForegroundColor Green
Write-Host ""
Write-Host "To make it permanent, run:" -ForegroundColor Yellow
Write-Host '[System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "' + $apiKey + '", "User")' -ForegroundColor Gray
Write-Host ""
Write-Host "⚠️ Note: This looks like a JWT token, not a standard OpenAI API key." -ForegroundColor Yellow
Write-Host " OpenAI keys usually start with 'sk-'. If LLM features don't work," -ForegroundColor Yellow
Write-Host " you may need to get your actual OpenAI API key from:" -ForegroundColor Yellow
Write-Host " https://platform.openai.com/api-keys" -ForegroundColor Cyan
Write-Host ""
Write-Host "To verify, run: python test_env.json.py" -ForegroundColor Cyan