This guide walks you through routing Claude Code to NVIDIA NIM using a local proxy server.
Before starting, ensure you have uv installed on your system to manage Python tools.
- Visit the NVIDIA API Keys settings page.
- Generate a new API key and save it securely. You will need this to authenticate with the NIM models.
Install the proxy tool using uv and launch the server.
# Install the free-claude-code proxy
uv tool install --force git+https://github.com/Alishahryar1/free-claude-code.git
# Launch the proxy server
fcc-server
Note: Keep this terminal window open. The server runs on port
8082. You can access the admin panel at http://127.0.0.1:8082/admin.
Open a new terminal window. You must set these environment variables to intercept Claude Code traffic and route it to your local server.
# Set the dummy authentication token
export ANTHROPIC_AUTH_TOKEN="freecc"
# Redirect the base URL to your local proxy
export ANTHROPIC_BASE_URL="http://localhost:8082"
See the comment below on how you can add this to your .bashrc as a custom function
In the same terminal where you just configured the environment variables, launch Claude Code.
# Start Claude Code
claude
Once inside the Claude Code interface, verify that the routing is working properly by running the status command:
/status
Ram N
Fix for Python 3.14 segfault / compatibility on macOS (Python 3.13)
uv python install 3.14currently installs 3.14.0a6 (alpha), which segfaults onfcc-server. Python 3.14 final isn't available throughuvyet. Here's how to get it working on Python 3.13:1. Clone the repo locally
git clone https://github.com/Alishahryar1/free-claude-code.git cd free-claude-code2. Relax the Python version requirement
In
pyproject.toml, change:to:
3. Fix Python 3.14-only
exceptsyntax (8 occurrences)Python 3.14 allows
except X, Y:but 3.13 requiresexcept (X, Y):. Fix these files:providers/openai_compat.py:459messaging/platforms/discord.py:404, 477core/anthropic/tokens.py:103messaging/rendering/telegram_markdown.py:179, 186messaging/rendering/discord_markdown.py:171, 178e.g.
except asyncio.CancelledError, GeneratorExit:→except (asyncio.CancelledError, GeneratorExit):4. Add
from __future__ import annotationsto all source filesPython 3.14 has deferred annotation evaluation by default (PEP 649). Without it on 3.13, you get
NameErrorfor forward references like-> Settingsinside theSettingsclass, andClassVar[GlobalRateLimiter | None]insideGlobalRateLimiter.Run this to patch all source files:
5. Install with Python 3.13
6. Configure your
.envCreate a
.envin your working directory:7. Important: export
.envbefore starting the serverPydantic-settings doesn't load
validation_aliasfields (MODEL_OPUS, MODEL_SONNET, MODEL_HAIKU) from.envfiles — only from actual environment variables. You must export them:Without
set -a && source .env && set +a, only theMODEL(default/fallback) will be loaded; the per-model overrides (Opus, Sonnet, Haiku) will be ignored.8. Optional: clean up the model list in Claude Code's
/modelpickerBy default the proxy lists ALL ~97 NIM models. To show only your configured models, edit
api/routes.pyand remove the block at ~lines 145-152 that callsprovider_registry.cached_prefixed_model_infos(). After the patch, only your MODEL/MODEL_OPUS/MODEL_SONNET/MODEL_HAIKU + Claude aliases will appear.To add extra models (e.g. Kimi, GLM) without listing all 97, add
import osat the top ofapi/routes.pyand insert this after the configured models loop:Then in your
.env:Reinstall after patching:
uv tool install --force --reinstall --python 3.13 /path/to/free-claude-codeTested on macOS ARM (Apple Silicon), Python 3.13.11, uv, May 2026.