Overview
Claude Code runs in your terminal and edits code in your project. Pointing it at Eden AI gives you:- 500+ models: switch between Claude, GPT, Gemini, and more without reinstalling
- One API key: unified billing and monitoring across providers
- Provider failover: keep working when an upstream provider has an incident
Prerequisites
- Claude Code installed (install instructions)
- Eden AI API key from app.edenai.run → API Keys
Setup
1. Export your API key
export lines to ~/.bashrc or ~/.zshrc and reload your shell.
2. Launch Claude Code
ANTHROPIC_MODEL.
Switching models
Eden AI uses theprovider/model format. Update the ANTHROPIC_MODEL environment variable (or pass --model on the command line) to switch:
GET https://api.edenai.run/v3/models.
Model pools and routing
Instead of pinning a single model, you can let Eden AI pick the best model for each request or fail over automatically when a provider has an incident.Automatic routing with @edenai
Set the model to @edenai and Eden AI’s router selects the best available model from its default pool on every request. This works directly in Claude Code, since it only needs the model name:
Smart routing is tuned for general prompts. Claude Code is an agentic tool that leans heavily on tool calling, so for real coding sessions we recommend pinning a strong model (for example
anthropic/claude-opus-4-8) or restricting the pool to tool-capable models.Custom pools and fallbacks
To restrict routing to a specific pool or declare an ordered failover list, you pass these as request-body fields:router_candidates: a custom pool that@edenaichooses from. See Smart Routing.fallbacks: models tried in order if the primary fails. See Fallback.
router_candidates and fallbacks through the API or an SDK directly rather than Claude Code’s environment variables.
Troubleshooting
Authentication errors
Verify the API key is loaded in your shell and that it has LLM access:Model not found
Use the fullprovider/model string (e.g. anthropic/claude-opus-4-8, not claude-opus-4-8). Confirm the ID is in the catalog returned by GET /v3/models.
Connection issues
ConfirmANTHROPIC_BASE_URL is exactly https://api.edenai.run/v3. Check Eden AI status at app-edenai.instatus.com.
Next Steps
- Codex CLI — OpenAI’s open-source coding agent on Eden AI
- OpenCode — terminal coding agent with auto-generated config
- Chat Completions — full reference for the underlying endpoint