Skip to main content

Authentication

API Key authentication and credential setup for the Managed Agents API

The Managed Agents API uses Bailian API Key authentication. All requests carry the API Key in the HTTP header, and a single key grants access to all resources within its workspace.
Authorization: Bearer <your-api-key>

Get credentials

1

Activate Bailian and open the console

Open the Bailian console, sign in with your Alibaba Cloud account, and activate the service.
2

Create an API Key

Create and copy an API Key on the API-KEY page; it starts with sk-.
API Keys carry account-level permissions. Keep them secure and never share them publicly or commit them to a code repository.

Usage

Set the API Key as an environment variable:
export DASHSCOPE_API_KEY="sk-xxxxxxxxxxxxxxxx"
Include the Authorization header in every request:
curl "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/agents" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Permissions

  • Alibaba Cloud account: can call all endpoints directly.
  • RAM users: need the corresponding permissions granted first.
  • The permission scope of an API Key is configured in the console.
Once configured, start with Create Agent.