Claude Code without a subscription: 6 backends that work
Six backends that can run Claude Code instead of a Claude plan: what each costs in 2026, which models it carries, and where each one breaks.
The Max plans are $100 and $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 can sit behind it, what each one actually costs, which models each carries, and -- the part usually left out -- where each one breaks.
The mechanism, briefly
Claude Code reads a few 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. The endpoint has to speak the Anthropic Messages API, which is why a translating router sits in the middle of most of these setups. The details, including the /v1 question, are in setting ANTHROPIC_BASE_URL correctly.
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. kRouter shows a risk notice before you connect Kiro, Copilot, Antigravity, Codex or a Claude login, because those sessions are not licensed for router use and the account can be restricted. Nothing below is legal advice.
Backend 1: Kiro
AWS's Kiro has a free plan of 50 credits a month that covers Claude Sonnet 4.5 and open-weight models. kRouter can sign in with an AWS Builder ID, IAM Identity Center, a Google or GitHub account, an imported token, or a Kiro API key.
Models: claude-sonnet-4.5 on the free plan, plus open-weight models including Qwen3 Coder Next and DeepSeek 3.2. Paid Kiro plans, from $20 a month for 1,000 credits, add newer Claude models.
Cost: free within the 50 credits.
Where it breaks: the allowance is monthly and counted in credits, so an agent can spend it in days. When Kiro reports the monthly limit, kRouter locks that account for about 30 days instead of retrying it. Kiro also rate-limits under sustained agentic load, and its server can time out on very large file writes; kRouter's -agentic model variants (for example kr/claude-sonnet-4.5-agentic) add an instruction to write in chunks for that reason. The free plan running dry is the most common reason people conclude "the free tier does not work"; it works, it just needs something behind it.
Best for: routine work early in the month, and as one entry in a chain.
Backend 2: GitHub Copilot
If you already pay for Copilot, the plan includes monthly AI Credits that Claude models draw on. Since June 1, 2026 credits are spent at each model's API rate; Copilot Pro is $10 a month with 1,000 base credits plus a 500 flex allotment, and code completions never use them.
Models: GitHub's list includes Claude Haiku 4.5, Sonnet 4.6 to 5.5 and Opus 4.8 to 5.5, plus the GPT and Gemini Flash lines; your plan decides which you get. kRouter's built-in examples are gh/claude-sonnet-4.6 and gh/claude-haiku-4.5; the provider page can fetch the live list for your account.
Cost: credits you already pay for, until they run out.
Where it breaks: Copilot's backend is not a public API -- it needs a GitHub device login exchanged for a short-lived token -- so you need something that does that exchange. And the credits are a prepaid pool at API rates, shared with Copilot Chat, agent mode and Copilot CLI. A coding agent resending its context on every turn spends a Pro plan's credits quickly.
Best for: anyone whose Copilot credits go mostly unused. More in using your Copilot plan in Claude Code.
Backend 3: Antigravity
Google's Antigravity has a free Individual plan with weekly rate limits, and serves Claude next to Gemini.
Models: claude-sonnet-4-6 and claude-opus-4-6-thinking on the free plan, plus Gemini 3.1 Pro and the 3.x Flash line. Google lists both Claude models as retiring on November 2, 2026; the newer Claude 5.5 models need a paid Google AI plan.
Cost: free within the plan's limits.
Where it breaks: limits are per account, so a single account under load pins itself against a rate limit while sitting on unused quota. kRouter rotates Antigravity accounts round-robin by default for this reason; one account hammered hard does not work as well. 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: free Sonnet 4.6 access until November, and as a second free tier to rotate against Kiro.
Backend 4: Cursor
A Cursor plan includes a monthly pool of model usage, with Claude and other third-party models billed against it at API rates.
Models: kRouter's Cursor IDE provider, which uses a token imported from your Cursor login, lists Claude 4.5 and 4.6 Sonnet and Opus variants plus gpt-5.2-codex and gpt-5.3-codex.
Cost: the Cursor plan's included usage.
Where it breaks: this spends the same pool Cursor's own agent spends, at API rates, so it only helps if you are not using that pool in the editor. Separately, Cursor routes its own requests through its servers, so a localhost router is not reachable from Cursor; that constraint is about Cursor as a client, not as a backend.
Best for: developers keeping Cursor for the editor but not using all of its included usage.
Backend 5: A cheap metered API
Not free, but the arithmetic is not close. Claude Sonnet 5.5 on Anthropic's API is $2 per million input tokens and $10 per million output. DeepSeek lists its Flash model at $0.15 to $0.30 per million input tokens and $0.60 to $1.20 per million output, with off-peak hours at half the peak rate (October 2026 prices).
Models: DeepSeek V4 Flash and Pro, GLM-5.3, Kimi K3, MiniMax M3 -- the last three also through an OpenCode Go subscription.
Cost: usage-dependent, and small when free tiers absorb most traffic.
Where it breaks: rarely, and when it does it is an ordinary API outage. One real catch: Claude Code guesses a context window from the model name, and it does not know these names. Set it explicitly (how).
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 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 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 (local first, cloud as fallback).
The comparison
| Backend | Cost | Claude models | Main limitation |
|---|---|---|---|
| Kiro | Free (50 credits/month) | Sonnet 4.5 | Monthly credits; rate-limits under agentic load |
| GitHub Copilot | Existing plan's credits | Haiku 4.5, Sonnet 4.6-5.5, Opus 4.8-5.5 (by plan) | Prepaid credits at API rates |
| Antigravity | Free | Sonnet 4.6, Opus 4.6 (retiring Nov 2) | Weekly limits per account |
| Cursor | Existing plan's usage | Claude 4.5 and 4.6 variants | Spends the editor's pool |
| Cheap API | ~$0.15/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 plan whose allowance you do not use up, start there.
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 sign-in or give you a device code; API-key providers take a key.
Then point Claude Code at it. The Claude Code card on kRouter's CLI Tools page writes these into ~/.claude/settings.json for you, or set them by hand:
export ANTHROPIC_BASE_URL=http://localhost:20128/v1
export ANTHROPIC_AUTH_TOKEN=<your-krouter-key>
claudeOn the same machine as kRouter any token value works; from another machine, use a key from the dashboard's Endpoint page. kRouter accepts the base URL with or without /v1.
Make it permanent in your shell profile:
echo 'export ANTHROPIC_BASE_URL=http://localhost:20128/v1' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN=<your-krouter-key>' >> ~/.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; several in sequence with a cheap paid tier at the end rarely will. Build it as a combo on the dashboard and use the combo's name as the model.
A reasonable default:
1. kr/claude-sonnet-4.5 # Kiro, free
2. ag/claude-sonnet-4-6 # Antigravity, free until November 2
3. gh/claude-sonnet-4.6 # Copilot, credits already paid for
4. ds/deepseek-v4-flash # cheap overflowWhen Kiro rate-limits, the request goes to Antigravity without your terminal noticing. When both are tight, Copilot 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. kRouter treats the order as a preference: entries whose provider reports remaining quota move ahead, the one with the most left first.
If you want to be more deliberate about cost, split by task weight rather than running one chain for everything. Claude Code sends its background work to whatever its haiku slot points at, so set ANTHROPIC_DEFAULT_HAIKU_MODEL to a cheap model (gh/claude-haiku-4.5, for instance). 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" \
-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.
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. Restart the terminal session, not just the CLI. Also check for a competing export elsewhere in your profile, or an env block in ~/.claude/settings.json -- 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 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 caveats.
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, with one default changed. MCP is negotiated between the CLI and the server on your machine. But when ANTHROPIC_BASE_URL points at a host other than Anthropic's, Claude Code turns MCP tool search off by default (set ENABLE_TOOL_SEARCH=true only if your gateway forwards tool_reference blocks), and Remote Control is disabled.
Skills and subagents work. Both are prompt and orchestration constructs that live in the CLI.
Prompt caching is the caveat. Anthropic's cache lives 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.
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 and how much of your traffic the free and already-paid tiers absorb. Against a Max plan, the most you can save is the plan price; what you spend instead is whatever spills over to metered models, which the dashboard's Usage page shows per provider. Against a metered Anthropic key, the saving is proportional to the traffic the free tiers take.
Is the quality actually the same?
For the same model, yes -- Sonnet 4.5 through Kiro is Sonnet 4.5. But the free routes carry older models than Anthropic's current Sonnet 5.5 and Opus 5.5, and you notice a difference 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.
What you give up
Honesty matters more than the pitch here.
The newest models cost money. The free routes carry Sonnet 4.5 (Kiro) and Sonnet 4.6 and Opus 4.6 (Antigravity, until November 2). Sonnet 5.5 and Opus 5.5 mean a paid route: Copilot credits, a paid Kiro or Google AI plan, or Anthropic's API, where Opus 5.5 is $4 per million input tokens and $20 per million output. For most coding an older Sonnet is fine; for genuinely hard reasoning it may not be.
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, and models retire: Sonnet 4.5 and Opus 4.7 are no longer on Copilot's list, and Antigravity's free Claude models go in November. 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 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 unused Copilot credits and two free tiers is that Claude Code keeps working much as it does now, on somewhat older models, with the marginal cost set by whatever overflows to the metered tier. If the subscription you keep is Claude's own, the weekly-limit guide covers using the same chain only when it runs out.
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
Published by Kodelyth, the team that builds kRouter. Posts are drafted with AI assistance and reviewed by a person before they go out. kRouter is free and MIT licensed.
Install kRouterRelated posts
- Save moneyFree Claude API access in 2026: the routes that workAnthropic has no free API tier, but Claude runs on Kiro's and Antigravity's free plans and on plans you may already pay for. What each one limits.
- Save moneyQwen Code's free tier is gone: keep the CLI, swap the modelQwen OAuth's free tier closed on April 15, 2026. What still works in Qwen Code, where Qwen models come from now, and how to keep the CLI answering.
- Save moneyANTHROPIC_BASE_URL: point Claude Code at any model you wantClaude Code sends every request to ANTHROPIC_BASE_URL if the endpoint speaks Anthropic's Messages API. How to use it with any model, and the gotchas.
Relevant docs
- Token savers: RTK, Caveman, Ponytail, Headroom, PXPIPEFive ways kRouter can shrink a request before it reaches the provider. Only RTK is on by default. What each saver does, what it needs, and its limits.
- Combos & fallbackPut several models behind one name. kRouter falls back from one to the next, rotates them, or asks a panel of models and merges the answers.
- ProvidersConnect 95+ AI providers to kRouter: OAuth subscriptions, free services, free-tier and pay-per-token API keys, and browser-cookie logins.