Skip to main content

创建 Skill

从已上传的 zip 包创建技能。请求体仅含 file_id,name 与 description 由服务端从 zip 包内的 SKILL.md 解析得到。新建技能进入 checking,扫描通过后变为 active,仅 active 可挂载到智能体;命中安全风险变为 rejected。

前提

已完成 Endpoint 与鉴权配置,详见API 总览与认证。创建技能前需先用File上传 zip 包获得 file_id。zip 包根目录须包含 SKILL.md,声明技能名称与描述。

接口

POST /skills 请求体仅含 file_id,对应文件须为 .zip 且通过审核。name 与 description 由服务端从 zip 包内的 SKILL.md 解析得到。

请求示例

curl -X POST "$AGENTSTUDIO_URL/skills" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id": "file_xxx"}'

响应字段

id string技能 ID,格式 skill_xxxtype string固定为 skillname / description string从 zip 包内 SKILL.md 解析得到source string来源:customer(自建) / official(阿里云百炼官方)status string扫描状态:checking / active / rejected / deleted,仅 active 可挂载latest_version string最新版本号,挂载到智能体时不能锁定到 latest,必须指定具体版本号created_at / updated_at string创建 / 最近更新时间,ISO 8601request_id string本次请求的唯一标识

响应示例

{
  "id": "skill_xxx",
  "type": "skill",
  "name": "pdf3.0",
  "description": "Use this skill whenever the user wants to do anything with PDF files...",
  "source": "customer",
  "status": "checking",
  "latest_version": "1.0",
  "created_at": "2026-06-16T07:56:03Z",
  "updated_at": "2026-06-16T07:56:03Z",
  "request_id": "xxx"
}

扫描状态

新建技能或上传新版本进入 checking 状态,扫描通过后变为 active 才可挂载到智能体;命中安全风险变为 rejected,不能挂载,可根据版本信息获取具体错误原因。删除后状态为 deleted。