All Products
Search
Document Center

Alibaba Cloud Model Studio:Get an API key

Last Updated:Mar 23, 2026

Get an API key to call models and applications.

Get an API key

Important

Use your Alibaba Cloud account or a RAM user with administrator or API-Key page permissions.

  1. 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.

  2. 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.

  3. Click the image icon next to the API key to copy it.

    Root accounts can view all API keys. RAM users can only view keys they created.

    2026-02-11_11-56-27

When should you choose a different account or workspace?

For team collaboration or cost allocation:

  • Owner Account: To bind a key to a specific member, select the corresponding RAM user. If the user is removed from the workspace, the key becomes invalid.

  • Workspace: Workspaces isolate resources and permissions for different projects or teams. To control model access or split billing, create a sub-workspace and select it from the list.

See Permission management and Billing and cost management.

Use API keys

Note

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/v1

      • US (Virginia): https://dashscope-us.aliyuncs.com/compatible-mode/v1

      • China (Beijing): https://dashscope.aliyuncs.com/compatible-mode/v1

      • China (Hong Kong): https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1

      • Germany (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.

Note

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.