Client setup
Anything that speaks the OpenAI API works. In every tool you only ever set two things: the base URL and an API key.
| Setting | Value |
|---|---|
| Base URL | __BASE__/v1 |
| API key | a generated client key (msk-…) |
| Model | auto, or whatever you pinned to the key |
Kilo Code
Kilo Code (and Cline / Roo — same settings) treats MSEMAX as an OpenAI-compatible provider:
- Open Kilo's provider settings and choose OpenAI Compatible.
- Base URL:
__BASE__/v1 - API Key: your
msk-…client key. - Model: type
auto(or the model you pinned to the key). If Kilo demands a model id and won't accept a free-typed one, any value works — the gateway resolves the real model from the key or upstream. - To send images, enable the provider's Image / vision capability so Kilo actually attaches image bytes; otherwise it silently drops them. See Vision.
Coding agents send whole files as context. If you hit 413 Prompt too large, the operator can raise MSE_MAX_PROMPT_CHARS on the server.
OpenAI SDK — Python
from openai import OpenAI
client = OpenAI(
base_url="__BASE__/v1",
api_key="YOUR_API_KEY",
)
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)OpenAI SDK — Node
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "__BASE__/v1",
apiKey: "YOUR_API_KEY",
});
const r = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(r.choices[0].message.content);n8n
Add an OpenAI credential and override its base URL:
- Base URL:
__BASE__/v1 - API Key: your
msk-…key.
Then use any OpenAI / AI Agent node as normal, with the model set to auto. n8n ignores CORS (it calls server-side), so no extra configuration is needed.
LangChain
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="__BASE__/v1",
api_key="YOUR_API_KEY",
model="auto",
)
print(llm.invoke("Hello!").content)Anything else
Any client with a configurable OpenAI base URL — Cursor, Continue, LibreChat, Open WebUI, curl — works with the same two settings above. If a tool sends an Origin header from a browser and is blocked, the operator can allow it via MSE_CORS_ORIGINS; server-to-server clients never need it.