Skip to main content
Memory API

Authentication

API Key acquisition and usage

Memory API uses API Key authentication. Pass the key via the Authorization header.

Get credentials

1

Open the console

Open the Bailian console and log in with your Alibaba Cloud account.
2

Get API Key

Obtain DASHSCOPE_API_KEY from the console, starting with sk-. See Get API Key.
API keys have account-level permissions. Store them securely and never commit to code repositories.

Usage

Configure as an environment variable:
export DASHSCOPE_API_KEY="sk-xxxxxxxxxxxxxxxx"
Each request carries the Authorization header:
curl https://dashscope.aliyuncs.com/api/v2/apps/memory/add \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json"

Permissions

  • Alibaba Cloud primary account: can call all endpoints directly
  • RAM sub-accounts: require appropriate permissions
  • API Key scope is configured in the console

Security best practices

  • Never in repos: use environment variables
  • Per-app keys: use separate keys for each app
  • Rotate regularly: change keys periodically
View AddMemory to start calling.
Overview
Managed Agent API
Sandbox API
Memory API
Flow Agent API
RAG API
Connector API
Framework Integration
Assistant API (Deprecating)
  • Overview