This topic describes how to obtain an API key.
If you use an Alibaba Cloud account, you can obtain all API keys. However, if you use a RAM user, you can only obtain the API key of the RAM user.
Log on to the Alibaba Cloud Model Studio console.
Click the
icon in the top right corner. Then, click API-KEY.
On the My API Key page, find the API key you want to obtain and click View in the Actions column.
API key-based access control
When you use APIs or SDKs to access Alibaba Cloud Model Studio services, take note of the following issues:
1. You can use the API key of your Alibaba Cloud account to access authorized resources, such as applications and model services, in all workspaces. However, you must specify the workspace ID when accessing the resources in a sub-workspace. For more information, see Call a model in a sub-workspace.
2. You can use the API key of a RAM user to access resources in the workspace associated with the API key.
If you want to access resources in the default workspace by using a RAM user, use one of the following methods:
(1) Use the API key of the Alibaba Cloud account.
(2) Request the Admin role of the default workspace from the Alibaba Cloud account. This way, you can create an API key of this RAM user to call resources in the default workspace.