Free Claude Code

Reroute Claude Code API calls to free or local LLMs, enabling use of the CLI and VSCode extension without a paid Anthropic API key.

Reroute Claude Code API calls to free or local LLMs, enabling use of the CLI and VSCode extension without a paid Anthropic API key.

The gist

Free Claude Code is an open-source proxy server that solves the problem of needing a paid Anthropic API key to use the Claude Code CLI and VSCode extension. The tool intercepts API requests intended for Anthropic and reroutes them to alternative providers, including free services like NVIDIA NIM or fully local models running via Ollama or LM Studio, allowing developers to code with powerful AI assistants at zero cost.

What it does

  • Reroute Claude Code API calls to providers like NVIDIA NIM, OpenRouter, DeepSeek, and local Ollama instances.
  • Serve as a drop-in replacement by setting two environment variables, with no modifications to the client tools needed.
  • Map Opus, Sonnet, and Haiku requests to different backend models or providers.
  • Intercept and respond to trivial API calls locally to save quota and reduce latency.
  • Control the coding agent remotely via an integrated Discord or Telegram bot.
  • Transcribe voice notes sent via messaging apps into text prompts for the agent.

How it works

Users clone the Git repository, configure an .env file with an API key for a provider like NVIDIA NIM or a URL for a local model, and run the proxy server locally. By pointing two environment variables (ANTHROPICBASEURL and ANTHROPICAUTHTOKEN) at the local server, all requests from the Claude Code CLI or VSCode extension are automatically redirected to the configured backend. The tool is free and open-source.

Best for

Developers who use the Claude Code CLI or VSCode extension and want to avoid Anthropic API costs by leveraging free model tiers or self-hosting LLMs locally for privacy and offline use.

Watch out for

Setup requires familiarity with the command line, Python environments, and configuring environment variables. It is not a one-click install and is intended for a technical audience.