> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scitix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen Code

[Qwen Code](https://github.com/QwenLM/qwen-code) is an open-source coding agent from the Qwen team at Alibaba. It is an interactive CLI at its core, with headless mode, IDE integrations for VS Code, Zed, and JetBrains, and a desktop app built on top. It natively supports the OpenAI, Anthropic, and Gemini protocols, so it can connect directly to the ScitiX OpenAI-compatible endpoint.

The configuration below applies to all Qwen Code forms.

Qwen Code requires **Node.js 22 or later** for the npm install. If the install produces a broken version or Qwen Code will not start, check `node --version`; installing with Node below 22 can pull an incomplete build.

## Configure

### 1. Install Qwen Code

Check your Node version first:

```bash theme={null}
node -v
```

If it is below 22, upgrade Node. The [official download page](https://nodejs.org/en/download) covers every platform and method.

<CodeGroup>
  ```bash macOS (Homebrew) theme={null}
  brew install node@24
  ```

  ```bash Windows (winget) theme={null}
  winget install OpenJS.NodeJS.LTS
  ```

  ```bash Linux/macOS (nvm) theme={null}
  nvm install 24 && nvm use 24
  nvm alias default 24
  ```
</CodeGroup>

<Warning>
  With nvm, set a default alias. Without it, new terminals may fall back to the old Node version and npm-installed commands can disappear from `PATH`.
</Warning>

Install Qwen Code:

```bash theme={null}
npm install -g @qwen-code/qwen-code@latest
# or
brew install qwen-code
qwen --version
```

### 2. Configure with environment variables

Create an API Key on the [API Keys](https://console.scitix.ai/model-inference/api_keys) page, then put the connection settings in Qwen Code's env file. It is loaded automatically on every launch and in every terminal.

```bash theme={null}
mkdir -p ~/.qwen
cat >> ~/.qwen/.env <<'EOF'
OPENAI_API_KEY=<Your API Key>
OPENAI_BASE_URL=https://api.scitix.ai/model-api/v1
OPENAI_MODEL=glm-5.2
EOF
qwen
```

Plain `export` commands also work, but only last for the current shell session. Qwen Code searches `.qwen/.env`, then `.env` walking up from the current directory, then `~/.qwen/.env`, then `~/.env`. A project-level `.qwen/.env` lets different projects use different keys.

On first launch, pick your provider in the `/auth` dialog. The current UI offers **Alibaba ModelStudio**, **Third-party Providers**, and **Custom Provider**. Use **Custom Provider** for ScitiX.

### 3. Configure with `settings.json`

For a persistent setup, create the config directory if this is a fresh machine, then edit `~/.qwen/settings.json`:

```bash theme={null}
mkdir -p ~/.qwen
```

```json theme={null}
{
  "modelProviders": {
    "openai": {
      "protocol": "openai",
      "models": [
        {
          "id": "glm-5.2",
          "baseUrl": "https://api.scitix.ai/model-api/v1",
          "envKey": "SCITIX_API_KEY"
        }
      ]
    }
  },
  "security": { "auth": { "selectedType": "openai" } },
  "model": { "name": "glm-5.2" }
}
```

Store the key in Qwen Code's env file:

```bash theme={null}
echo 'SCITIX_API_KEY=<Your API Key>' >> ~/.qwen/.env
qwen
```

A plain `export SCITIX_API_KEY="..."` also works, but only lasts for the current shell session. A new terminal loses it and Qwen Code shows "Missing credentials ... Set that environment variable".

With `security.auth.selectedType` set, Qwen Code starts directly into the configured provider without the `/auth` dialog.

| Field                                    | Description                                                                        |
| ---------------------------------------- | ---------------------------------------------------------------------------------- |
| `modelProviders.openai.models[].id`      | Model ID, such as `glm-5.2`. Must match `model.name` exactly.                      |
| `modelProviders.openai.models[].baseUrl` | ScitiX OpenAI-compatible endpoint: `https://api.scitix.ai/model-api/v1`.           |
| `modelProviders.openai.models[].envKey`  | Environment variable holding your API Key. Optional; defaults to `OPENAI_API_KEY`. |
| `security.auth.selectedType`             | Set to `openai` to use this provider by default.                                   |

<Warning>
  `model.name` must match an `id` under `modelProviders` exactly. Otherwise, the model will not show up in `/model`.
</Warning>

`glm-5.2` is the recommended default. For faster responses, `DeepSeek-V4-Flash` is also verified to support native tool calling.

If you do not want to export anything, `settings.json` also accepts a top-level `"env": { "SCITIX_API_KEY": "..." }` block. It has the lowest priority; shell exports and `.env` files win. A project-level `.qwen/settings.json` overrides the home-directory one.

## Verify

In interactive mode, send a task such as "list the current directory and summarize the project structure" and confirm that tool calls and responses work.

You can also verify headlessly:

```bash theme={null}
qwen -p "introduce yourself in one sentence, and name the model you're connected to"

# headless run that's allowed to edit files
# approval modes: plan / default / auto-edit / auto / yolo
qwen -p --approval-mode yolo "create a file named check.txt containing ok"
```

## VS Code Companion

Qwen Code has an official VS Code extension, **Qwen Code Companion** (`qwenlm.qwen-code-vscode-ide-companion`). Run `/ide install` inside Qwen Code to set it up, or install it from the marketplace and run `/ide enable`.

It feeds workspace context, such as recent files, cursor position, and selection, to the agent and shows native diff review. Zed and JetBrains integrations are also available. See the [official IDE integration docs](https://qwenlm.github.io/qwen-code-docs/en/users/ide-integration/ide-integration/).
