aider
Set OPENAI_BASE_URL, pass --model deepseek-chat, and the pair programmer runs on the free backend.
❯ /serve on▊
The same provider stack the TUI drives, exposed as OpenAI Chat Completions on a port you choose. Start it from inside the agent, or run the whole thing headless.
7667
default port — /server <port> persists another
/v1
chat/completions + models, /v1-less spellings accepted
SSE
token-by-token streaming, the shape clients expect
$0.00
the built-in backend still costs nothing
── starting it
The server is a detached task owned by the TUI, so starting and stopping it never interrupts a turn.
pooprusteek
❯ /serve on
API server listening on http://127.0.0.1:7667/v1
dialect openai · auth off (loopback) · backends: 4
❯ /serve
running · 12 requests · 0 errors
models: deepseek-chat, deepseek-reasoner,
lmstudio/qwen2.5-coder, gemini/…
Or drop the interface entirely: --proxy prints a timestamped request log instead of a UI (the same as --api --uiless).
── model ids
Routing is a pure function over your provider list — no network, no guessing, and testable on its own.
── clients
There is no SDK to adopt. If a tool has a base-URL field, it is already compatible.
Set OPENAI_BASE_URL, pass --model deepseek-chat, and the pair programmer runs on the free backend.
Anything with an OpenAI-compatible provider block: base URL, any api-key string, a model id from the catalog.
Add it as an OpenAI connection and the whole model catalog shows up in the picker.
Python, JS, curl — the request shape is unchanged, streaming included.
The catalog rendered as the listing clients ask for on connect.
Synthesized on top of the chat path for older clients that never moved.
python — openai sdk
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:7667/v1",
api_key="not-needed" # unless [server] api_key is set
)
client.chat.completions.create(
model="deepseek-chat", messages=[…], stream=True)
env — anything that reads OPENAI_BASE_URL
OPENAI_BASE_URL=http://127.0.0.1:7667/v1
OPENAI_API_KEY=whatever
# aider --model deepseek-chat
# continue / open-webui / any OpenAI-shaped client
── defaults
The gateway hands out access to accounts and paid upstreams. Every default here assumes you did not mean to publish it.
config.toml
[server]
host = "127.0.0.1" # loopback by default
port = 7667 # /server <port>
api = "openai" # anthropic/gemini reserved
# api_key = "…" # required bearer + CORS gate