Configuration
Claude Code supports custom API endpoints through its settings. You can configure it to use Edgee as your AI provider in two ways:Option 1: Environment Variables
Set the following environment variables in your shell configuration (~/.bashrc, ~/.zshrc, etc.):
Option 2: Claude Code Settings
You can also configure Claude Code through its settings file. Create or edit~/.claude/settings.json:
Make sure to replace
"sk-edgee-..." with your actual Edgee API key from the Edgee Console.Usage
Once configured, Claude Code will automatically route all requests through Edgee. You can use Claude Code normally:Model Selection
When using Edgee with Claude Code, you can specify which Claude model to use through Edgee’s model routing. By default, Claude Code uses the latest Claude model, but you can configure specific models:Advanced Configuration
Custom Headers
You can add custom headers for analytics and filtering by setting additional environment variables:Tags for Observability
Tags help you categorize and filter requests in Edgee’s analytics dashboard:Streaming Responses
Claude Code automatically handles streaming responses. When using Edgee, streaming works seamlessly:- Real-time token streaming for faster perceived response times
- Proper handling of connection errors with automatic failover
- Full observability of streaming metrics in Edgee dashboard
Authentication
Edgee uses standard Bearer token authentication. Your API key is automatically formatted as:- Go to Edgee Console
- Navigate to API Keys
- Create a new key or use an existing one
Benefits of Using Claude Code with Edgee
Unified Infrastructure
Access multiple LLM providers through Edgee while using Claude Code’s powerful CLI interface.
Cost Control
Track costs in real-time and set budget alerts for your Claude Code usage through Edgee’s dashboard.
Automatic Failover
If Claude API is down or rate-limited, Edgee can automatically route to backup models without interrupting your workflow.
Full Observability
Monitor all Claude Code sessions with detailed metrics: latency, token usage, costs, and error rates.
Troubleshooting
Connection Issues
If Claude Code cannot connect to Edgee:- Verify your API key is correct
- Check that the base URL is set to
https://api.edgee.ai/v1 - Ensure you have internet connectivity
- Check Edgee’s status page
Authentication Errors
If you receive authentication errors:Example Workflow
Here’s a complete workflow for setting up Claude Code with Edgee:Next Steps
- Explore Claude Code’s documentation for advanced features
- Check out Edgee’s routing capabilities for intelligent model selection
- Set up observability to monitor your Claude Code sessions
- Configure privacy controls for sensitive codebases