A lightweight Node.js reverse proxy that lets you use AgentRouter with any OpenAI-compatible coding agent — Cline, KiloCode, Roo Code, and more.
AgentRouter only accepts requests from specific clients (e.g. Codex CLI). This proxy spoofs the required headers so your favorite coding tool works seamlessly.
- Node.js v18+
git clone https://github.com/user/agentrouter-proxy-node.git
cd agentrouter-proxy-node
node proxy.jsThe proxy starts on http://localhost:8318.
npm install -g pm2
pm2 start proxy.js --name agentrouter-proxy
pm2 startup # follow the printed instructions
pm2 savenpm install -g forever
forever start proxy.js- Open Task Scheduler.
- Create a new task.
- Trigger: At log on.
- Action > Start a program:
- Program/script: full path to
node.exe - Arguments: full path to
proxy.js
- Program/script: full path to
In the OpenAI Compatible Provider settings:
| Field | Value |
|---|---|
| Base URL | http://localhost:8318/v1 |
| API Key | Your AgentRouter key (get one here) |
| Model | e.g. gpt-5, deepseek-r1-0528, or any supported model |
curl http://localhost:8318/v1/modelsOr open http://localhost:8318/v1 in your browser.
pm2 stop agentrouter-proxy
# or
pm2 delete agentrouter-proxy| Problem | Solution |
|---|---|
| Port 8318 in use | Change the port in proxy.js |
| Invalid API key | Get a new key from the AgentRouter dashboard |
| Still getting fetch errors | Check proxy logs: pm2 logs agentrouter-proxy |
| Proxy doesn't start after reboot | Run pm2 startup again |