/serve on

Pooprusteek as an API

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

Four ways in

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/…
/serve on|off
Start and stop from inside the TUI. The status line keeps count of requests and errors.
/server <port>
Persist a different port, restarting the server if it is already up.
/serve api <dialect>
openai today. anthropic and gemini are reserved in the config and say so plainly instead of half-working.
--serve
Launch the TUI with the server already running. --server and --api are aliases.

Or drop the interface entirely: --proxy prints a timestamped request log instead of a UI (the same as --api --uiless).

── model ids

One name picks the backend

Routing is a pure function over your provider list — no network, no guessing, and testable on its own.

deepseek-chat · deepseek-reasoner
The built-in DeepSeek web client, when a token is configured. Also reachable as deepseek/<id>.
<entry>/<model>
A /providers entry with an explicit model: its default plus everything the upstream lists. Unlisted ids pass through, so whatever the endpoint actually serves works.
<entry>
The entry’s configured model — or the first one fetched from it, when no default is set.
a bare model id
If it matches some entry’s configured or fetched model, that entry wins. Ids copied out of upstream docs work unprefixed.

── clients

Point anything at it

There is no SDK to adopt. If a tool has a base-URL field, it is already compatible.

aider

Set OPENAI_BASE_URL, pass --model deepseek-chat, and the pair programmer runs on the free backend.

Continue & IDE plugins

Anything with an OpenAI-compatible provider block: base URL, any api-key string, a model id from the catalog.

Open WebUI

Add it as an OpenAI connection and the whole model catalog shows up in the picker.

OpenAI SDKs

Python, JS, curl — the request shape is unchanged, streaming included.

GET /v1/models

The catalog rendered as the listing clients ask for on connect.

Legacy /v1/completions

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

Local until you say otherwise

The gateway hands out access to accounts and paid upstreams. Every default here assumes you did not mean to publish it.

host
127.0.0.1. Exposing a keyless gateway on a LAN has to be a decision, not an accident.
api_key
Set it and every request must carry Authorization: Bearer …
CORS
Only sent when a bearer token is configured — the browser gate follows the auth gate, never leads it.
sessions
A fresh fork per request; DeepSeek forks discard their remote session, so serving never litters your chat list.
providers
Settings are snapshotted at launch — edits made in the TUI apply on the next /serve off + on.

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

How the whole thing is wired

deepseek · deepseek-chatctx:0% · | [streaming]