Use Claude Code for Free: 3 Routes That Work

Three ways to use Claude Code for free, checked October 29, 2026: a guest pass for real Claude, a local Ollama model with no cap, and OpenRouter's free models. Setup commands for each, the two settings that quietly bill you, and the routes that look free but are not.

Sophia Carter

Sophia Carter

3 November 2026

Use Claude Code for Free: 3 Routes That Work

To use Claude Code for free, you have three working routes as of October 29, 2026: a seven-day guest pass from a Max subscriber, a local model served by Ollama, or a free model on OpenRouter. Only the guest pass gives you Claude itself. The other two keep Claude Code’s tools and swap the model underneath.

Claude Code is Anthropic’s coding agent: it reads your repository, edits files and runs commands from the terminal. The app installs at no cost. The model behind it is what you pay for, and that is where every free route has to make a trade.

If you only want the yes-or-no answer on Anthropic’s plans, read Is Claude Code free? instead. This page is the how-to: setup steps for each route that works, and the ones that look free but are not.

Every $0 route, checked today

Each row below was checked against the provider’s own page on October 29, 2026.

Diagram: Claude Code's ANTHROPIC_BASE_URL and auth token route requests to Anthropic on a guest pass, a local Ollama model, or OpenRouter free models
Route Cost Model you get Catch
Guest pass $0 for 7 days Claude (Pro plan) Invite from a Max subscriber, card on file, converts to paid
Local model through Ollama $0 Open model on your own hardware Quality and speed depend on your GPU and RAM
OpenRouter free models $0 Models whose ID ends in :free Account, API key and a daily request cap
Claude Free plan Does not work None Claude Code is not included
Ollama cloud models Not free Hosted open models Billed per token

What does not work

Three routes look free and are not. Rule them out first and you skip an afternoon of login errors.

Infographic: the Claude Free plan, Ollama cloud models and Max API credits do not give free Claude Code, and two settings that trigger billing

The Claude Free plan. Anthropic’s setup docs say: “Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access.” The pricing page agrees: Claude Code reads “No” in the Free column, and the FAQ says “Claude Code is included in all paid plans.” Pro costs $17 per month billed yearly or $20 monthly.

Ollama’s cloud models. Ollama’s pricing page lists its $0 tier as “Pay as you go: Pay per token for every cloud model.” Running models locally stays free. Any model name ending in :cloud bills your Ollama account.

Max plan API credits. Max includes monthly API credits, but Anthropic’s Pro and Max help article says they “can’t be used in Claude Code or the Claude apps.” New Console accounts get no sign-up grant either: the Console help article tells you to “enter your payment details and fund your account.”

Route 1: a guest pass (the only free Claude)

A guest pass is the one way to run Claude Code on Claude models without paying. According to Anthropic’s guest pass article, “Guest passes are currently available to eligible Max subscribers only,” and each one gives “Seven days of free access to Claude’s Pro plan, which includes Claude Code.”

How to use one:

  1. Ask a friend or colleague on Max to send you a pass.
  2. Accept it with an account that has never held a Claude subscription. Recipients “must be new to Claude paid subscriptions.”
  3. Enter a payment method. You are not charged during the seven days.
  4. Install Claude Code and log in with that account.
  5. Set a reminder for day six. The trial “will automatically convert to a paid Pro plan” unless you cancel.

Seven days of Pro is enough to judge whether Claude Code fits your workflow. Pro limits still apply: a five-hour session window plus a weekly cap, shared with chat. Our guide to Claude Code usage limits covers how to stretch them.

Route 2: Claude Code on a local model with Ollama

This is the only route that stays at $0 with no time limit and no daily cap. Claude Code sends its requests to whatever server ANTHROPIC_BASE_URL names, and Ollama serves an Anthropic-compatible API on your own computer.

How do you set up Claude Code with Ollama?

Ollama’s Claude Code guide lists a one-line launcher and a manual setup. The manual version shows what changes:

# 1. Install Claude Code (macOS / Linux)
curl -fsSL https://claude.ai/install.sh | bash

# 2. Pull a local model with Ollama installed and running
ollama pull qwen3.5

# 3. Point Claude Code at Ollama instead of Anthropic
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434

# 4. Start a session on the local model
claude --model qwen3.5

The shortcut is ollama launch claude, which sets the same variables for you.

What to expect from a local model

Ollama’s docs ask for “a 64k+ context window” for local models, because an agent loop sends a lot of file content per turn. They also warn that “Hosted WebSearch and advanced tool controls are not fully supported.” Expect slower turns and more retries than on Claude, and keep tasks small: one function, one test file, one bug.

Watch the model name. qwen3.5 runs on your hardware. kimi-k2.7-code:cloud from the same docs runs on Ollama’s servers and bills per token.

Route 3: OpenRouter’s free models

OpenRouter is a model gateway that speaks Anthropic’s API format. Its public model list returned 16 models with IDs ending in :free on October 29, 2026, and 15 of them list tool calling, which Claude Code needs. Examples include cohere/north-mini-code:free, poolside/laguna-s-2.1:free and google/gemma-4-31b-it:free.

How do you connect Claude Code to OpenRouter for free?

OpenRouter’s Claude Code guide sets four variables. The guide’s own model defaults point at paid Anthropic models, so you also override the model variables with a free ID:

export OPENROUTER_API_KEY="sk-or-..."
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY=""   # must be explicitly empty

# Route every role to a free model, or you pay for Claude through OpenRouter
export ANTHROPIC_DEFAULT_OPUS_MODEL="cohere/north-mini-code:free"
export ANTHROPIC_DEFAULT_SONNET_MODEL="cohere/north-mini-code:free"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="cohere/north-mini-code:free"
export CLAUDE_CODE_SUBAGENT_MODEL="cohere/north-mini-code:free"

