Skip to main content
Credential

创建 Credential

在密钥库中创建密钥

POST
/api/v1/agentstudio/credentials
cURL
curl --request POST \
  --url 'https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio/credentials' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "vault_id": "vault_01JXH5K2",
  "name": "OpenAI Key",
  "key": "OPENAI_API_KEY",
  "value": "sk-xxxxx"
}
'
{
  "id": "cred_01JXH5K2",
  "vault_id": "vault_01JXH5K2",
  "name": "OpenAI Key",
  "key": "OPENAI_API_KEY",
  "created_at": "2026-07-20T10:00:00Z",
  "updated_at": "2026-07-20T10:00:00Z",
  "workspace_id": "ws_xxx",
  "request_id": "req_xxx"
}

Authorizations

string
header
required

DashScope API Key

Body

application/json
string
required

所属密钥库 ID

string
required

密钥显示名称

string
required

变量名,供工具引用(如 MY_API_KEY)

string
required

变量值(密钥内容),保存后不可查看明文

object

Response

200-application/json
string

密钥 ID

string
string
string

变量名

string
string
string
string
RAG API
Connector API
Memory API
框架集成
  • 框架