Skip to main content
Claude Code speaks the Anthropic Messages API, and Eden AI serves that API at /v3/v1/messages, so a few environment variables (the base URL, your key and the model names) send Claude Code through Eden AI with no proxy in between.

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

Prerequisites

  • Claude Code installed (install instructions). On Windows, the native installer puts claude.exe in %USERPROFILE%\.local\bin but does not add that folder to your PATH; it prints a note about it instead. If claude is not recognized afterward, see Troubleshooting. The installer also shows no progress while it downloads, so give it a few minutes.
  • Eden AI API key from app.edenai.run → API Keys. You do not need an Anthropic API key or a claude.ai account.

Setup

1. Point Claude Code at Eden AI

Put the settings in Claude Code’s user settings file so they apply to every terminal and every project. The file is ~/.claude/settings.json on macOS and Linux, and %USERPROFILE%\.claude\settings.json on Windows. Create it if it does not exist. If it already exists, add these entries to its env block and keep the rest of the file:
On Windows, this PowerShell snippet adds the settings for you. It asks for the key so it never lands in your shell history, keeps any other settings already in the file (saving a copy as settings.json.bak), and writes the file without a byte order mark:
Use ANTHROPIC_AUTH_TOKEN for the key. Claude Code sends it as an Authorization: Bearer header and uses it without asking. ANTHROPIC_API_KEY also works with Eden AI, but Claude Code asks you to approve the key the first time; choose Yes. Either variable takes precedence over a claude.ai login saved on the machine, so you do not need to log out. To try it in one terminal without touching the settings file, export the same variables:
In PowerShell, $env:NAME = "value" does the same. Variables set this way are lost when you close the window, unless you add the lines to your shell profile (~/.bashrc, ~/.zshrc, or your PowerShell $PROFILE). Otherwise, the next claude you start in a new window shows the login menu, or quietly runs on your claude.ai login if one is saved. When settings.json also sets a variable, the settings.json value wins.

2. Launch Claude Code

Run /status inside Claude Code to check the setup. The Status tab should show Anthropic base URL: https://api.edenai.run/v3, an Auth token line naming ANTHROPIC_AUTH_TOKEN, and the model you set. Claude Code now sends requests to Eden AI with the model in ANTHROPIC_MODEL, and background tasks use the model in ANTHROPIC_DEFAULT_HAIKU_MODEL. The Claude Desktop app does not take its base URL or key from settings.json or the environment. To use Eden AI there, configure its own gateway: see Claude Desktop.

Model naming

Eden AI model IDs have the form provider/model, such as anthropic/claude-sonnet-5-5 or openai/gpt-latest. A -latest alias points to the current release of that model. For Claude models, use the versioned ID rather than a -latest alias: Claude Code infers the context window from the model name, and with an alias it does not recognize, such as anthropic/claude-sonnet-latest, it falls back to a 200K window instead of the model’s real one. Claude Code sends tool definitions with every request, so pick a model that supports function calling. Browse the catalog in List Models or with GET https://api.edenai.run/v3/models.

Switching models

Change ANTHROPIC_MODEL in settings.json to change the default. For one session, start Claude Code with --model, or run /model inside it. An exported ANTHROPIC_MODEL does not override the value in settings.json.

Expert Models as Tools (MCP)

Eden AI also hosts an MCP server that exposes the expert model catalog (OCR, web search, speech, translation and more) as tools. Add it and Claude Code can read documents or search the web through the same API key:
--scope user makes the server available in every project; without it, Claude Code adds it to the current project only. The command is one line, so it runs as is in PowerShell too. To share it with your team instead, commit the equivalent block to the project’s .mcp.json. Claude Code expands ${VAR} in that file, so the block names the variable and each teammate exports EDEN_AI_API_KEY in their own shell. The key itself is never committed:
Keep the type field: without it Claude Code reads the entry as a stdio server. Run /mcp to confirm the connection. See the MCP server page for the full tool catalog and the conventions its tools share.

Troubleshooting

Claude Code shows the login menu

Claude Code did not find an Eden AI key, so it asks you to log in to Anthropic. Do not pick any of the login options. Check that ~/.claude/settings.json (%USERPROFILE%\.claude\settings.json on Windows) exists, is valid JSON and has the env block from Setup. Then restart claude and run /status. If you set the variables with export or $env:, they only last for that terminal window. If you used ANTHROPIC_API_KEY and declined the approval prompt once, Claude Code ignores the key from then on: turn it back on under /config with Use custom API key, or switch to ANTHROPIC_AUTH_TOKEN.

Authentication errors

Check that the key works outside Claude Code. Claude Code appends /v1/messages to ANTHROPIC_BASE_URL and sends the key from ANTHROPIC_AUTH_TOKEN as a Bearer token, so this request is the same call. Replace YOUR_EDEN_AI_API_KEY with your key:
A 401 means the key is wrong, a 402 that the account is out of credits or over a spending budget, a 403 that a policy on your Eden AI account blocks the model, and a 451 that the model is not available in the region your account is restricted to.

Model not found

Use the full provider/model string from the catalog, for example anthropic/claude-sonnet-5-5. Anthropic’s own spelling without the prefix, such as claude-sonnet-5-5, gets a 400 that reads Model(s) not found or inactive. Confirm the ID is in the catalog returned by GET /v3/models.

”This session isn’t eligible” notice in auto mode

In auto mode, Claude Code may show a notice that auto mode is changing to no longer charge for classifier requests, but that this session isn’t eligible because requests go through api.edenai.run. Nothing is broken: Eden AI does not support Anthropic’s server-side auto mode checks yet, so Claude Code runs those checks itself as ordinary requests, billed to your Eden AI account as before. Press Enter to continue. To stop the notice, add "CLAUDE_CODE_AUTO_MODE_SERVER": "0" to the env block of settings.json.

Claude command not recognized on Windows

The native installer puts claude.exe in %USERPROFILE%\.local\bin. Add that folder to your user PATH, then open a new PowerShell window. Anthropic’s installation troubleshooting covers other cases.

Connection issues

Confirm ANTHROPIC_BASE_URL is exactly https://api.edenai.run/v3. Check Eden AI status at app-edenai.instatus.com.

Next Steps

  • Claude Desktop: Claude models and Eden AI tools in the Claude desktop app
  • Codex CLI: OpenAI’s open-source coding agent on Eden AI
  • OpenCode: terminal coding agent with auto-generated config
  • Prompt Caching: how caching works on the Messages endpoint Claude Code uses