claude

If you ever logged in with a Claude account, run /logout once inside Claude Code. Then run /status and confirm the auth line names ANTHROPIC_AUTH_TOKEN and the base URL is OpenRouter’s.

Limits on the free tier

Free models carry a requests-per-minute and requests-per-day cap. Per OpenRouter’s limits docs, the daily ceiling rises once you have bought credits, and a negative balance can block free models too. Check your real counter with the free_model_daily_requests field on GET /api/v1/key. OpenRouter also states that “Claude Code is optimized for Anthropic models and may not work correctly with other providers.” Free models change often, so re-check the list before you commit to one.

Two traps that cost money

These two settings turn a “free” session into a billed one without any warning on screen.

  • A base URL alone keeps your old login. Anthropic’s LLM gateway docs say that setting only ANTHROPIC_BASE_URL, “without a gateway credential, doesn’t replace the subscription.” Your saved claude.ai login stays active, with its limits and billing. Always set ANTHROPIC_AUTH_TOKEN too.
  • A stray API key takes over. If ANTHROPIC_API_KEY holds a real key, Anthropic’s help article warns that Claude Code uses it “instead of your Claude subscription,” which means per-token charges. Every route above sets it to an empty string on purpose.

Which free route should you pick?

You want Pick
To try Claude Code with Claude before paying Guest pass
$0 forever, and you have a strong GPU Local model via Ollama
$0 without local hardware, light daily use OpenRouter free model
A free coding agent, Claude Code or not OpenCode on a free model

If the goal is a free agent rather than Claude Code specifically, OpenCode ships with free models and needs no account. Our OpenCode free models test covers what each one does with your code and where the limits sit. For keys you can call from your own scripts, see free AI API keys. Apidog’s Claude Code free guide takes another angle on the same question.

Running free Claude Code sessions as a team

Free routes get messy once more than one person uses them. One teammate is on a guest pass that ends Friday, another is on a laptop with Ollama, a third burns the OpenRouter cap by noon. Nobody can see which agent worked on what.

Sharkly is a work board for coding agents. You connect a Computer, Sharkly detects the Claude Code runtime on it, and you assign tasks to that Agent the way you would to a person. Per the Agents docs, each Agent can carry its own plain and secret environment variables. That means one Agent can run Claude Code against a local Ollama model and another against your paid plan, both on the same board.

Sharkly does not change what the model costs. Per the pricing page, “Sharkly does not sell tokens,” the Free plan covers organizations of up to 5 people, and Agents and Computers do not take seats. Sharkly pricing explained has the details.

Conclusion

You can use Claude Code for free today, with a clear trade on each route. The guest pass gives you real Claude for seven days. Ollama gives you unlimited sessions on a local model, at the speed of your own hardware. OpenRouter gives you hosted free models under a daily cap. The Claude Free plan, Ollama cloud models and Max API credits do not get you there.

Pick the route that matches your hardware and your patience. Then connect your first Computer to Sharkly so every Claude Code session, free or paid, lands on one board.

FAQ

Can I use Claude Code for free? Yes, through three routes: a seven-day guest pass from a Max subscriber, a local model served by Ollama, or a :free model on OpenRouter. Only the guest pass runs Claude models.

Does the Claude Free plan include Claude Code? No. Anthropic’s docs state that “the free claude.ai plan does not include Claude Code access.” Pro, at $17 per month billed yearly or $20 monthly, is the cheapest plan that does.

Is Claude Code with Ollama free? Local models are free and unlimited. Models with a :cloud suffix run on Ollama’s servers and bill per token, per Ollama’s pricing page.

Are OpenRouter’s free models free in Claude Code? Yes, within a per-minute and per-day request cap. Override the ANTHROPIC_DEFAULT_*_MODEL variables with a :free ID, or Claude Code requests paid Anthropic models through your OpenRouter credits.

Is there a Claude Code free trial? Only the guest pass. It needs an invite from an eligible Max subscriber, an account with no prior Claude subscription and a payment method. It converts to Pro after seven days unless you cancel.

Why does Claude Code still use my subscription after I set ANTHROPIC_BASE_URL? Because a base URL alone does not replace your saved login. Set ANTHROPIC_AUTH_TOKEN and an empty ANTHROPIC_API_KEY, or run /logout once.

Explore more

Gemini 4 Hydrogen for Coding Agents: The Fast Model Your Team's Agents Can Run All Day

Gemini 4 Hydrogen for Coding Agents: The Fast Model Your Team's Agents Can Run All Day

Gemini 4 Hydrogen for coding agents: $1.50/$7.50 per 1M tokens, a free tier, four thinking levels. Which Tasks to give it, when to escalate to Carbon.

13 November 2026

Gemini 4 Carbon and Hydrogen: Pair a Planner Agent With Fast Workers

Gemini 4 Carbon and Hydrogen: Pair a Planner Agent With Fast Workers

Pair Gemini 4 Carbon and Hydrogen across your agent team: a Carbon planner writes sub-tasks, Hydrogen workers and a verifier build and test, and blocked work goes back to the planner.

13 November 2026

How to Route AI Agent Tasks with the Gemini Decisions API

How to Route AI Agent Tasks with the Gemini Decisions API

Route AI agent tasks with the Gemini Decisions API: one call asks which Agent, how hard, and whether a person must decide, then a confidence threshold picks auto-assign or human review.

12 November 2026

Use Claude Code for Free: 3 Routes That Work