Skip to main content
Use AGCloud models in Qwen3 Coder — a terminal-based AI coding assistant powered by Qwen.

What is Qwen3 Coder?

Qwen3 Coder is a terminal-based AI coding assistant built on Qwen models. It enables developers to write, debug, and refactor code using natural language directly from the command line. Qwen3 Coder supports multiple AI providers through OpenAI-compatible, Anthropic, and Gemini API formats.
With AGCloud, you can use 160+ AI models from top providers (GLM, Kimi, MiniMax, DeepSeek, and more) directly in Qwen3 Coder — all with a single API key.

Step 1: Install Qwen3 Coder

Required Node.js 18+
Install Qwen3 Coder globally via npm:
npm install -g @qwen-code/qwen-code
Verify the installation:
qwen --version # e.g., 0.13.0

Step 2: Configure AGCloud API

Qwen3 Coder supports multiple API providers. Choose one or more based on the models you want to use.

Option A: Environment Variables (Quick Setup)

# OpenAI-compatible provider (supports GLM, Kimi, DeepSeek, etc.)
export OPEN_API_KEY="<YOUR_API_KEY>"
export OPEN_BASE_URL="https://aiandgpu.com/v1"

# Anthropic-compatible provider
export ANTHROPIC_API_KEY="<YOUR_API_KEY>"
export ANTHROPIC_BASE_URL="https://aiandgpu.com"

# Gemini-compatible provider
export GEMINI_API_KEY="<YOUR_API_KEY>"

qwen
You only need to configure the provider(s) you plan to use. For example, if you only want OpenAI-compatible models, you can skip the Anthropic and Gemini variables.
Add the environment variables to your shell profile so they persist across sessions. Linux/macOS:
# For zsh users
nano ~/.zshrc

# For bash users
nano ~/.bashrc
Add the following lines:
export OPEN_API_KEY="<YOUR_API_KEY>"
export OPEN_BASE_URL="https://aiandgpu.com/v1"
export ANTHROPIC_API_KEY="<YOUR_API_KEY>"
export ANTHROPIC_BASE_URL="https://aiandgpu.com"
Apply the changes:
# zsh users
source ~/.zshrc

# bash users
source ~/.bashrc
Windows (PowerShell - Permanent):
[System.Environment]::SetEnvironmentVariable("OPEN_API_KEY", "<YOUR_API_KEY>", "User")
[System.Environment]::SetEnvironmentVariable("OPEN_BASE_URL", "https://aiandgpu.com/v1", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "<YOUR_API_KEY>", "User")
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://aiandgpu.com", "User")
After setting environment variables on Windows, you need to restart PowerShell for the changes to take effect.

Step 3: Add Configuration File settings.json

The configuration file path depends on your operating system:
OSPath
Linux/macOS~/.qwen/settings.json
Windows%USERPROFILE%\.qwen\settings.json
# Create the directory if it doesn't exist
mkdir -p ~/.qwen

# Create or edit the configuration file
nano ~/.qwen/settings.json
Add the following content to settings.json:
{
  "modelProviders": {
    "openai": [
      {
        "id": "gpt-4o",
        "name": "GPT-4o",
        "envKey": "OPEN_API_KEY",
        "baseUrl": "https://aiandgpu.com/v1"
      },
      {
        "id": "gpt-4o-mini",
        "name": "GPT-4o Mini",
        "envKey": "OPEN_API_KEY",
        "baseUrl": "https://aiandgpu.com/v1"
      },
      {
        "id": "gemini-2.5-flash",
        "name": "Gemini 2.5 Flash",
        "envKey": "GEMINI_API_KEY",
        "baseUrl": "https://aiandgpu.com/v1"
      }
    ],
    "anthropic": [
      {
        "id": "claude-sonnet-4-6",
        "name": "Claude Sonnet 4.6",
        "envKey": "ANTHROPIC_API_KEY",
        "baseUrl": "https://aiandgpu.com"
      },
      {
        "id": "claude-opus-4-6",
        "name": "Claude Opus 4.6",
        "envKey": "ANTHROPIC_API_KEY",
        "baseUrl": "https://aiandgpu.com",
        "generationConfig": {
          "timeout": 120000,
          "maxRetries": 3,
          "contextWindowSize": 200000,
          "samplingParams": {
            "temperature": 1,
            "max_tokens": 65535
          }
        }
      }
    ]
  },
  "$version": 3,
  "security": {
    "auth": {
      "selectedType": "anthropic"
    }
  },
  "model": {
    "name": "claude-opus-4-6"
  }
}
Since AGCloud provides an OpenAI-compatible API format, Gemini models should also be placed under the openai provider section in the configuration.

Step 4: Start Using Qwen3 Coder

Launch Qwen3 Coder in your project directory:
cd your-project
qwen
If prompted to select an authentication method, choose the first option Qwen OAuth and press Enter. After logging in, use the /model command to switch to your configured models.
You can use natural language to interact with your codebase:
> Help me refactor the authentication module

> Find and fix the bug in the payment logic

> Write unit tests for the user service

> Explain the architecture of this project

Available Models

Below are the recommended models available through AGCloud:
Model NameProviderAPI FormatUse For
claude-opus-4-6AnthropicAnthropicComplex reasoning, full-stack dev
gemini-3.1-pro-previewGoogleOpenAIMultimodal tasks, long context
gpt-5-codexOpenAIOpenAICode generation, agentic tasks
glm-5ZhipuOpenAIComplex reasoning, full-stack dev
kimi-k2.5MoonshotOpenAILong context, code analysis
deepseek-v3.2DeepSeekOpenAICode generation, math
MiniMax-M2.5MiniMaxOpenAIGeneral coding, creative tasks
qwen3-235bQwenOpenAIMultilingual, reasoning
AGCloud supports 160+ models. You can browse all available models at https://aiandgpu.com/v1/models.

FAQ

1. How do I switch between models?

You can select a different model within Qwen3 Coder’s interactive interface, or specify the model via environment variables before launching.

2. Connection issues?

If you encounter connection errors:
  1. Verify your API key is valid at the AGCloud Dashboard
  2. Make sure the BASE_URL is set correctly (no trailing slash)
  3. Test connectivity:
curl https://aiandgpu.com/v1/models \
  -H "Authorization: Bearer <YOUR_API_KEY>"

3. Node.js version too old?

Qwen3 Coder requires Node.js 18+. Update using nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 22
nvm use 22