BYOK Providers¶
Bring Your Own Key (BYOK) mode connects to cloud AI providers using your API keys.
Overview¶
BYOK is the primary mode for production use:
- Full control: Use your own API keys and quotas
- Cost management: Pay directly to providers
- Model selection: Choose specific models for roles
- Privacy: Data goes directly to your chosen provider
Quick Setup¶
# 1. Set API key
export ANTHROPIC_API_KEY=sk-ant-...
# 2. Verify configuration
superqode providers test anthropic
# 3. Connect
superqode connect byok anthropic claude-sonnet-4
Supported Providers¶
Tier 1 (First-Class Support)¶
Full optimization and testing:
Anthropic (Claude)¶
| Model | Best For |
|---|---|
claude-opus-4-5 | Complex analysis |
claude-sonnet-4-5 | Balanced performance |
claude-sonnet-4 | General use |
claude-haiku-4-5 | Fast, cost-effective |
Documentation: docs.anthropic.com
OpenAI (GPT)¶
| Model | Best For |
|---|---|
gpt-4o | General use |
gpt-4o-mini | Cost-effective |
o1 | Complex reasoning |
o1-mini | Fast reasoning |
Documentation: platform.openai.com
Google AI (Gemini)¶
| Model | Best For |
|---|---|
gemini-2.5-pro | Complex tasks |
gemini-2.5-flash | Fast, cost-effective |
Documentation: ai.google.dev
Tier 2 (Supported)¶
Tested and working:
Deepseek¶
| Model | Best For |
|---|---|
deepseek-v3 | General use |
deepseek-r1 | Reasoning |
Cost: Very competitive pricing
Mistral¶
xAI (Grok)¶
Model Hosts¶
Access multiple models through a single API:
OpenRouter¶
- 95+ models from various providers
- Use format:
provider/model-name
Documentation: openrouter.ai
Together AI¶
Groq¶
- Very fast inference
- Free tier available
Fireworks¶
export FIREWORKS_API_KEY=...
superqode connect byok fireworks accounts/fireworks/models/llama-v3p3-70b-instruct
Configuration¶
Environment Variables¶
| Provider | Variable | Notes |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | Required |
| OpenAI | OPENAI_API_KEY | Required |
GOOGLE_API_KEY | Required | |
| Deepseek | DEEPSEEK_API_KEY | Required |
| OpenRouter | OPENROUTER_API_KEY | Required |
| Together | TOGETHER_API_KEY | Required |
| Groq | GROQ_API_KEY | Required |
| Mistral | MISTRAL_API_KEY | Required |
| xAI | XAI_API_KEY | Required |
Configuration File¶
providers:
anthropic:
api_key_env: ANTHROPIC_API_KEY
recommended_models:
- claude-opus-4-5
- claude-sonnet-4-5
- claude-sonnet-4
- claude-haiku-4-5
openai:
api_key_env: OPENAI_API_KEY
recommended_models:
- gpt-4o
- gpt-4o-mini
- o1
- o1-mini
deepseek:
api_key_env: DEEPSEEK_API_KEY
recommended_models:
- deepseek-v3
- deepseek-r1
Per-Role Configuration¶
team:
modes:
qe:
roles:
security_tester:
mode: byok
provider: anthropic
model: claude-sonnet-4
performance_tester:
mode: byok
provider: openai
model: gpt-4o
Cost Management¶
Tracking Costs¶
After each task, you'll see:
Cost Summary:
Provider: anthropic
Model: claude-sonnet-4
Input tokens: 15,234
Output tokens: 2,456
Estimated cost: $0.12
Cost-Effective Strategies¶
- Use appropriate models: Haiku/mini for simple tasks
- Use quick mode: Shorter sessions, less tokens
- Local fallback: Use local models for high-volume tasks
Security Best Practices¶
API Key Management¶
Rotate Keys Regularly¶
- Anthropic: console.anthropic.com
- OpenAI: platform.openai.com/api-keys
Use Project Keys¶
Where available, use project-specific API keys with limited scope.
Troubleshooting¶
"Not Configured" Error¶
Solution: Set the API key environment variable.
"Invalid API Key"¶
Solution: Verify your API key is correct and has appropriate permissions.
Rate Limiting¶
Solutions: - Wait and retry - Use a different provider temporarily - Upgrade your API tier
Model Not Found¶
Solution: Check available models:
Provider Comparison¶
| Provider | Speed | Cost | Models | Best For |
|---|---|---|---|---|
| Anthropic | Fast | Medium | 4 | Security, reasoning |
| OpenAI | Fast | Medium | 4 | General, reasoning |
| Fast | Low | 2 | General, vision | |
| Deepseek | Medium | Low | 2 | Cost-effective |
| Groq | Very Fast | Low | 3 | Speed-critical |
Next Steps¶
- Local Providers - Self-hosted alternatives
- ACP Agents - Coding agent integration
- Provider Commands - CLI reference