← Blog

How-to5 min read

Is Claude Code free? What it costs, and how to run it for free or for less

Claude Code is free to install, but running it on Claude needs a paid plan or an API key. The free and cheap options: local models with Ollama, or other providers.

Mirasim's agent and model picker, where a Claude Code session can run on a local or another provider's modelMirasim's agent and model picker, where a Claude Code session can run on a local or another provider's model

The short answer

Installing Claude Code costs nothing, but running it on Anthropic's models does: the free Claude plan doesn't include Claude Code, so you need Pro or a higher plan, or an API key billed per token. To spend nothing, run it on a model you host yourself with Ollama; to spend less, point it at a cheaper provider's model. Both work because Claude Code can talk to any Anthropic-compatible endpoint, but neither is Claude, so expect weaker results on hard tasks.

Claude plan prices from claude.com/pricing, November 27, 2026.
OptionWhat you payGood to know
Claude Pro or higherFrom $20 a monthClaude models, within the plan's 5-hour and weekly limits
Anthropic API keyPer tokenNo plan limit; the bill grows with use
Local model with OllamaNothing but your own hardwareNeeds a model with tool calling and a 64k+ context; slower and weaker than Claude on most machines
Ollama cloud modelsYour Ollama accountLarger models without downloading them; some hosted tools aren't fully supported
DeepSeek, Kimi or GLMTheir per-token pricesEach publishes an Anthropic-compatible endpoint for Claude Code

Run Claude Code on a local model with Ollama

Ollama serves local and cloud models through an Anthropic-compatible API, and has a launcher for Claude Code. Install Ollama, pull a model that supports tool calling, then start Claude Code through it:

From Ollama's Claude Code guide. qwen3.5 is their example; use any local model that supports tools.
# the launcher picks a model and starts Claude Code
ollama launch claude

# or set the endpoint yourself
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434
claude --model qwen3.5
  • For larger repositories, set the model's context length to 64k or more.
  • Settings in Claude Code's settings files override your shell variables. If it still talks to Anthropic, check the env block there, then run /status to see the connection.
  • For a script or CI, ollama launch claude --model <model> --yes -- -p "…" skips the pickers and passes the rest to Claude Code.

Pay less with another provider's model

DeepSeek, Moonshot (Kimi) and Z.ai (GLM) each publish an Anthropic-compatible endpoint and the environment variables to point Claude Code at it. You keep Claude Code's tools and workflow and pay their per-token prices. Set the variables in one shell to try it, since putting them in your settings changes Claude Code everywhere.

Any of these, per session, in Mirasim

Mirasim's free plan includes the whole local workspace, and sessions that run on your own accounts, API keys or local models use no Mirasim credit. Instead of editing environment variables, you choose the model for each session, so one Claude Code session can run on a local model while the next uses Claude.

  • Local models: Mirasim detects Ollama (and mlx-lm on macOS), can start the backend and pull models, and adds it as a model provider.
  • Other providers: add an endpoint and key in Settings › Models; any OpenAI-compatible endpoint works, including OpenRouter, and Mirasim translates between protocols so Claude Code can use it.
  • Then set the session's “Paying with” to “API key” and pick the model.
  • Or stay on Claude models on Mirasim credit, charged per use: Opus 5.5 50% off, Sonnet 5.5 50% off off the official API price.

Questions

Can I use Claude Code without a Claude subscription?
Yes. Sign in with an Anthropic API key and pay per token, or point it at another endpoint such as Ollama, DeepSeek, Kimi or GLM.
Does Claude Code work with Ollama?
Yes. Ollama provides an Anthropic-compatible API and ollama launch claude. Pick a model that supports tool calling; basic chat and file edits work with compatible models.
Do Claude-only features still work on another model?
Claude Code's own tools, such as reading and editing files and running commands, keep working with compatible models. Features that rely on Anthropic's service, such as Remote Control, need Claude Code talking to api.anthropic.com.

Sources

Checked on November 27, 2026 against claude.com/pricing, Anthropic's Claude Code documentation (code.claude.com/docs, Manage costs effectively) and Ollama's Claude Code guide (docs.ollama.com/integrations/claude-code). Check those pages for current plans and setup.

Keep reading