Qwen Code
Qwen Code can integrate with CoAIWork through a custom OpenAI Provider.
Configuration Values
| Item | Value |
|---|---|
baseUrl |
https://coaiwork.com/v1 |
Request path relative to baseUrl |
/chat/completions |
| Default model | gpt-5.4 |
apiKey |
CoAIWork API token |
| Protocol | OpenAI Compatible |
Because baseUrl already includes /v1, Qwen Code requests /chat/completions. The full URL is https://coaiwork.com/v1/chat/completions.
| Environment | Qwen Code config path |
|---|---|
| macOS | ~/.qwen/settings.json |
| Linux | ~/.qwen/settings.json |
| Windows | $HOME\.qwen\settings.json |
Recommended ~/.qwen/settings.json
{
"model": "gpt-5.4",
"modelProvider": "coaiwork",
"modelProviders": {
"coaiwork": {
"name": "CoAIWork",
"baseUrl": "https://coaiwork.com/v1",
"envKey": "OPENAI_API_KEY",
"authType": "openai"
}
}
}
Warning
OPENAI_API_KEY must be set as an environment variable. Do not hard-code the real token in settings.json. envKey only tells Qwen Code which environment variable name to read.
macOS
npm install -g @qwen-code/qwen-code@latest
echo 'export OPENAI_API_KEY="<YOUR_TOKEN>"' >> ~/.zshrc
source ~/.zshrc
mkdir -p ~/.qwen
Save the configuration to ~/.qwen/settings.json, then run:
qwen
Linux
npm install -g @qwen-code/qwen-code@latest
echo 'export OPENAI_API_KEY="<YOUR_TOKEN>"' >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/.qwen
Save the configuration to ~/.qwen/settings.json, then run:
qwen
Windows
npm install -g @qwen-code/qwen-code@latest
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "<YOUR_TOKEN>", "User")
New-Item -ItemType Directory -Force $HOME\.qwen | Out-Null
Save the configuration to $HOME\.qwen\settings.json, then run:
qwen