Overview
AXON separates credentials into two categories:- Backend API Keys — For LLM providers (Anthropic, OpenAI, Gemini)
- Tool API Keys — For external services (WebSearch, etc.)
None are required for development. AXON provides stub implementations that work without any API keys. Use
--tool-mode stub for testing.Environment Configuration
Using .env File (Recommended)
- Copy the example configuration:
- Edit
.envwith your API keys:
- AXON automatically loads
.envfiles in the working directory.
Using Shell Environment
Alternatively, export variables in your shell:Backend API Keys
Anthropic (Claude)
Variable:ANTHROPIC_API_KEY
Get your key: console.anthropic.com
Format: sk-ant-api03-...
Models Used:
claude-3-5-sonnet-20241022(default)claude-3-opus-20240229claude-3-haiku-20240307
- Claude 3.5 Sonnet: 15/MTok output
- Claude 3 Opus: 75/MTok output
- Claude 3 Haiku: 1.25/MTok output
OpenAI (GPT)
Variable:OPENAI_API_KEY
Get your key: platform.openai.com
Format: sk-proj-... or sk-...
Models Used:
gpt-4-turbo-previewgpt-4ogpt-4
- GPT-4 Turbo: 30/MTok output
- GPT-4o: 15/MTok output
- GPT-4: 60/MTok output
Google Gemini
Variable:API_KEY_GEMINI
Get your key: aistudio.google.com
Format: AIza...
Models Used:
gemini-1.5-progemini-1.5-flash
- Gemini 1.5 Pro: 10.50/MTok output
- Gemini 1.5 Flash: 1.05/MTok output
Ollama (Local Models)
Variable: None (runs locally) Setup: Install and run Ollama:llama3.1(8B, 70B, 405B)mistralcodellamaphi-2- Custom models
- 8GB+ RAM for 7B models
- 16GB+ RAM for 13B models
- 32GB+ RAM for 70B models
Tool API Keys
Serper (WebSearch)
Variable:SERPER_API_KEY
Get your key: serper.dev
Used For: WebSearch tool (Google Search API)
Setup:
- Free: 2,500 queries (one-time)
- Paid: $50/month for 100,000 queries
Brave Search (Alternative WebSearch)
Variable:BRAVE_API_KEY
Get your key: brave.com/search/api
Used For: Alternative WebSearch backend
Setup:
- Free: 2,000 queries/month
- Paid: Starting at $3/month for 15,000 queries
Tool Modes
AXON supports three tool execution modes:Stub Mode (Default)
- No API keys required
- All tools return mock data
- Safe for testing and CI/CD
- Deterministic results
- Development without credentials
- Unit testing
- CI/CD pipelines
- Learning AXON
Real Mode
- Requires API keys for all used tools
- Production-ready execution
- Real external API calls
- Fails if credentials missing
- Production deployments
- Integration testing
- Real-world workflows
Hybrid Mode (Recommended)
- Uses real tools where API keys available
- Falls back to stubs automatically
- Graceful degradation
- Best for mixed environments
- Development with partial credentials
- Gradual rollout
- Testing with selective real tools
Verification
Test Backend Access
Test Tool Access
Security Best Practices
1. Never Commit Secrets
2. Use Environment-Specific Configuration
3. Rotate Keys Regularly
Set reminders to rotate API keys every 90 days.4. Use Restricted Keys
Create API keys with minimal required permissions:- Anthropic: Use project-scoped keys
- OpenAI: Enable usage limits
- Serper: Set request rate limits
5. Monitor Usage
Check API usage dashboards regularly:- Anthropic: console.anthropic.com/settings/usage
- OpenAI: platform.openai.com/usage
- Gemini: aistudio.google.com/usage
6. Use Secret Management in Production
For production deployments, use secret management services: AWS Secrets Manager:Troubleshooting
”API key not set” Error
“Invalid API key” Error
Solution:- Check for typos in the key
- Verify key format matches provider requirements
- Regenerate key from provider dashboard
”Rate limit exceeded” Error
Solution:- Check your usage dashboard
- Implement exponential backoff
- Upgrade to higher tier if needed
”Insufficient quota” Error
Solution:- Add payment method to provider account
- Increase spending limits
- Wait for quota reset (free tiers)
Cost Optimization
1. Use Stub Mode for Development
2. Choose Appropriate Models
3. Cache Compiled IR
4. Monitor Token Usage
Related Documentation
Tool Modes
Learn about tool execution modes
Backends
Backend-specific configuration
