Get an API key to call models and applications.
Get an API key
Use your Alibaba Cloud account or a RAM user with administrator or API-Key page permissions.
Go to the Alibaba Cloud Model Studio console, select your target region in the upper-right corner. Go to the API key page and click Create API Key.
In the pop-up window, 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 the
icon 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 requires a dedicated API key (format: sk-sp-xxxxx), not the general Model Studio API key (format: sk-xxxxx). For the dedicated API key and base URL, see Get your plan-specific API key and base URL.
Method 1: Call models in third-party tools.
If you use a tool such as Chatbox to call a model, you typically need:
The API key from 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/v1China (Hong Kong):
https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1Germany (Frankfurt):
https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/compatible-mode/v1. Replace{WorkspaceId}with your actual Workspace ID.
The model name, such as qwen-plus
Set up developer tools: Chatbox, Cline, Claude Code, Dify, OpenClaw (formerly Clawdbot/Moltbot), Postman, Qwen Code.
Method 2: Call models in code
Call the Qwen API in code. Set the API key as an environment variable to avoid hardcoding it in source code.
Never share your API key publicly. Unauthorized use can cause security breaches or financial loss.
API key permissions
An API key’s permissions are determined by its workspace. All API keys in the same workspace share identical permissions. You do not need separate keys for different model types (such as text-to-text, text-to-image, speech synthesis).
Default workspace API key: You can use this API key to call all standard models and applications in the default workspace.
Sub-workspace keys: can call standard models that the sub-workspace has been granted access to, and applications within that sub-workspace.
Fine-grained access control for API keys is currently supported only in the China (Beijing) region:
Specify an IP address whitelist to restrict which IP addresses can use this API key.
Configure model-level authorization to limit this API key’s access to specific models.
API key validity
API keys remain valid permanently unless deleted manually.
To grant temporary access to third-party applications or users, or to control high-risk operations such as accessing or deleting sensitive data, generate a temporary API key (valid for 60 seconds). This avoids exposing long-term API keys and reduces leak risk.
FAQ
Q: How many API keys can I create under one Alibaba Cloud account?
A: Each Alibaba Cloud account supports up to 10 workspaces (including the default workspace), 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 in the RAM console, all API keys created by the user become invalid and can no longer be used to call models.