MCP API uses a Model Studio API key for authentication and is accessed through a workspace endpoint.
MCP API uses an Alibaba Cloud Model Studio API key for authentication. Each request carries the API key in an HTTP header.
Set the API key as an environment variable:
Each request carries the
Get an API key
- Log on to the Alibaba Cloud Model Studio console.
- Go to the API Key page, create an API key, and copy it.
Configure the endpoint
workspace_id: the workspace ID. Log on to the Model Studio console and copy it from the workspace menu in the upper-right corner.
Send a request
Set the API key as an environment variable:
Authorization header:
Permissions
- The Alibaba Cloud primary account can call all APIs.
- RAM users require the corresponding permissions.
- The permission scope of an API key is configured in the console.
If authentication fails or workspace information is missing, the API returns
403 AccessDenied. For details, see MCP API error codes.