Create an API key to call models and applications.
Create an API key
Use your Alibaba Cloud account or a RAM user with administrator or API-Key page permissions.
-
Open the API Key (Singapore), API Key (US (Virginia)), or API Key (China (Beijing) page and click Create API Key.
-
Configure the following settings and click OK:
-
Owner Account: Select the Alibaba Cloud account (digit-only ID in the Account column).
-
Workspace: Select the default workspace.
-
-
Click
next to the API key to copy it.Root accounts can view all API keys. RAM users can only view keys they created.

Use API keys
Coding Plan users: use your exclusive API key (format: sk-sp-xxxxx), see Get your plan-specific API key and base URL. Do not use the general API key (format: sk-xxxxx) from this page.
-
Method 1: In third-party tools
To call models in third-party tools like Chatbox, you might need:
-
The API key from this page
-
The base URL for the region where the API key was created:
-
Singapore:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1 -
US (Virginia):
https://dashscope-us.aliyuncs.com/compatible-mode/v1 -
China (Beijing):
https://dashscope.aliyuncs.com/compatible-mode/v1
-
-
The model name, such as qwen-plus
Common tools: Chatbox, Cline, Claude Code, Dify, OpenClaw, Use Postman or cURL, Qwen Code.
-
-
Method 2: Through code
When calling Qwen APIs for the first time through code, set the API key as an environment variable to avoid hardcoding it in source code and reduce exposure risk.
Never share your API key publicly - unauthorized use can cause security breaches or financial loss.
Permissions
An API key’s permissions are fully determined by its workspace. All API keys in the same workspace have identical permissions. You do not need separate keys for different model types (text, image, speech).
-
Default workspace keys: Can call all models and applications in the default workspace.
-
Sub-workspace keys: Can call models that the sub-workspace has been granted access to, along with applications within that sub-workspace.
Validity
API keys remain valid permanently unless deleted.
To grant temporary access to third-party applications or control high-risk operations (accessing or deleting sensitive data), generate a temporary API key (valid for 60 seconds). This avoids exposing long-term keys and reduces leakage risk.
FAQ
Q: How many API keys can I create under one Alibaba Cloud account?
A: Each account supports up to 10 workspaces (including default), and each workspace supports up to 20 API keys.
Q: If a RAM user is deleted, are the API keys they created still usable?
A: After you disable or delete a RAM user, all keys created by that user become invalid and cannot call models.