Heidelberg AICurriculum

How to Use Claude Code for FREE (2026)

Nick Saraev ·2026-05-02 ·2 min read

Summary written by us from the video's transcript. The video, and everything in it, is Nick Saraev's work.

Learn how to replace Claude Code’s paid backend with a free, open‑source proxy that routes requests to cheaper models like DeepSeek via OpenRouter, Nvidia NIM, or Ollama.

Takeaways

  • A local proxy lets Claude Code use cheaper models without changing its UI or commands.
  • OpenRouter’s DeepSeek‑v4‑Flash can build a functional app for only a few cents versus tens of dollars on Anthropic.
  • Configure the .env file with API keys and model identifiers for OpenRouter, Nvidia NIM, or Ollama.
  • Disable Claude Code fast mode when using models that don’t support it to avoid API errors.
  • Restarting the coding instance roughly every 50 k tokens helps preserve output quality.

Why use a free Claude Code proxy

Claude Code offers a powerful coding interface but costs $20–$200 per month and has strict rate limits. A free proxy lets you keep the same terminal UI while sending requests to cheaper models that achieve 80‑90% of Opus 4.7 quality for only 2‑5% of the cost.

The proxy works by intercepting Claude Code’s API calls and forwarding them to alternative providers, so you pay as little as $0.005 per million tokens instead of Anthropic’s $5 per million.

Setting up the free‑code repository

Clone the open‑source repo (free‑claude‑code by Ali Sherer) using the three quick‑start commands shown in the video; on macOS/Linux run them directly, on Windows use PowerShell equivalents.

After cloning you’ll have a directory with hidden configuration files (.env). Show hidden files with ⌘+Shift+Period on macOS or ‘ls -a’ in the terminal.

Configuring OpenRouter (simplest provider)

Create an API key at openrouter.ai, set an expiration to limit exposure, and copy it into the .env file’s OPENROUTER_API_KEY field.

In the same .env file specify a model, e.g., deepseek/deepseek‑v4‑flash, under the OPENROUTER_MODEL entry. Save the file and start the proxy (default localhost:8082).

Running Claude Code with the proxy

Launch Claude Code pointing it at the local proxy URL (e.g., http://localhost:8082/cloud). The interface behaves exactly like the original, showing thinking blocks and allowing multi‑line input.

A test prompt such as “Hello” demonstrates that DeepSeek‑v4‑Flash processes the request; logs show the raw JSON payload and token usage (≈30 k input tokens for the system prompt, 47 output tokens).

Switching to Nvidia NIM

Generate an API key on NVIDIA’s NIM platform, then paste it into the .env file under NVIDIA_API_KEY and set the model to nvidia_nim/z‑ai/glm‑4.7 (free at time of recording).

Restart the proxy and send a request; the response may be slower if Claude Code’s fast mode is enabled—disable fast mode for compatibility.

Using Ollama or other backends

If you have a local GPU, install Ollama and run a model locally; configure its endpoint in .env similarly to OpenRouter and Nvidia sections.

Because Ollama runs on your hardware, latency can be lower than cloud providers, but you must ensure the chosen model supports Claude Code’s request format.

Practical demo: building a habit‑tracker app

With DeepSeek‑v4‑Flash active, the speaker generated a simple habit‑tracker web app in a subdirectory, then opened it at nicksari.com/habittracker to verify functionality.

The demo highlighted token usage stats, occasional slower responses due to model architecture, and strategies like restarting the instance every ~50 k tokens to maintain quality.