Coding agents · Claude Code
Use Claude Code with open-source models hosted in the EU
Claude Code reads its model endpoint from environment variables, so you can keep the agent and swap the model behind it. inference.eu speaks the Anthropic Messages format. Set the base URL and a token, pin the model slots, and your sessions run on open-weight models in European data centres.
- 01API format: Anthropic Messages
- 02EU data centres
- 03Covered by one DPA
Set it up in a few minutes
- 1
Create an API key in your inference.eu account and export it as
INFERENCE_EU_API_KEY. - 2
Set
ANTHROPIC_BASE_URLto the inference.eu host without the trailing/v1, andANTHROPIC_AUTH_TOKENto your key. - 3
Clear
ANTHROPIC_API_KEYand, if you ever ranclaude login, run/logoutso no Anthropic credential takes precedence. - 4
Pin
ANTHROPIC_MODELand theANTHROPIC_DEFAULT_*_MODELvariables to inference.eu model ids. - 5
Start
claudeand open/status. The Anthropic base URL line should show the inference.eu host and the auth token line should nameANTHROPIC_AUTH_TOKEN.
# Claude Code adds /v1/messages itself, so pass the host without /v1.
INFERENCE_EU_BASE_URL="https://api.inference.eu/v1"
export ANTHROPIC_BASE_URL="${INFERENCE_EU_BASE_URL%/v1}"
export ANTHROPIC_AUTH_TOKEN="$INFERENCE_EU_API_KEY"
export ANTHROPIC_API_KEY=""
# Pin every model slot Claude Code uses, including background tasks.
export ANTHROPIC_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3-coder-480b-a35b-instruct"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-oss-120b"
# Turn off version checks, telemetry and other non-model traffic.
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claudeWhat Claude Code is
Claude Code is Anthropic's agentic coding tool. It runs in the terminal, in VS Code and JetBrains, and in a desktop app, reads your repository, edits files, runs commands and works through multi-step tasks with sub-agents. By default it talks to Anthropic's API, but it is built to work behind an LLM gateway: the endpoint and credential come from environment variables or the env block of a settings file.
Because inference.eu implements the Anthropic Messages API, Claude Code needs no patch, fork or proxy to use it. You change where requests go, not how you work.
How the configuration works
ANTHROPIC_BASE_URL tells Claude Code where to send requests. Claude Code appends /v1/messages itself, so the value must be the host without /v1; the snippet strips it for you. ANTHROPIC_AUTH_TOKEN sends your key as an Authorization: Bearer header.
Claude Code asks for models by tier: opus, sonnet and haiku, plus a main model. Set ANTHROPIC_MODEL and the three ANTHROPIC_DEFAULT_*_MODEL variables to inference.eu ids so every request, including background work such as session titles, goes to a model you chose. To apply the settings everywhere, including the VS Code extension, put the same values in the env block of ~/.claude/settings.json.
Which models to choose
Claude Code runs long agent loops with many tool calls, so pick models that follow tool schemas closely. glm-5.3 and kimi-k3 work well as the main and opus-tier model for planning and larger refactors. qwen3-coder-480b-a35b-instruct is a good sonnet-tier choice for everyday edits and test writing.
The haiku slot handles quick background calls, so a fast model such as gpt-oss-120b fits. Leaving it unset means Claude Code asks for a Claude model name that we would not serve. Try different combinations on a real task and keep the one that finishes it with the fewest corrections.
Troubleshooting
A 404 on every request usually means ANTHROPIC_BASE_URL still ends in /v1, so requests go to /v1/v1/messages. Remove the suffix. A 401 means the key is missing or travels in the wrong header: check that ANTHROPIC_AUTH_TOKEN is set, that ANTHROPIC_API_KEY is empty, and log out of any claude.ai session.
If /status does not show the inference.eu host, the variables did not reach the process; set them in the shell you launch from or in ~/.claude/settings.json. A "model not found" error means one slot still points at a Claude name. Errors about thinking or unknown tool types come from newer Claude-only features; updating Claude Code and pinning models resolves most of them.
Keeping code and data in the EU
With these settings, model requests carrying your prompts, file contents and command output go to inference.eu, where they are processed in EU data centres and never used for training. We sign a data processing agreement under Article 28 GDPR, share our subprocessor list and bill in euros.
Claude Code also sends some traffic outside the model path, such as version checks and telemetry. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 turns that off. Features that depend on a claude.ai identity, including Remote Control, voice dictation and Anthropic-hosted cloud sessions, are unavailable while a gateway token is active. Administrators can pin the endpoint for everyone with managed settings.
Claude Code: common questions
The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.
Related
- OpenCodeRun the OpenCode terminal agent on open-weight models processed in EU data centres. Add one provider block to opencode.json and keep your code in Europe.Coding agents
- Anthropic SDK (Python and TypeScript)Point the official Anthropic Python or TypeScript SDK at inference.eu and call open-weight models processed in the EU through the Messages API.SDKs
- OpenAI Codex CLIRun OpenAI's Codex CLI on open-weight models processed in EU data centres. Add a model_providers block to config.toml and keep code in Europe.Coding agents
- ClineConnect the Cline coding agent for VS Code and the terminal to open-weight models processed in EU data centres with the OpenAI Compatible provider.Coding agents
Move your AI workloads to EU infrastructure
Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.
- Reply within one working day
- Pricing for your volume
- DPA ready to sign