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

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:

Claude Code:
2.1.205

Project directory:

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

Repository Used

Initially, I looked at:

Rishurajgautam24/free-claude-code

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

Alishahryar1/free-claude-code

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

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:

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:

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

Installation Steps Followed

Installed dependencies:

uv sync

Started the server successfully:

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

Server output:

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:

http://127.0.0.1:8082/admin

Claude Code Configuration

I configured Claude Code using:

$env:ANTHROPIC_AUTH_TOKEN="freecc"

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

claude

The proxy receives requests:

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

However, Claude Code fails with:

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:

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:

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:

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

Output:

Key loaded: True

Current Situation

At this point:

:white_check_mark: Repository cloned successfully
:white_check_mark: Dependencies installed
:white_check_mark: Proxy server starts
:white_check_mark: Admin UI works
:white_check_mark: Claude Code connects to proxy
:white_check_mark: Requests reach /v1/messages
:cross_mark: Provider response is empty/malformed
:cross_mark: 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!