VNAI Pro
Client tools

Qwen Code

Configure Qwen Code with your gateway key and model

Qwen Code supports custom providers and does not require a Qwen model. Choose a coding model with tool calling using the shared guide.

1. Install Qwen Code

Requires Node.js 22 or later:

npm install -g @qwen-code/qwen-code@latest
qwen --version

2. Use the terminal wizard

Run qwen, enter /auth, and select Custom Provider. Choose OpenAI-compatible, use https://api.vnaipro.app/v1 as the base URL, and enter your gateway key and model ID from Check models.

Do not choose a DeepSeek/Alibaba preset just because the model name matches: those presets target the vendor's endpoint.

3. Or use a configuration file

Create or merge into personal ~/.qwen/settings.json (Windows: %USERPROFILE%\.qwen\settings.json):

{  "modelProviders": {    "openai": [      {        "id": "YOUR_MODEL_ID",        "name": "VNAI Pro model",        "baseUrl": "https://api.vnaipro.app/v1",        "envKey": "VNAI_API_KEY"      }    ]  },  "env": {    "VNAI_API_KEY": "YOUR_API_KEY"  },  "security": {    "auth": {      "selectedType": "openai"    }  },  "model": {    "name": "YOUR_MODEL_ID"  }}

Replace the key and both occurrences of YOUR_MODEL_ID. This example uses Chat Completions. Matching shell or .env variables may override the key in settings.json.

For Claude through Anthropic Messages, rename modelProviders.openai to anthropic, set security.auth.selectedType to anthropic, use the gateway root https://api.vnaipro.app, and select a Claude model available to your key's group. Do not use Chat Completions for a Responses-only model.

4. Verify

Start qwen, use /model to select the configured model, then test a chat and file read. If another provider remains active, revisit /auth and check for project-level overrides. See common errors.

Sources: Qwen Code, Authentication, Model providers.

On this page