16 providers · 100+ models · ~1.7B tokens / month

One gateway.
Two protocols.
Zero cost.

A self-hosted proxy that speaks both the OpenAI and Anthropic wire formats, aggregating the free tiers of sixteen LLM providers behind a single API key — with smart routing, automatic failover, encrypted keys, and built-in agent tools.

$ docker compose up -d · point your OpenAI or Anthropic client at one URL

FreeAIGateway dashboard — routing strategy and live fallback chain
~1.7B
free tokens / month
16+
providers + custom
100+
models, auto-routed
2
wire protocols
Drop-in compatible

Point any client at one base URL

Same gateway, same unified key. Speak OpenAI, speak Anthropic, or generate an image — it routes to whichever free provider can serve it and fails over when one is rate-limited.

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:3001/v1",
    api_key="freellmapi-your-unified-key",
)

resp = client.chat.completions.create(
    model="auto",                 # let the router pick the best free model
    messages=[{"role": "user", "content": "Explain MoE routing in one line."}],
)
print(resp.choices[0].message.content)
Everything in one binary

Built to actually run in production

Two protocols, one router

OpenAI (/v1/chat/completions, /v1/responses) and Anthropic (/v1/messages) over the same routing, retry, and cooldown machinery.

Automatic failover

On a 429, 5xx, or timeout the router skips the provider, cools the key down, and retries the next model — up to 20 attempts.

Built-in agent tools

Gateway-run web_search, web_extract, and generate_image turn plain chat into an agent — generated images render inline.

Prompt cache

Opt-in TTL cache returns identical requests instantly with X-Cache: HIT and no provider call — streaming replays as SSE.

Encrypted keys

Provider keys are AES-256-GCM encrypted in SQLite; apps only ever see one unified freellmapi-… bearer token.

Admin dashboard

Manage keys, drag the fallback chain, watch latency percentiles, cache hit-rate, and a live request log — dark & light.

Stack the free tiers

Sixteen providers, plus any custom endpoint

➕ Point at any OpenAI-compatible endpoint too — llama.cpp, LM Studio, vLLM, a local Ollama, or a remote gateway — straight from the Keys page.

The control room

A dashboard that earns its pixels

Analytics
Analytics — success rate, latency percentiles, cache hit-rate, per-model breakdown, live log.
Settings
Settings — unified key, both protocol endpoints, prompt cache, built-in tools.
Playground
Playground — chat, multi-model compare, and image generation.
Keys
Keys — add providers, health status, drag the fallback order.
How it works

Your request, routed the smart way

Your app
OpenAI or Anthropic SDK
FreeAIGateway
auth · cache · router · retry
Best free provider
scored by reliability · speed · cost
Up in two minutes

Quick start

1

Run it

Docker Compose serves the API + dashboard on port 3001, SQLite in a named volume.

2

Add your keys

Open the dashboard, paste provider keys (many work anonymously), order the fallback chain.

3

Point your SDK

Swap base_url to your gateway and use the one unified key. Done.

Docker (recommended)
git clone https://github.com/Hansade2005/FreeAIGateway.git
cd FreeAIGateway

# generate an at-rest encryption key for your provider keys
ENCRYPTION_KEY="$(openssl rand -hex 32)"
printf "ENCRYPTION_KEY=%s\nPORT=3001\n" "$ENCRYPTION_KEY" > .env

docker compose up -d   # → http://localhost:3001

Stop juggling sixteen SDKs.

Self-hosted, single-user, MIT-licensed. One endpoint, two protocols, ~1.7B free tokens a month.