Qwen Code is Alibaba's open-source terminal coding assistant: it reads your project, edits files, runs commands and checks its own work. Besides its own default channel it accepts any OpenAI-compatible endpoint via OPENAI_BASE_URL / OPENAI_API_KEY, so one QuantoPort key can drive qwen3.8-max, deepseek-v4-pro and the rest of the catalogue.
base_url or *_BASE_URL setting./v1 for anything speaking the OpenAI wire (/v1/chat/completions).GET /v1/models.Skip it — one-line setup
The script installs Qwen Code from the official npm source, writes the gateway settings into the tool's own config file (our settings: ~/.qwen/settings.json plus ~/.qwen/.env, backing up any existing ones), installs a qwen-shinloo launcher that pins traffic to us, and runs a live check. It asks for your gateway key, or take it from --key / --key-file. --uninstall restores exactly what it wrote.
curl -fsSL https://quantoport.com/agents/qwen-code/setup | bash
1 · Install
Install from the official npm source (this package requires Node.js 22 or newer).
node -v # needs v22 or newer npm install -g @qwen-code/qwen-code qwen --version
2 · Configure — point it at QuantoPort
Gateway base URL https://quantoport.com/v1; get your key from the console.
1) Write ~/.qwen/settings.json (selects the protocol, endpoint and default model; your other provider entries are kept):
{
"modelProviders": { "openai": [ { "id": "qwen3.8-max", "baseUrl": "https://quantoport.com/v1", "envKey": "OPENAI_API_KEY" } ] },
"security": { "auth": { "selectedType": "openai" } },
"model": { "name": "qwen3.8-max" }
}
2) Write ~/.qwen/.env for the key (create it if missing; the block this script writes is marked managed and is the only part removed by --uninstall):
OPENAI_API_KEY="YOUR_API_KEY"
OPENAI_BASE_URL="https://quantoport.com/v1"
OPENAI_MODEL="qwen3.8-max"
On the China endpoint use https://api.shinlinkai.com/v1 instead.
3) A qwen-shinloo launcher is installed in ~/.local/bin/: it exports this key and endpoint before starting qwen.
4) Reopen the terminal and run qwen (or qwen-shinloo); switch models in-session with /model.3 · Verify
One request proves you are on our channel.
qwen-shinloo -p "reply with OK" # recommended: pins our channel qwen -p "reply with OK" # also works once the config is written
4 · Common pitfalls
- You need Node.js 22+: the package pins engines >=22 and will refuse to install on older Node. Check with
node -vfirst. OPENAI_BASE_URLmust end with/v1; the bare gateway root returns 404.- settings.json and .env are read at startup — reopen the terminal after editing them.
- If
OPENAI_API_KEYis already exported in your environment (or the tool falls back to its own default channel), that wins over the config files and the request will go elsewhere — launch qwen-shinloo instead to pin our channel. - If the file already had
OPENAI_*lines, the script comments the old ones out and notes the original value, so nothing is silently overwritten. - Model names follow
GET /v1/modelsfor your key — the published catalogue can change with upstream supply.
Sources for the tool-side steps: github.com/QwenLM/qwen-code qwenlm.github.io/qwen-code-docs