Qwen Code CLI Custom Model Configuration

Qwen Code uses the modelProviders configuration in ~/.qwen/settings.json to customize the Provider. Here, the OpenAI-compatible protocol is fixed.

Configuration

{
  "modelProviders": {
    "acedatacloud": [
      {
        "id": "MODEL_ID",
        "name": "MODEL_ID",
        "envKey": "ACEDATACLOUD_API_KEY",
        "baseUrl": "https://api.acedata.cloud/v1",
        "provider": "openai"
      }
    ]
  },
  "providerProtocol": { "acedatacloud": "openai" }
}

modelProviders.acedatacloud must be an array. Provider entries are independently configured and will not automatically inherit other top-level context, Header, or body parameters.

Verification

export ACEDATACLOUD_API_KEY="PASTE_YOUR_ACEDATACLOUD_API_TOKEN_HERE"
qwen --auth-type openai --model MODEL_ID --output-format stream-json \
  --prompt "Reply only OK"

After entering, send Reply only OK, then run the read-only file tool again. If the strictly compatible endpoint rejects the tool result format, please check the current Qwen Code version and the official compatibility instructions.

Official References

Return to the Coding Plan Configuration Center.