Claude Code, Cursor und Cline mit einem einzigen API-Key betreiben
Mit einem OpenAI-kompatiblen Gateway lassen sich Claude Code, Cursor und Cline über einen gemeinsamen Schlüssel mit Modellen wie GPT, Claude, Gemini und DeepSeek nutzen. Das erspart mehrere API-Keys, Rechnungen und Konfigurationen.

Hinweis: Ich arbeite an 666 AI, dem Gateway, das in den folgenden Beispielen verwendet wird. Das Setup-Muster funktioniert mit jedem OpenAI-kompatiblen Gateway.
Wenn man häufig zwischen Modellen wechselt, sammeln sich mehrere API-Schlüssel, mehrere Rechnungen und in jedem Werkzeug eine eigene Konfiguration an. Gateways lösen dieses Problem: ein Schlüssel, ein Guthaben, und im Werkzeug müssen nur zwei Felder geändert werden, nämlich die Basis-URL und der Schlüssel.
Im Folgenden finden Sie funktionierende Konfigurationen für die gängigsten Werkzeuge.
curl https://YOUR-ENDPOINT/v1/chat/completions \ -H "Authorization: Bearer $KEY " \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}]}' Enter fullscreen mode Exit fullscreen mode Wenn eine JSON-Antwort zurückkommt, ist alles eingerichtet.
Claude Code spricht das Anthropic-Protokoll, daher richtet man es auf die Adresse im Anthropic-Format aus:
# ~/.zshrc oder ~/.bashrc export ANTHROPIC_BASE_URL = "https://YOUR-ENDPOINT" export ANTHROPIC_AUTH_TOKEN = "YOUR_KEY" Enter fullscreen mode Exit fullscreen mode Terminal neu öffnen und claude ausführen. Der häufigste Fehler besteht darin, hier /v1 anzuhängen, was man vermeiden sollte.
from openai import OpenAI client = OpenAI ( api_key = " YOUR_KEY ", base_url = " https://YOUR-ENDPOINT/v1 " ) resp = client. chat. completions. create ( model = " claude-sonnet-5-5 ", messages = [{ " role ": " user ", " content ": " Explain this regex: ^ \\ d{3}- \\ d{4}$ " }], ) print ( resp. choices [ 0 ]. message. content ) Enter fullscreen mode Exit fullscreen mode Der Modellwechsel ist nun eine Änderung von einem einzigen Wort ( claude-sonnet-5-5 → gemini-3.5-flash → deepseek-v4-flash ), ohne neues SDK und ohne neuen Schlüssel.
Eine verbreitete Aufteilung ist Claude für Refactorings, DeepSeek für günstige Massenaufgaben und Gemini für lange Dokumente. Da alle drei hinter einem Schlüssel liegen, ändert sich an der Editor-Konfiguration nie etwas, außer dem Modellnamen.
Wer das Gateway in diesen Beispielen ausprobieren möchte, kann sich kostenlos registrieren und erhält ein tägliches kostenloses Chat-Kontingent: 666gogogo.com. Die vollständige Dokumentation finden Sie unter Documentation.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Disclosure: I work on 666 AI, the gateway used in the examples below. The setup pattern works with any OpenAI-compatible gateway.
If you switch between models a lot, you end up with several API keys, several bills, and a different config in every tool. Gateways fix that: one key, one balance, and the tool only needs two fields changed — the base URL and the key.
Below are working configs for the most common tools.
curl https://YOUR-ENDPOINT/v1/chat/completions \ -H "Authorization: Bearer $KEY " \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}]}' Enter fullscreen mode Exit fullscreen mode A JSON response means you're done.
Claude Code speaks the Anthropic protocol, so point it at the Anthropic-format address:
# ~/.zshrc or ~/.bashrc export ANTHROPIC_BASE_URL = "https://YOUR-ENDPOINT" export ANTHROPIC_AUTH_TOKEN = "YOUR_KEY" Enter fullscreen mode Exit fullscreen mode Reopen the terminal and run claude. The most common mistake is adding /v1 here — don't.
from openai import OpenAI client = OpenAI ( api_key = " YOUR_KEY ", base_url = " https://YOUR-ENDPOINT/v1 " ) resp = client. chat. completions. create ( model = " claude-sonnet-5-5 ", messages = [{ " role ": " user ", " content ": " Explain this regex: ^ \\ d{3}- \\ d{4}$ " }], ) print ( resp. choices [ 0 ]. message. content ) Enter fullscreen mode Exit fullscreen mode Switching models is now a one-word change ( claude-sonnet-5-5 → gemini-3.5-flash → deepseek-v4-flash ), with no new SDK and no new key.
A common split is Claude for refactors, DeepSeek for cheap bulk tasks and Gemini for long documents. With all three behind one key, the editor config never changes. Only the model name does.
If you want to try the gateway in these examples, signup is free and there's a daily free chat allowance: 666gogogo.com. Full docs: Documentation.