| name | gitlawb-opengateway-proxy |
| description | Install, run, and integrate the gitlawb-opengateway-proxy. Use this whenever the user wants free, no-API-key access to Xiaomi MiMo models (mimo-v2.5-pro, mimo-v2-flash, etc.) from any OpenAI-compatible CLI/SDK or agent UI. |
gitlawb-opengateway-proxy — install & integration skill
A tiny zero-dependency Node script that proxies the free, no-auth gateway
https://opengateway.gitlawb.com/v1/xiaomi-mimo and re-exposes it locally as a
plain OpenAI-compatible REST API at http://localhost:19911/v1.
Use this when:
- The user wants to talk to Xiaomi MiMo from a tool that requires an OpenAI
base URL (Cline, Continue, Cursor, raw
curl, the OpenAI SDK, or any other
OpenAI-compatible client).
- The tool insists on a non-empty API key — this proxy lets you use any
string (e.g.
"none") because the upstream is unauthenticated.
- The tool can't handle the upstream's
reasoning_content field — set
MERGE_REASONING=1 to fold it into <think>...</think> inside content.
1. Requirements
- Node.js ≥ 18 (uses the global
fetch). Check with node -v.
- Port
19911 free (or pick any other via PORT=...).
- Outbound HTTPS to
opengateway.gitlawb.com.
2. Install
The proxy is a single file. Two equivalent install paths:
A. Run directly without installing (preferred for one-off testing)
cd /path/to/gitlawb-opengateway-proxy
node server.mjs
B. Install as a global CLI
cd /path/to/gitlawb-opengateway-proxy
npm install -g .
gitlawb-opengateway-proxy
C. Background daemon via systemd (Linux server)
sudo tee /etc/systemd/system/gitlawb-opengateway-proxy.service >/dev/null <<'UNIT'
[Unit]
Description=Gitlawb Opengateway proxy (Xiaomi MiMo, no-auth)
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/node /opt/gitlawb-opengateway-proxy/server.mjs
Environment=PORT=19911
Restart=on-failure
User=nobody
[Install]
WantedBy=multi-user.target
UNIT
sudo mkdir -p /opt/gitlawb-opengateway-proxy
sudo cp server.mjs /opt/gitlawb-opengateway-proxy/
sudo systemctl daemon-reload
sudo systemctl enable --now gitlawb-opengateway-proxy
sudo systemctl status gitlawb-opengateway-proxy
3. Verify
curl -s http://localhost:19911/health
curl -s http://localhost:19911/v1/models | head -c 400
curl -s http://localhost:19911/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"mimo-v2.5-pro","messages":[{"role":"user","content":"Say hi"}],"max_tokens":20}'
curl -sN http://localhost:19911/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"mimo-v2.5-pro","messages":[{"role":"user","content":"2+2?"}],"stream":true,"max_tokens":80}'
If curl returns valid JSON / SSE, the proxy is good.
4. Environment variables
| Var | Default | Purpose |
|---|
PORT | 19911 | TCP port to listen on |
UPSTREAM_BASE | https://opengateway.gitlawb.com/v1/xiaomi-mimo | Override the gateway sub-route (e.g. another vendor on opengateway) |
MERGE_REASONING | 0 | If 1, fold reasoning_content into content as <think>...</think> blocks. Turn on for clients that don't render reasoning_content. |
DROP_KEEPALIVE | 1 | Drop the upstream's empty delta:{} keepalive chunks. Set to 0 if your client relies on them. |
DEBUG | 0 | Log every request to stderr |
5. Hook into any OpenAI-compatible client
In any client that supports an OpenAI-compatible / custom provider, set:
| Field | Value |
|---|
| Provider type | OpenAI-compatible |
| Base URL | http://localhost:19911/v1 |
| API Key | none (or any non-empty string — required only because most UIs demand one) |
| Default model | mimo-v2.5-pro (or any other mimo-* listed by /v1/models) |
If the client is on a different host, point it at http://<host>:19911/v1 and
make sure port 19911 is reachable / firewalled appropriately.
OpenAI SDK example
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "http://localhost:19911/v1",
apiKey: "none",
});
const res = await client.chat.completions.create({
model: "mimo-v2.5-pro",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0].message.content);
6. Reasoning / "thinking" output — make sure it never errors
The upstream returns chain-of-thought as delta.reasoning_content (DeepSeek /
MiMo convention), not inside content. This proxy passes it through unchanged
by default, which works for:
- OpenAI SDK ≥ 1.50 (accepts unknown fields gracefully)
- Anthropic-compat shims that ignore unknown OpenAI fields
- Most modern OpenAI-compatible routers
If your client errors on reasoning_content (rare — usually old, strict
parsers), start the proxy with MERGE_REASONING=1. The reasoning text will
then be folded into content as a <think>...</think> block, which every
markdown renderer handles.
MERGE_REASONING=1 node server.mjs
7. Troubleshooting
| Symptom | Fix |
|---|
400 Param Incorrect from upstream | The /v1/xiaomi-mimo route only accepts mimo-* models. Set UPSTREAM_BASE to a different sub-route if you want a different vendor, or stick to mimo-v2.5-pro etc. |
Client crashes on empty delta:{} chunks | Default DROP_KEEPALIVE=1 removes them — make sure you didn't set DROP_KEEPALIVE=0. |
EADDRINUSE :::19911 | Pick another port: PORT=29911 node server.mjs. |
| Streaming hangs in browser fetch | Ensure your reverse proxy / CDN doesn't buffer SSE. The proxy already sets X-Accel-Buffering: no. |
| No reasoning visible in UI | Either your client doesn't render reasoning_content — set MERGE_REASONING=1 — or the model wasn't in reasoning mode (use mimo-v2.5-pro). |
model is required | Make sure the POST body has "model": "mimo-v2.5-pro". |
8. Update / uninstall
sudo systemctl restart gitlawb-opengateway-proxy
sudo systemctl disable --now gitlawb-opengateway-proxy
sudo rm /etc/systemd/system/gitlawb-opengateway-proxy.service /opt/gitlawb-opengateway-proxy/server.mjs
npm uninstall -g gitlawb-opengateway-proxy