Claude-Code-Einrichtungsleitfaden (Dezember 2026): Installation, LLM-Gateways und Cloud-Anbieter
Claude Code kann direkt mit einem eigenen Anthropic-Konto, über ein selbst gewähltes Gateway oder über die gehosteten Claude-Modelle eines Cloud-Anbieters arbeiten. Der Leitfaden erläutert zunächst die Installation und dann die drei Wege mit ihren jeweiligen Stolperfallen, gestützt auf die Anthropic-Dokumentation.

Claude Code kann mit Anthropic über dein eigenes Konto kommunizieren, über ein Gateway, auf das du es verweist, oder über die gehosteten Claude-Modelle eines Cloud-Anbieters. Jeder Weg hat eigene Variablen und eigene Fehlerquellen. Dieser Guide behandelt zunächst die Installation und danach die drei Wege. Alles stammt aus Anthropics Dokumentation, wie sie am 2026-12-03 dort stand, sowie aus den wenigen Prüfungen, die ich selbst durchgeführt habe und die ich als meine eigenen kennzeichne.
Anthropics Supported Regions Policy besagt, dass seine Produkte, Claude Code eingeschlossen, nur in den dort aufgeführten Ländern und Regionen verfügbar sind und dass jedes nicht aufgeführte Land oder jede nicht aufgeführte Region nicht unterstützt wird. Als ich sie las, standen Festlandchina und Hongkong nicht auf der Liste, Taiwan, Japan, Singapur und die Vereinigten Staaten dagegen schon.
Dieser Guide behandelt nicht, wie man diese Einschränkung umgeht. Die weiter unten beschriebenen Wege über Gateway und Cloud sind in Anthropics Dokumentation dokumentiert, aber ob ein Weg für deinen Standort, deinen Arbeitgeber und die Bedingungen des Anbieters angemessen ist, liegt in deiner Verantwortung.
# macOS, Linux, WSL curl -fsSL https://claude.ai/install.sh | bash Vollbildmodus aktivieren Vollbildmodus beenden # Windows PowerShell (die Eingabeaufforderung beginnt mit PS) irm https: // claude. ai / install. ps1 | iex Vollbildmodus aktivieren Vollbildmodus beenden:: Windows CMD ( die Eingabeaufforderung hat kein PS ) curl - fsSL https: // claude. ai / install. cmd - o install. cmd && install. cmd && del install. cmd Vollbildmodus aktivieren Vollbildmodus beenden Auch Paketmanager funktionieren: brew install --cask claude-code unter macOS, winget install Anthropic.ClaudeCode unter Windows.
Das npm-Paket benötigt Node.js 22 oder neuer:
npm install -g @anthropic-ai/claude-code@latest Vollbildmodus aktivieren Vollbildmodus beenden Die Dokumentation rät davon ab, dafür sudo zu verwenden und nicht, mit npm update -g zu aktualisieren, weil das möglicherweise nicht zur neuesten Version wechselt. Führe stattdessen den Installationsbefehl erneut aus.
Falls registry.npmjs.org in deinem Netzwerk langsam oder nicht erreichbar ist, kannst du npm mit --registry auf einen Spiegel verweisen. Ich habe geprüft, dass registry.npmmirror.com @anthropic-ai/claude-code auflistet (neuester Tag 2.1.336, als ich nachsah) sowie das Plattformpaket für Windows x64. Es handelt sich um einen Spiegel von einem Drittanbieter, der zurückliegen kann, vertraue also claude --version mehr als den Angaben des Spiegels.
Claude Code muss eine Liste von Hosts erreichen, die die Seite zur Netzwerkkonfiguration dokumentiert. Die wichtigsten sind api.anthropic.com, claude.ai, platform.claude.com, downloads.claude.ai (nativer Installer und Updates) und registry.npmjs.org (npm-Installationen). Wenn ein Gateway oder ein Cloud-Anbieter den Modellverkehr übernimmt, gehen die Anfragen dorthin statt an api.anthropic.com, aber ein Teil des optionalen Verkehrs geht weiterhin an Anthropic. Mehr dazu im Abschnitt zum Gateway.
Starte claude und folge den Anweisungen im Browser. Das Konto gehört dir allein, und Anthropics Bedingungen erlauben es nicht, es zu teilen.
Claude Code liest die üblichen Variablen:
export HTTPS_PROXY = http://proxy.example.com:8080 export NO_PROXY = "localhost,127.0.0.1" Vollbildmodus aktivieren Vollbildmodus beenden Drei Einzelheiten aus der Dokumentation:
Um zu prüfen, ob die Einstellungen geladen wurden, starte claude --debug oder führe /status in einer Sitzung aus und schau in die Zeile Proxy.
Ein Gateway ist ein Proxy zwischen Claude Code und einem Modell-Anbieter. Du teilst Claude Code mit, wo es liegt und wie die Authentifizierung erfolgt.
Wenn dir nicht mitgeteilt wird, welche Art es ist, beginne mit ANTHROPIC_AUTH_TOKEN. Ein späterer 401-Fehler bedeutet, dass du die falsche gewählt hast, wechsle also. Jede Variable setzt die Zugangsdaten in einen anderen HTTP-Header, weshalb eine falsche Wahl mit einem 401 fehlschlägt.
export ANTHROPIC_BASE_URL = https://llm-gateway.example.com export ANTHROPIC_AUTH_TOKEN = sk-gateway-key Vollbildmodus aktivieren Vollbildmodus beenden $env: ANTHROPIC_BASE_URL = "https://llm-gateway.example.com" $env: ANTHROPIC_AUTH_TOKEN = "sk-gateway-key" Vollbildmodus aktivieren Vollbildmodus beenden Shell-Exporte gelten nur für eine Terminalsitzung, und ein aus dem Dock oder Startmenü gestarteter Editor sieht sie nicht. Um die Werte dauerhaft zu setzen, nutze den env-Block von ~/.claude/settings.json:
{ "env": { "ANTHROPIC_BASE_URL": "https://llm-gateway.example.com", "ANTHROPIC_AUTH_TOKEN": "sk-gateway-key" } } Vollbildmodus aktivieren Vollbildmodus beenden Die Dokumentation warnt davor, die Zugangsdaten in die Datei.claude/settings.json eines Projekts zu legen, weil diese Datei committet und mit allen geteilt wird, die das Repository klonen. Wenn ein Shell-Export und ein env-Block in einer Einstellungsdatei dieselbe Variable setzen, gewinnt die Einstellungsdatei.
Dies ist die eigene Prüfprozedur der Dokumentation. Sie sendet eine Anfrage mit einem Token direkt an das Gateway:
curl -sS -w '\n%{http_code}\n' -X POST "$ANTHROPIC_BASE_URL/v1/messages" \ -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}' Vollbildmodus aktivieren Vollbildmodus beenden So liest du das Ergebnis gemäß der Dokumentation:
Wenn dein Gateway den Header x-api-key erwartet, ersetze die Zeile Authorization durch -H "x-api-key: $ANTHROPIC_API_KEY".
Starte dann claude, sende eine Nachricht und führe /status aus. Der Reiter Status sollte eine Zeile Anthropic base URL mit der Adresse deines Gateways zeigen sowie eine Zeile Auth token oder API key, die die von dir gesetzte Variable nennt. Fehlt die Zeile mit der Base URL, hat die Variable die Sitzung nicht erreicht.
Diese stammen aus der Tabelle zur Fehlerbehebung der Dokumentation:
Wenn dein Netzwerk nur ausgehenden Verkehr zum Gateway erlaubt, werden Claude Codes Hintergrundanfragen (Versionsprüfungen, Telemetrie und ähnliche Anfragen an Anthropic und GitHub) fehlschlagen und möglicherweise als blockierte Verbindungen auftauchen. Die Dokumentation empfiehlt, neben den Gateway-Variablen CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 zu setzen. Ein Nebeneffekt ist, dass dadurch automatische Updates deaktiviert werden, plane also einen anderen Weg für Updates ein.
Wenn dein Unternehmen bereits ein Cloud-Konto hat, kann Claude Code Amazon Bedrock, die Agent Platform von Google Cloud oder Microsoft Foundry nutzen. Abrechnung, Regionen und Berechtigungen folgen dann den Regeln des jeweiligen Anbieters. Jeder davon hat eine eigene Seite mit eigenen Variablen in der Dokumentation, weshalb ich sie hier nicht wiedergebe. Beginne mit Anthropics Dokumentation für den von dir genutzten Anbieter.
Ich habe nicht jeden Befehl für diesen Artikel auf einem frischen Rechner ausgeführt. Die Befehle, Variablennamen und Einträge zur Fehlerbehebung stammen aus Anthropics Dokumentation, wie sie am 2026-12-03 dort stand. Die Prüfung des npm-Spiegels und das Lesen der Kompatibilitätsseite von DeepSeek sind von mir. Claude Code entwickelt sich schnell weiter, wenn dies also älter als ein paar Wochen ist, vertraue der Dokumentation mehr als mir.
Eine kleine Sache zum Ausprobieren: Führe nach der Installation claude --version aus, starte eine Sitzung und öffne /status. Es zeigt dir, welche Base URL, welche Zugangsdaten und welchen Proxy Claude Code tatsächlich verwendet, und das ist das Erste, was man wissen sollte, bevor man irgendetwas anderes debuggt.
Dieser Artikel wurde mit Hilfe von KI erstellt.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Claude Code can talk to Anthropic with your own account, to a gateway you point it at, or to a cloud provider's hosted Claude models. Each path has its own variables and its own failure modes. This guide covers the install first, then the three paths. Everything comes from Anthropic's docs as they read on 2026-12-03, plus the few checks I ran myself, which I mark as mine.
Anthropic's Supported Regions Policy says its products, Claude Code included, are available only in the countries and regions it lists, and that any country or region not listed is unsupported. When I read it, mainland China and Hong Kong were not on the list, and Taiwan, Japan, Singapore and the United States were.
This guide does not cover how to get around that. The gateway and cloud routes below are documented in Anthropic's docs, but whether a route is appropriate for your location, your employer and the provider's own terms is your call.
# macOS, Linux, WSL curl -fsSL https://claude.ai/install.sh | bash Enter fullscreen mode Exit fullscreen mode # Windows PowerShell (the prompt starts with PS) irm https: // claude. ai / install. ps1 | iex Enter fullscreen mode Exit fullscreen mode:: Windows CMD ( the prompt has no PS ) curl - fsSL https: // claude. ai / install. cmd - o install. cmd && install. cmd && del install. cmd Enter fullscreen mode Exit fullscreen mode Package managers also work: brew install --cask claude-code on macOS, winget install Anthropic.ClaudeCode on Windows.
The npm package needs Node.js 22 or later:
npm install -g @anthropic-ai/claude-code@latest Enter fullscreen mode Exit fullscreen mode The docs say not to use sudo for this and not to upgrade with npm update -g, because it may not move you to the newest release. Re-run the install command instead.
If registry.npmjs.org is slow or unreachable on your network, you can point npm at a mirror with --registry. I checked that registry.npmmirror.com lists @anthropic-ai/claude-code (latest tag 2.1.336 when I looked) and the platform package for Windows x64. It is a third-party mirror and can lag, so trust claude --version over what the mirror claims.
Claude Code needs to reach a list of hosts, which the network configuration page documents. The main ones are api.anthropic.com, claude.ai, platform.claude.com, downloads.claude.ai (native installer and updates) and registry.npmjs.org (npm installs). When a gateway or cloud provider carries the model traffic, requests go there instead of api.anthropic.com, but some optional traffic still goes to Anthropic. More on that in the gateway section.
Run claude and follow the browser prompts. The account is yours alone, and Anthropic's terms do not allow sharing it.
Claude Code reads the standard variables:
export HTTPS_PROXY = http://proxy.example.com:8080 export NO_PROXY = "localhost,127.0.0.1" Enter fullscreen mode Exit fullscreen mode Three details from the docs:
To check that the settings loaded, start claude --debug, or run /status in a session and look at the Proxy row.
A gateway is a proxy between Claude Code and a model provider. You tell Claude Code where it is and how to authenticate.
If you are not told which kind it is, start with ANTHROPIC_AUTH_TOKEN. A 401 later means you picked the wrong one, so switch. Each variable puts the credential in a different HTTP header, which is why a wrong pick fails with 401.
export ANTHROPIC_BASE_URL = https://llm-gateway.example.com export ANTHROPIC_AUTH_TOKEN = sk-gateway-key Enter fullscreen mode Exit fullscreen mode $env: ANTHROPIC_BASE_URL = "https://llm-gateway.example.com" $env: ANTHROPIC_AUTH_TOKEN = "sk-gateway-key" Enter fullscreen mode Exit fullscreen mode Shell exports last for one terminal session, and an editor launched from the dock or Start menu will not see them. To persist the values, use the env block of ~/.claude/settings.json:
{ "env": { "ANTHROPIC_BASE_URL": "https://llm-gateway.example.com", "ANTHROPIC_AUTH_TOKEN": "sk-gateway-key" } } Enter fullscreen mode Exit fullscreen mode The docs warn against putting the credential in a project's.claude/settings.json, because that file is committed and shared with everyone who clones the repository. If a shell export and a settings-file env block set the same variable, the settings file wins.
This is the docs' own check. It sends a one-token request straight to the gateway:
curl -sS -w '\n%{http_code}\n' -X POST "$ANTHROPIC_BASE_URL/v1/messages" \ -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}' Enter fullscreen mode Exit fullscreen mode How to read the result, per the docs:
If your gateway expects the x-api-key header, replace the Authorization line with -H "x-api-key: $ANTHROPIC_API_KEY".
Then start claude, send a message, and run /status. The Status tab should show an Anthropic base URL row with your gateway address, and an Auth token or API key row naming the variable you set. If the base URL row is missing, the variable did not reach the session.
These come from the docs' troubleshooting table:
If your network only allows egress to the gateway, Claude Code's background traffic (version checks, telemetry and similar requests to Anthropic and to GitHub) will fail and may show up as blocked connections. The docs say to set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 alongside the gateway variables. One side effect is that it disables auto-updates, so plan another way to update.
If your company already has a cloud account, Claude Code can use Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. Billing, regions and permissions then follow that provider's rules. Each has its own page in the docs with its own variables, so I do not reproduce them here. Start from Anthropic's docs for the provider you use.
I did not run every command on a clean machine for this article. The commands, variable names and troubleshooting entries are from Anthropic's docs as they read on 2026-12-03. The npm mirror lookup and the reading of DeepSeek's compatibility page are mine. Claude Code changes quickly, so if this is more than a few weeks old, trust the docs over me.
One small thing to try: after you install, run claude --version, start a session, and open /status. It tells you which base URL, credential and proxy Claude Code is actually using, which is the first thing to know before debugging anything else.
This article was created with the help of AI.