Store the key in DASHSCOPE_API_KEY, not in code. Build the base URL with your workspace ID as the first label under ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1; swapping regions without swapping keys is the classic silent 401. Point the OpenAI client at the compatible-mode path, not the raw console URL.