Skip to main content
Configure Qwen Code to call the Modellix LLM gateway. Qwen Code supports OpenAI-compatible endpoints through environment variables or modelProviders in settings.json, pointed at Chat Completions on POST /v1/chat/completions.
This page covers LLM text only (https://llm.modellix.ai).Modellix model IDs are provider/name (for example openai/gpt-5.5). Set that full string as OPENAI_MODEL or as each modelProviders model id. See Models & Pricing.

Set Up Qwen Code

1

Install Qwen Code

Requires Node.js 20+. Install the global CLI:
2

Set Environment Variables

Point the OpenAI-compatible client at Modellix (same pattern as the OpenAI SDK):
Add these lines to your shell profile (for example ~/.zshrc), then run source ~/.zshrc.
Use a Modellix API key, not an OpenAI platform key. Do not set OPENAI_BASE_URL to the media API host (https://api.modellix.ai).
3

Optional: Persist in settings.json

For multiple models or a durable project/user config, declare Modellix under the openai auth type in ~/.qwen/settings.json (or .qwen/settings.json in a project):
Replace mdlx-xxxxxxxx with your Modellix API key, or keep the key only in the process environment and omit the env block. Credentials in modelProviders are read from process.env[envKey], not stored as plaintext API fields.
You do not need a separate Anthropic baseUrl without /v1 for these IDs. Register anthropic/... and google/... on the same Modellix OpenAI-compatible baseUrl; traffic goes through Chat Completions on https://llm.modellix.ai/v1. Native Anthropic Messages is for the Anthropic SDK and Claude Code.
4

Start Qwen Code

From your project directory:
Run /about to confirm the active model and endpoint. Use /model to switch among entries declared in modelProviders.

Troubleshooting