查询技能版本

列出技能的版本快照。该接口可显式读取当前工作区或系统工作区中的技能版本。

GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/skills/{skill_id}/versions

调用前准备

先查询技能列表,从同一列表项取得技能 ID 和技能所属工作区。将两个返回值分别保存为 SKILL_ID 和 SKILL_WORKSPACE_ID。系统技能的 SKILL_WORKSPACE_ID 为 system。

请求参数

curl --get "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/versions" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode "skill_workspace_id=$SKILL_WORKSPACE_ID" \
  --data-urlencode "limit=20" \
  --data-urlencode "offset=0"

路径参数

参数

类型

是否必填

说明

workspace_id

string

是

当前工作区 ID。

skill_id

string

是

技能 ID。

查询参数

参数

类型

是否必填

说明

skill_workspace_id

string

否

技能所属工作区。使用技能列表同一项返回的 workspace_id。系统技能为 system。未提供时使用当前工作区。

limit

integer

否

每页数量。默认 50,最大 200。

offset

integer

否

起始偏移量。负数按 0 处理。

成功响应

{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "skill_ver_02",
        "workspace_id": "ws_01",
        "skill_id": "skill_01",
        "version": 2,
        "spec_snapshot": {
          "name": "摘要技能",
          "status": "active",
          "id": "",
          "workspace_id": "",
          "source_type": "",
          "routing_summary": {},
          "instruction": {
            "body": "总结用户提供的内容。"
          },
          "requirements": {},
          "version": 1,
          "created_at": "2026-01-02T15:04:05Z",
          "updated_at": "2026-01-02T15:04:05Z"
        },
        "change_summary": "补充输出约定",
        "created_at": "2026-01-03T10:00:00Z"
      }
    ],
    "total": 2,
    "limit": 20,
    "offset": 0
  }
}

字段

类型

说明

code

integer

成功时为 0。

data

object

本次请求的结果。

data.items

array

结果列表。

data.items[].id

string

技能版本记录 ID。为空或未设置时可省略。

data.items[].workspace_id

string

所属工作区标识。为空或未设置时可省略。

data.items[].skill_id

string

技能标识。为空或未设置时可省略。

data.items[].change_summary

string

版本变更说明。为空或未设置时可省略。

data.items[].created_by

string

创建者标识。为空或未设置时可省略。

data.items[].version

integer

版本号。为空或未设置时可省略。

data.items[].spec_snapshot

object

该版本的完整技能快照。为空或未设置时可省略。

data.items[].spec_snapshot.annotations

object

扩展注释。为空或未设置时可省略。

data.items[].spec_snapshot.category

string

分类。为空或未设置时可省略。

data.items[].spec_snapshot.created_at

string

创建时间。使用 RFC 3339 格式。为空或未设置时可省略。

data.items[].spec_snapshot.created_by

string

创建者标识。为空或未设置时可省略。

data.items[].spec_snapshot.description

string

说明。为空或未设置时可省略。

data.items[].spec_snapshot.icon_ref

string

图标引用。为空或未设置时可省略。

data.items[].spec_snapshot.id

string

技能 ID。为空或未设置时可省略。

data.items[].spec_snapshot.instruction

object

技能指令。为空或未设置时可省略。没有子字段时返回空对象。

data.items[].spec_snapshot.instruction.body

string

指令正文。为空或未设置时可省略。

data.items[].spec_snapshot.instruction.variables_schema

object

指令变量的 JSON Schema。为空或未设置时可省略。

data.items[].spec_snapshot.labels

object

扩展标签。为空或未设置时可省略。

data.items[].spec_snapshot.market_metadata

object

市场元数据。为空或未设置时可省略。

data.items[].spec_snapshot.metadata

object

扩展元数据。为空或未设置时可省略。

data.items[].spec_snapshot.name

string

名称。为空或未设置时可省略。

data.items[].spec_snapshot.output_contract

object

输出约定。为空或未设置时可省略。

data.items[].spec_snapshot.parameters_schema

object

