Claude Code Free: What Is Actually Free and What Is Not
Claude Code is free to install, but the model is what costs money. These are the real free routes, local models, free tiers and gateways, and what you give up.

You can use Claude Code free if the model behind it costs you nothing, which means a local model on your own hardware, a provider's free tier or a free model routed through a gateway. The program itself installs at no charge, but Anthropic's free claude.ai plan does not include Claude Code. Expect slower and weaker results than with Claude, plus limits you should read before you start.
Is Claude Code free to install and use?
Installing the CLI costs nothing. On macOS, Linux and WSL run curl -fsSL https://claude.ai/install.sh | bash. In Windows PowerShell run irm https://claude.ai/install.ps1 | iex. Using it is a different question. Anthropic's setup page says Claude Code requires a Pro, Max, Team, Enterprise or Console account, and that the free claude.ai plan does not include Claude Code access. Anthropic's cost documentation adds that Claude Code charges by API token consumption.
As of 4 October 2026 Anthropic's pricing page lists Pro at $20 per month when billed monthly, and Max from $100 per month. Our post on Claude subscription vs API for coding covers that decision. The free routes below rely on one documented mechanism: when you set a gateway credential, Claude Code uses it instead of a claude.ai login and starts a session without the login screen.
What are the real ways to use Claude Code for free?
Run a local model on your own hardware
A local model has no per-token fee. You pay with hardware, electricity and patience. Ollama, LM Studio and llama.cpp all expose Anthropic-compatible endpoints, so Claude Code connects without a gateway. With Ollama one command does the setup, ollama launch claude. The manual version looks like this:
ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_BASE_URL=http://localhost:11434 ANTHROPIC_API_KEY="" claude --model qwen3.5
Ollama's Claude Code guide recommends a context length of 64k or higher for larger repositories, and a long context uses memory on top of the model weights. That is why a machine that runs a model comfortably in chat can struggle once Claude Code fills the window. LM Studio works the same way on port 1234 with ANTHROPIC_AUTH_TOKEN=lmstudio. We walk through the details in Claude Code with other models.
Use a provider's free tier or free models
Several providers offer free access with limits. These three facts come from the providers' own pages, read on 4 October 2026.
- OpenRouter. Free model variants have IDs ending in
:free. The limits page lists 20 requests per minute, 50 requests per day if you have bought less than $10 of credits, and 1,000 per day if you have bought at least $10. - Google Gemini API. The pricing page lists a free tier with limited access to certain models, and says content on the free tier is used to improve Google's products.
- Ollama Cloud. The Free plan includes starter usage credits, access to starter models and one concurrent request.
Free offers change often. Read the current page before you build a workflow on one, and read its data terms too, because a coding agent sends your source code to whoever hosts the model. The Gemini API uses its own request format, so it needs a gateway in front of Claude Code. OpenRouter and Ollama Cloud both publish Anthropic-compatible addresses.
Put a gateway in front and route by tier
My Claude Code is a local gateway and free software, licensed AGPL-3.0-or-later or under a commercial licence. The models behind it may be free, paid, subscription-based or entirely local, and that is your choice. For a free setup it helps in three ways. You can send the haiku tier to a small local model and the sonnet tier to a free cloud model. You can chain stand-ins, so when one free model rate-limits, the next one takes over. And its request log shows what each call cost, with a dash for anything it cannot price. It also proxies Claude Code's web search tool across 14 search providers, with a keyless fallback. A gateway only routes requests, so a paid model stays paid.
What do you give up with free models?
Anthropic's gateway documentation says Anthropic does not support routing Claude Code to non-Claude models through any gateway. A free setup runs on that footing. Here is what changes.
| Area | Local model | Free cloud tier |
|---|---|---|
| Speed | Set by your GPU or CPU. Long contexts are slow on weak hardware. | Shared capacity, so responses can queue. |
| Quality | Only models that fit in your memory. Multi-file work is where small models struggle first. | Free offers usually cover a limited set of models, such as starter models on Ollama Cloud. |
| Tool calling | Varies by model. Ollama lists tool_choice as unsupported. | Varies by model and provider. |
| Context | 64k or more recommended, and it costs memory. | Set per model by the provider. |
| Rate limits | None beyond your hardware. | Requests per minute, per day and concurrency caps. |
| Privacy | Prompts stay on your machine. | Read the data terms. Google's free tier uses content to improve its products. |
Rate limits matter more with an agent than with chat. Anthropic's cost documentation explains that each time Claude uses tools it sends another request carrying the tool results, so one task takes many requests. A cap of 50 requests per day can disappear quickly.
Which free option fits your budget and hardware?
| Your situation | Pick | Watch out for |
|---|---|---|
| A recent GPU or plenty of RAM, and a zero bill | A local model through Ollama or LM Studio, connected directly | Context memory, slower turns, tool reliability. Test on your own tasks. |
| No GPU, and a zero bill | Free cloud models through a gateway with a fallback chain | Daily request caps, data terms, sessions that stop mid-task |
| A few dollars a month | Pay-per-token API on cheap models for the sonnet and haiku tiers, local or free for haiku | Track spend in the request log |
| Daily professional use | A Claude subscription or API key in your own name | See the comparison linked above |
| Client or employer code | A paid plan with clear data terms | Do not send confidential code to a free tier |
How do you set up a free Claude Code stack?
Route A: a local model, no gateway
- Install Claude Code with the command from the first section.
- Install Ollama, then pull a model that supports tools and a long context.
- Set Ollama's context length to 64k or higher, as its docs recommend.
- Run
ollama launch claude, or use the environment variables shown earlier withclaude --modeland your model tag.
Route B: free cloud models through My Claude Code
- Install Claude Code, then MCC with
npx @firedmosquito831/my-claude-codeornpm install -g @firedmosquito831/my-claude-code. Reopen your terminal. - Run
mcc-serverand openhttp://127.0.0.1:8082/admin. - On Providers, add your OpenRouter key, then Validate and Apply.
- On Model Config, pick a model whose ID ends in
:freefor each tier, and add a second one to each fallback chain. - Run
mcc-claudeand check/status. Watch the Analytics page to see how fast you use up the free allowance.
The MCC source is on GitHub, and the project page lists everything it supports.
What should you never do to get Claude Code for free?
- Share or borrow an account or a subscription. Plans belong to the person who bought them.
- Resell access, or run other people's requests through your credentials.
- Create many free accounts, or rotate keys across accounts, to get around a provider's limits.
- Use leaked or shared API keys.
- Route requests through a consumer subscription with a third-party tool. Anthropic's legal page says it does not permit third-party developers to route requests through Free, Pro or Max plan credentials on behalf of their users. The My Claude Code README marks its Claude subscription option with a caution for that reason.
Check the terms of every provider you use. When a free route stops working, the honest options are a cheaper model, a smaller task or paying for what you use.
Where Danube Labs fits
Danube Labs is a founder-led software, AI and automation studio in Bucharest. We built My Claude Code so that provider keys, routing and cost tracking for coding agents live in one place on your machine. The same measure-first approach, described in our post on cutting LLM costs by 99%, is how we pick models for client products. To compare a cheap model against an expensive one on your own data, see our AI systems service or book a free intro call.
Frequently asked questions
- Is Claude Code free?
- The program installs at no charge, but it needs a model. Anthropic's setup docs say Claude Code requires a Pro, Max, Team, Enterprise or Console account and that the free claude.ai plan does not include it. To use it free, you point it at a local model or a provider's free tier through the documented gateway variables.
- Can I use Claude Code without a subscription?
- Yes. You can use a Claude Console API key billed per token, or point ANTHROPIC_BASE_URL at a compatible server or gateway and set that server's credential. When a gateway credential variable is set, Claude Code uses it instead of a claude.ai login. You avoid a monthly plan, but you still pay per token unless the model is local or free.
- What is the best free alternative to Claude Code?
- It depends on your hardware. You can keep Claude Code and swap the model for a local one or a free tier, or point open-source agents such as OpenCode, Aider, Goose or Cline at the same gateway. My Claude Code lists all of them as supported clients. Run the same three real tasks on each option and keep the one that needs the fewest corrections.
- Are free OpenRouter models enough for Claude Code?
- They work for light use, but limits arrive fast. OpenRouter's limits page lists 20 requests per minute for free models, 50 per day if you have bought under $10 of credits and 1,000 per day above that. An agent sends many requests per task, so check the page for current numbers and expect to hit the cap.
- Can Claude Code run offline with a local model?
- The model can run on your machine, but Claude Code is not documented as an offline tool. Anthropic's system requirements list an internet connection as required, and Claude Code sends some background traffic. Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 turns off the nonessential part, including auto-updates. Check the network behaviour yourself if offline use matters.
- Can I share a Claude account to use Claude Code for free?
- No. Plans belong to the person who bought them, and sharing, reselling or rotating accounts to dodge limits breaks provider terms. Anthropic's legal page says it does not permit third-party developers to route requests through Free, Pro or Max plan credentials for their users. Use your own API key, a local model or a free tier in your own name.


