From 148ced3324596fe781fa24eba6b1a8625ee43b4d Mon Sep 17 00:00:00 2001 From: whit3rabbit Date: Sat, 4 Apr 2026 13:39:16 -0500 Subject: [PATCH] docs: add Claude Code env vars for proxy mode Document ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY="", and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 alongside ANTHROPIC_BASE_URL so users know the full set of vars needed to run Claude Code against the proxy. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18bbe8b..cec1dbc 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,11 @@ Most users never leave simple mode. Start there. Point Claude Code at the proxy: ```bash -ANTHROPIC_BASE_URL=http://localhost:3000 claude +ANTHROPIC_BASE_URL=http://localhost:3000 \ +ANTHROPIC_AUTH_TOKEN=proxy-user \ +ANTHROPIC_API_KEY="" \ +CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \ +claude ``` ### Admin Web Interface (optional) @@ -234,6 +238,20 @@ The proxy listens on `0.0.0.0:3000`. The admin dashboard (opt-in via `--webui`) ## 1. Primary Use Case: Claude Code + Local LLMs +Claude Code works with any OpenAI-compatible backend (GPT-4o, DeepSeek, Azure, LM Studio, vLLM) by pointing it at anyllm-proxy. Use these environment variables when launching Claude Code: + +```bash +export ANTHROPIC_BASE_URL="http://localhost:3000" +export ANTHROPIC_AUTH_TOKEN="proxy-user" +export ANTHROPIC_API_KEY="" +# Prevents Claude Code from hitting Anthropic's cloud telemetry endpoints +export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1" + +claude +``` + +`ANTHROPIC_AUTH_TOKEN` is sent as the `Authorization: Bearer` header to the proxy. Set it to any non-empty string (or a real virtual key if you have auth enabled). `ANTHROPIC_API_KEY` must be explicitly cleared so Claude Code does not attempt direct Anthropic API calls. + ### Example: Running with Ollama (DeepSeek / Qwen) ```bash @@ -248,7 +266,11 @@ SMALL_MODEL=qwen2.5-coder:32b \ cargo run -p anyllm_proxy & # 3. Use Claude Code targeting the local proxy -ANTHROPIC_BASE_URL=http://localhost:3000 claude +export ANTHROPIC_BASE_URL="http://localhost:3000" +export ANTHROPIC_AUTH_TOKEN="proxy-user" +export ANTHROPIC_API_KEY="" +export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1" +claude ``` Use the same pattern for **LM Studio** (default port `1234`) or **vLLM** (default port `8000`) by substituting `OPENAI_BASE_URL`.