The dreaded message now appears several times a day: “You’ve reached your usage limit.” Opus 4.7 is so token-hungry that it burns through a Pro plan’s 5-hour window in about 30 minutes of actual coding. And when the limit hits mid-session, your only built-in option is Extra Usage — Anthropic’s pay-as-you-go credits at Opus API prices. Keep coding for a few more hours and you’re looking at a bill the size of a nice dinner. Every. Single. Time.
So I built Claudex — a single-command provider switcher that makes switching as trivial as launching Claude Code itself.
Why switch providers?
The answer is simple: Opus 4.7 costs $25 per million output tokens. DeepSeek V4-Pro costs $3.48. That’s a 7× gap.
And DeepSeek backs it up. On SWE-bench Verified — the standard benchmark for real-world bug fixes — V4-Pro scores 80.6% to Opus 4.6’s 80.8%. On LiveCodeBench, it actually pulls ahead: 93.5% to 88.8%.
Near-identical capability at one-seventh the price changes the mental math completely. Instead of rationing your session because you’re watching a meter tick up, you just keep coding.
Let me be clear: Opus 4.7 is still the best. It plans better, it reasons through ambiguity better, and when you’re in uncharted territory it’s the one you want at the wheel. I’m not switching away from it — I’m switching after it. The pattern that’s working incredibly well is: start the session with Opus, let it understand the problem and sketch the plan, then claudex deepseek to execute. The plan survives the provider switch because Claude Code’s session context stays intact.
This hybrid workflow means you’re never sitting there waiting for a limit window to reset just to finish what Opus already figured out. That alone is worth the price of admission.
How it works
Claudex writes to Claude Code’s own settings file — no wrapper scripts, no proxy, no daemon. It updates ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, and the model mappings for each tier, then launches Claude Code. The switch persists across terminal sessions.
claudex deepseek # switch to DeepSeek V4 and launch
claudex # launch with current provider
API keys live in a separate file (~/.config/claudex/credentials, chmod 600), not mixed into INI config. Providers are configured in ~/.config/claudex/providers.ini.
Seven providers come pre-configured: Anthropic, DeepSeek, MiniMax, GLM, Kimi, Mistral, and Ollama. Adding a new one is two edits — a [section] in providers.ini and a line in credentials.
Install
curl -fsSL https://raw.githubusercontent.com/hleroy/claudex/refs/heads/main/install.sh | bash
The installer drops a symlink in ~/.local/bin/ — just make sure that’s in your PATH. After that, set your keys in ~/.config/claudex/credentials and you’re done.
The bottom line
Claude Code is the best AI coding tool I’ve used, and Opus 4.7 is the best model in it. I don’t want to leave either of them. But finishing what Opus planned shouldn’t require burning Opus tokens at Opus prices. Claudex lets you keep the best of both: Opus for the hard thinking, whichever provider fits your budget for the rest.
The project is MIT-licensed at github.com/hleroy/claudex. If you’ve been staring at the Extra Usage screen wondering if there’s a better way — you were right to wonder.