Qwen Code access
Qwen Code officially supports configuring any OpenAI compatible interface in modelProviders.openai of settings.json. This article does not use Qwen’s own services and directly sends the request to ShangHai Do.
If not yet installed, follow Qwen Code quick start to install the client. After installation, run qwen --version in a terminal to confirm the command is available.
configuration file
User-level configuration file:
Windows:%USERPROFILE%\.qwen\settings.json
macOS / Linux:~/.qwen/settings.json
Write or merge the following:
{
"modelProviders": {
"openai": [
{
"id": "qwen3.8-flash",
"name": "ShangHai Do qwen3.8-flash",
"baseUrl": "https://shanghaido.com/v1",
"envKey": "SHANHAI_API_KEY",
"wireApi": "chat-completions"
}
]
},
"security": {
"auth": {
"selectedType": "openai"
}
},
"model": {
"name": "qwen3.8-flash"
}
}
wireApi refers to the request format: chat-completions refers to /v1/chat/completions that calls this site. Do not change it to responses in the configuration of this article unless you confirm otherwise that both the model and the client use the Responses API.
Set token and start
Windows PowerShell:
$env:SHANHAI_API_KEY = "YOUR_API_KEY"
qwen
macOS / Linux:
export SHANHAI_API_KEY="YOUR_API_KEY"
qwen
Qwen Code officially supports reading tokens from shell environment variables, project .qwen/.env or user configuration. It is recommended to use environment variables or .qwen/.env instead of writing the real token into the file that will be submitted to the warehouse.
After startup, you can run /model to view the model, or you can use:
qwen --model "qwen3.8-flash"
Get started
Send a normal question first, and then perform a task that only reads a small file. Long conversations and multi-assistant tasks need to meet both client configuration and model capability requirements.
If the model does not exist, confirm that the return values of id and /v1/models are consistent; if the request reaches the wrong protocol, confirm that selectedType is openai and wireApi is chat-completions .
official information
encountered a problem
If you encounter problems with calling or configuration, please contact the site customer service and provide the model name, error time and error information to facilitate troubleshooting.