Authentication
Cyberstrike requires authentication with at least one AI provider to function. This guide covers setting up credentials for supported providers.
🎬 GIF: auth-flow.gif
Authentication flow demonstration
Interactive Login
The simplest way to authenticate:
cyberstrike auth loginSelect your provider from the interactive menu:
? Select provider❯ OpenRouter (free tier available) Anthropic (API key from console.anthropic.com) OpenAI (ChatGPT Plus/Pro or API key) Google (API key from ai.google.dev) Ollama (local models) OtherProvider-Specific Setup
Anthropic
- Get your API key from console.anthropic.com
- Run authentication:
cyberstrike auth login# Select: Anthropic# Enter your API keyOpenAI
- Get your API key from platform.openai.com
- Run authentication:
cyberstrike auth login# Select: OpenAI# Enter your API keyOpenRouter
OpenRouter provides access to multiple models with a free tier:
- Get your API key from openrouter.ai/keys
- Run authentication:
cyberstrike auth login# Select: OpenRouter# Enter your API keyGoogle Gemini
- Get your API key from ai.google.dev
- Run authentication:
cyberstrike auth login# Select: Google# Enter your API keyOllama (Local)
Ollama requires no API key but needs to be running:
# Start Ollamaollama serve
# Pull a modelollama pull llama3.3
# Use with Cyberstrikecyberstrike --model ollama/llama3.3Environment Variables
Set credentials via environment variables for CI/CD or automation:
# Anthropicexport ANTHROPIC_API_KEY="sk-ant-..."
# OpenAIexport OPENAI_API_KEY="sk-..."
# Googleexport GOOGLE_API_KEY="AI..."
# OpenRouterexport OPENROUTER_API_KEY="sk-or-..."
# Groqexport GROQ_API_KEY="gsk_..."Add to your shell profile for persistence:
# ~/.bashrc or ~/.zshrcexport ANTHROPIC_API_KEY="sk-ant-..."Configuration File
Store credentials in the config file:
{ "provider": { "anthropic": { "options": { "apiKey": "{env:ANTHROPIC_API_KEY}" } } }}Tip
Use {env:VAR_NAME} syntax to reference environment variables in config files.
Managing Credentials
List Stored Credentials
cyberstrike auth listOutput:
Credentials ~/.cyberstrike/auth.json Anthropic api OpenRouter api
Environment ANTHROPIC_API_KEYRemove Credentials
cyberstrike auth logout# Select provider to removeSwitch Provider
# Use different provider for sessioncyberstrike --model openai/gpt-4o
# Set default in config{ "model": "anthropic/claude-sonnet-4-20250514"}Enterprise Authentication
AWS Bedrock
# Configure AWS credentialsaws configure
# Or via environmentexport AWS_ACCESS_KEY_ID="..."export AWS_SECRET_ACCESS_KEY="..."export AWS_REGION="us-east-1"Azure OpenAI
export AZURE_API_KEY="..."export AZURE_RESOURCE_NAME="your-resource"Google Vertex AI
gcloud auth application-default loginSecurity Best Practices
- Never commit API keys to version control
- Use environment variables for sensitive values
- Rotate keys regularly for security
- Use scoped keys when available
- Monitor usage on provider dashboards
Troubleshooting
Invalid API Key
Error: Invalid API key- Verify key is correct (no extra spaces)
- Check key has not expired
- Ensure billing is active on provider
Rate Limits
Error: Rate limit exceeded- Wait and retry
- Check provider dashboard for limits
- Consider upgrading your plan
Network Issues
Error: Connection refused- Check internet connection
- Verify no proxy/firewall blocking
- Try different network