Local first · Open source · Yours to build

Your AI.
Connected freely.

One endpoint. Multiple AI providers.
Let Free Router handle routing, keys, and failover.
Keep your focus on what you’re building.

Runs locallyOpenAI-compatibleYour keys, your control
Different providers. Same endpoint.OpenRouteropencode zenCommand CodeOpenAI API
BUILT TO GET OUT OF YOUR WAY

Less setup.
More building.

From your first request to your next idea.
The essentials are already here.

One API. More than one option.

Keep the OpenAI SDK you already know. Change the base URL to connect your existing app to your local gateway.

baseURL127.0.0.1:8787/v1ONE ENDPOINT
space-bunnyopenrouter/…commandcode/…

Put every key to work.

Up to 16 keys per provider, rotated per request. Add keys, remove them, or change priorities without restarting.

A failed route isn’t the end.

Failed keys cool down while available keys take over. Switch providers before the response starts, without replaying a running stream.

429Rate limitedFailover200Continue

Go from asking to building.

A built-in Pi coding agent reads code, edits files, and runs tests, using the gateway you’ve already configured.

›Add a dark theme to this projectExample
readeditbash

Your keys stay on your machine.Credentials are managed by the local Rust backend, never persisted in your browser.

LOCAL FIRST
A SMALL SETUP. A BETTER FLOW.

Set up once. Connect everywhere.

Three steps from provider keys to your app.

01

Start your local gateway

Run the desktop app or start from source. The default gateway listens locally on port 8787.

Desktop / Web / CLI
02

Connect your providers

Add provider API keys in Settings, choose your preferred provider, and generate a gateway key.

Bring your own API keys
03

Build something

Set the base URL and gateway key in your app. Choose space-bunny and let the gateway handle routing.

Same SDK. Familiar workflow.
HELLO, FREE ROUTER.

Your next call.
Starts here.

No new API to learn.
Pick your language and send your first request.

Generate a gateway key in Settings and set the GATEWAY_API_KEY environment variable.
If the desktop app selects a different port, use the base URL shown in the app.
Read the installation guide
app.pypip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8787/v1",
    api_key=os.environ["GATEWAY_API_KEY"],
)

response = client.chat.completions.create(
    model="space-bunny",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
OpenAI-compatible API/v1/chat/completions
GOOD QUESTIONS.

A few things to know.

About the API, your keys, and what’s next.

Join the conversation on GitHub
What is Free Router?

Free Router is an AI gateway that runs on your machine. It connects OpenRouter, OpenCode Zen, and Command Code through one OpenAI-compatible API, with a settings UI, playground, and Pi coding agent.

Does “Free” mean all model calls are free?

The source is available on GitHub. Model pricing, quotas, and availability are determined by each upstream provider. You bring your own provider API keys; Free Router does not promise unlimited or universally free model access.

Which APIs and models are supported?

It supports Chat Completions and model listing, with pass-through SSE, tool calls, and multimodal parameters. Use space-bunny for automatic routing or a provider prefix to select an upstream. Command Code also accepts other Chat Completions model IDs. Responses and Anthropic Messages conversion are not currently implemented.

Where are my API keys stored?

Provider keys are managed by the local Rust backend and saved in local configuration files with Unix permissions of 0600. Saved provider keys are not returned to the UI or persisted in browser storage.

What happens if a provider fails?

The gateway tries other available keys in the pool. Automatic routing can also switch providers. Failed keys enter cooldown based on the error. Retries happen before response headers are sent; a stream that has started is never replayed, avoiding duplicated output.

What can Pi Agent do?

Pi Agent uses your existing gateway configuration to read code, create and edit files, and run commands and tests in a chosen directory. Tasks can be stopped. Tools run with your local user permissions; the working directory is not a sandbox, so use it in a trusted local environment.

LESS FRICTION. MORE FREEDOM.

Give your ideas room to run.

One local gateway. Whatever you want to build next.

Start on GitHubOpen source · Local first · Free to build