# Trying to Run Free Claude Code Proxy on Windows: Facing HTTP 200 Empty Response and 422 API Errors

**URL:** <https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [July 10, 2026, 2:13pm UTC](https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768 "2026-07-10T14:13:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BooleanMonk](https://onehack.st/user_avatar/onehack.st/booleanmonk/32/169428_2.png) [@BooleanMonk](https://onehack.st/u/BooleanMonk)\
**Post date:** [July 10, 2026, 2:13pm UTC](https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768/1 "2026-07-10T14:13:33Z")

</div>

Hi 1HACKERS,

I am trying to set up a free Claude Code environment using the open-source **free-claude-code** project, but I am currently stuck with API response errors. I am sharing my complete setup details and troubleshooting steps here in the hope that someone can point me in the right direction.

## Goal

My goal is to use Claude Code CLI with a free/low-cost backend provider by routing Anthropic API requests through the free-claude-code proxy.

The project description mentions support for:

- NVIDIA NIM

- OpenRouter

- LM Studio

- Multiple model routing (Opus / Sonnet / Haiku mapping)

- Claude Code CLI compatibility

## Environment

Operating System:

- Windows 11

- PowerShell

Installed versions:

```auto
Claude Code:
2.1.205

```

Project directory:

```auto
C:\Users\SARASWATHI\free-claude-code

```

## Repository Used

Initially, I looked at:

```auto
Rishurajgautam24/free-claude-code

```

However, the README structure I was following appeared to match another fork:

```auto
Alishahryar1/free-claude-code

```

The version I finally downloaded uses a newer `src` based Python structure:

```auto
free-claude-code
│
├── src
│ └── free_claude_code
│ ├── api
│ ├── cli
│ ├── config
│ ├── core
│ ├── messaging
│ └── providers
│
├── pyproject.toml
├── uv.lock
└── README.md

```

Because of this, the older command:

```auto
uv run uvicorn server:app --host 0.0.0.0 --port 8082

```

did not work because there is no `server.py` file in this version.

The correct startup command appears to be:

```auto
uv run fcc-server --host 127.0.0.1 --port 8082

```

## Installation Steps Followed

Installed dependencies:

```auto
uv sync

```

Started the server successfully:

```auto
uv run fcc-server --host 127.0.0.1 --port 8082

```

Server output:

```auto
INFO: Started server process [9176]
INFO: Waiting for application startup.
INFO: Admin UI: http://127.0.0.1:8082/admin
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8082

```

The admin panel also loads successfully:

```auto
http://127.0.0.1:8082/admin

```

## Claude Code Configuration

I configured Claude Code using:

```auto
$env:ANTHROPIC_AUTH_TOKEN="freecc"

$env:ANTHROPIC_BASE_URL="http://127.0.0.1:8082"

claude

```

The proxy receives requests:

```auto
POST /v1/messages?beta=true HTTP/1.1" 200 OK

```

However, Claude Code fails with:

```auto
API Error: API returned an empty or malformed response (HTTP 200)
— check for a proxy or gateway intercepting the request

```

## Earlier Error Encountered

Before changing the repository and configuration, I also received:

```auto
API Error: 422

{
 "detail": [
   {
    "type": "literal_error",
    "loc": [
       "body",
       "messages",
       1,
       "role"
    ],
    "msg": "Input should be 'user' or 'assistant'",
    "input": "system"
   }
 ]
}

```

This appeared to be a provider/model compatibility issue.

## Configuration Tested

I tested with OpenRouter:

```auto
MODEL="open_router/qwen/qwen3-coder:free"

MODEL_OPUS="open_router/qwen/qwen3-coder:free"

MODEL_SONNET="open_router/qwen/qwen3-coder:free"

MODEL_HAIKU="open_router/qwen/qwen3-coder:free"

```

The API key loads correctly:

Test:

```auto
uv run python -c "import os; from dotenv import load_dotenv; load_dotenv(); print('Key loaded:', bool(os.getenv('OPENROUTER_API_KEY')))"

```

Output:

```auto
Key loaded: True

```

## Current Situation

At this point:

✅ Repository cloned successfully  
✅ Dependencies installed  
✅ Proxy server starts  
✅ Admin UI works  
✅ Claude Code connects to proxy  
✅ Requests reach `/v1/messages`  
❌ Provider response is empty/malformed  
❌ Claude Code cannot complete a request

## Questions

I would appreciate help from anyone familiar with this project:

1. Is the `src/free_claude_code` version compatible with the latest Claude Code CLI `2.1.205`?

2. Is there a recommended model/provider combination that works reliably?

3. Does the OpenRouter adapter currently support Claude Code streaming responses correctly?

4. Should I use NVIDIA NIM instead of OpenRouter for better compatibility?

5. Is there any required environment variable missing for response streaming?

Any suggestions, logs to collect, or configuration examples would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Emanuel\_Branson](https://onehack.st/user_avatar/onehack.st/emanuel_branson/32/178452_2.png) [@Emanuel\_Branson](https://onehack.st/u/Emanuel_Branson)\
**Post date:** [July 10, 2026, 8:59pm UTC](https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768/2 "2026-07-10T20:59:48Z")

</div>

# 🔥🛠 FREE-CLAUDE-CODE PROXY — FIXING “EMPTY OR MALFORMED RESPONSE” ERRORS 💻⚡

* * *

> 🎯 **Stuck with `HTTP 200` but empty responses from your free-claude-code proxy? This exact issue is documented in the project’s own GitHub repo with a known fix. Here’s the diagnosis, the fix, and direct answers to all 5 of your questions.** 👇

* * *

## 🧠 THE ROOT CAUSE — CLI VERSION MISMATCH

```auto
YOUR EXACT ERROR IS A KNOWN, DOCUMENTED ISSUE:
──────────────────────────────────────────────
GitHub Issue #137 AND #497 on Alishahryar1/free-claude-code
both report the IDENTICAL error you're seeing:

  "API Error: API returned an empty or malformed 
   response (HTTP 200) — check for a proxy or 
   gateway intercepting the request"

THE CONFIRMED FIX (from Issue #497):
  → Downgrade Claude Code CLI to version 2.1.142
  → Set DISABLE_AUTOUPDATER=1 globally to stop
    Claude Code from auto-updating back to a
    newer, incompatible version

FIX COMMAND:
  npm install -g @anthropic-ai/claude-code@2.1.142

  Then set (PowerShell):
  $env:DISABLE_AUTOUPDATER="1"

```

**Your CLI version 2.1.205 is newer than the version the proxy was tested against — this is almost certainly your primary problem, matching the documented GitHub issue exactly.**

* * *

## 📋 DIRECT ANSWERS TO YOUR 5 QUESTIONS

* * *

### ❓ Q1 — Is the src/free\_claude\_code version compatible with CLI 2.1.205?

```auto
ANSWER: Not fully confirmed compatible.

  → The project's dev.to writeup and official
    README reference installation via:
    uv tool install --force git+https://github.com/
    Alishahryar1/free-claude-code.git
  → Then launching with `fcc-claude` (NOT plain
    `claude`) — this wrapper auto-injects the
    required environment variables correctly
  → Using plain `claude` with manually set env
    vars (as you did) can miss newer protocol
    requirements that 2.1.205 expects

```

* * *

### ❓ Q2 — Recommended model/provider combination that works reliably?

```auto
ANSWER: NVIDIA NIM is currently the most reliable.

  → NVIDIA NIM free tier includes Kimi K2.5 
    and GLM 4.7 — both confirmed working
    with this proxy
  → OpenRouter's free-tier models (including
    Qwen3-coder:free) are known to be LESS
    stable for tool-use/streaming with this
    proxy specifically
  → Multiple community tutorials (KSK Royal,
    other guides) default to NVIDIA NIM or
    Gemini free tier as the primary
    recommendation, not OpenRouter

```

* * *

### ❓ Q3 — Does OpenRouter adapter support Claude Code streaming correctly?

```auto
ANSWER: This is likely your SECOND problem.

  → Your earlier 422 error:
    "Input should be 'user' or 'assistant', 
     input: 'system'"
    → This means the OpenRouter adapter is NOT
      correctly translating Anthropic's "system"
      role into the format your chosen Qwen3-coder
      model expects
  → Free-tier models on OpenRouter often have
    incomplete or inconsistent system-role support
  → This is a known translation-layer gap between
    Anthropic Messages API format and OpenRouter's
    OpenAI-compatible format for free models
    specifically

```

* * *

### ❓ Q4 — Should you use NVIDIA NIM instead of OpenRouter?

```auto
ANSWER: Yes, switch to NVIDIA NIM.

  → NVIDIA NIM's free tier (build.nvidia.com) is
    explicitly listed as the PRIMARY supported
    backend in the project documentation
  → It's designed to closely mirror Anthropic's
    message structure, reducing translation errors
  → Kimi K2.5 and GLM 4.7 are the two models
    confirmed to work reliably through this proxy
  → This should resolve BOTH your 422 role error
    AND likely your empty response issue

```

* * *

### ❓ Q5 — Missing environment variable for streaming?

```auto
ANSWER: Yes — add gateway model discovery flag.

  → Add this environment variable:
    CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

  → This is explicitly required in the VS Code
    integration example from the official docs:
    {
      "claude.env": {
        "ANTHROPIC_BASE_URL": "http://localhost:8082",
        "ANTHROPIC_AUTH_TOKEN": "freecc",
        "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
      }
    }

  → Without this flag, Claude Code CLI may not
    correctly negotiate the /v1/models endpoint,
    which can result in malformed/empty response
    handling on newer CLI versions like yours

```

* * *

## 🔧 COMPLETE FIX SEQUENCE — TRY IN THIS ORDER

```auto
STEP 1: Downgrade Claude Code CLI
  npm install -g @anthropic-ai/claude-code@2.1.142

STEP 2: Disable auto-updater
  $env:DISABLE_AUTOUPDATER="1"

STEP 3: Switch provider to NVIDIA NIM
  → Get free key at: build.nvidia.com
  → Configure via Admin UI at 
    http://127.0.0.1:8082/admin
  → Select model: Kimi K2.5 or GLM 4.7

STEP 4: Add the missing env variable
  $env:CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY="1"

STEP 5: Use the wrapper launcher, not plain claude
  uv tool install --force git+https://github.com/
    Alishahryar1/free-claude-code.git
  fcc-server
  fcc-claude ← use this instead of "claude"

STEP 6: Re-test
  → Send a simple prompt
  → Check server console for the actual JSON
    response body, not just the HTTP status code

```

* * *

## 📊 PROVIDER COMPATIBILITY SNAPSHOT

| 🛠 PROVIDER | ⚡ RELIABILITY | 🔧 ROLE MAPPING | 🌊 STREAMING |
| --- | --- | --- | --- |
| **NVIDIA NIM (Kimi K2.5/GLM 4.7)** | ⭐⭐⭐⭐⭐ | ✅ Stable | ✅ Confirmed |
| **OpenRouter (free tier models)** | ⭐⭐ | ⚠ Inconsistent | ⚠ Known issues |
| **Gemini (via AI Studio)** | ⭐⭐⭐⭐ | ✅ Stable | ✅ Confirmed |
| **LM Studio (local)** | ⭐⭐⭐ | ✅ Stable | ⚠ Depends on model |

* * *

## 💡 PRO TIPS

- 🔥 **Always check the raw JSON response in the proxy’s console logs, not just Claude Code’s error message** — “HTTP 200 empty” often hides a malformed JSON body that the terminal log will show clearly
- 📌 **The `fcc-claude` wrapper exists specifically to avoid manual env var mistakes** — skip manual `$env:` exports entirely once you install the wrapper via `uv tool install`
- 🎯 **NVIDIA NIM’s free tier requires zero credit card** — just a [build.nvidia.com](http://build.nvidia.com) account, making it the lowest-friction fix to test first
- ⚠ **Free-tier OpenRouter models are the least stable link in this entire chain** — even the project’s own docs flag them as “some with free tiers” rather than fully guaranteed
- 🔄 **Pin your CLI version going forward** — add `DISABLE_AUTOUPDATER=1` to your permanent PowerShell profile so future `npm` auto-updates don’t silently break compatibility again

* * *

_Your setup is 95% correct — the empty response error is a documented, known issue tied to CLI version 2.1.205 outpacing the proxy’s tested compatibility. Downgrade to 2.1.142, switch to NVIDIA NIM, and add the gateway model discovery flag, and this should resolve cleanly._ 🔥💻⚡

---

<div class="post-metadata">

**Author:** ![NoBody](https://onehack.st/user_avatar/onehack.st/nobody/32/163880_2.png) [@NoBody](https://onehack.st/u/NoBody)\
**Post date:** [July 15, 2026, 4:34pm UTC](https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768/3 "2026-07-15T16:34:40Z")

</div>

# 🧨 Claude Code, Minus the Anthropic Bill

* * *

 ![image](https://onehack.st/uploads/default/original/3X/c/a/cad5e08b3d3153e806217342d12519660bbe0832.jpeg)

* * *

**Claude Code** = Anthropic’s terminal AI coder (reads files, writes code, runs commands from your command line). It never checks _who_ answers — swap the address, run it on a free model, it can’t tell.

Two settings. Everything below is how deep it goes. 👇

* * *

> **🔌 Two settings + a free key → Claude Code stops charging you**
>
> Claude Code reads two things on boot:
> 
> - `ANTHROPIC_BASE_URL` → _where_ it sends requests
> - `ANTHROPIC_AUTH_TOKEN` → your key (password to a model)
> 
> Point them at a free backend, done. Nothing cracked — you just changed the return address.
> 
> Free keys, email only, no card:
> 
> - [NVIDIA NIM](https://build.nvidia.com) — 100+ models, 40 req/min free
> - [Groq](https://console.groq.com) — fastest inference, ~14,400 req/day
> - [Google AI Studio](https://aistudio.google.com) — Gemini, 1M context
> - [OpenRouter](https://openrouter.ai) — 400+ models, many tagged `:free`
> 
> Pre-wired proxy that does the plumbing: [free-claude-code](https://github.com/Rishurajgautam24/free-claude-code)

> **🪤 The 422 wall (not your bug) → the one-line kill**
>
> The error everyone hits and blames themselves for:
> 
> ```auto
> API Error: 422 "Input should be 'user' or 'assistant'", "input":"system"
> 
> ```
> 
> **Cause:** Claude Code 2.1.15x jams a `system` message into a slot that only allows `user`/`assistant`. Strict proxies reject it before it reaches a model. It’s Claude Code’s bug → [official thread](https://github.com/anthropics/claude-code/issues/63469).
> 
> **Kill it 3 ways:**
> 
> - Patch the proxy to accept `system` → [exact fix](https://github.com/Alishahryar1/free-claude-code/issues/611)
> - Use a proxy that already eats it → [empero-org](https://github.com/empero-org/claude-code-proxy) (ignores junk fields) or [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) ([role-rewrite code](https://github.com/router-for-me/CLIProxyAPI/issues/3608))
> - Pin Claude Code to **2.1.150** (last clean version)
> 
> Why it happens (Anthropic vs OpenAI message shape) → [teardown](https://blog.margrop.net/en/post/claude-code-invalid-message-role-system/)

> **🔀 Translators: bolt Claude Code onto any cheap model**
>
> A proxy = a middleman that flips Anthropic ↔ OpenAI format both ways. Pick one:
> 
> - [fuergaosi233/claude-code-proxy](https://github.com/fuergaosi233/claude-code-proxy) — the original everything forks
> - [1rgs/claude-code-proxy](https://github.com/1rgs/claude-code-proxy) — Claude Code on OpenAI/Gemini
> - [JulesMellot worker](https://github.com/JulesMellot/Claude-Code-openrouter-proxy) — no install, runs on Cloudflare free
> - [CCProxy](https://ccproxy.orchestre.dev/) — multi-provider, 100+ models
> - [LiteLLM](https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models) — heavyweight, routes anything
> 
> ⚠ LiteLLM **1.82.7 / 1.82.8** shipped key-stealing malware — pin around them → [receipts](https://github.com/BerriAI/litellm/issues/24518)

> **🌊 One door, 200+ free providers, auto-dodge every limit**
>
> Stack providers behind one endpoint — one caps out, it slides to the next.
> 
> Self-host hubs:
> 
> - [new-api](https://github.com/QuantumNous/new-api) · [one-api](https://github.com/songquanpeng/one-api) · [uni-api](https://github.com/yym68686/uni-api) · [Mirrowel proxy](https://github.com/Mirrowel/LLM-API-Key-Proxy)
> 
> Free-tier stackers (auto-failover across dozens of free plans):
> 
> - [OmniRoute](https://github.com/diegosouzapw/OmniRoute) — 231+ providers, honest quota math
> - [freellmapi](https://github.com/tashfeenahmed/freellmapi) — 28 free tiers, self-updating
> - [free-llm-gateway](https://github.com/MrFadiAi/free-llm-gateway) — 24+ providers, keys encrypted
> 
> Set-and-forget switchers (UI):
> 
> - [Claude Code Router](https://github.com/musistudio/claude-code-router) · [cc-switch](https://github.com/farion1231/cc-switch) · [llm-router](https://github.com/ypollak2/llm-router) · [9router](https://github.com/decolua/9router)

> **🔑 Where the free keys actually live (refreshed daily)**
>
> - [freellm.net](https://freellm.net) — 600+ models, live-verified
> - [cheahjs/free-llm-api-resources](https://github.com/cheahjs/free-llm-api-resources) — the list everyone copies
> - [free-model.com](https://free-model.com/) — no-card filter, per-tool configs
> - [awesome-freellm-apis](https://github.com/open-free-llm-api/awesome-freellm-apis) — 134+ APIs, Claude Code snippets
> - [github.com/topics/free-llm-api](https://github.com/topics/free-llm-api) — the living feed

> **🐉 China's native stack — ~1/7 the price, no proxy, no 422**
>
> GLM / Kimi / Qwen / MiniMax speak Claude’s dialect _natively_ and sell flat monthly coding plans. Just change the base URL:
> 
> - [cc-compatible-models](https://github.com/Alorse/cc-compatible-models) — master cheat-sheet (endpoints, prices, plans)
> - GLM setup → [docs.z.ai](https://docs.z.ai/scenario-example/develop-tools/claude) · URL `https://open.bigmodel.cn/api/anthropic`
> - Kimi `https://api.moonshot.cn/anthropic` · Qwen `https://dashscope-intl.aliyuncs.com/apps/anthropic` · Volcengine `https://ark.cn-beijing.volces.com/api/coding`
> - [glm-claude](https://github.com/alchaincyf/glm-claude) — one command, launches on GLM
> - Windows 11 + PowerShell → [step-by-step](https://blog.csdn.net/weixin_44262492/article/details/160348230)

> **🎭 Turn a login into a free API (no card, no key)**
>
> The “Sign in with Google/GitHub” flow gives model access — these borrow that session and hand you a local API:
> 
> - [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) — Gemini/Codex/Claude/Grok logins → one API
> - [gemini-proxy](https://github.com/KashifKhn/gemini-proxy) — free Gemini off a Google login
> - [Hermes proxy](https://hermes-agent.nousresearch.com/docs/integrations/providers) — Claude/ChatGPT/Grok logins → local endpoint
> - [sub2api](https://github.com/Wei-Shaw/sub2api) — pool/share subscriptions behind one door

> **📱 Run the whole rig from an Android phone**
>
> Termux = a full Linux terminal as an Android app. Runs all of the above:
> 
> - [claude-code-android](https://github.com/ferrumclaudepilgrim/claude-code-android) — native, no root
> - [ClaudeCodeOnPhone](https://github.com/AbuZar-Ansarii/ClaudeCodeOnPhone) — two-var Termux + OpenRouter recipe
> - [Termux + router walkthrough](https://blog.closex.org/posts/8e3fd37d/) — model switching on-device

> **💡 5 spots this quietly saves your ass**
>
> - 3am mega-refactor, no usage meter ticking in the back of your head.
> - Old $100 Android in Termux on a train — full AI coder, no laptop.
> - One cheap coding plan covers a whole team instead of five separate Anthropic bills.
> - Point it at a local model → company’s private code never leaves the machine.
> - Anthropic rate-limits you mid-task → auto-failover to a free model finishes it instead of losing the work.

* * *

Same tool, same terminal, cheaper (or free) engine underneath. Cheap models nail routine work; keep one paid escape hatch for the giant multi-file jobs. Full living index: [awesome-claude-code](https://github.com/hesreallyhim/awesome-claude-code).

Nothing here is cracked. The lock was just a URL you were always allowed to change.

---

<div class="post-metadata">

**Author:** ![muse\_sharer](https://onehack.st/user_avatar/onehack.st/muse_sharer/32/178588_2.png) [@muse\_sharer](https://onehack.st/u/muse_sharer)\
**Post date:** [October 3, 2026, 4:12am UTC](https://onehack.st/t/trying-to-run-free-claude-code-proxy-on-windows-facing-http-200-empty-response-and-422-api-errors/323768/4 "2026-10-03T04:12:35Z")

</div>

I read the OP’s whole ordeal and it hit home — installing a command-line tool means environment variables, uv, a proxy, then chasing errors one line at a time; a whole day gone. I started out exactly the same way.

The shortcut I found later: a free one-click installer made for Codex — **[codex.thz.quest](https://codex.thz.quest)** — with builds for Windows and macOS. Download it and keep clicking Next: no shell, no environment variables to configure, and the most frustrating step is skipped completely.

Being honest though — after it installs you still sign in with your own ChatGPT account, and whatever network trouble you have day to day is still yours to solve. It only makes the “can’t install it” step simple.

Just passing it on.
