Most guides on this topic reach for a proxy. Install LiteLLM, write a config, map model names, run a local server, point Claude Code at it. It works. For the majority of people it is also unnecessary, and it adds three new things that can break on a Tuesday morning.

There are two families of solution here, and the boring one wins for most people: point Claude Code at a provider that already speaks the Anthropic protocol and change nothing else.

The constraint everything follows from

Claude Code talks to exactly one API shape: Anthropic's. That single fact sorts every option into two buckets.

A provider either exposes an Anthropic-compatible endpoint, in which case you set two environment variables and you are finished, or it does not, in which case something must translate between formats and that something is a proxy you now run.

This is why some models on a given subscription work and others do not, even though you are paying for all of them. It is a protocol boundary, not a quality one.

Family one: direct endpoints

These need no extra software. Set ANTHROPIC_BASE_URL, set your key, done.

ProviderEntry priceAnthropic endpointCatch
OpenCode Go$10/mo, $5 first monthYes, for 6 of 18 modelsHard caps: $12 per 5h, $30/week, $60/month
GLM Coding Planaround $18/mo entry tierYes, full Anthropic specPublished tier prices vary by source and billing period
Kimi Codearound $19/mo entry tierYes, adapter on every planAPI fees billed separately from membership

On OpenCode Go, only six of the eighteen models carry Anthropic-compatible endpoints, so DeepSeek, GLM, Kimi, Grok and GPT models on that plan are invisible to Claude Code no matter what you configure. The permanent configuration setup covers which six and how to make the config survive a reboot.

DeepSeek is the sharpest illustration of why the protocol boundary matters more than the price list. On OpenCode Go, DeepSeek V4 Flash carries by far the most generous quota on the plan: roughly 31,650 requests per 5-hour window and 158,150 per month, against MiniMax M3's 16,000. It is also not a weak model: the July 2026 retrain posts 82.7 on Terminal Bench 2.1, though those are vendor numbers and worth treating as a ceiling rather than a promise. And it is OpenAI-compatible, which makes it completely unreachable from Claude Code. The most generous allowance on the subscription, attached to a capable model, is worth nothing to this client.

DeepSeek also just got more expensive. API prices rose on 16 August 2026, taking V4 Flash to $0.22 per million input and $0.66 output off-peak, $0.44 and $1.32 at peak. Cached input took the harshest increase, roughly six times higher off-peak and twelve times at peak, which matters because cached input is exactly what a long coding session leans on. If you were routing to DeepSeek through a proxy on the strength of old pricing, re-run that math.

Z.ai ships full Anthropic API compatibility, which means Claude Code, Cline, Goose and Crush all work by swapping the base URL. Note that GLM tier pricing is quoted inconsistently across sources, with entry tiers reported anywhere from $10 to $18 depending on the page and the billing period, so check the current figure at the source before committing.

Moonshot provides an Anthropic-compatible adapter on every Kimi Code plan, with membership and API usage billed as separate line items.

Family two: proxies

A proxy speaks Anthropic on the side facing Claude Code and something else on the side facing your provider. LiteLLM is the general-purpose option and handles routing, fallback chains and cost tracking. Claude Code Router is the lighter one aimed at solo use.

The honest case for a proxy is narrow but real:

  • You want automatic failover across several providers
  • You need per-developer usage attribution or audit logs
  • You want to route different request types to different models
  • Your provider has no Anthropic-compatible endpoint at all

The case against is that you are inserting a service into the hot path of your editor. As one setup guide puts it, failures can now originate in Claude Code, in the proxy, or upstream, and most setup problems come from three places: the proxy is unreachable, the auth token does not match the proxy config, or Claude Code asked for a model name your config does not expose.

That last one has a specific trap worth knowing before you spend an evening on it. The model name you expose must contain claude, anthropic, or a family name such as opus, sonnet, haiku, or fable. So claude-smart-router is accepted while smart-router, auto, and a bare UUID are rejected by the client before any request leaves your machine. Another vendor's name anywhere in the string fails the same check.

What Anthropic actually says about this

Worth reading before you build anything elaborate, because it is easy to miss.

Anthropic's own gateway documentation states plainly that it does not endorse, maintain, or audit third-party gateway products, and does not support routing Claude Code to non-Claude models through any gateway. Everything in this post is outside the supported path. That does not mean it stops working, it means nobody owes you a fix when it does.

The same page names the structural risk better than any blog post could: Claude Code adds capabilities with each release, and a gateway that does not forward them breaks the corresponding features. Your proxy is not a one-time setup, it is a thing you maintain against a moving client.

One more detail that trips people up: setting ANTHROPIC_BASE_URL alone, without a credential variable, does not replace your subscription. Requests route through the gateway but a saved login stays the active credential, so subscription limits and billing still apply.

Which one to pick

Take a direct endpoint if you are one person who wants cheaper tokens. That covers almost everyone reading this. Two environment variables, no new process, nothing to keep patched. Pick the provider by which models you actually want rather than by headline price, because a plan whose good models speak the wrong protocol is worth nothing to you here.

Take a proxy if you have a team, need audit logs or per-developer attribution, or genuinely need failover across providers. Start with Claude Code Router rather than LiteLLM if it is just you, since authentication and rate limiting are overhead you do not need yet, and migrating later is easy.

Take neither if you are hitting limits rather than cost. Cheaper tokens do not fix an exhausted weekly quota, and the harness itself accounts for more of your spend than most people expect. We measured that separately: Claude Code sends 28,407 input tokens on a cold hello before you type anything, mostly tool definitions.

The pattern across all of it is unglamorous. The setup that survives is the one with the fewest moving parts, and for this problem that is two environment variables pointed at a provider that already speaks the right protocol.

FAQ

Can I use Claude Code with a cheaper model?

Yes. Claude Code reads ANTHROPIC_BASE_URL and an API key, so any provider exposing an Anthropic-compatible endpoint works without extra software. OpenCode Go, GLM Coding Plan and Kimi Code all ship one. Providers without such an endpoint require a translation proxy such as LiteLLM or Claude Code Router.

Do I need LiteLLM to run Claude Code on another provider?

No, not if your provider already speaks the Anthropic protocol. LiteLLM earns its place when you need failover across providers, per-developer usage attribution, audit logging, or routing different request types to different models. For a single developer chasing lower cost, it adds a process, a config file and an auth flow with no benefit.

Why do only some models on my plan work with Claude Code?

Because Claude Code speaks only Anthropic's API format. On OpenCode Go, for example, just six of eighteen models expose Anthropic-compatible endpoints; the rest are OpenAI-compatible and unreachable from Claude Code regardless of configuration. It is a protocol limitation, not a quality or licensing one.

Is running Claude Code on a non-Anthropic model supported?

No. Anthropic's documentation states it does not endorse, maintain, or audit third-party gateways and does not support routing Claude Code to non-Claude models through any gateway. These setups work in practice but sit outside the supported path, so breakage after a Claude Code release is your problem to fix.

Why is my proxy rejecting the model name?

Claude Code validates the model name client-side before sending anything. The name must contain claude, anthropic, or a family name such as opus, sonnet, haiku, or fable. Names like auto or a bare UUID fail, and including another vendor's name anywhere in the string fails too. Rename the model in your proxy config and the request goes through.

Sources