Skip to content

About

Lightweight Node.js reverse proxy that enables any OpenAI-compatible coding agent (Cline, KiloCode, Roo Code, etc.) to work with AgentRouter by spoofing required client headers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

AgentRouter Local Proxy (Node.js)

License: MIT

Persian / فارسی

A lightweight Node.js reverse proxy that lets you use AgentRouter with any OpenAI-compatible coding agent — Cline, KiloCode, Roo Code, and more.

Why?

AgentRouter only accepts requests from specific clients (e.g. Codex CLI). This proxy spoofs the required headers so your favorite coding tool works seamlessly.

Prerequisites

Quick Start

git clone https://github.com/user/agentrouter-proxy-node.git
cd agentrouter-proxy-node
node proxy.js

The proxy starts on http://localhost:8318.

Running as a Service

PM2 (recommended)

npm install -g pm2
pm2 start proxy.js --name agentrouter-proxy
pm2 startup   # follow the printed instructions
pm2 save

Forever

npm install -g forever
forever start proxy.js

Windows Task Scheduler

  1. Open Task Scheduler.
  2. Create a new task.
  3. Trigger: At log on.
  4. Action > Start a program:
    • Program/script: full path to node.exe
    • Arguments: full path to proxy.js

Configuration in Your Coding Tool

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

Verify It Works

curl http://localhost:8318/v1/models

Or open http://localhost:8318/v1 in your browser.

Stopping the Proxy

pm2 stop agentrouter-proxy
# or
pm2 delete agentrouter-proxy

Troubleshooting

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

License

MIT

About

Lightweight Node.js reverse proxy that enables any OpenAI-compatible coding agent (Cline, KiloCode, Roo Code, etc.) to work with AgentRouter by spoofing required client headers.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages