|
Hi! Trying to get Headroom proxy working as a compression layer between Cline (VS Code extension) and OpenRouter, using GLM-5.2 as my model. Running on Windows. Questions:
My setup:
What happens when I start the proxy: I set What I've tried in Cline settings: Attempt 1 — OpenAI Compatible provider:
Attempt 2 — Anthropic provider:
Any guidance appreciated — the proxy guidance message is helpful but written with Claude Code in mind and it's not clear how to translate it to Cline's settings UI. Thanks! |
Replies: 3 comments
|
The issue is that Cline's OpenAI Compatible provider and Headroom's OpenRouter backend need the right wiring. Here is the working configuration for Cline + OpenRouter via Headroom on Windows: Cline Provider Settings (OpenAI Compatible):
Why the dummy key doesn't work: The For GLM-5.2 specifically: Use If you want to use Claude models via OpenRouter: Set the model to Verification steps:
The proxy's guidance message is written assuming Claude Code (which reads |
|
Good suggestion here. Alas, no luck so far. It looks like Headroom's OpenRouter backend expects Anthropic APIs in CLI mode. No combination of setting for Cline OpenAI Compatible model worked for me. I ended up switching to 9Router and it was a breeze to plug it into my Cline + OpenRouter setup. Bonus: It supports KLM and Headroom out of the box. |
|
Hi! I managed to identify the issue on Windows. The important detail is that Cline's OpenAI Compatible provider sends requests to /v1/chat/completions, and Headroom routes that endpoint to OpenAI by default: /v1/chat/completions → https://api.openai.com So if Cline sends an OpenRouter key (sk-or-...) through Headroom without changing the backend URL, OpenAI rejects it with: 401 Incorrect API key provided The working setup should be: ### 1. Start Headroom with OpenRouter as the OpenAI-compatible backend In the same PowerShell session: $env:OPENROUTER_API_KEY="sk-or-v1-YOUR_KEY" headroom proxy --port 8787 --backend openrouter --openai-api-url "https://openrouter.ai/api" The important part is: --openai-api-url "https://openrouter.ai/api" This prevents /v1/chat/completions from being sent to api.openai.com. 2. Cline providerIn Cline, use: Provider: OpenAI Compatible Do NOT use: openrouter/zhipuai/glm-5.2 The model should use the exact OpenRouter slug: zhipuai/glm-5.2 ANTHROPIC_API_KEY=sk-ant-dummy is only relevant when using Headroom through the Anthropic /v1/messages interface, which is what Claude Code uses. For Cline's OpenAI Compatible provider, the request is: /v1/chat/completions So Cline should use the real OpenRouter API key, not sk-ant-dummy. The resulting flow is: Cline One additional thing I noticed: Headroom's startup message is somewhat misleading for Cline because the ANTHROPIC_BASE_URL instructions are primarily aimed at Claude Code. For Cline, you need to translate that into the OpenAI Compatible provider settings above. I also verified that Headroom itself was healthy on Windows (/health and /readyz both returned HTTP 200), so the key issue was the routing of /v1/chat/completions, not the proxy itself. |
Good suggestion here. Alas, no luck so far. It looks like Headroom's OpenRouter backend expects Anthropic APIs in CLI mode. No combination of setting for Cline OpenAI Compatible model worked for me. I ended up switching to 9Router and it was a breeze to plug it into my Cline + OpenRouter setup. Bonus: It supports KLM and Headroom out of the box.