Qwen Code Config Generator

Free generator for Qwen Code config. Choose Alibaba Model Studio, OpenRouter, or a local endpoint and copy a ready-to-use ~/.qwen/settings.json plus matching environment variables. Fixes the region base-URL mistakes that cause 401s.

Advertisement

Generate a Qwen Code settings.json

Qwen Code is OpenAI-compatible, so the same config shape works whether your model runs on Alibaba Model Studio, OpenRouter, or locally. This tool writes ~/.qwen/settings.json (the modelProviders block) and a matching set of environment variables.

Install Qwen Code

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

Pick your provider

  • Alibaba Model Studio — choose the right regional base URL (International/Singapore, China/Beijing, or US/Virginia). Using the wrong region is the most common cause of 401 errors.
  • OpenRouter — base URL https://openrouter.ai/api/v1, model in provider/model[:tag] form, e.g. qwen/qwen3-coder:free.
  • Local (Ollama / LM Studio) — point at http://localhost:11434/v1 or :1234/v1; any non-empty API key works.

Environment variables

The env tab gives you OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL exports as a quick alternative to the settings file.

FAQ

Why am I getting 401 errors?

Almost always a base-URL/region or key mismatch. Make sure the base URL matches the region your key was issued in.

Does anything leave my browser?

No — the config is generated entirely on your device.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.