Qwen Code

Qwen Code is Alibaba's CLI AI coding assistant. Configure it to use Unisound MaaS models with pay-as-you-go or U Plan.

1. Preparation

Before connecting an AI tool, complete the following preparation steps.

1. Get an API Key

The platform supports pay-as-you-go and U Plan. Credentials differ by billing mode:

Usage
Description
How to get credentials (API Key examples below)
Pay-as-you-go API
Billed by usage; suitable for light use
  • Base URL OpenAI-compatible: https://maas-api.unisound.com/v1
  • API Key
  • Format: sk-xxxxx

Go to API Key Management to create an API Key

U Plan
Fixed subscription fee with plan quotas
  • Base URL OpenAI-compatible: https://maas-api.unisound.com/v1
  • API Key
  • Format: tp-xxxxx

After successfully subscribing to U Plan, go to Subscription Management to get your dedicated API Key

Pay-as-you-go supports all modalities, including text, speech, and vision.

A plan-exclusive Key is for plan quota. It may exist before paid resources are available; you can use resources only when you have plan quota. See U Plan overview.

2. Install Qwen Code

  1. Install or update Node.js (v22.19 or later).
  2. Run the following command in a terminal to install Qwen Code.
Qwen Code install screenshot
Bash
npm.cmd install -g @qwen-code/qwen-code@latest

Verify the install. A version number means success.

Bash
qwen --version

3. Configure the target model

Method 1: Edit the config file (recommended)

Create or edit ~/.qwen/settings.json (Windows: C:\\Users\\<username>\\.qwen\\settings.json), write the following config, and save — no sign-in required.

Replace UNISOUND_API_KEY with your API Key and '<'MODEL_ID'>' with the target Model ID.

JSON
{
  "modelProviders": {
    "openai": [
      {
        "id": "<MODEL_ID>",
        "name": "<MODEL_ID>",
        "baseUrl": "https://maas-api.unisound.com/v1"
      }
    ]
  },
  "env": {
    "OPENAI_API_KEY": "UNISOUND_API_KEY"
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "<MODEL_ID>"
  }
}

model.name must match the provider id as the default model. API Key comes from env.OPENAI_API_KEY or the same environment variable.

Then run:

Shell
setx UNISOUND_API_KEY "UNISOUND_API_KEY"

For example:

Shell
setx UNISOUND_API_KEY "sk-xxxxxxxx"

Afterwards, start Qwen Code:

Bash
qwen

Method 2: Environment variables

Set the following environment variables in a terminal:

macOS/Linux:

Bash
export OPENAI_API_KEY="UNISOUND_API_KEY"
export OPENAI_BASE_URL="https://maas-api.unisound.com/v1"
export OPENAI_MODEL="u2-flash"

Windows:

PowerShell
$env:OPENAI_API_KEY = "UNISOUND_API_KEY"
$env:OPENAI_BASE_URL = "https://maas-api.unisound.com/v1"
$env:OPENAI_MODEL = "u2-flash"

Add the commands to ~/.bashrc or ~/.zshrc (or system env vars on Windows) for persistence.

See Preparation for how to obtain an API Key and its format.

Run qwen in your project. Use /model to view and switch models.

Qwen Code startup screenshot

4. Quick access to capability models

We provide U2-ASR, U2-TTS, U2-TTS-Clone, and U2-OCR capabilities. Add the matching model Skill in Qwen Code to call these services without integrating each model API separately.

Open a Skill page below to install via chat or CLI. After installation, the Skill guides you through model configuration.

Model
Skill Name
Skill Description
Action
U2-OCR
u1-ocr-parser-pro
Document Parsing
U2-OCR
u1-ocr-extract-pro
Document Information Extraction and Classification
U2-OCR-Med
u1-ocr-med-pro
Medical Document Information Extraction and Classification
U2-ASR
u2-asr-pro
Speech Transcription
U2-TTS
u2-tts-pro
Speech Synthesis
U2-TTS-Clone
u2-tts-clone-pro
Voice Cloning