free-router-proxy README

The project's README from github.com/www222fff/free-router-proxy. As one markdown file: README.md.

Free Router

English | 中文

Free Router architecture: any OpenAI client to a local gateway to pluggable providers

Local OpenAI-compatible gateway. Point any client at `http://127.0.0.1:8787/v1` and use `free-best`. It ranks currently free models across **any OpenAI-compatible provider you configure**, then fails over when one is rate-limited, down, or empty. A missing key just drops that provider.

Run

Node.js 20+. Copy .env.example to .env, add at least one provider key, then:

git clone https://github.com/www222fff/free-router-proxy.git
cd free-router-proxy
cp .env.example .env
./start.sh

Stop with ./stop.sh. Docker: docker compose up -d. Open http://127.0.0.1:8787/ to set keys, manage routing, and watch usage. The local-only interface follows your browser language (12 languages included).

Variable Where
GEMINI_API_KEY Google AI Studio
OPENROUTER_API_KEY openrouter.ai/keys
TOKENROUTER_API_KEY TokenRouter
BAI_API_KEY chat.b.ai
HASHNEURON_API_KEY HashNeuron (https://hashneuron.space/v1)

Need more than one key per provider? Set OPENROUTER_API_KEYS (or OPENROUTER_API_KEY_KEYS) with comma-separated values, or add named keys in the web UI — requests rotate across them automatically.

More providers: add a block in config.json, or add one in the web UI with just a name and a base URL. See How it works.

Configuration layers

config.json holds defaults and stays merge-clean. Everything you change — in the web UI or via the first-boot .env import — is written to the gitignored config.local.json, which wins over defaults at startup (objects merge per key, arrays are replaced). Provider keys also work straight from the environment, so .env remains a valid key store that never needs a UI.

./models.sh          # current free-best order
./models.sh --usage  # today's quota

Star History

Star History Chart

free-router-proxy (www222fff/free-router-proxy)

Searching Database…

What is this?Free Router is a local OpenAI-compatible gateway that points your client at free models from any OpenAI-compatible provider you configure, ranking them and failing over automatically when one is rate-limited, down, or has no key.
Is this a hosted service or something I run myself?It's a self-hosted local server (Node.js app or Docker container) that you run on your own machine, not a hosted cloud service.
How do I get it running?Run it with Node.js 20+: copy .env.example to .env, add at least one provider key, then start the server; stop it with ./stop.sh. Alternatively run it with Docker Compose via 'docker compose up -d'.
What do I need before running this?You need Node.js 20 or newer (or Docker if using the compose setup) and at least one API key from an OpenAI-compatible provider offering free models.
What happens if a provider's free quota runs out?If a configured provider is rate-limited, down, or empty, Free Router automatically fails over to the next ranked provider; a provider with no key configured is simply skipped.
What platforms can I run this on?It runs anywhere Node.js 20+ or Docker is available, including Linux, macOS, and Windows.
How does it pick which free model to use?It ranks currently free models across all the OpenAI-compatible providers you've configured and routes to the best available one, switching automatically on failure.
Can I point my existing OpenAI client at it?Yes, since it exposes an OpenAI-compatible API, you just point any existing OpenAI client at your local Free Router endpoint instead of the provider's endpoint.
Do I need to configure every provider?No, you only need to add keys for the providers you want to use; providers without a key configured are automatically skipped.
Creator
www222fff
Size
0.6 MB
Stars
485
Age
3mo
Commits · 90 Days