Claude Code quotas: an OpenAI workaround and the Chinese alternatives in practice
Imagine someone walks into your office, sits down at your desk and does business with your client right there. The client pays your competitor — and you bring both of them coffee. In the real economy this is unthinkable. Digitally it is happening right now, in exactly that way: OpenAI has released an official open-source plugin that wires Codex directly into Claude Code — into the terminal, into the ecosystem, into the projects of Anthropic's own users.[1]
To understand why a company makes such a move, you have to look at the numbers. Anthropic's flagship model has become so expensive over the API that a single intensive hour of work can cost several hundred dollars; building out a website quickly heads toward 500 euros. The same job — worked through to a comparable 98, 99 percent — might cost 30 to 50 dollars on Codex. That gap is no longer a nuance; it has become open mockery on every platform, from YouTube to Medium. And the community is reacting: for about a week and a half we have seen a massive migration away from Claude subscriptions toward OpenAI's new models. Anthropic did not just notice this on social media — they felt it, and have since been extending the flagship model's subscription quota week after week to slow the churn.
What is remarkable is OpenAI's response to this situation. The obvious move would have been: poach the users, tell them to cancel their Claude subscription and come over. OpenAI does the opposite. Anyone who wants to migrate but has their ecosystem, their habits and their projects in Claude Code is not asked to switch — switching is made unnecessary. The plugin slips in through the back door, plants itself where the user already works, and pockets the token processing. The user stays in Claude Code; Anthropic handles a few prompts, OpenAI takes the rest — in the same window. This form of aggressive competition, a plugin inside a rival's ecosystem, is something I have never seen this plainly before.
You only grasp how hard this is once you look at the market from above: worldwide, roughly ten companies dominate AI — five on the Chinese side, four on the US side, plus Mistral as the European special case. There is not more out there. Every country is feverishly building energy and data infrastructure to put its own model in the race, but right now there are about as many providers as I have fingers on my hands. That is why the fight is so relentless — and why you will even walk into your competitor's office to close the deals there. On top of that: OpenAI itself is under considerable pressure; the deficits between revenue and spending are an open topic. A company fighting for its future gets creative.
So what does this mean for us — for solo users, freelancers and SMEs in Europe working with budgets of 20, 200 or 2,000 euros? It affects everyone at once, just to different degrees. The lesson is not to bet on the right winner. The lesson is to keep switching cheap: to set up your own working environment so that the model behind it is interchangeable. The direction stays with you — you are the project manager and product owner. Execution may roam, to wherever quality and price happen to line up. Claude Code is surprisingly well suited to this, because it is more open than many think.
I will show two ways to get there in this piece, both from teaching practice, both working today. First, API routing: redirecting Claude Code to a Chinese model like GLM-5.2 — a route Anthropic can hardly block, because the API keys are mine, and Claude is not allowed to look at where they connect.[2] Second, the Codex plugin: OpenAI's official path, which could one day be blocked, but right now is a remarkable door.[1] Both techniques are independent of each other, do not interfere, and can even be used at the same time — every subscription quota in a single window, in a single project.
Part 1 — Routing Chinese models: GLM-5.2 as a drop-in
Claude Code talks to api.anthropic.com by default. Via the env block of a settings file, this target can be redirected entirely. By now several providers offer an Anthropic-compatible endpoint — besides Z.ai (Zhipu AI, the GLM family), Moonshot with Kimi and MiniMax as well. With them the routing works without an extra proxy, as a true drop-in replacement. I use GLM-5.2 as the running example here; Kimi or MiniMax are wired in through the same env variables — you only swap the base URL and the model IDs. The core trick: internally Claude Code only knows the tier aliases opus, sonnet and haiku. Via the ANTHROPIC_DEFAULT_*_MODEL variables you map each tier to a concrete GLM model. Choose /model opus in the CLI and the request actually goes to GLM-5.2.
The configuration belongs, per project, in .claude/settings.local.json at the repo root — this file is ignored by Git by default, which is exactly right for keys. Machine-wide, ~/.claude/settings.json would work too:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "DEIN_ZAI_API_KEY",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2[1m]",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"API_TIMEOUT_MS": "3000000"
}
}Two stumbling blocks decide between success and frustration. First: Z.ai strictly expects the key in ANTHROPIC_AUTH_TOKEN, not in ANTHROPIC_API_KEY — the most common beginner mistake. Second: environment variables are read only once, at process start. A new tab is not enough; Claude Code has to be fully quit and freshly started. Then verify: /model should show GLM-5.2, and when asked „What model are you?" GLM-5.2 must identify itself. If it answers „Claude" there, the routing is wrong — then an active Claude login or a key in the shell probably took precedence; /status shows which route is active. The full field table plus error catalog is available here as a cheat sheet:
If you want to switch cleanly between the worlds, do not redirect globally — define a shell function instead. Then it is clear in every terminal which provider is working — and which one is being billed:
claude-zai() {
ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" \
ANTHROPIC_AUTH_TOKEN="$Z_AI_API_KEY" \
claude "$@"
}
# claude-zai -> GLM via Z.ai
# claude -> Anthropic, as usualA word of context, especially for SMEs in the EU: this routing sends your code to an endpoint in a different legal jurisdiction. For learning projects, prototypes and open repositories that is a legitimate, drastically cheaper option. For client code and personal data, the question belongs in your data-protection assessment before the first request flows. The technology takes the cost question off your hands — the responsibility question stays with you.
Part 2 — OpenAI's answer: Codex as a second agent in Claude Code
The second way is the one with which OpenAI sits down in Anthropic's office — and for us users it is simply practical. The openai/codex-plugin-cc plugin lets you call Codex from within Claude Code: to have your own code checked by a second, independent instance, or to hand off whole tasks when the Claude quota is burning. Important for the mental model: the plugin does not start a second AI runtime. It calls the locally installed Codex CLI on the same machine — same installation, same login, same repo checkout. Claude Code is only the remote control. Usage counts against your Codex quota, not Claude's — which is exactly the point.
Installation is done in four commands: /plugin marketplace add openai/codex-plugin-cc, then /plugin install codex@openai-codex, /reload-plugins, and finally /codex:setup as a check — it verifies whether Codex is installed and logged in, and offers to install it if not. Requirements: a Codex account (a ChatGPT subscription is enough, even Free, or an API key) and Node 18.18 or newer.
Didactically, the most valuable thing about it is the „second opinion" among agents. Just as you would have code reviewed by a human colleague, here you get the judgment of another model — an agent that does not share the first one's assumptions and therefore finds mistakes the original author overlooks, whether human or AI. /codex:review asks: is the code correct? /codex:adversarial-review asks the more uncomfortable question: was this even the right approach? And /codex:rescue hands over a whole task — a bug, a fix, a continuation, gladly in the background too, while Claude keeps working. All seven commands with their flags and flows are in the cheat sheet:
A warning belongs here: the optional review gate (/codex:setup --enable-review-gate) hooks into Claude's response and blocks completion until Codex is satisfied. That sounds like quality assurance, but it can create a long-running Claude-↔-Codex loop that eats your usage limit while you are getting coffee. Only enable it when you are actively watching the session — agent loops are where cost control stops being theory.
What remains: sovereignty over your own workbench
Whether Anthropic will eventually block the plugin, we will see — I think it is likely, because nobody serves the coffee voluntarily forever. API routing, on the other hand, will not be so easy to abolish: the keys belong to the user, and looking into them is off-limits. In practical terms, for us that means: learn both techniques today, master both, make neither into a worldview. The models have become interchangeable performers; what is not interchangeable is your projects, your methodology and your judgment. Whoever owns the workbench cannot be blackmailed by the price tag on the tool — that holds for the solo user with the 20-euro subscription just as much as for the SME with a compliance department. The complete teaching material for both parts, including step-by-step guides, discussion questions and a hands-on exercise that connects both techniques, is available here:
References
0 comments
● Loading comments…