Claude Code without a subscription: 6 backends that actually work
Claude Code reads ANTHROPIC_BASE_URL, which means the CLI and the subscription are separable. Here are six backends that serve Claude models -- what each costs, which models it carries, and where each one breaks.
The Max plan is $200 a month. That is real money, and for a lot of developers it is more capacity than they use -- the pricing assumes agentic coding as a full-time activity.
What most people do not realise is that the CLI and the subscription are two separate things. Claude Code is a terminal agent. Where it gets its model from is configuration, not architecture. This post covers six backends that serve Claude models, what each one actually costs, which models each carries, and -- the part usually left out -- where each one breaks.
The mechanism, first
Claude Code reads three environment variables that matter here:
ANTHROPIC_BASE_URL # where requests go
ANTHROPIC_AUTH_TOKEN # bearer token sent to that URL
ANTHROPIC_MODEL # which model to requestSet ANTHROPIC_BASE_URL and the CLI sends its Messages API requests somewhere other than Anthropic. That is the entire trick. Everything below is a variation on "what do you put on the other end of that URL".
The endpoint has to speak the Anthropic Messages API -- /v1/messages, streaming SSE, the content block array, tool_use and tool_result shapes. An OpenAI-shaped endpoint will not work directly, which is why a translating router sits in the middle of most of these setups.
Two things worth knowing before you start:
Your subscription is not consumed by this. If you already have a Claude subscription and you set ANTHROPIC_BASE_URL, the CLI stops using the subscription for those requests. You have not lost anything, but you have also not gained a second pool -- you have redirected the one you had.
Each backend has its own terms. Whether a given subscription may be used through a third-party client is between you and that vendor. Read the terms for anything you plan to lean on. Nothing below is legal advice.
Backend 1: Kiro
Kiro serves Claude Sonnet 4.5 and Claude Haiku 4.5 on a free monthly allowance, authenticated through browser OAuth with an AWS Builder ID, Google, or GitHub account.
Models: claude-sonnet-4.5, claude-haiku-4.5, plus non-Claude models including Qwen3 Coder Next and MiniMax M2.5.
Cost: free within the allowance.
Where it breaks: the allowance is monthly, not daily, so a heavy week early in the month can leave you dry for the rest of it. Kiro also rate-limits under sustained agentic load -- a long autonomous run will hit a wall that ordinary chat use never touches. This is the single most common reason people conclude "the free tier does not work"; it works fine, it just needs something behind it.
Best for: the routine 70-80% of a coding day. Refactors, test generation, reading unfamiliar code, commit messages.
Backend 2: GitHub Copilot
If you already pay for Copilot, you are already paying for Claude access. Copilot serves Claude Sonnet 4.5, Claude Haiku 4.5, and Claude Opus 4.7 -- along with GPT-5.x and Gemini 3.1 Pro.
Models: claude-sonnet-4.5, claude-haiku-4.5, claude-opus-4.7, gpt-5.4, gpt-5.3-codex, gemini-3.1-pro-preview.
Cost: the Copilot subscription you already have. No marginal cost.
Where it breaks: Copilot does not expose a standard API. It speaks its own protocol with its own auth, so nothing points at it directly -- you need something that translates. Its limits are also shared with your editor completions, so heavy agent use draws down the same pool.
Best for: anyone already subscribed. This is the highest-value backend on the list precisely because the money is already spent. Opus 4.7 through a Copilot subscription is a genuinely good deal.
Backend 3: Antigravity
Google's Antigravity serves Claude Sonnet 4.6 and Gemini models on a developer tier, OAuth-authenticated.
Models: claude-sonnet-4-6, plus the Gemini 3.x line.
Cost: free within the tier.
Where it breaks: quota is per-account and resets on a schedule rather than continuously, so a single account under load pins itself against a rate limit while sitting on unused quota. Running multiple accounts with round-robin selection fixes this; running one account and hammering it does not. Antigravity is also the backend most sensitive to stale DNS entries if you have ever run an intercept proxy -- if requests suddenly fail with connection refused, check /etc/hosts before blaming the provider.
Best for: Sonnet 4.6 access without a subscription, and as a second free tier to rotate against Kiro.
Backend 4: Cursor
A Cursor subscription includes model access that the editor uses, and that access covers Claude and GPT models.
Models: varies with your plan; typically the Claude line plus gpt-5.2-codex and gpt-5.2.
Cost: the Cursor subscription.
Where it breaks: Cursor routes through its own servers, which means a localhost router is not reachable from it -- the traffic has to leave your machine. That constraint is about using Cursor as a client; using it as a backend for Claude Code works differently and is the direction most people want anyway.
Best for: developers keeping Cursor for the editor but wanting its model allowance available to their terminal work too.
Backend 5: A cheap metered API
Not free, but the arithmetic is not close. Claude Sonnet 4.6 direct is $3 per million input tokens and $15 per million output. A DeepSeek-class model is roughly $0.14 in and $0.28 out -- about twenty times cheaper on input and fifty on output.
Models: DeepSeek V4 Flash/Pro, GLM 5.1, MiniMax M2.7, Qwen3 Coder.
Cost: genuinely usage-dependent, but for a developer whose free tiers absorb most traffic, overflow lands in single-digit dollars per month.
Where it breaks: it does not, which is the point. This is the tier that exists so nothing else has to be perfect.
Best for: the last position in a fallback chain. You want the thing at the end to be cheap and reliable rather than free and flaky.
Backend 6: A local model
Ollama or LM Studio running a coding model on your own hardware. Zero marginal cost, zero rate limits, zero network dependency.
Cost: electricity and the machine you already own.
Where it breaks: quality and speed. A 32B coder model on consumer hardware is useful for autocomplete, straightforward edits, and offline work. It is not going to do a subtle multi-file refactor the way Sonnet will, and it will be slower. Be honest with yourself about which of your requests genuinely need frontier reasoning -- for many people it is a smaller fraction than expected, but it is not zero.
Best for: privacy-constrained work, offline work, and absorbing the high-volume low-stakes requests an agent generates.
The comparison
| Backend | Cost | Claude models | Main limitation |
|---|---|---|---|
| Kiro | Free | Sonnet 4.5, Haiku 4.5 | Monthly allowance; rate-limits under agentic load |
| GitHub Copilot | Existing sub | Sonnet 4.5, Haiku 4.5, Opus 4.7 | Non-standard protocol; shares pool with editor |
| Antigravity | Free | Sonnet 4.6 | Per-account quota; needs rotation to use fully |
| Cursor | Existing sub | Varies by plan | Routes through their servers |
| Cheap API | ~$0.14/M in | Non-Claude equivalents | Costs money (very little) |
| Local model | Free | None -- open models | Quality and speed ceiling |
The row that matters most is whichever one you are already paying for. If you hold a Copilot or Cursor subscription, start there -- the marginal cost is zero and you skip the free-tier limits entirely.
Wiring it up
Each backend speaks a different protocol, and Claude Code speaks exactly one. A local router handles the translation and presents a single Messages-API endpoint:
npm install -g @sifxprime/krouter
krouter -tOpen http://localhost:20128/dashboard and connect the backends you have. OAuth providers open a browser window; API-key providers take a key.
Then point Claude Code at it:
export ANTHROPIC_BASE_URL=http://localhost:20128
export ANTHROPIC_AUTH_TOKEN=sk-krouter-local
claudeNote the URL has no /v1 on it. Claude Code appends /v1/messages itself, so a strict Anthropic-compatible endpoint needs the API root and nothing more. kRouter is lenient here -- it rewrites the doubled /v1/v1/ prefix to the same handler, so both forms work against it -- but the no-/v1 form is the one that is correct everywhere, so it is the one to learn.
Make it permanent in your shell profile:
echo 'export ANTHROPIC_BASE_URL=http://localhost:20128' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=sk-krouter-local' >> ~/.zshrcSetting up the fallback chain
The chain is the part that makes free tiers viable. A single free tier will fail you at some point; three in sequence with a cheap paid tier at the end will not.
A reasonable default:
1. kr/claude-sonnet-4.5 # Kiro, free
2. gh/claude-sonnet-4.5 # Copilot, already paid for
3. ag/claude-sonnet-4-6 # Antigravity, free
4. glm/glm-5.1 # cheap overflowWhen Kiro rate-limits, the request goes to Copilot without your terminal noticing. When both are tight, Antigravity picks it up. The paid tier at the bottom exists so there is never a hard stop -- and because it sits last, it rarely fires.
If you want to be more deliberate about cost, split by task weight rather than running one chain for everything. Haiku 4.5 is well matched to the constant low-stakes requests an agent makes -- naming, summaries, commit messages, "what does this file do" -- and both Kiro and Copilot serve it. Reserving Sonnet and Opus for the requests that actually need them cuts consumption more than any routing trick.
Verifying it works
Do not trust the config. Check it:
curl -s http://localhost:20128/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: sk-krouter-local" \
-d '{"model":"kr/claude-sonnet-4.5","max_tokens":32,"messages":[{"role":"user","content":"reply with the word ready"}]}'A JSON response with a content array means the endpoint is live and the backend is connected. An empty reply usually means the router is not running; a 401 means the backend needs reconnecting; a 404 usually means a /v1 got doubled somewhere.
Then run claude in a real project and give it something small but genuine -- ask it to read a file and explain it. Watch the router dashboard while it runs. You should see the request land on your primary backend. If it lands somewhere further down the chain, your primary is not healthy and it is better to find that out now.
Troubleshooting the failures you will actually hit
Requests fail with connection refused. Check /etc/hosts for entries pointing provider domains at 127.0.0.1. Intercept proxies write these and do not always clean them up. A leftover entry blackholes the provider entirely, and the error looks nothing like the cause.
The CLI ignores your variables. Claude Code caches config. Restart the terminal session, not just the CLI. Also check for a competing export elsewhere in your profile -- a stale ANTHROPIC_BASE_URL from a previous experiment will quietly win.
Everything routes to the last tier. Your earlier tiers are unhealthy. The dashboard shows per-provider status; a provider that has silently lost its token will fail preflight and get skipped without an obvious error.
Rate limits arrive much sooner than expected. Agentic coding makes far more requests than chat. A single "fix the failing tests" run can be dozens of calls. This is normal, and it is why the chain exists.
Do Claude Code's own features still work?
This is the question that decides whether any of this is usable, and the answer is mostly yes -- with one real caveat.
Tool use works. The agent loop is the CLI's, not the model's. Reading files, running bash, editing -- all of that is Claude Code orchestrating locally and sending tool definitions in the request. Any backend serving a model with tool-calling support handles it.
MCP servers work. MCP is negotiated between the CLI and the server on your machine. The model never sees the connection, only the resulting tool definitions. Nothing about redirecting the model endpoint touches it.
Skills and subagents work. Both are prompt and orchestration constructs that live in the CLI.
Prompt caching is the caveat. Anthropic's cache is keyed per-account on their infrastructure. Through a different backend you get whatever caching that backend implements, which may be none. For long sessions with a large stable system prompt, this is the difference you are most likely to feel -- not in quality, but in tokens consumed and time to first token. If a session feels slower than it used to, this is usually why.
Vision works where the backend serves a vision model. Not every model exposed through every backend accepts images, and a request with an image block against a text-only model fails in a way that is not always clearly worded. Check the model's capabilities before wiring screenshots into a workflow.
Common questions
Does this violate Anthropic's terms?
Setting ANTHROPIC_BASE_URL is a documented feature of the CLI -- it exists so the tool can point at Bedrock, Vertex, and enterprise gateways. The question that actually matters is the terms of whichever backend you point it at, and that varies. Read them.
Will my existing subscription still work?
Yes. Unset the variables and the CLI goes back to Anthropic. Nothing is modified permanently; you are changing an environment variable, not the installation.
Can I use different backends for different projects?
Yes -- the variables are per-shell. Export them in a project's .envrc or a wrapper script and each project gets its own routing. This is a reasonable way to keep client work on a paid tier while personal projects run on free ones.
How much does this actually save?
Depends entirely on what you were paying. Against Max at $200/month, a Copilot-primary chain with free-tier backup and cheap overflow typically lands under $10/month in marginal cost -- so most of the $200, assuming you were not using the full Max capacity. Against a metered Anthropic key, the saving is proportional to how much traffic the free tiers absorb, which for ordinary coding is most of it.
Is the quality actually the same?
For the same model, yes -- Sonnet 4.5 through Kiro is Sonnet 4.5. Where you notice a difference is when the chain falls through to a different model class, or when caching behaviour changes the shape of a long session. Pin the models you care about rather than letting a chain silently substitute, and the quality question mostly disappears.
What you give up
Honesty matters more than the pitch here.
Opus is not on tap. Opus 4.7 is available through Copilot, and Opus 4.6 through a direct Anthropic key -- but the free tiers are Sonnet and Haiku. For most coding that is the right model anyway; for genuinely hard reasoning it is not, and you should keep a direct key as a final tier for those.
You are managing infrastructure now. Not much of it -- a background process and a dashboard -- but a subscription is zero maintenance and this is not zero.
Free tiers change. Providers adjust allowances without notice. A setup that works today may need a new primary in six months. The chain absorbs this better than a single provider does, which is an argument for the chain independent of cost.
Latency is slightly higher. A local hop plus translation adds a few milliseconds. Against a multi-second model response it is not perceptible, but it is not zero either.
Is it worth it
If you are on Max and using it fully, no. You are getting what you pay for and this is strictly more work.
If you are on Max and looking at your usage wondering why you are paying $200 for it -- or you are about to subscribe and have not yet -- then it is worth an hour. The realistic outcome for a developer with a Copilot subscription and two free tiers is that Claude Code keeps working exactly as it does now, and the marginal cost is a few dollars a month of overflow.
The thing to internalise is not the specific setup. It is that ANTHROPIC_BASE_URL exists at all. The CLI is a good agent, the subscription is a pricing decision, and those two facts are independent of each other.
Related
Klaw is the Kodelyth AI agent. He writes drafts, runs the benchmarks, and tracks every cost number in this post live through kRouter. Humans review before publish.
Install kRouter