Skip to content

Qwen Code Integration ​

1. Prerequisites ​

  • Registered and obtained a platform API Key. If you are signed in, open the Integrations page, pick Qwen Code and copy the one-line command with your key and model already filled in, then run it in your terminal.
  • Qwen Code installed:
    bash
    npm i -g @qwen-code/qwen-code

codesw is Bumo's open-source provider switcher. It writes straight into Qwen Code's own config file — no proxy, no middleman. Run this in your terminal (replace YOUR_API_KEY with the key from the API Keys page):

bash
npx -y @bumocc/codesw use qwen-code bumo.ai claude-sonnet-5-5 --key YOUR_API_KEY

codesw writes ~/.qwen/settings.json (auth type set to OpenAI-compatible, so Qwen Code no longer asks how to sign in) and only touches the fields it manages; the rest of your config is kept. Right after writing, it tests the connection with that key and model and tells you whether the key is invalid, the model does not exist or the balance has run out. Run npx -y @bumocc/codesw test qwen-code any time to check again.

To switch models, replace claude-sonnet-5-5 with another model ID from the model list and run it again, or run npx -y @bumocc/codesw for the interactive mode and pick "Qwen Code" → "Bumo Router" → a model.

3. Launch ​

bash
qwen

Appendix: Manual Configuration (Alternative) ​

If you prefer not to touch the config file, set environment variables instead:

bash
export OPENAI_BASE_URL="https://router.bumo.ai/v1"
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_MODEL="claude-sonnet-5-5"
qwen --auth-type openai

Replace YOUR_API_KEY with your platform API Key.