跳转到内容
EN

创建技能版本

POST/agent/v1/skills/{skill_id}/versions◐ 部分支持

请求参数

  • skill_idstring必填

    path: 技能 ID(skill_...),由 skills.create 或 skills.list 返回。其他组织的技能返回 404。

  • filesarray必填

    要上传的技能文件。所有文件必须位于同一顶层目录,且该目录根部必须包含 SKILL.md 文件。

返回

200

支持上传 Skill 目录(含 SKILL.md)并按版本管理,下载的是 application/zip。只支持 source=custom,source=anthropic 返回空列表。上传总大小不超过 8 MB、最多 200 个文件,路径不得含 .. 或绝对路径。版本不可变;有未删除版本的技能不能删除(409),需先删除全部版本。

错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码

请求示例

curl
curl https://api.deepraxis.com/agent/v1/skills/skill_123/versions \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -F "files[]=@docs-sample/SKILL.md;filename=docs-sample/SKILL.md" \
  -F "display_name=docs-sample"
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证);每个文件部分的文件名就是它的相对路径
resp = requests.post(
    f"{opts['base_url']}/v1/skills/skill_123/versions",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    files=[
        ("files[]", ("docs-sample/SKILL.md", open("docs-sample/SKILL.md", "rb"), "text/markdown")),
    ],
    data={"display_name": "docs-sample"},
)
resp.raise_for_status()
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证);每个文件部分的文件名就是它的相对路径
const { readFile } = await import("node:fs/promises");
const form = new FormData();
form.append("files[]", new File([await readFile("docs-sample/SKILL.md")], "docs-sample/SKILL.md", { type: "text/markdown" }));
form.append("display_name", "docs-sample");
const resp = await fetch(`${opts.baseURL}/v1/skills/skill_123/versions`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}` },
  body: form,
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
console.log(resp.status, await resp.json());

响应示例 200

{
  "id": "1792747592161000",
  "type": "skill_version",
  "skill_id": "skill_5413fa74f9db40dda811ec5f1281a793",
  "name": "docs-sample",
  "description": "Greets the user in one line, second version.",
  "created_at": "2026-10-23T09:26:32.893Z"
}

响应

HTTP 200

Successful response

multipart/form-data

名称 类型 说明
id string Unique identifier for this Skill Version. The id addresses the version in paths and pins it in references.
created_at string ISO 8601 timestamp of when the skill was created.
description string Description of the skill version. This is extracted from the SKILL.md file in the skill upload.
name string The Skill's immutable kebab-case slug, set at creation from the first upload's SKILL.md frontmatter name (or its enclosing directory). Every later upload must resolve to the same value. Also the top-level directory of the Skill's mounted files and the base name of a downloaded archive.
skill_id string Unique identifier for the skill. The format and length of IDs may change over time.
type string Object type. For Skill Versions, this is always "skill_version".