# 🔑 Claude Code for $0 — and the "AUTH Error" That Was Never the API Key

**URL:** <https://onehack.st/t/claude-code-for-0-and-the-auth-error-that-was-never-the-api-key/324166>\
**Category:** Tutorials & Methods\
**Tags:** programming, tips-tricks, ai\
**Created:** [July 26, 2026, 6:33pm UTC](https://onehack.st/t/claude-code-for-0-and-the-auth-error-that-was-never-the-api-key/324166 "2026-07-26T18:33:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BCBC](https://onehack.st/user_avatar/onehack.st/bcbc/32/179825_2.png) [@BCBC](https://onehack.st/u/BCBC)\
**Post date:** [July 26, 2026, 6:33pm UTC](https://onehack.st/t/claude-code-for-0-and-the-auth-error-that-was-never-the-api-key/324166/1 "2026-07-26T18:33:27Z")

</div>

🔑 **That `AUTH Error` is lying.** Your API key is almost never the problem — the session is stale, or your model can’t do the job. Two curls tell you which.

🧩 **Free Claude Code** = a middleman app on your PC. Claude Code phones Anthropic; this answers the call itself and asks **NVIDIA’s free models** instead. Same terminal, $0 instead of $240/year.

⚠ Straight up: this does **not** hand you Claude. You keep the Claude Code tool — the thinking comes from someone else’s model.

> **🧠 What this actually is, in 30 seconds — no background needed**
>
> **Claude Code** is Anthropic’s coding assistant that lives in your terminal — it reads your files, writes code, runs commands, fixes its own mistakes. It normally costs **$20/month** (Pro) up to **$200/month** (Max).
> 
> **[Free Claude Code](https://github.com/Alishahryar1/free-claude-code)** (FCC) is a small program you run on your own machine. Claude Code sends every request to Anthropic’s servers — FCC quietly stands in the middle, catches those requests, and forwards them to a **different AI company** that has a free tier. Claude Code never notices the swap.
> 
> ├─ ✅ You keep: the terminal, the file editing, the agent behaviour, `/commands`, everything  
> ├─ 🔄 You swap: the brain — NVIDIA, DeepSeek, Gemini, Groq, Kimi, MiniMax, Z.ai, or a model on your own PC (Ollama / LM Studio / llama.cpp). **28 providers** , switch anytime  
> └─ ❌ You don’t get: actual Claude models. Nobody gives those away
> 
> ⭐ MIT licensed · **42,000+ stars** · shipping updates the same week. It also launches **Codex** and **Pi** the same way (`fcc-codex`, `fcc-pi`).

> **⚡ The fix — changing the model mid-session does nothing**
>
> A **live** Claude session stays glued to whatever model it booted with. Pick a new one from the menu and it keeps hammering the old, dead one — throwing errors that _look_ like auth failures.
> 
> ```bash
> # 1. exit Claude completely (not a new tab — fully out)
> # 2. restart the proxy
> fcc-server restart
> # 3. brand-new session
> fcc-claude
> 
> ```
> 
> First message to prove it’s alive:
> 
> ```plaintext
> Reply with exactly: FCC is working
> 
> ```
> 
> 🔓 **Second cause, same symptom — and it’s FCC’s most-reported bug.** If you ever logged into `claude.ai` from the terminal, that saved login **outranks** your proxy token. You get:
> 
> ```plaintext
> Auth conflict: Both a token (ANTHROPIC_AUTH_TOKEN) and an API key (/login managed key) are set.
> API Error: 401 {"detail":"Invalid API key"}
> 
> ```
> 
> Your key is fine. One command clears it:
> 
> ```bash
> claude /logout
> 
> ```
> 
> …then relaunch with `fcc-claude`. 🩹 Also check `cat ~/.claude/settings.json | jq .env` — a value saved in that file **silently beats** anything you export in your shell.

> **🩺 Two curls that split the blame in 10 seconds — key vs proxy**
>
> **① Is my NVIDIA key good?**
> 
> ```bash
> curl -s -o /dev/null -w "%{http_code}\n" \
> -H "Authorization: Bearer $NVIDIA_API_KEY" \
> https://integrate.api.nvidia.com/v1/models
> 
> ```
> 
> `200` → key is fine, account is fine. **Stop making new keys.** · `401` → no key sent · `403` → key rejected _or_ that model isn’t granted to you — 403 alone can’t tell you which.
> 
> **② Is the proxy actually answering?**
> 
> ```bash
> curl -X POST "http://localhost:8082/v1/messages" \
> -H "Authorization: Bearer freecc" -H "anthropic-version: 2023-06-01" \
> -H "content-type: application/json" \
> -d '{"model":"claude-sonnet-4-6","max_tokens":1,"messages":[{"role":"user","content":"."}]}'
> 
> ```
> 
> Anything starting `{"id":"msg_` → working. Even an **unknown-model error counts as a pass** — it authenticated you before rejecting the name.
> 
> 🎯 Both curls green but Claude Code still 401s? Then it’s the stale session above, 100%. ⚠ `ANTHROPIC_BASE_URL` must be the **root** — `http://localhost:8082`, no `/v1`. Claude Code adds that itself.

> **🧨 The model trap — anything named "coder" quietly breaks it**
>
> Claude Code needs **tool calling** — the model’s ability to actually run commands and edit files, not just talk about them. Without it you get the worst kind of failure: **no error at all.** Claude describes what it’s about to do, prints tool JSON as plain text, and never touches a single file.
> 
> ☠ **Trap:** models with `coder`, `codellama`, `starcoder`, `codestral` or `granite-code` in the name are mostly 2023-era builds from before tool calling existed. They’re the obvious-looking pick in the catalog and they’re the wrong one — `deepseek-coder-6.7b-instruct` is exactly this.
> 
> ✅ **Picks that work:**  
> ├─ `nvidia/nemotron-3-super-120b-a12b` — FCC’s default, tool calling confirmed _(120B total brain, 12B used per answer — fast for its size)_  
> ├─ `minimaxai/minimax-m2.7` — the one with a confirmed working Claude-Code-on-NIM report; switch to it the moment tools stop firing  
> └─ 📋 Full live list: [integrate.api.nvidia.com/v1/models](https://integrate.api.nvidia.com/v1/models) — 118 models, no key needed to look
> 
> 🔬 That list carries **zero** capability info — presence proves nothing. Smoke-test any model before you trust it. Context limits: NVIDIA’s docs claim up to 1M, sibling models measured ~131K — test your own ceiling.

> **🚀 Full setup from zero — install, run, Linux needs two terminals**
>
> ```bash
> curl -fsSL "https://raw.githubusercontent.com/Alishahryar1/free-claude-code/main/scripts/install.sh" | sh
> 
> ```
> 
> Same command **updates** it later. Add `--dry-run` first to see what it does without doing it.
> 
> 📦 It also installs **Claude Code** and **Codex** , and offers **Pi** — not a single-package install. It pulls its own Python 3.14 through `uv`; on Ubuntu that’s expected, not a bug. It refuses to run while any `fcc-*` process is alive.
> 
> ```bash
> fcc-server # terminal 1 — leave it open, this IS the proxy
> fcc-claude # terminal 2 — your Claude Code session
> 
> ```
> 
> 🖥 **No tray icon on Linux** — that’s Windows/macOS only, so two terminals is normal, not a broken install.  
> ⚙ Paste your NVIDIA key into the admin panel: **[http://127.0.0.1:8082/admin](http://127.0.0.1:8082/admin)** (your PC only, nobody else can reach it).  
> 🔑 Get the key free at **[build.nvidia.com](https://build.nvidia.com)**.
> 
> Real commands are `fcc-server` `fcc-claude` `fcc-codex` `fcc-pi`. _(`fcc-init` and `free-claude-code` aren’t commands — you’ll get command-not-found.)_

> **⚠️ Read before you start — phone gate, blocked countries, rate limit, terms**
>
> ├─ 📱 **No credit card — but a phone number is mandatory.** NVIDIA sends an SMS code before it’ll issue a key.  
> ├─ 🚫 **Country blocks on that SMS step:** TR, IR, SY, CU, KP, RU, BY. If you’re in one, you hit a wall at the key step — use a different provider in FCC instead (OpenRouter, Gemini, Groq, Cerebras all have free tiers).  
> ├─ 🐢 **~40 requests per minute** is the real free-tier ceiling. No official way to raise it. Old “1,000 credits” numbers floating around are years stale.  
> ├─ 📖 **Terms:** NVIDIA keeps what you send _and_ what comes back to improve their models, and the free API is for testing and evaluation — not production. So: personal projects, learning, messing around ✅ · client code, anything under NDA ❌  
> └─ 🧯 Never overwrite `~/.claude.json` with a fresh file — merge into it, or you wipe your whole Claude Code config.

> **💡 Five moments this actually saves you**
>
> ├─ 💸 You want to try an agent that edits your own files, but $20/month to find out if you even like it is a hard no.  
> ├─ 🌙 You hit your plan’s limit at 11pm mid-task — flip to `fcc-claude` and keep going on the free backend instead of stopping.  
> ├─ 🔁 You’re on your 4th regenerated API key at 2am. All four were valid. The curl would have said so in ten seconds.  
> ├─ 🤖 Claude confidently explains the fix, “writes” the file… and nothing changes on disk. That’s the tool-calling trap, not you doing it wrong.  
> └─ 🏠 You’ve got a decent GPU sitting idle — same tool, pointed at Ollama or LM Studio, fully offline, no key at all.

Fast version: **curl the key → 200 → `claude /logout` → quit → `fcc-server restart` → new session.** And if tools never fire, it’s the model, not you.

_A key that answers `200` has nothing left to confess — everything after that is the client’s fault, not your account’s._
