API Key Configuration Guide
Qwen Code requires access to the Qwen3-Coder model, so you need to configure the Alibaba Cloud API key.
Configuration steps
- Register for an Alibaba Cloud account and activate the Model Studio service
- Generating API Keys in the Alibaba Cloud Console
- Select any of the following configuration methods:
- Environment variable approach::
export OPENAI_API_KEY="your_api_key_here" export OPENAI_BASE_URL="https://dashscope-intl.aliyuncs.com/compatible-mode/v1" export OPENAI_MODEL="qwen3-coder-plus"
- The .env file method: Create a .env file in the root directory of the project and add the contents:
OPENAI_API_KEY=your_api_key_here OPENAI_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1 OPENAI_MODEL=qwen3-coder-plus
- Environment variable approach::
caveat
- API keys should be kept secure and not disclosed
- Calling the API may incur costs, please refer to the Alibaba Cloud website for specific prices.
- Network stability is required to ensure successful API calls
This answer comes from the articleQwen Code: Gemini CLI-Based Command Line Tools for Code Generation and ManagementThe
































