Published: 2026-08-21
Summary

Running Claude Code on Free OpenRouter Models: Setup, Limits, the 6-Hour Catch

Chapters / key moments (click to jump — plays here on the page)

Nate Herk runs Claude Code on OpenRouter's free models by editing one env block in his Claude Code settings file — swapping the Anthropic auth token for an OpenRouter key and every model slot for a free model slug. The harness behaves normally: it reads CLAUDE.md, invokes skills, uses web search and fetch, and spawns sub-agents. The catch is speed. Two jobs he'd expect to finish in 20–30 minutes each took roughly six hours, and he ran into repeated upstream timeouts along the way. His honest framing: this is a credible fallback for knowledge work when you're out of credits, not a replacement for a frontier model on deep technical builds.

Source video

"This Stealth Model Makes Claude Code Free. Here's How." by Nate HerkWatch on YouTube →

Key Takeaways

  • The desktop app can't do this. Claude Code's desktop app overrides these settings and forces a Claude model — by design, in Herk's read. You need the CLI in a terminal, or the Claude Code extension inside an editor like VS Code.
  • The whole change is one env block in your settings file. Set the Anthropic auth token to your OpenRouter API key, then set the model to an OpenRouter model slug.
  • Replace the model in every slot, not just the main one. This is the step people miss. If a session spawns a sub-agent and only the primary slot was changed, that sub-agent comes up on the old model — so the run silently stops being free. Herk swaps every instance.
  • Free model slugs rotate, so copy the slug from the model's page. OpenRouter regularly changes which models are free; the one Herk uses may already be gone or paid by the time you try. Filter the model list for free options and copy the exact slug rather than typing it from a video.
  • There's a stable fallback: OpenRouter's free-models router. Instead of naming a specific free model, point the slots at the free-models router and each request routes to whichever free model is currently available. This is the version that doesn't break next month.
  • The harness features survive the model swap. In a project with no relevant CLAUDE.md, the agent still dug through sibling projects, found existing scripts and API keys, and used them to pull YouTube analytics. Elsewhere it correctly located and invoked a custom skill, used web fetch and search, and even wrote itself a cron job to retry a blocked task.
  • Speed is the real cost. A landing-page build and a YouTube analytics report each took about six hours; a skill-database task that normally runs in five minutes ran 44 minutes and then gave up as blocked. Herk is direct that this would have been far faster on a frontier model.
  • The money side genuinely is near-zero. He reports about 61.6 million tokens in a single day of testing for roughly 13 cents total.
  • Know what you're sending. The "stealth" model he uses is an anonymous provider of undisclosed origin. Herk flags this himself: don't put sensitive data through a model whose operator you can't identify.
  • Match the model to the task. His conclusion is that free and small models handle everyday knowledge work acceptably, and fall down on deep technical builds or on orchestrating many dynamic sub-agents — which is exactly where a frontier model earns its price.

Commands & Code Mentioned

# In your Claude Code settings file, inside the "env" block:
#   - set the Anthropic auth token to your OpenRouter API key
#   - set every model slot to an OpenRouter model slug

ANTHROPIC_AUTH_TOKEN     # <- your OpenRouter API key, not an Anthropic key

# Model slugs are copied from the model's page on openrouter.ai.
# Slugs rotate — copy the current one rather than retyping from a video.
# For a setup that survives rotation, use OpenRouter's free-models router,
# which selects an available free model per request.

/goal                    # the slash command Herk uses to kick off each task

Herk puts his exact env block in the video description rather than dictating it on screen, so the key names above are the ones actually named in the video. Confirm the current variable names against Claude Code's own settings documentation before relying on them.

Errors Hit During Testing

Error: upstream idle timeout exceeded

Why it happens: Herk traced it to the agent attempting too much in one pass — writing and reading across a large scope. He notes free endpoints are also shared, so heavy concurrent demand contributes.

Fix: Instruct the agent to work in smaller chunks. After he did, the same job continued and completed. The error recurred on other tasks and was not always recoverable — one run ended blocked after 44 minutes.

Weekly Digest — In Your Inbox

Get the week's top AI agent news, updates, and guides — every Friday.