Before using models or applications in Alibaba Cloud Model Studio, get an API key for authentication.
Get an API key
Use your Alibaba Cloud account, or a RAM user with administrator or API-Key page permissions.
Go to the API Key (Singapore), API Key (US (Virginia)), or API Key (China (Beijing)) page. Click Create API Key.
In the dialog box, 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.The Alibaba Cloud account can view all API keys. RAM users can only view API keys they created.

Use an API key
Method 1: In third-party tools
If you call models in tools or platforms such as Chatbox, you might need:
The API key you get in this topic
The base URL for the region where the API key was created:
Singapore:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1US (Virginia):
https://dashscope-us.aliyuncs.com/compatible-mode/v1China (Beijing):
https://dashscope.aliyuncs.com/compatible-mode/v1
The model name, such as qwen-plus
Common tools: Chatbox, Cline, Claude Code, Dify, OpenClaw (formerly Clawdbot/Moltbot), Postman, 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 hard coding it in your source code and reduce the risk of exposure.
Never share your API key publicly. Unauthorized use can lead to security risks 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 API keys for different models (such as text-to-text, text-to-image, or speech synthesis).
API keys in the default workspace: Can call all models and applications in the default workspace.
API keys in a sub-workspace: 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 you mannually delete them.
To grant temporary access to third-party applications or users, or require strict control over high-risk operations such as accessing or deleting sensitive data, generate a temporary API key (valid for 60 seconds). This avoids exposing long-term valid API keys and reduces the risk of leakage.
FAQ
Q: How many API keys can I create under one Alibaba Cloud account?
A: Each Alibaba Cloud account can have up to 10 workspaces (including the default workspace), and each workspace can have 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 in the RAM console, all API keys created by that RAM user become invalid and can no longer be used to call models.