Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt

Use this file to discover all available pages before exploring further.

Configure Claude Code, Anthropic’s official CLI coding agent, to use Eden AI for access to 500+ models behind a single API key.

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

Setup

1. Export your API key

export ANTHROPIC_API_KEY="YOUR_EDEN_AI_API_KEY"
export ANTHROPIC_BASE_URL="https://api.edenai.run/v3"
export ANTHROPIC_MODEL="anthropic/claude-opus-4.7"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="anthropic/claude-haiku-4-5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="anthropic/claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="anthropic/claude-opus-4-7"
To make it permanent, add the export lines to ~/.bashrc or ~/.zshrc and reload your shell.

2. Launch Claude Code

claude
Claude Code now sends requests to Eden AI using the model you set in ANTHROPIC_MODEL.

Switching models

Eden AI uses the provider/model format. Update the ANTHROPIC_MODEL environment variable (or pass --model on the command line) to switch:
export ANTHROPIC_MODEL="anthropic/claude-opus-4.7"     # default
export ANTHROPIC_MODEL="anthropic/claude-sonnet-4-5"   # cheaper, faster
export ANTHROPIC_MODEL="anthropic/claude-haiku-4-5"    # fastest
Browse the full catalog via List Models or GET https://api.edenai.run/v3/models.

Troubleshooting

Authentication errors

Verify the API key is loaded in your shell and that it has LLM access:
echo $ANTHROPIC_API_KEY

curl -X POST https://api.edenai.run/v3/chat/completions \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "anthropic/claude-opus-4.7", "messages": [{"role": "user", "content": "ping"}]}'

Model not found

Use the full provider/model string (e.g. anthropic/claude-opus-4.7, not claude-opus-4.7). Confirm the ID is in the catalog returned by GET /v3/models.

Connection issues

Confirm ANTHROPIC_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