Skip to content

Qwen Code FAQ #61

@koalazf99

Description

@koalazf99

1. Where do I get an API key? (如何申请 API Key)

Region Console Notes
🌏 Outside Mainland China https://modelstudio.console.alibabacloud.com/ Global console
🇨🇳 Mainland China https://bailian.console.aliyun.com/ 国内控制台

2. Quick one‑liner to launch Qwen Code (如何用一行命令启动 Qwen Code)

# Outside Mainland China
OPENAI_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1 \
OPENAI_API_KEY=your-api-key \
OPENAI_MODEL=qwen3-coder-plus \
qwen

# 中国大陆
OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 \
OPENAI_API_KEY=你的API密钥 \
OPENAI_MODEL=qwen3-coder-plus \
qwen

3. Using a .env file (project‑local) (如何通过 .env 文件配置)

# put this file in your project root
OPENAI_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1
OPENAI_API_KEY=your-api-key
OPENAI_MODEL=qwen3-coder-plus

# 将如下文件放置在你自己的项目根目录下
OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
OPENAI_API_KEY=your-api-key
OPENAI_MODEL=qwen3-coder-plus

4. Running without saving these variables (不用环境变量登录)

Running qwen with no env will drop you into the interactive GUI login.
Press Enter to open the prompt, then paste: API Key, Base URL, Model name
(We have fixed this issue in the latest npm package, please run npm i -g @qwen-code/qwen-code@latest to upgrade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FAQThis will not be worked oncategory/cliCommand line interface and interactionpriority/P3Low - Minor, cosmetic, nice-to-fix issuesscope/documentationDocumentation toolingstatus/need-informationMore information is needed to resolve this issue.status/needs-triageIssue needs to be triaged and labeledtype/documentationDocumentation improvements or additions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions