Claude blocked? How to run Claude Code on a ChatGPT subscription in 15 minutes
If Anthropic blocks your Claude account, you don't have to give up Claude Code: sessions, CLAUDE.md files, and MCP servers sit on your disk, and the model is swappable. The author set up a local LiteLLM proxy that routes requests to ChatGPT through a regular subscription, then resumed old sessions with the command claude-gpt --resume. Setup in Docker takes about 15 minutes, and no OpenAI API key is needed. As a fallback the scheme works, but the model is different and the behavior differs.
AI-processed from Habr AI; edited by Hamidun News
Imagine you spent weeks working on a project in Claude Code, setting up instructions, memory, and hooks, and then Anthropic blocked your Claude account. It seems that your entire working environment disappeared along with access to the models. The author of a Habr review shows that this is not the case. Claude Code is a local program, almost everything valuable in it lives on your disk, and the model can be replaced. He pointed Claude Code at a local LiteLLM proxy that sends requests to ChatGPT models on a regular subscription, and resumed old sessions with the command claude-gpt --resume. The whole setup takes about 15 minutes, and a paid OpenAI API key is not needed.
What stays with you
Session history for --resume and --continue is stored in ~/.claude/projects/<project>/<id>.jsonl. Instructions live in ~/.claude/CLAUDE.md and in CLAUDE.md files inside projects. Auto-memory sits alongside the sessions, while settings, permissions, and hooks are in settings.json, and MCP servers, skills, plugins, and commands are in ~/.claude and the project's .claude/.
Two environment variables choose the model: ANTHROPIC_BASE_URL (the API address) and ANTHROPIC_AUTH_TOKEN (the key). This is the standard way to connect Claude Code to an LLM gateway, and logging into claude.ai is not required. The author tested the scheme on his own sessions: one history file contained both Anthropic responses and responses received through the proxy. You can switch in both directions.
How the bridge works
Claude Code talks to the Anthropic API via a local LiteLLM instance at 127.0.0.1:4000. LiteLLM translates the requests and sends them to the ChatGPT backend using the OAuth token of your subscription. No OpenAI API key is required: you spend your subscription limits instead of paying for tokens separately.
The client requests models by their usual names, and config/config.yaml substitutes them. claude-sonnet-4-5 and claude-opus-4-5 point to gpt-6.1-terra, which is the strongest model on the standard plan. Fast background tasks on claude-haiku-4-5 go to gpt-6-luna. If you have a higher-tier plan, you can specify a stronger model for Opus and restart the container.
Installation requires Docker with Compose, Bash, and OpenSSL (macOS, Linux, or WSL), an installed Claude Code, and a ChatGPT subscription with the needed models. The steps are: clone the den-dw/claude-gpt repository, generate the proxy master key, log in to ChatGPT with a device code, then run docker compose up -d --build. Next, add a claude-gpt function to ~/.zshrc or ~/.bashrc, and in the project folder claude-gpt --resume and claude-gpt --continue will work. The variables live only within the script's process, so plain claude still goes to Anthropic. If the account is unblocked, you can continue the same session there.
LiteLLM would not work without a fix. Claude Code passes the system prompt not as a string but as an array of blocks, and the map_system_message_pt function failed with a TypeError. The author wrote a patch: it extracts the text from either a string or blocks, adds the instructions to the nearest user message, and stops the image build if the function has moved in a new LiteLLM version. The proxy will not start silently without the patch. The drop_params: true setting discards Claude-specific parameters that the ChatGPT route does not support, instead of rejecting the entire request.
Limitations and risks
The main point: a different model behaves differently. CLAUDE.md and skills were written for Claude, so quality and instruction-following will vary. In /model, only the names from the config work: Sonnet, Opus, and Haiku. When the ChatGPT limit is exhausted, the proxy responds with 429, and you have to wait for the reset.
Not all background calls go through. Some requests on the Haiku route with forced tool selection fail with the error Tool choice 'function' not found in 'tools' parameter. For the author, that is 28 errors per 649 successful requests, roughly 4%. claude.ai connectors and anything requiring account login do not work, but local MCP servers function as usual. Another trap: the Dockerfile pulls the image tagged latest, and a fresh LiteLLM release may break the patch, so you should pin the version after launch. The repository includes a native PowerShell launch, but the author did not test it, and WSL is more reliable.
Security matters a great deal here. The master key grants access to your subscription, so the port is published only on 127.0.0.1, and the container runs without Linux capabilities and with no-new-privileges. The key and OAuth token are stored in secrets/ with 700/600 permissions and excluded through .gitignore. Proxy logs must not be published, since they may contain fragments of sessions.
There is also a legal nuance. This is not the official OpenAI API: the proxy uses the same backend as Codex, with a subscription token, and OpenAI sets the rules and limits. Read them before moving a working process onto it. Remember that with --resume the entire session history, including code and project context, goes to OpenAI. For team development with sensitive code, that is a reason to think twice.
Practical takeaway: as a temporary fallback, the scheme is good. It decouples your working environment from a single vendor and restores your familiar tool in 15 minutes. As a permanent production solution, it needs separate evaluation because of model differences, the unofficial channel, and subscription limits.
- Nov 30, 2026Apple Signs Deals with 20+ Publishers, Including BBC and CNN, So Siri AI Can Stay Current on the News
- Nov 30, 20269 Open-Source Repos That Can Replace Paid AI Subscriptions: From LibreChat to Langflow
- Nov 30, 2026In the Newsroom Budget, an AI Draft Saves 700 ₽ per Text and Pays Off from 40 Pieces a Month
- Nov 30, 2026Anthropic Delays Next-Model Training by Six Weeks and Moves 100+ Staff to Safety
Key Questions Answered
What stays with you?
Session history for --resume and --continue is stored in ~/.claude/projects/<project>/<id>.jsonl. Instructions live in ~/.claude/CLAUDE.md and in CLAUDE.md files inside projects. Auto-memory sits alongside the sessions, while settings, permissions, and hooks are in settings.json, and MCP servers, skills, plugins, and commands are in ~/.claude and the project's .claude/. Two environment variables choose the model: ANTHROPIC_BASE_URL (the API address) and ANTHROPIC_AUTH_TOKEN (the key).
How the bridge works?
Claude Code talks to the Anthropic API via a local LiteLLM instance at 127.0.0.1:4000. LiteLLM translates the requests and sends them to the ChatGPT backend using the OAuth token of your subscription. No OpenAI API key is required: you spend your subscription limits instead of paying for tokens separately. The client requests models by their usual names, and config/config.yaml substitutes them. claude-sonnet-4-5 and claude-opus-4-5 point to gpt-6.1-terra, which is the strongest model on the standard plan.
What are the key details on Limitations and risks?
The main point: a different model behaves differently. CLAUDE.md and skills were written for Claude, so quality and instruction-following will vary. In /model, only the names from the config work: Sonnet, Opus, and Haiku. When the ChatGPT limit is exhausted, the proxy responds with 429, and you have to wait for the reset. Not all background calls go through. Some requests on the Haiku route with forced tool selection fail with the error Tool choice 'function' not found in 'tools' parameter.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
