Quickstart
Up and coding in three steps.
Zero lock-in, bring your own FreeRouter key, and switch models or gateways without touching a config file.
Install FreeRouter-Pi
Install globally with npm or run directly with npx — always pinned to @latest so you get the newest gateway and AdsRouter support.
npm install -g freerouter-pi@latest
npx freerouter-pi@latest
Connect your FreeRouter key
Grab a key at app.freerouter.com. Launching freerouter-pi walks you through first-run onboarding automatically, or export your key in your shell:
export FREEROUTER_API_KEY="fr_..."
Add AdsRouter (Optional)
Sign in at adsrouter.ai to grab your Property Key (ar_pub_...) and Property Secret (ar_sec_...). Set them via env vars or live in-app with /keys.
Ads appear contextually below the editor after agent responses — click the terminal link or run /ad to open.
export ADSROUTER_PROPERTY_KEY="ar_pub_..." ADSROUTER_PROPERTY_SECRET="ar_sec_..."
Unified LLM Gateway + Live Sync
Change providers on the backend. /model stays in sync.
FreeRouter sits behind your single API key as a unified LLM gateway router. Connect OpenRouter, Vercel AI Gateway, Cloudflare AI Gateway, or direct model providers on the backend — with automatic failover, traffic splits, and model remaps.
Whenever you add, swap, or reconfigure providers in the FreeRouter dashboard, simply run /model inside freerouter-pi. It pulls your updated live model catalog straight from FreeRouter — zero CLI reconfiguration, no hand-edited models.json, and no restarts.
Want to see how manual configuration compares? Read our Pi + FreeRouter guide.
Connect every LLM gateway once
Bring your own keys across OpenRouter, Vercel, Cloudflare, Anthropic, OpenAI, and more. FreeRouter mediates every call behind one fr_... key.
Automatic /model catalog sync
Add a new provider or remap a model on the FreeRouter backend, then type /model in the TUI. Your newly available models appear immediately with zero local config edits.
Failover & routing without touching your CLI
Switch from priority failover to percentage splits or cheapest-route arbitrage in the FreeRouter dashboard while your coding session keeps running uninterrupted.
Extensible Blueprint
Build your own ad-supported AI dev harness.
FreeRouter-Pi is more than a ready-to-run CLI — it is an open-source reference blueprint for pairing a multi-gateway LLM router with contextual native monetization.
FreeRouter + AdsRouter out of the box
Pair FreeRouter's unified inference routing with AdsRouter to subsidize token spend for your team, community, or developer tool. Ads are fetched asynchronously after agent turns and never block inference or fail a prompt.
Extend via pi extensions or fork it
Drop in custom pi extensions for your own tools, slash commands, and workflows — or fork github.com/niyogi/freerouter-pi (MIT) to ship your own branded, ad-supported AI coding harness in minutes.
Start coding with FreeRouter-Pi.
One command to launch. One key for every LLM gateway. Optional AdsRouter when you want to offset compute.
$npx freerouter-pi@latest