Start with the job: an editor that helps you write code can use a supported coding subscription; your own product backend needs a standard model API. A plan key and a standard API key can look similar while belonging to different billing systems. Decide this before choosing a model.
Choose an official API entry point
| Model family | Standard API base URL for the documented route | Example model ID | Where to get the key |
|---|---|---|---|
| Qwen | https://{workspace-id}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 | qwen3.6-plus | Alibaba Cloud Model Studio, Singapore workspace |
| DeepSeek | https://api.deepseek.com | deepseek-flash | DeepSeek API Platform |
| GLM | https://api.z.ai/api/paas/v4 | glm-5.4 | Z.ai Open Platform, standard API key |
| Kimi | https://api.moonshot.ai/v1 | kimi-k3.1-pro | Kimi API Platform |
These are examples from the linked official documents, not a promise that an account in any country can buy or use them. Use the vendor’s published signup and billing options; if your account or location is ineligible, select a provider or region you can legitimately use. Do not reuse a mainland-platform key against a different provider account or regional endpoint.
Qwen: set up a small standard API test in Singapore
- Match the account, workspace and endpoint. Open Model Studio with an eligible Alibaba Cloud account and select Singapore. Create a standard API key in the workspace you will call. Copy the region’s workspace endpoint from the console and confirm that your workspace offers
qwen3.6-plus. - Set local environment variables. Set
MODEL_STUDIO_WORKSPACEto the workspace ID copied from the console (normally beginningllm-) andMODEL_STUDIO_API_KEYto the standard key. Do not put the token into a browser bundle or commit it to your repo. - Make one bounded request. Save the following script as
check-qwen.pyand runpython check-qwen.py. It sends only a harmless test prompt. Calling a standard API may incur charges; check the rate and your account beforehand. If successful, look for an answer resemblingreadyand a usage object, rather than assuming that a response is free.
import json
import os
from urllib.request import Request, urlopen
# Use a standard Singapore Model Studio key, not a Coding Plan key.
workspace = os.environ["MODEL_STUDIO_WORKSPACE"]
key = os.environ["MODEL_STUDIO_API_KEY"]
if not workspace.startswith("llm-") or not workspace.replace("-", "").isalnum():
raise ValueError("Use the workspace ID shown in your Model Studio console.")
if key.startswith("sk-sp-"):
raise ValueError("Use a standard API key for this metered endpoint.")
base = f"https://{workspace}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1"
body = {"model": "qwen3.6-plus", "messages": [
{"role": "user", "content": "Reply with the word ready."}
], "max_tokens": 128, "enable_thinking": False}
req = Request(base + "/chat/completions", data=json.dumps(body).encode(),
headers={"Authorization": f"Bearer {key}",
"Content-Type": "application/json"}, method="POST")
with urlopen(req, timeout=30) as reply:
result = json.load(reply)
print(result["choices"][0]["message"]["content"])
print(result.get("usage", {}))
Use Qwen Code without mixing billing routes
In Qwen Code, select Alibaba ModelStudio, select the billing route you actually have, then choose Singapore when using the international setup documented here. A Coding Plan takes its dedicated key and plan endpoint (https://coding-intl.dashscope.aliyuncs.com/v1 for the OpenAI-compatible route); the standard API uses the Singapore workspace key and URL above. Use the documentation for the client’s required protocol. Alibaba documents the Coding Plan for interactive coding, not general backend scripts or batch jobs.
If you see 401, 403, 404 or a surprise charge
- 401: Compare the key family and region with the base URL first. A valid key in the wrong region or plan can still fail authentication.
- 403: Check that the account has permission to use that workspace and that any key restrictions allow the application's outbound connection. Do not send full keys in screenshots or logs.
- 404 or model unavailable: Make sure a client that appends
/chat/completionsreceived the base URL only, then confirm the exact model ID is listed in that region or subscription. - Usage shows up as metered: Check that the editor is not still configured with your standard key and endpoint. A subscription on the account does not convert calls made to a metered endpoint into plan usage.
When access works, compare a single small, non-confidential task before moving a project. See Coding Plan vs pay-as-you-go API for the same-model calculation and a downloadable sample coding task.
Sources & verification
- Alibaba Cloud Model Studio: regional endpoints and billing-plan key pairing — Sources checked 2026-12-03
- Alibaba Cloud: Singapore access and international deployment scope — Sources checked 2026-12-03
- Alibaba Cloud: OpenAI-compatible Chat API parameters and examples — Sources checked 2026-12-03
- Alibaba Cloud: obtain a Model Studio API key — Sources checked 2026-12-03
- Alibaba Cloud: Qwen Code configuration and billing route — Sources checked 2026-12-03
- Alibaba Cloud: Coding Plan scope, model list, price and quotas — Sources checked 2026-12-03
- DeepSeek API: first call, protocols and served model aliases — Sources checked 2026-12-03
- Z.ai international API quick start and separate Coding Plan instructions — Sources checked 2026-12-03
- Kimi API Platform international quick start and API base URL — Sources checked 2026-12-03
Sources checked YYSI checked official documentation for the four routes and separated vendor statements from editorial guidance. The sample uses a standard Python HTTP client. No provider API request, account signup, purchase, or country-by-country eligibility test was made for this guide.
Read our editorial standards or send corrections to [email protected].