Free LLM API router: one local OpenAI-compatible endpoint
This page shows how to put several free LLM API keys behind one OpenAI-compatible address on your own computer.
Whose router is this?
Free LLM API Radar is a directory. It does not proxy your requests and it does not hold provider keys.
The router in this guide is the open-source project FreeLLMAPI, maintained by its own authors, at github.com/tashfeenahmed/freellmapi. Their README marks the license as MIT.
Where the keys live
The router runs on your own computer for one user. Your provider keys are stored in its local database, and requests go straight from your computer to each provider. This site never sees those keys.
How to use it
The project is meant for personal use and experimenting: one person, on a computer you control. Each provider's own terms still apply to every call.
Install
The quick start needs Docker and is a single command. It creates ~/freellmapi, generates an encryption key, pulls the image and starts the container.
curl -fsSL https://freellmapi.co/install.sh | bashIt is a good habit to read a script before piping it to bash. This one is at freellmapi.co/install.sh. Other install options (Docker Compose, npm, desktop apps)
After it starts, open http://localhost:3001, add provider keys on the Keys page, and copy the unified API key from that page. That key is what you send as the OpenAI client api_key.
OpenAI SDK
Point the official OpenAI SDK at http://localhost:3001/v1 and use the unified key from the dashboard. model="auto" lets the router pick a model for you.
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:3001/v1",
api_key="freellmapi-your-unified-key",
)
response = client.chat.completions.with_raw_response.create(
model="auto", # let the router pick; or "auto:fast", "auto:smart", a profile, or a model id
messages=[{"role": "user", "content": "Summarise the fall of Rome in one sentence."}],
)
completion = response.parse()
print(completion.choices[0].message.content)
print("Routed via:", response.headers.get("x-routed-via"))Streaming and the other endpoints are covered in the project README.
Questions
- Is the free LLM API router part of this site?
- No. Free LLM API Radar only lists free allowances. The router is the third-party MIT project at github.com/tashfeenahmed/freellmapi. We are not affiliated with freellmapi.co or that project.
- Where do the provider keys go?
- On the computer running the router, in its local database. Requests go from there to each provider. This site never asks for those keys.
- Who is this setup for?
- One person experimenting on their own computer. Follow each provider's terms when you call them.