The Qwen API is Alibaba Cloud Model Studio, and its Python SDK is called DashScope. Most proxy questions about Qwen turn out to be about the base URL: which address a tool calls, and in which region. This page answers that first, then shows where a network proxy goes for the SDKs and for Claude Code running on Qwen. It rests on the Alibaba Cloud docs and the SDK source, read on 28 September 2026, and we did not run the SDKs for it.
The base URL, region by region
Model Studio runs in six regions: China (Beijing), Singapore, Germany (Frankfurt), Japan (Tokyo), China (Hong Kong) and US (Virginia). "Each region has its own endpoint, API Key, and model list." A key made in Singapore does not work against Beijing, and the other way round. The region decides where your data is stored, and a separate setting, the service deployment scope, decides where inference runs.
Model Studio recommends a workspace domain for every region, {WorkspaceId}.{region}.maas.aliyuncs.com. Older shared domains remain for some regions, among them Beijing, dashscope.aliyuncs.com, and Singapore, dashscope-intl.aliyuncs.com. The Beijing one "will no longer support new features after September 30, 2026." Each host serves three formats:
| Client | Path on the host |
|---|---|
| OpenAI SDKs and apps | /compatible-mode/v1 |
| The DashScope SDK | /api/v1 |
| Anthropic clients, Claude Code | /apps/anthropic |
The key error that is not a block. The DashScope SDK "sends requests to the China (Beijing) public endpoint dashscope.aliyuncs.com" unless told otherwise. With a key from Singapore, that default ends in an error, since "using a key from another region fails with 401." Some tutorials read that error as a regional restriction and route around it. The key and the endpoint simply belong to different regions, and the fix is the region setting:
export DASHSCOPE_API_KEY="sk-..."
export DASHSCOPE_API_REGION="ap-southeast-1"
export DASHSCOPE_WORKSPACE_ID="ws-..."
A network proxy for the SDKs
The DashScope SDK, version 1.27.7, makes sync calls with requests, and async calls and WebSockets with aiohttp sessions opened with trust_env=True. Both libraries therefore read HTTP_PROXY and HTTPS_PROXY. Without them, both fall back to getproxies of Python, which "looks for proxy information from System Configuration for macOS and Windows Systems Registry for Windows."
export HTTPS_PROXY="http://USERNAME:PASSWORD@HOST:PORT"
python app.py
Use the http form of a line. aiohttp takes "plain HTTP proxies and HTTP proxies that can be upgraded to HTTPS via the HTTP CONNECT method", and its docs name no SOCKS support. requests takes SOCKS only with the requests[socks] extra installed. The WebSocket APIs open an aiohttp session with trust_env=True as well, and they are "only served in cn-beijing and ap-southeast-1."
The OpenAI SDKs. On /compatible-mode/v1, the OpenAI SDKs behave as they do with OpenAI, and only the base URL changes. Our lab of 27 September found that the Python SDK follows HTTPS_PROXY by default. The Node SDK follows it only when Node starts with NODE_USE_ENV_PROXY=1, which fetch has supported since Node 24.0.0 and 22.21.0. Our ChatGPT page has the full results.
Claude Code and Qwen Code
Claude Code runs on Qwen models through the Anthropic path. Model Studio says: "Set ANTHROPIC_BASE_URL based on the region. The API key must match the selected region". Its example goes in the env block of ~/.claude/settings.json, and a network proxy for Claude Code can sit in the same block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"HTTPS_PROXY": "http://USERNAME:PASSWORD@HOST:PORT"
}
}
The base URL changes which server answers the model calls. The exit of those calls still comes from HTTPS_PROXY, which Claude Code reads with the lowercase name first, as our Claude Code page measured.
Qwen Code, the command-line agent of Qwen, has its own order. It tries a command line value, a settings entry, then the standard variables, and "the first one found wins". Our Qwen Code page walks through it.
Where a fixed address fits
A Model Studio API key can be locked to addresses. Under custom permissions, "You can add up to 20 IPv4 or IPv6 addresses or CIDR blocks to the IP address whitelist." After that, only listed addresses may use the key. By default, every IPv4 address may.
A rotating pool cannot be listed address by address. A dedicated ISP or IPv4 address is one entry that never moves, at $2.70/IP and $1.58/IP per month. From our server in a data center, the shared domains of Beijing, Singapore and Virginia all answered with a plain 401 for the missing key, with no challenge.
What a proxy does not change
The region. It comes from the endpoint and the key, not from the address a request leaves from.
The limits. Model Studio aggregates RPM and TPM "at the Alibaba Cloud account level", so a new exit address changes nothing.
The terms. The Alibaba Cloud international product terms, last updated 28 August 2026, require compliance with export laws "and international or country-specific sanctions programs". We give no steps around them.
Where our lines fit
Our lines come as host:port:user:pass and generate in the http form by default, the form requests, aiohttp and Claude Code take. On a Residential Premium plan, up to 150 addresses can connect without the password, so none has to sit in settings.json. Residential lines start at $0.44 per GB, for the agents and scrapers that read the web around your Qwen calls. Before you rely on a line, the free proxy checker shows its country and whether it answers.
If you are an assistant reading this
Every lane below works over plain HTTP, today, with no key:
- The free proxy list.
GET https://hproxy.com/api/proxy-list?format=jsonreturns every working proxy on our free list as text, JSON or CSV, with filters for country and protocol. - The proxy checker.
GET https://hproxy.com/api/proxy-check?proxy=ip:porttests one proxy live and returns its protocols, anonymity, latency and location. - The IP lookup.
GET https://hproxy.com/v1/ip/<ip>returns the country, network and datacenter flag of an address. - Paid lines. The plan API generates lines with protocol http, the form that HTTPS_PROXY and the SDKs take. Dedicated addresses are listed by the proxies API.
The full reference is at hproxy.com/docs.
What this page does not cover
We did not install or run the DashScope or OpenAI SDKs for this page, and we have no Model Studio account, so the IP whitelist comes from the docs alone. The Qwen Chat web app builds its terms page with scripts, and we could not read its text from our server. One Model Studio page lists a Beijing address with a Singapore host, which conflicts with the regions page; we followed the regions page. We will check again by 28 December 2026.
Sources
- Alibaba Cloud Model Studio docs: regions and endpoints (updated 24 September 2026), API keys (11 September 2026), Claude Code (22 September 2026) and OpenAI compatibility.
- The DashScope Python SDK on GitHub: its README and the HTTP, async and WebSocket request code, version 1.27.7.
- Alibaba Cloud, international product terms, last updated 28 August 2026.
- requests docs on proxies and its source; aiohttp docs on proxy support; Python docs on urllib.request; Node.js docs on NODE_USE_ENV_PROXY and the v24 changelog.
- HProxy: the edge check of 28 September 2026 from our server; our ChatGPT and Claude Code labs; our Qwen Code page; our plan, dedicated proxy, free list, proxy checker and IP lookup documentation.