技能输入参数的 JSON Schema。为空或未设置时可省略。

data.items[].spec_snapshot.phase

string

使用阶段。为空或未设置时可省略。

data.items[].spec_snapshot.pipeline_ref

string

流水线引用。为空或未设置时可省略。

data.items[].spec_snapshot.requirements

object

技能依赖要求。为空或未设置时可省略。没有子字段时返回空对象。

data.items[].spec_snapshot.requirements.description

string

说明。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.file_inputs

array

文件输入要求。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.file_inputs[].description

string

说明。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.file_inputs[].mime_types

array

接受的文件媒体类型。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.file_inputs[].name

string

名称。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.file_inputs[].required

boolean

是否必需。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.knowledge_base_roles

array

知识库角色要求。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.knowledge_base_roles[].description

string

说明。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.knowledge_base_roles[].required

boolean

是否必需。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.knowledge_base_roles[].role

string

知识库角色。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.model_capabilities

array

模型能力要求。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.skill_refs

array

依赖的技能标识。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_refs

array

依赖的工具标识。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs

array

工具资源引用。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].bindability_reason

string

绑定能力说明。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].bindable

boolean

是否可绑定。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].binding_source

string

绑定来源。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].category

string

分类。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].config

object

资源配置。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].description

string

说明。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].display_name

string

展示名称。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].id

string

引用项 ID。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].kind

string

工具类型。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].manageable

boolean

是否可管理。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].name

string

名称。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].phase

string

使用阶段。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].resource_id

string

所引用对象的 ID。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].runtime_tool_visibility

string

运行时工具可见性。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].status

string

状态。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].supported_runtimes

array

支持的运行时。为空或未设置时可省略。

data.items[].spec_snapshot.requirements.tool_resource_refs[].workspace_id

string

所属工作区标识。为空或未设置时可省略。

data.items[].spec_snapshot.routing_summary

object

技能路由摘要。为空或未设置时可省略。没有子字段时返回空对象。

data.items[].spec_snapshot.routing_summary.examples

array

路由示例。为空或未设置时可省略。

data.items[].spec_snapshot.routing_summary.summary

string

路由摘要正文。为空或未设置时可省略。

data.items[].spec_snapshot.source_ref

string

来源信息。为空或未设置时可省略。

data.items[].spec_snapshot.source_type

string

来源类型。为空或未设置时可省略。

data.items[].spec_snapshot.status

string

状态。为空或未设置时可省略。

data.items[].spec_snapshot.tags

array

标签。为空或未设置时可省略。

data.items[].spec_snapshot.updated_at

string

最近更新时间。使用 RFC 3339 格式。为空或未设置时可省略。

data.items[].spec_snapshot.updated_by

string

最近更新者标识。为空或未设置时可省略。

data.items[].spec_snapshot.version

integer

版本号。为空或未设置时可省略。

data.items[].spec_snapshot.workspace_id

string

所属工作区标识。为空或未设置时可省略。

data.items[].created_at

string

创建时间。使用 RFC 3339 格式。为空或未设置时可省略。

data.total

integer

匹配记录总数。

data.limit

integer

本次实际返回数量上限。

data.offset

integer

起始偏移量。

错误响应

{
  "code": 2,
  "message": "<错误信息>"
}

常见 HTTP 错误

HTTP 状态码

错误代码

说明

400

2(INVALID_ARGUMENT)

**常见原因:**技能 ID、工作区范围或分页参数无效。**建议操作:**检查路径和查询参数。

401

6(UNAUTHENTICATED)

**常见原因:**缺少有效身份凭据。**建议操作:**检查 API Key。

403

5(PERMISSION_DENIED)

**常见原因:**当前身份没有读取技能版本的权限。**建议操作:**检查工作区授权。

404

3(NOT_FOUND)

**常见原因:**系统目录中不存在该技能。**建议操作:**检查技能 ID 和 skill_workspace_id。

503

15(UNAVAILABLE)

**常见原因:**技能服务或授权依赖暂不可用。**建议操作:**稍后重试。

最后更新于