---
title: "Claude Code with EU-hosted open models · Setup guide"
description: "Point Claude Code at inference.eu with ANTHROPIC_BASE_URL and run it on open-weight models processed in EU data centres. No Anthropic account needed."
canonical: "https://inference.eu/integrations/claude-code/"
language: "en"
---

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.

[Contact sales](https://inference.eu/contact/)[Setup](#setup)

1.  01API format: Anthropic Messages
2.  02EU data centres
3.  03Covered by one DPA

## Set it up in a few minutes

1.  1

    Create an API key in your inference.eu account and export it as `INFERENCE_EU_API_KEY`.

2.  2

    Set `ANTHROPIC_BASE_URL` to the inference.eu host without the trailing `/v1`, and `ANTHROPIC_AUTH_TOKEN` to your key.

3.  3

    Clear `ANTHROPIC_API_KEY` and, if you ever ran `claude login`, run `/logout` so no Anthropic credential takes precedence.

4.  4

    Pin `ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` variables to inference.eu model ids.

5.  5

    Start `claude` and open `/status`. The Anthropic base URL line should show the inference.eu host and the auth token line should name `ANTHROPIC_AUTH_TOKEN`.

~/.bashrc or ~/.zshrc

```
# 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

claude
```

## What 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

Category

Coding agents

Maker

Anthropic

API format

Anthropic Messages

Processing

EU data centres

Website

[code.claude.com](https://code.claude.com/)

Documentation

[code.claude.com](https://code.claude.com/docs/en/llm-gateway-connect)

## Claude Code: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Yes, for model requests. Set \`ANTHROPIC\_BASE\_URL\` to inference.eu and authenticate with \`ANTHROPIC\_AUTH\_TOKEN\`, and Claude Code sends its model traffic to us instead of Anthropic. You need no Anthropic subscription or API key. Turn off non-essential traffic so version checks and telemetry are not sent either.

No. Claude Code works with a gateway credential instead of a claude.ai login. Make sure you are logged out of any subscription, because a saved claude.ai login stays the active credential if you only set the base URL and not the token.

Claude Code adds \`/v1/messages\` to the base URL itself. If the value already ends in \`/v1\`, requests go to \`/v1/v1/messages\` and fail with 404. Use the inference.eu host on its own; the setup snippet removes the suffix automatically.

Remote Control, voice dictation and Anthropic-hosted cloud environments need a claude.ai identity and are unavailable while a gateway token is set. Features tied to specific Claude models, such as certain thinking modes or fast mode, depend on model support. Editing, tools, sub-agents, MCP servers and hooks keep working.

Use GLM-5.3 or Kimi K3 as the main model, Qwen3 Coder 480B for the sonnet tier and gpt-oss-120b for the haiku tier. All handle tool calls reliably. Pin every slot so no request asks for a Claude model name that inference.eu does not serve.

Model requests go to inference.eu. Claude Code separately sends non-essential traffic such as version checks, release notes and telemetry; \`CLAUDE\_CODE\_DISABLE\_NONESSENTIAL\_TRAFFIC=1\` turns it off. Check your egress logs once after setup to confirm nothing else leaves your network.

Put the variables in the \`env\` block of a managed settings file and set \`allowedProviders\` to \`\["customEndpoint"\]\`. Claude Code then refuses sessions pointed anywhere else. Give each developer their own inference.eu key so usage can be tracked per person.

Yes, if you put the variables in \`~/.claude/settings.json\`. Shell exports only reach sessions started from that shell. You can also set \`claudeCode.environmentVariables\` in VS Code settings, with the same base URL, token and model variables.

The key is missing, wrong or in the wrong header. \`ANTHROPIC\_AUTH\_TOKEN\` sends a bearer token, which is what inference.eu expects. Leave \`ANTHROPIC\_API\_KEY\` empty, log out of claude.ai, and test the key with a direct request to \`/v1/messages\` with curl.

Yes. Set \`CLAUDE\_CODE\_ENABLE\_GATEWAY\_MODEL\_DISCOVERY=1\` and Claude Code reads the model list from inference.eu at startup. Pinning models with the environment variables is still the most reliable way to control which model each tier uses.

No. Requests sent to inference.eu are processed to produce the response and are never used for training. They are processed in EU data centres and covered by a data processing agreement under Article 28 GDPR.

[Ask a question](https://inference.eu/contact/)

## Related

[All integrations](https://inference.eu/integrations/)

-   [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](https://inference.eu/integrations/opencode/)
-   [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](https://inference.eu/integrations/anthropic-sdk/)
-   [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](https://inference.eu/integrations/openai-codex/)
-   [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](https://inference.eu/integrations/cline/)

## 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
