Skip to main content
Credential

Create a credential

Create a credential in the credential store

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": "vlt_xxx",
  "display_name": "第三方 API 密钥",
  "auth": {
    "type": "environment_variable",
    "secret_name": "API_KEY",
    "secret_value": "sk-xxxx",
    "networking": {
      "type": "unrestricted"
    }
  }
}
'
{
  "id": "cred_xxx",
  "type": "credential",
  "vault_id": "vlt_xxx",
  "display_name": "第三方 API 密钥",
  "auth": {
    "type": "environment_variable",
    "secret_name": "API_KEY",
    "networking": {
      "type": "unrestricted"
    }
  },
  "metadata": {},
  "archived_at": null,
  "created_at": "2026-07-10T08:00:00Z",
  "updated_at": "2026-07-10T08:00:00Z",
  "request_id": "req_xxx"
}

Authorizations

string
header
required

DashScope API Key

Body

application/json
string
required

所属 Vault ID,格式 vlt_xxx

object
required

认证信息,当前仅支持 environment_variable 类型。

string

Credential 可读名称,最大 255 字符

object

业务自定义键值对元数据

Response

200-application/json
string

Credential ID,格式 cred_xxx

string

固定为 credential

string

所属 Vault ID

string

Credential 可读名称

object

认证信息,敏感值已脱敏(如 secret_value 不返回)。

object

业务自定义键值对

string | null

归档时间,未归档时为 null

string

创建时间,ISO 8601

string

最近更新时间,ISO 8601

string

请求唯一标识

Overview
Sandbox API
Memory API
Flow Agent API
RAG API
Connector API
Framework Integration
Assistant API (Deprecating)
  • Overview