{
  "openapi": "3.1.1",
  "info": {
    "title": "ModelScope OpenAPI",
    "description": "魔搭社区 OpenAPI 文档",
    "version": "1.1.0+master.20261022T105704Z",
    "termsOfService": "https://www.modelscope.cn/protocol/%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC",
    "contact": {
      "name": "modelscope",
      "url": "https://www.modelscope.cn/protocol/%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC",
      "email": "contact@modelscope.cn"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://modelscope.cn/openapi/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "User",
      "description": "用户相关接口"
    },
    {
      "name": "Models",
      "description": "模型相关接口"
    },
    {
      "name": "Datasets",
      "description": "数据集相关接口"
    },
    {
      "name": "MCP",
      "description": "MCP 服务相关接口"
    },
    {
      "name": "Studios",
      "description": "创空间相关接口"
    },
    {
      "name": "Skills",
      "description": "技能相关接口"
    },
    {
      "name": "AgentHub",
      "description": "AgentHub 相关接口"
    },
    {
      "name": "Files",
      "description": "文件上传相关接口"
    },
    {
      "name": "Agent-IDP",
      "description": "Agent-IDP身份认证服务（beta版本）"
    },
    {
      "name": "Magicube",
      "description": "魔粒体系相关接口"
    },
    {
      "name": "Collections",
      "description": "合集相关接口"
    },
    {
      "name": "Galleries",
      "description": "Gallery 相关接口"
    },
    {
      "name": "Agent Playground",
      "description": "实验场（Agent Playground）相关接口（beta版本）"
    }
  ],
  "externalDocs": {
    "description": "了解更多关于 ModelScope 的信息",
    "url": "https://modelscope.cn"
  },
  "paths": {
    "/users/me": {
      "get": {
        "operationId": "getCurrentUser",
        "summary": "获取当前用户信息",
        "description": "获取当前已认证用户的个人信息。",
        "tags": [
          "User"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-current-user-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "获取模型列表",
        "description": "列出模型",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "针对模型名称、作者（包括组织、个人）的子字符串关键词进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "examples": [
                "Qwen",
                "glm"
              ]
            }
          },
          {
            "name": "owner",
            "in": "query",
            "description": "针对模型作者（包括组织、个人）进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "iic",
                "ZhipuAI"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "排序方式",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "default",
                "downloads",
                "likes",
                "last_modified"
              ],
              "default": "default",
              "examples": [
                "default",
                "downloads",
                "likes",
                "last_modified"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "examples": [
                1
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页大小，限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "filter.task",
            "in": "query",
            "description": "按任务筛选（示例：text-generation / image-captioning）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "text-generation",
                "image-captioning"
              ]
            }
          },
          {
            "name": "filter.library",
            "in": "query",
            "description": "按库/框架筛选（示例：pytorch / safetensors / diffusers / transformer）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "pytorch",
                "safetensors",
                "diffusers",
                "transformer"
              ]
            }
          },
          {
            "name": "filter.model_type",
            "in": "query",
            "description": "按模型类型筛选（示例：qwen3_moe / glm4v）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "qwen3_moe",
                "glm4v"
              ]
            }
          },
          {
            "name": "filter.custom_tag",
            "in": "query",
            "description": "按自定义标签筛选（示例：llm）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "common-crawl",
                "markdown",
                "math",
                "html-parsing"
              ]
            }
          },
          {
            "name": "filter.license",
            "in": "query",
            "description": "按许可证筛选（示例：Apache License 2.0 / MIT License）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "Apache License 2.0",
                "MIT License"
              ]
            }
          },
          {
            "name": "filter.deploy",
            "in": "query",
            "description": "按部署方式筛选（示例：swingdeploy）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "swingdeploy"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-models-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createModel",
        "summary": "创建通用模型仓库",
        "description": "创建一个新的通用模型仓库。默认 `model_category` 为 `base`，即未进入任何专区的普通模型。\n\n如需创建 AIGC 模型或科学模型，请先调用本接口创建仓库，上传权重等文件后，再调用 `PUT /models/{owner}/{repo_name}/category` 设置模型类型及专区业务字段。\n\n使用用户访问令牌（Bearer Token）认证。只能在自己的命名空间或拥有写入/管理员权限的组织下创建。当前 OAuth 仅读取仓库的授权不支持创建。\n\n省略 license 时默认 apache-2.0；license=\"other\" 时必须提供 license_name，省略 license_link 时自动创建空白 LICENSE.md。创建时仅 visibility=\"gated\" 可传 gated_mode：auto 自动审批，manual 人工审批；省略或空字符串默认 auto。null、布尔值、数字及其他非法值返回 400。visibility 为 public/private（含省略后默认 public）时禁止传 gated_mode。请求仅接受文档列出的字段，未知字段返回 400。\n\n重复仓库返回 HTTP 409（DuplicateEntity）；权限或私有仓库配额不足返回 HTTP 403。创建成功返回 HTTP 201，所有 JSON 响应包含 request_id。\n\n本接口仅接收通用元数据字段，不接受 `aigc_type`、`base_model_architecture_type`、`primary_subject_area` 等专区字段。",
        "tags": [
          "Models"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateModelRequest"
              },
              "example": {
                "owner": "alice",
                "repo_name": "my-model",
                "visibility": "gated",
                "gated_mode": "manual",
                "task": "text-generation"
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/create-model-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/models/{owner}/{repo_name}": {
      "get": {
        "operationId": "getModel",
        "summary": "获取模型详情",
        "description": "根据 owner/repo_name 获取模型详情。model_category=base 时无专区字段；science 返回学科与封面；aigc 返回架构、内容类别及 versions。每个版本含数值 version_id、固定 Git tag 的 weight_files 元数据和 sample_images；AIGC 不返回 cover_image。所有响应均有 request_id。",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-model-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/models/{owner}/{repo_name}/category": {
      "put": {
        "operationId": "setModelCategory",
        "summary": "设置/变更模型类型",
        "description": "设置或变更模型的专区类型（`base` / `aigc` / `science`）。\n\n本接口是 PUT 类型转换；PATCH /category 仅局部更新当前类型，不能转换类型。必填项由目标 model_category 决定，与来源类型无关。\n\n| 目标类型 | 必填字段（除 model_category 外） | 可选字段 | 不适用字段 |\n| --- | --- | --- | --- |\n| base | 无 | 无 | AIGC 和 Science 专区字段 |\n| aigc | aigc_type、base_model_architecture_type、base_model_architecture_subtype、version_name、非空 weight_files、非空 sample_images | version_description、trigger_words、content_categories | version_id、cover_image、Science 学科字段 |\n| science | primary_subject_area、secondary_specialization | cover_image | version_id、version_name、weight_files、sample_images 等 AIGC 字段 |\n\n- 类型转换不修改 README.md 内容或 YAML 头；模型类型和专区元数据保存在数据库，AIGC 权重配置仍通过 configuration.json 管理\n- 转换为 AIGC 时创建新版本，传 version_name，不传用于更新已有版本的 version_id\n- 转换为 Science 时不创建 AIGC 版本/tag；无需 version_id，详情不返回 versions\n- 传入 `base` 时，只需提供 `model_category`，所有专区业务字段将被清除（回退为通用模型）\n- 目标为 aigc（包括创建新 tag）时 weight_files 和 sample_images 均必填且非空\n- 基础模型由架构子类型确定\n- AIGC 图片使用 sample_images（url 必填、prompt 和 negative_prompt 选填），cover_image 仅适用于科学专区\n- 需要仓库维护者权限；仅有读取权限的 OAuth scope 不允许修改\n- 科学分类和 AIGC 架构的实际枚举以 options 接口返回的产品数据为准\n- 传入非目标类型的字段将返回 400\n- 必填字段缺失时返回 400，`message` 一次性列出全部缺失字段名，并指引查询对应 options 接口",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetModelCategoryRequest"
              },
              "examples": {
                "toBase": {
                  "summary": "转换为普通模型",
                  "value": {
                    "model_category": "base"
                  }
                },
                "toAigc": {
                  "summary": "转换为 AIGC 并创建新版本",
                  "value": {
                    "model_category": "aigc",
                    "aigc_type": "Checkpoint",
                    "base_model_architecture_type": "Z_IMAGE_TURBO",
                    "base_model_architecture_subtype": "Z_IMAGE_TURBO",
                    "version_name": "v1.0",
                    "weight_files": [
                      {
                        "path_in_repo": "model.safetensors"
                      }
                    ],
                    "sample_images": [
                      {
                        "url": "https://modelscope.oss-cn-beijing.aliyuncs.com/resource/modelscope_logo.png",
                        "prompt": "清晰的山间风景",
                        "negative_prompt": "模糊、低清晰度"
                      }
                    ]
                  }
                },
                "toScience": {
                  "summary": "转换为 Science，学科必填、封面选填",
                  "value": {
                    "model_category": "science",
                    "primary_subject_area": "life-sciences",
                    "secondary_specialization": "medicine"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/set-model-category-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "updateModelCategory",
        "summary": "更新模型专区与已有 tag 元数据",
        "description": "Science 更新 primary_subject_area、secondary_specialization、cover_image 不需要 version_id，且不应传 AIGC 版本字段；Science 详情不返回 versions。仅更新当前模型专区或已有 AIGC tag 的元数据；类型由服务端从数据库读取当前仓库确定；不接受 model_category，传入返回 400，类型转换使用 PUT /category。更新 tag 描述、触发词或样例图时，必须提供 GET 详情 versions[].version_id 的数值 ID。省略不变，显式空值清空，但必填字段和非空样例图约束仍需满足。已有 tag 的权重不可修改：weight_files、version_name 和 base_model_id 不接受，权重变化请 PUT /category 创建新 tag。AIGC 不接受 cover_image，样例图使用 sample_images。不适用于数据库当前类型的字段返回 400，message 列出当前类型及所有不适用字段；显式 null 也按传入字段校验。所有响应均有 request_id。此接口不修改 README.md 或 YAML 头。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetModelCategoryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateModelCategoryRequest"
              },
              "examples": {
                "aigcVersion": {
                  "summary": "更新 AIGC 版本字段，需要 version_id",
                  "value": {
                    "version_id": 1070760,
                    "version_description": null,
                    "trigger_words": []
                  }
                },
                "scienceCover": {
                  "summary": "更新 Science 封面，无需 version_id",
                  "value": {
                    "cover_image": "https://modelscope.oss-cn-beijing.aliyuncs.com/resource/modelscope_banner.png"
                  }
                },
                "scienceSubjects": {
                  "summary": "更新 Science 学科，无需 version_id",
                  "value": {
                    "primary_subject_area": "life-sciences",
                    "secondary_specialization": "medicine"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/model/aigc/options": {
      "get": {
        "operationId": "listAigcModelOptions",
        "summary": "查询 AIGC 模型配置项枚举",
        "description": "返回设置 AIGC 模型类型时可用的配置项枚举：aigc_types（模型子类型）、base_architectures（基础模型架构一级/二级级联）、content_styles / content_functions / content_elements（内容类别三级联动）。设置或更新 AIGC 模型的枚举字段取值以本接口返回的 id 为准。 所有层级的选项使用 label 作为展示名称，提交参数使用 id。 基础架构涵盖 IMAGE、VIDEO、AUDIO，base_architectures 为一级架构，subtypes 为二级架构；每项均包含 type、id、label。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/aigc-model-options-success"
          },
          "429": {
            "$ref": "#/components/responses/too-many-requests"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": []
      }
    },
    "/model/science/options": {
      "get": {
        "operationId": "listScienceModelOptions",
        "summary": "查询科学模型配置项枚举",
        "description": "返回设置科学模型类型时可用的学科分类树：subject_areas（一级学科）及其下属 specializations（二级专业方向）。primary_subject_area / secondary_specialization 的取值以本接口返回的 id 为准。 所有层级的选项使用 label 作为展示名称，提交参数使用 id。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/science-model-options-success"
          },
          "429": {
            "$ref": "#/components/responses/too-many-requests"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": []
      }
    },
    "/datasets": {
      "get": {
        "operationId": "listDatasets",
        "summary": "获取数据集列表",
        "description": "列出数据集",
        "tags": [
          "Datasets"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "针对数据集中文名称、数据集英文名称、作者（包括组织、个人）的子字符串关键词进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "examples": [
                "ImageNet",
                "中文语料库"
              ]
            }
          },
          {
            "name": "owner",
            "in": "query",
            "description": "针对数据集作者（包括组织、个人）进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "modelscope",
                "AI-ModelScope"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "排序方式",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "default",
                "downloads",
                "likes",
                "last_modified"
              ],
              "default": "default",
              "examples": [
                "default",
                "downloads",
                "likes",
                "last_modified"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "examples": [
                1
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页大小，限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "filter.task",
            "in": "query",
            "description": "按任务筛选（示例：text-classification）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "text-classification"
              ]
            }
          },
          {
            "name": "filter.license",
            "in": "query",
            "description": "按许可证筛选（示例：Apache License 2.0 / cc-by-4.0）",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "Apache License 2.0",
                "cc-by-4.0"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-datasets-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createDataset",
        "summary": "创建通用数据集仓库",
        "description": "创建通用数据集仓库，默认 dataset_category=base。只接受通用元数据；科学字段通过 PUT /category 设置。license=other 时需要 license_name；省略 license_link 自动创建 LICENSE.md。创建时仅 visibility=\"gated\" 可传 gated_mode：auto 自动审批，manual 人工审批；省略或空字符串默认 auto。null、布尔值、数字及其他非法值返回 400。visibility 为 public/private（含省略后默认 public）时禁止传 gated_mode。请求仅接受文档列出的字段，未知字段返回 400。成功返回 201，所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "201": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetWriteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDatasetRequest"
              },
              "example": {
                "owner": "alice",
                "repo_name": "my-dataset",
                "visibility": "gated",
                "gated_mode": "manual",
                "license": "apache-2.0"
              }
            }
          }
        }
      }
    },
    "/datasets/{owner}/{repo_name}": {
      "get": {
        "operationId": "getDataset",
        "summary": "获取数据集详情",
        "description": "根据 owner/repo_name 获取数据集详情。dataset_category=base 时无科学字段；science 返回 primary_subject_area、secondary_specialization 和 cover_image。通用字段包含 visibility 和 login_required。所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-dataset-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/mcp/servers": {
      "put": {
        "operationId": "listMcpServers",
        "summary": "获取MCP服务列表",
        "description": "返回查询的 ModelScope MCP 广场服务列表",
        "tags": [
          "MCP"
        ],
        "requestBody": {
          "description": "查询参数",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {
                    "type": "string",
                    "description": "支持针对服务中文名称、服务英文名称、作者/所有者用户名进行搜索"
                  },
                  "filter": {
                    "type": "object",
                    "description": "筛选条件",
                    "properties": {
                      "category": {
                        "type": "string",
                        "description": "指定筛选类别标签。与tag,is_hosted同时传入时,取三者的交集",
                        "examples": [
                          "communication"
                        ]
                      },
                      "is_hosted": {
                        "type": "boolean",
                        "description": "指定筛选hosted或未hosted MCP服务。与tag,category同时传入时,取三者的交集",
                        "examples": [
                          true
                        ]
                      }
                    }
                  },
                  "page_number": {
                    "type": "integer",
                    "description": "页码，默认为 1，限制 page_number * page_size <= 100",
                    "default": 1
                  },
                  "page_size": {
                    "type": "integer",
                    "description": "每页大小，默认为20，限制 page_number * page_size <= 100",
                    "default": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-mcp-servers-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/mcp/servers/operational": {
      "get": {
        "operationId": "listOperationalMcpServers",
        "summary": "获取用户托管MCP服务列表",
        "description": "获取用户托管MCP服务列表",
        "tags": [
          "MCP"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-operational-mcp-servers-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/mcp/servers/{id}": {
      "get": {
        "operationId": "getMcpServer",
        "summary": "获取指定MCP服务详情",
        "description": "返回指定 MCP 服务的详细信息",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_server_id"
          },
          {
            "name": "get_operational_url",
            "in": "query",
            "description": "传入true时返回当前用户在modelscope上托管的MCP服务链接（例如SSE_URL），默认false",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-mcp-server-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/mcp/servers/{id}/deploy": {
      "post": {
        "operationId": "deployMcpServer",
        "summary": "部署MCP服务",
        "description": "部署MCP服务",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_server_id"
          }
        ],
        "requestBody": {
          "description": "部署参数",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transport_type": {
                    "type": "string",
                    "description": "传输方式: sse/streamable_http",
                    "enum": [
                      "sse",
                      "streamable_http"
                    ],
                    "examples": [
                      "streamable_http"
                    ]
                  },
                  "expiration_minutes": {
                    "type": "integer",
                    "description": "有效期（分钟），-1 代表长期有效",
                    "examples": [
                      -1,
                      60,
                      1440
                    ]
                  },
                  "auth_check": {
                    "type": "boolean",
                    "description": "远程 url 连接时是否需要提供魔搭访问令牌鉴权",
                    "default": false
                  },
                  "env_info": {
                    "type": "object",
                    "description": "MCP环境变量，具体需要传入的环境变量可在获取指定MCP服务详情接口返回的 env_schema 字段中获取",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/deploy-mcp-server-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/mcp/servers/{id}/undeploy": {
      "delete": {
        "operationId": "undeployMcpServer",
        "summary": "解除MCP服务部署",
        "description": "解除MCP服务部署",
        "tags": [
          "MCP"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/mcp_server_id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/undeploy-mcp-server-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios": {
      "get": {
        "operationId": "listStudios",
        "summary": "获取创空间列表",
        "description": "列出创空间",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "针对创空间名称、展示名称、作者（包括组织、个人）的子字符串关键词进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "examples": [
                "chatbot",
                "demo"
              ]
            }
          },
          {
            "name": "owner",
            "in": "query",
            "description": "针对创空间作者（包括组织、个人）进行搜索",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "iic",
                "ZhipuAI"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "排序方式",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "default",
                "last_modified",
                "view_num",
                "likes"
              ],
              "default": "default",
              "examples": [
                "default",
                "last_modified",
                "view_num",
                "likes"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "examples": [
                1
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页大小（1~50），限制 page_number * page_size <= 3000",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "examples": [
                10
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "按创空间运行状态筛选。正常搜索仅支持 running；当按 owner 筛选时，默认为 all",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "running",
                "all"
              ],
              "default": "running",
              "examples": [
                "running",
                "all"
              ]
            }
          },
          {
            "name": "mcp_support",
            "in": "query",
            "description": "是否支持通过MCP使用",
            "required": false,
            "schema": {
              "type": "boolean",
              "examples": [
                true,
                false
              ]
            }
          },
          {
            "name": "hardware_type",
            "in": "query",
            "description": "根据创空间硬件类型筛选，当前仅支持筛选 xGPU",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "xgpu",
                "amd"
              ],
              "examples": [
                "xgpu"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-studios-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "createStudio",
        "summary": "创建创空间",
        "description": "创建一个新的 Studio（创空间）",
        "tags": [
          "Studios"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStudioRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-studio-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/hardware": {
      "get": {
        "operationId": "listHardware",
        "summary": "查询可用硬件配置",
        "description": "查询创空间可用的硬件配置列表。\n- 未登录：返回默认免费硬件\n- 已登录：返回用户可用的免费硬件和带价格的付费硬件\n- 已登录且指定创空间：免费硬件以该创空间的可用免费资源为准\n- 付费资源：使用 `paid/<InstanceType>` 作为创建或更新 Studio 时的 `hardware` 参数值\n- `sdk_type` 用于按 `supported_sdk_types` 过滤硬件配置\n",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "name": "sdk_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StudioSDKType"
            },
            "description": "过滤支持该 SDK 类型的硬件"
          },
          {
            "name": "studio",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "创空间路径（owner/repo_name），指定后返回该创空间可选的硬件"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-hardware-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      }
    },
    "/studios/sdk-versions": {
      "get": {
        "operationId": "listSdkVersions",
        "summary": "查询可用 SDK 版本",
        "description": "查询创空间可用的 SDK 版本列表。\n仅当 `sdk_type=gradio` 时返回 Gradio 版本列表；其他 SDK 类型或未传 `sdk_type` 时返回空列表。\n",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "name": "sdk_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StudioSDKType"
            },
            "description": "SDK 类型，仅 `gradio` 返回版本列表",
            "example": "gradio"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-sdk-versions-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      }
    },
    "/studios/base-images": {
      "get": {
        "operationId": "listBaseImages",
        "summary": "查询可用基础镜像",
        "description": "查询创空间可用的基础镜像列表，登录与否返回结果一致",
        "tags": [
          "Studios"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-base-images-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      }
    },
    "/studios/{owner}/{repo_name}": {
      "get": {
        "operationId": "getStudio",
        "summary": "获取创空间详情",
        "description": "获取指定 Studio 的详细信息。\n公开（public）和公开体验（protected）类型的创空间无需认证即可访问；私有（private）创空间需要认证。\n",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-studio-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      }
    },
    "/studios/{owner}/{repo_name}/settings": {
      "patch": {
        "operationId": "updateStudioSettings",
        "summary": "更新创空间设置",
        "description": "更新指定 Studio 的设置，传入哪个字段修改哪个字段，不传的字段不修改。注意：sdk_type、sdk_version、base_image、hardware 修改后需重新部署才能生效",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStudioSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-studio-settings-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/{owner}/{repo_name}/secrets": {
      "get": {
        "operationId": "listStudioSecrets",
        "summary": "获取创空间密文变量列表",
        "description": "获取指定 Studio 的所有密文变量 key 列表，不返回 value；创建或更新时填写的 description 会一并返回",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "responses": {
          "200": {
            "description": "成功获取密文变量列表",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListStudioSecretsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "addStudioSecret",
        "summary": "添加创空间密文变量",
        "description": "为指定的 Studio 添加一个密文变量，value 不会公开展示；可通过可选的 description 记录该变量的用途（最长 512 字符），描述含敏感内容时返回 400",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "description": "添加密文变量请求参数",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddStudioSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "updateStudioSecret",
        "summary": "更新创空间密文变量",
        "description": "更新指定 Studio 的一个密文变量值，并可同时更新可选的 description（最长 512 字符）；未提供 description 时保留原有描述，描述含敏感内容时返回 400",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "description": "更新密文变量请求参数",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStudioSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteStudioSecret",
        "summary": "删除创空间密文变量",
        "description": "删除指定 Studio 的一个密文变量",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "description": "删除密文变量请求参数",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteStudioSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/{owner}/{repo_name}/variables": {
      "get": {
        "operationId": "listStudioVariables",
        "summary": "获取创空间明文变量列表",
        "description": "获取指定 Studio 的所有明文变量的 key、value 和可选的 description（与密文变量不同，明文变量的值公开可见）",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-studio-variables-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "addStudioVariable",
        "summary": "添加创空间明文变量",
        "description": "为指定的 Studio 添加一个明文变量（key 和 value 都公开可见，敏感信息请使用密文变量接口）；可通过可选的 description 记录该变量的用途（最长 512 字符），描述含敏感内容时返回 400",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddStudioVariableRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "updateStudioVariable",
        "summary": "更新创空间明文变量",
        "description": "更新指定 Studio 的一个明文变量值，并可同时更新可选的 description（最长 512 字符）；未提供 description 时保留原有描述，描述含敏感内容时返回 400",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStudioVariableRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteStudioVariable",
        "summary": "删除创空间明文变量",
        "description": "删除指定 Studio 的一个明文变量",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteStudioVariableRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-operation-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/{owner}/{repo_name}/deploy": {
      "post": {
        "operationId": "deployStudio",
        "summary": "部署创空间",
        "description": "部署指定的 Studio（会重新拉取代码并重建），无论当前状态是停止还是运行中均可调用",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-runtime-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/{owner}/{repo_name}/stop": {
      "post": {
        "operationId": "stopStudio",
        "summary": "停止创空间",
        "description": "停止指定的 Studio",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/studio-runtime-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/studios/{owner}/{repo_name}/logs/{log_type}": {
      "get": {
        "operationId": "getStudioLogs",
        "summary": "获取创空间日志",
        "description": "获取指定 Studio 的运行日志",
        "tags": [
          "Studios"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/studio_owner"
          },
          {
            "$ref": "#/components/parameters/studio_repo_name"
          },
          {
            "$ref": "#/components/parameters/studio_log_type"
          },
          {
            "name": "page_num",
            "in": "query",
            "description": "页码，默认 1",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页数量，默认 100，最大 500",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 500
            }
          },
          {
            "name": "keyword",
            "in": "query",
            "description": "关键字过滤",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "description": "开始时间戳（秒），可不填，自动根据 end_timestamp 计算",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "description": "结束时间戳（秒），可不填，默认当前时间",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-studio-logs-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/skills": {
      "get": {
        "operationId": "listSkills",
        "summary": "获取技能列表",
        "description": "返回 ModelScope 技能广场的技能列表，支持关键词搜索与多维度筛选",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "关键词搜索，支持技能名称、描述等",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.developer",
            "in": "query",
            "description": "按开发者筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "amap-web": {
                "value": "AMap-Web",
                "summary": "开发者 AMap-Web"
              }
            }
          },
          {
            "name": "filter.category",
            "in": "query",
            "description": "按分类筛选",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SkillCategory"
            },
            "examples": {
              "developer-tools": {
                "value": "developer-tools",
                "summary": "开发工具"
              },
              "ai-media": {
                "value": "ai-media",
                "summary": "AI 媒体"
              }
            }
          },
          {
            "name": "filter.license",
            "in": "query",
            "description": "按许可证筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "mit": {
                "value": "MIT License",
                "summary": "MIT 许可证"
              }
            }
          },
          {
            "name": "filter.custom_tag",
            "in": "query",
            "description": "按自定义标签筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "api-design": {
                "value": "api-design",
                "summary": "API 设计"
              }
            }
          },
          {
            "name": "filter.owner",
            "in": "query",
            "description": "按所有者筛选",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，从 1 开始",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页条数",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-skills-success"
          },
          "400": {
            "$ref": "#/components/responses/skill-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/skill-unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/skill-internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/skill-service-unavailable"
          }
        }
      },
      "post": {
        "operationId": "createSkill",
        "summary": "创建技能",
        "description": "创建一个新的 Skill（技能）。\n\n创建流程：\n1. 先调用 `POST /files/upload` 上传 Skill 项目文件（zip 包，根目录必须且仅可包含 1 个 SKILL.md 文件），获取 `file_id`。\n2. 再调用本接口传入 `skill_file`（上一步返回的 file_id）及其他元信息完成创建。\n\n注意：`skill_name` 仅允许小写字母、数字和连字符，创建后不可修改；`owner` 创建后不可修改。\n",
        "tags": [
          "Skills"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSkillRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-skill-success"
          },
          "400": {
            "$ref": "#/components/responses/skill-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/skill-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "409": {
            "$ref": "#/components/responses/skill-conflict"
          },
          "500": {
            "$ref": "#/components/responses/skill-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/skills/{id}": {
      "get": {
        "operationId": "getSkill",
        "summary": "获取指定技能详情",
        "description": "根据技能 ID 返回指定技能的详细信息，ID 格式为 @author/skill_name（例如 @Alipay/alipay-payment-integration），其中 @ 和 / 无需 URL 编码",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "技能 ID，格式为 @author/skill_name，其中 @ 和 / 无需 URL 编码",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "alipay-payment": {
                "value": "@Alipay/alipay-payment-integration",
                "summary": "支付宝支付集成"
              },
              "summarize": {
                "value": "@steipete/summarize",
                "summary": "内容总结"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-skill-success"
          },
          "401": {
            "$ref": "#/components/responses/skill-unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/skill-not-found"
          },
          "500": {
            "$ref": "#/components/responses/skill-internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/skill-service-unavailable"
          }
        }
      }
    },
    "/skills/{owner}/{skill_name}/settings": {
      "patch": {
        "operationId": "updateSkillSettings",
        "summary": "更新技能设置",
        "description": "更新指定 Skill 的设置，传入哪个字段修改哪个字段，不传的字段不修改保持原值。\n\n语义说明：\n- `skill_file` 传入时整体覆盖原有项目文件；不传则保留原文件不变。\n- `tags` 传入时整体覆盖原标签列表。\n- `logo_url` 传空字符串时恢复为平台默认图标。\n- `skill_name` 和 `owner` 创建后不可修改，故不在本接口内。\n",
        "tags": [
          "Skills"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/skill_owner_path"
          },
          {
            "$ref": "#/components/parameters/skill_name_path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSkillSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-skill-settings-success"
          },
          "400": {
            "$ref": "#/components/responses/skill-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/skill-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/skill-not-found"
          },
          "500": {
            "$ref": "#/components/responses/skill-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agents": {
      "get": {
        "operationId": "listAgents",
        "summary": "获取 Agent 列表",
        "description": "返回 ModelScope Agent 广场的 Agent 列表，支持关键词搜索与多维度筛选。\n\n默认只返回已发布/预发布的 Agent；携带 Token 访问时，同时返回当前用户及其所属组织下的私有 Agent。\n\n分页总量（`page_number` × `page_size`）不得超过 2400，超出返回 `QuotaLimitExceed`。\n",
        "tags": [
          "AgentHub"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "关键词搜索，支持 Agent 名称、描述等",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter.framework",
            "in": "query",
            "description": "按框架类型筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "ms-agent": {
                "value": "ms-agent",
                "summary": "ModelScope Agent 框架"
              },
              "qwenpaw": {
                "value": "qwenpaw",
                "summary": "QwenPaw 框架"
              }
            }
          },
          {
            "name": "filter.category",
            "in": "query",
            "description": "按分类筛选（对应 Agent 的 categories）",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "tools": {
                "value": "tools",
                "summary": "工具类"
              }
            }
          },
          {
            "name": "filter.license",
            "in": "query",
            "description": "按许可证筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "apache": {
                "value": "Apache License 2.0",
                "summary": "Apache 2.0 许可证"
              }
            }
          },
          {
            "name": "filter.custom_tag",
            "in": "query",
            "description": "按自定义标签筛选",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "weather": {
                "value": "weather",
                "summary": "天气"
              }
            }
          },
          {
            "name": "filter.owner",
            "in": "query",
            "description": "按所有者筛选（用户名或组织名）",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "排序方式：default（综合）/ created_at（创建时间）/ last_modified（最近更新）/ views（浏览量）/ downloads（下载量）/ likes（喜欢数）",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "default",
                "created_at",
                "last_modified",
                "views",
                "downloads",
                "likes"
              ],
              "default": "default",
              "examples": [
                "default",
                "created_at",
                "last_modified",
                "views",
                "downloads",
                "likes"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，从 1 开始",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页条数，取值 1~100",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-agents-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-quota-limit-exceeded"
          },
          "404": {
            "$ref": "#/components/responses/agent-list-failed"
          }
        }
      },
      "post": {
        "operationId": "createAgent",
        "summary": "创建 Agent",
        "description": "创建一个新的 Agent。\n\n使用 `owner` 和 `agent_name` 指定 Agent 所有者与唯一名称。\n\n支持设置框架类型（`framework`）、是否私有（`private`）与自定义标签（`custom_tags`）等配置。\n\n请求字段与查看 Agent 详情接口保持同名（`logo_url` / `private` / `custom_tags` 等）。\n",
        "tags": [
          "AgentHub"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-agent-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/agent-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agents/{id}": {
      "get": {
        "operationId": "getAgent",
        "summary": "查看 Agent 详情",
        "description": "根据 Agent ID 返回指定 Agent 的详细信息，包括关联的模型、技能、MCP 配置等",
        "tags": [
          "AgentHub"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-agent-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-bad-request"
          },
          "403": {
            "$ref": "#/components/responses/agent-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/files/upload": {
      "post": {
        "operationId": "uploadFile",
        "summary": "上传文件",
        "description": "通用文件上传接口（最大 5MB），返回文件 ID。该 ID 可作为入参传给其他接口，用于引用已上传的文件。",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadFileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/upload-file-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "413": {
            "$ref": "#/components/responses/bad-request"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_ids": {
      "post": {
        "operationId": "createAgentIdentity",
        "summary": "创建 Agent 身份",
        "description": "客户端本地生成 Ed25519 密钥对后，将公钥（JWK 格式）上传到 ModelScope，注册一个新的 Agent 身份。\n\n- 私钥仅由客户端保存，服务端只存储公钥\n- `public_key` 必须包含 `kty=OKP`、`crv=Ed25519`、`x`（base64url 无 padding 编码的公钥）和 `kid`\n- `token_expire_time` 可选 300/600/1800/3600 秒（默认 3600）\n",
        "tags": [
          "Agent-IDP"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentIdentityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-agent-identity-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_ids/{agent_id}": {
      "get": {
        "operationId": "getAgentIdentity",
        "summary": "获取 Agent 身份详情",
        "description": "根据 agent_id 返回该 Agent 的完整信息（含当前公钥、状态、Token 配置等）",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "sample": {
                "value": "agent_id:modelscope:agent_1234567890ab"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-agent-identity-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "updateAgentIdentity",
        "summary": "更新 Agent 身份设置",
        "description": "更新 Agent 名称、描述或 Token 过期时间。所有字段均为可选。",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentIdentityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-agent-identity-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteAgentIdentity",
        "summary": "删除 Agent 身份",
        "description": "删除指定的 Agent 身份。删除后该 Agent 将无法再签发 Token，已签发的 Token 仍可使用直至过期。",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/delete-agent-identity-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_ids/{agent_id}/key_pairs": {
      "put": {
        "operationId": "resetAgentKeyPair",
        "summary": "重置 Agent 密钥对",
        "description": "客户端本地生成新的 Ed25519 密钥对后，上传新公钥替换旧公钥。\n\n- 旧 kid 立即失效，新 kid 立即生效\n- 已签发的旧 Token 不受影响（仍可使用直至过期），新签发的 Token 使用新 kid\n",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetKeyPairRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/reset-key-pair-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_ids/{agent_id}/paused": {
      "post": {
        "operationId": "pauseAgent",
        "summary": "启用/停用 Agent",
        "description": "设置 Agent 的 paused 状态：\n\n- `paused=true` 停用：该 Agent 无法再签发 Token，但已签发的 Token 仍有效\n- `paused=false` 启用：恢复签发 Token 能力\n",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/pause-agent-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_ids/{agent_id}/jwt_id_tokens": {
      "get": {
        "operationId": "listAgentTokenRecords",
        "summary": "获取 Agent 的 Token 签发记录",
        "description": "按 audience 维度返回该 Agent 最近一次给每个 Hub 应用签发的 Token 记录。\n",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "description": "Agent 身份 ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "页码（默认 1）",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页数量（默认 20，最大 50）",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-token-records-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/users/{username}/agent_ids": {
      "get": {
        "operationId": "listUserAgentIdentities",
        "summary": "获取指定用户的 Agent 身份列表",
        "description": "按用户名维度返回该用户名下所有 Agent 身份摘要列表，支持分页和按状态筛选。",
        "tags": [
          "Agent-IDP"
        ],
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "用户名",
            "required": true,
            "schema": {
              "type": "string"
            },
            "examples": {
              "sample": {
                "value": "alice"
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "按状态筛选",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AgentIdentityStatus"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "页码（默认 1）",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页数量（默认 20，最大 50）",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-agent-identities-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent_id/token": {
      "post": {
        "operationId": "issueAgentToken",
        "summary": "签发 Agent Token",
        "description": "Agent 用其私钥对 message=`agent_id|kid|audience|timestamp` 进行 Ed25519 签名，\n服务端用注册时上传的公钥验签通过后，签发一个面向指定 Hub 应用（audience）的 JWT。\n\n本端点为公开端点，不需要 bearerAuth；签名本身即为身份证明。\n",
        "tags": [
          "Agent-IDP"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenSignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/issue-token-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": []
      }
    },
    "/agent_id/.well-known/agentid-configuration": {
      "get": {
        "operationId": "getAgentIdConfiguration",
        "summary": "获取 Agent IDP OIDC 配置",
        "description": "OIDC Discovery 端点，返回 Agent IDP 服务的核心元数据：\n`issuer`、`token_endpoint`、`jwks_uri`、`registration_endpoint`、`activity_endpoint`、\n`id_token_signing_alg_values_supported`。\n\n客户端及外部接入方应通过本端点动态发现各端点 URL，避免硬编码。\n本端点为公开端点，不需要 bearerAuth。\n",
        "tags": [
          "Agent-IDP"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/agentid-configuration-success"
          },
          "429": {
            "$ref": "#/components/responses/too-many-requests"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": []
      }
    },
    "/agent_id/.well-known/agentid-jwks": {
      "get": {
        "operationId": "getAgentIdJWKS",
        "summary": "获取 Agent IDP JWKS",
        "description": "返回服务端用于签发 Agent JWT 的公钥集合（JSON Web Key Set）。\n\n资源方收到 Agent JWT 后，应通过本端点拉取 JWKS，根据 JWT header 中的 `kid` 选择对应公钥验签。\n支持多 kid 同时存在以实现密钥轮换：旧 kid 在过渡期内继续返回，新签发的 JWT 使用新 kid。\n\n本端点为公开端点，不需要 bearerAuth。\n",
        "tags": [
          "Agent-IDP"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/agentid-jwks-success"
          },
          "429": {
            "$ref": "#/components/responses/too-many-requests"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": []
      }
    },
    "/magicubes/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "查询余额",
        "description": "查询当前用户的魔粒余额信息",
        "tags": [
          "Magicube"
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-balance-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/collections": {
      "get": {
        "operationId": "listCollections",
        "summary": "获取 Collection 列表",
        "description": "获取 Collection 列表，支持搜索、按所有者过滤与排序、分页。公开列表无需 Token；查询私有 Collection 需 Bearer Token。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "针对标题、描述的子字符串搜索",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "nlp"
              ]
            }
          },
          {
            "name": "owner",
            "in": "query",
            "description": "所有者过滤。仅允许过滤当前 Token 所属用户自己的 Collection，过滤他人（或匿名使用）返回 403 OperationNotAllowed。",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "排序方式：default（综合）/ last_modified（最近更新）/ likes（喜欢数）",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "default",
                "last_modified",
                "likes"
              ],
              "default": "default",
              "examples": [
                "likes"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码（≥1）",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "examples": [
                1
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页大小（1~50）",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "examples": [
                10
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-collections-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      },
      "post": {
        "operationId": "createCollection",
        "summary": "创建 Collection",
        "description": "创建一个新的 Collection。",
        "tags": [
          "Collections"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCollectionRequest"
              },
              "examples": {
                "create-collection-request": {
                  "value": {
                    "title": "最佳 NLP 模型合集",
                    "owner": "iSolver",
                    "description": "精选的自然语言处理模型...",
                    "visibility": "public",
                    "theme": "Blue"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-collection-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/collections/{owner}/{slug}": {
      "get": {
        "operationId": "getCollection",
        "summary": "获取 Collection 详情",
        "description": "根据 {owner}/{slug} 获取 Collection 详情。visibility=public 时 Token 可选；visibility=private 时必填 Bearer Token。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-collection-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      },
      "patch": {
        "operationId": "updateCollection",
        "summary": "更新 Collection",
        "description": "更新 Collection 元数据。传入哪个字段即更新哪个字段，未传字段保持原值。open/close 语义映射为 visibility（public/private）。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCollectionRequest"
              },
              "examples": {
                "update-collection-request": {
                  "value": {
                    "title": "最佳 NLP 模型合集（已更名）",
                    "visibility": "private"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-collection-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteCollection",
        "summary": "删除 Collection",
        "description": "删除指定 {owner}/{slug} 的 Collection。需具备 admin 权限的 Bearer Token。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/delete-collection-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/collections/{owner}/{slug}/items": {
      "get": {
        "operationId": "listCollectionItems",
        "summary": "获取 Collection 条目列表",
        "description": "分页获取指定 Collection 的条目列表，支持按资源类型过滤。visibility=public 时 Token 可选；private 时必填。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          },
          {
            "name": "item_type",
            "in": "query",
            "description": "按资源类型过滤：model / dataset / studio / paper / skill / mcp",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "model",
                "dataset",
                "studio",
                "paper",
                "skill",
                "mcp"
              ],
              "examples": [
                "model"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码（≥1）",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "examples": [
                1
              ]
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页大小（1~50）",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "examples": [
                10
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-collection-items-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ]
      },
      "post": {
        "operationId": "addCollectionItems",
        "summary": "添加 Collection 条目",
        "description": "向 Collection 批量添加条目。传入 items 数组。\n\n异常处理：若部分条目不存在、已在 Collection 中或无权限，接口不整体回滚，返回 success=true，并在 data.failed_items 中列出失败项；\n全部失败时仍返回 success=true、added_count=0。仅请求参数格式错误返回 400。部分失败不返回 code 字段。\n",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCollectionItemsRequest"
              },
              "examples": {
                "add-collection-items-request": {
                  "$ref": "#/components/examples/add-collection-items-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/add-collection-items-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "updateCollectionItems",
        "summary": "批量更新 Collection 条目",
        "description": "批量更新 Collection 条目（P2）。通过每个条目的 item_type + item_object_id 定位，传入哪个字段就修改哪个字段。\n\n异常处理：若部分条目不在当前 Collection 或对应资源不存在，接口不整体回滚，返回 success=true，并在 data.failed_items 中列出失败项；\n全部失败时仍返回 success=true、updated_count=0。仅请求参数格式错误返回 400。部分失败不返回 code 字段。\n",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCollectionItemsRequest"
              },
              "examples": {
                "update-collection-items-request": {
                  "$ref": "#/components/examples/update-collection-items-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-collection-items-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/collections/{owner}/{slug}/items/{item_type}/{item_object_id}": {
      "patch": {
        "operationId": "updateCollectionItem",
        "summary": "更新单个 Collection 条目",
        "description": "通过 item_type + item_object_id 定位并更新单个条目。传入哪个字段即更新哪个字段。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          },
          {
            "$ref": "#/components/parameters/collection_item_type_path"
          },
          {
            "$ref": "#/components/parameters/collection_item_object_id_path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCollectionItemRequest"
              },
              "examples": {
                "update-collection-item-request": {
                  "$ref": "#/components/examples/update-collection-item-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-collection-item-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "removeCollectionItem",
        "summary": "移除 Collection 条目",
        "description": "通过 item_type + item_object_id 定位并从 Collection 中移除单个条目。",
        "tags": [
          "Collections"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/collection_owner_path"
          },
          {
            "$ref": "#/components/parameters/collection_slug_path"
          },
          {
            "$ref": "#/components/parameters/collection_item_type_path"
          },
          {
            "$ref": "#/components/parameters/collection_item_object_id_path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/remove-collection-item-success"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          },
          "503": {
            "$ref": "#/components/responses/service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/galleries": {
      "post": {
        "operationId": "createGallery",
        "summary": "创建 Gallery",
        "description": "创建一个新的灵感流/Gallery 内容。\n\n**权限要求**\n\n- 基线要求：已注册用户。\n- 若上传到组织名下，用户须为该组织的管理员或写权限成员。\n- 若上传到个人名下，需为和 token 身份指向一致的个人用户。\n\n**字段说明**\n\n- name 名称、labels 标签：需满足 CSI 内容安全审核要求，不合法返回 403。\n- path 自定义 URL 尾缀：系统会校验 owner/path 是否已存在，重复返回 400。\n- entry_file 入口文件：文件后缀须与 category 匹配（后缀不区分大小写，如 .IPYNB 等价于 .ipynb）：notebook→.ipynb，website→.html，pdf→.pdf；file 类别不限后缀，不匹配返回 400。\n- Gallery ID：由服务端生成 UUID v4，不可自定义。\n- 封面颜色：系统随机分配封面颜色模板（purple / pink / blue / turquoise / green）。\n",
        "tags": [
          "Galleries"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGalleryRequest"
              },
              "examples": {
                "create-gallery-request": {
                  "$ref": "#/components/examples/create-gallery-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-gallery-success"
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/models/{owner}/{repo_name}/settings": {
      "patch": {
        "operationId": "updateModelSettings",
        "summary": "更新模型通用设置",
        "description": "局部更新模型通用设置。省略不变，显式空值清空。gated_mode 取 auto 自动审批、manual 人工审批；显式 visibility=\"gated\" 时，gated_mode 省略或空字符串默认 auto；两字段均省略保持原设置；无论 visibility 取值，显式 null、布尔值、数字及其他非法值均返回 400；visibility 为 public/private 时禁止传 gated_mode（含空串和 null），否则返回 400；PATCH 省略 visibility 时，仅当前仓库已是申请制才可用 gated_mode 修改审批方式。关闭申请制请将 visibility 改为 public 或 private。通用设置不包含专区字段。所有响应均有 request_id。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetModelCategoryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModelSettingsRequest"
              },
              "example": {
                "description": null,
                "visibility": "gated",
                "gated_mode": "manual",
                "task": "text-generation"
              }
            }
          }
        }
      }
    },
    "/datasets/{owner}/{repo_name}/category": {
      "put": {
        "operationId": "setDatasetCategory",
        "summary": "设置数据集类型",
        "description": "设置或切换数据集类型。science 必须提供匹配的 primary_subject_area 和 secondary_specialization，枚举查询 GET /dataset/science/options；base 清除科学专区字段。不支持 AIGC 字段。需要仓库维护权限，所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetWriteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetCategoryRequest"
              },
              "example": {
                "dataset_category": "science",
                "primary_subject_area": "life-sciences",
                "secondary_specialization": "dna"
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateDatasetCategory",
        "summary": "局部更新科学数据集字段",
        "description": "仅更新当前数据集专区字段；类型由服务端从数据库读取当前仓库确定，不接受 dataset_category（传入返回 400），改变类型请用 PUT /category。省略不变，显式空值清空，学科必填约束仍需满足；cover_image 可用 null 清空。不适用于数据库当前类型的字段返回 400，message 列出当前类型及所有不适用字段；显式 null 也按传入字段校验。所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetWriteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDatasetCategoryRequest"
              },
              "example": {
                "cover_image": null
              }
            }
          }
        }
      }
    },
    "/datasets/{owner}/{repo_name}/settings": {
      "patch": {
        "operationId": "updateDatasetSettings",
        "summary": "更新数据集通用设置",
        "description": "局部更新数据集通用设置。省略不变，显式空值清空。gated_mode 取 auto 自动审批、manual 人工审批；显式 visibility=\"gated\" 时，gated_mode 省略或空字符串默认 auto；两字段均省略保持原设置；无论 visibility 取值，显式 null、布尔值、数字及其他非法值均返回 400；visibility 为 public/private 时禁止传 gated_mode（含空串和 null），否则返回 400；PATCH 省略 visibility 时，仅当前仓库已是申请制才可用 gated_mode 修改审批方式。关闭申请制请将 visibility 改为 public 或 private。所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetWriteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetSettingsRequest"
              },
              "example": {
                "description": null,
                "visibility": "gated",
                "gated_mode": "manual"
              }
            }
          }
        }
      }
    },
    "/models/{owner}/{repo_name}/files": {
      "delete": {
        "operationId": "deleteModelFiles",
        "summary": "单次 commit 原子批量删除文件",
        "description": "批量删除仓库文件，整个请求只产生一次 commit；任一文件不存在或校验失败时全部失败，不允许部分成功。file_paths 为 1–100 个不重复的仓库相对文件路径，不接受目录或越界路径。revision 默认为 master，只能指定分支，不能指定 tag。成功返回 commit_sha 和完整 deleted_files，failed_files 为空；所有响应均有 request_id。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteFilesRequest"
              },
              "example": {
                "file_paths": [
                  "obsolete/a.txt",
                  "obsolete/b.txt"
                ],
                "revision": "master",
                "commit_message": "Remove obsolete files"
              }
            }
          }
        }
      }
    },
    "/datasets/{owner}/{repo_name}/files": {
      "delete": {
        "operationId": "deleteDatasetFiles",
        "summary": "单次 commit 原子批量删除文件",
        "description": "批量删除仓库文件，整个请求只产生一次 commit；任一文件不存在或校验失败时全部失败，不允许部分成功。file_paths 为 1–100 个不重复的仓库相对文件路径，不接受目录或越界路径。revision 默认为 master，只能指定分支，不能指定 tag。成功返回 commit_sha 和完整 deleted_files，failed_files 为空；所有响应均有 request_id。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteFilesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo_name"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteFilesRequest"
              },
              "example": {
                "file_paths": [
                  "obsolete/a.txt",
                  "obsolete/b.txt"
                ],
                "revision": "master",
                "commit_message": "Remove obsolete files"
              }
            }
          }
        }
      }
    },
    "/dataset/science/options": {
      "get": {
        "operationId": "listScienceDatasetOptions",
        "summary": "获取科学数据集学科枚举",
        "description": "获取科学数据集学科枚举。 所有层级的选项使用 label 作为展示名称，一级学科和二级专业方向均使用 id 作为提交值，分别用于 primary_subject_area 和 secondary_specialization。",
        "tags": [
          "Datasets"
        ],
        "responses": {
          "200": {
            "description": "成功；所有响应含 request_id。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScienceDatasetOptionsResponse"
                },
                "examples": {
                  "science-dataset-options-response": {
                    "$ref": "#/components/examples/science-dataset-options-response"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": []
      }
    },
    "/models/options": {
      "get": {
        "operationId": "getModelOptions",
        "summary": "获取模型任务与许可证选项",
        "description": "返回 tasks 和 license 两个列表，每项仅包含 type、id、label。tasks[].id 用于创建模型、更新模型设置的 task 或列表筛选 filter.task；license[].id 用于创建模型的 license，label 是可用于各处直接展示的名称。",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "Success. Every response includes request_id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelOptionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "500": {
            "$ref": "#/components/responses/internal-server-error"
          }
        },
        "security": []
      }
    },
    "/agent/playground/instances": {
      "post": {
        "operationId": "createAgentPlaygroundInstance",
        "summary": "创建实验场实例",
        "description": "创建一个实验场（Agent Playground）实例。\n\n异步创建：响应中 `status` 为 `starting`，就绪后转为 `running`。\n\n可选的 `models` / `mcps` / `skills` / `message` 会在实例就绪后按「模型 → MCP → Skill → 对话」的顺序\n作用于实例内 `default` Agent。引用在创建时同步校验，不合法直接返回 400；应用阶段失败的项会被跳过\n（实例照常转为 `running`），错误经一次性通知（`init_error`）返回。\n\n不传 `models` 时会自动配置平台默认模型。\n\n实例数超出账号配额时返回 400。\n",
        "tags": [
          "Agent Playground"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentPlaygroundInstanceRequest"
              },
              "examples": {
                "create-agent-playground-instance-request": {
                  "$ref": "#/components/examples/create-agent-playground-instance-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "409": {
            "$ref": "#/components/responses/agent-playground-conflict"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "listAgentPlaygroundInstances",
        "summary": "获取实验场实例列表",
        "description": "分页返回调用者名下的实验场实例。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "name": "owner",
            "in": "query",
            "description": "实例归属账号，缺省为调用者；只能是调用者本人，否则返回 403",
            "required": false,
            "schema": {
              "type": "string",
              "examples": [
                "username"
              ]
            }
          },
          {
            "name": "page_number",
            "in": "query",
            "description": "页码，需大于 0；非数字或小于等于 0 返回 400",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "每页条数，取值 1~100；越界或非数字返回 400",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "排序字段，大小写不敏感；`user_modified_at` 为用户最近操作时间（相同时按创建时间）",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "user_modified_at",
                "gmt_created"
              ],
              "default": "user_modified_at"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "排序方向",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desc",
                "asc"
              ],
              "default": "desc"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/list-agent-playground-instances-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/from-agent-hub": {
      "post": {
        "operationId": "createAgentPlaygroundInstanceFromAgentHub",
        "summary": "从 Agent Hub 创建实验场实例",
        "description": "创建实例，并把 Agent Hub 上指定 agent 的内容同步到实例内 `default` Agent（覆盖写入）。\n\n与普通创建的区别：\n\n- 内容同步目前只支持 `qwenpaw` / `ms-agent`。\n- **不会**自动配置默认模型：未传 `models` 时实例内模型取决于源 agent 的内容，可能为空。\n- 同步完成后产生一次性通知（`import_result`；带 `message` 时为 `conversation`），payload 里标明来源与去向。\n\n其余字段的校验与普通创建一致。\n",
        "tags": [
          "Agent Playground"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentPlaygroundInstanceFromAgentHubRequest"
              },
              "examples": {
                "create-agent-playground-instance-from-agent-hub-request": {
                  "$ref": "#/components/examples/create-agent-playground-instance-from-agent-hub-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/create-agent-playground-instance-from-agent-hub-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "409": {
            "$ref": "#/components/responses/agent-playground-conflict"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}": {
      "get": {
        "operationId": "getAgentPlaygroundInstance",
        "summary": "获取实验场实例详情",
        "description": "按 `uuid` 返回实例详情。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-agent-playground-instance-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "updateAgentPlaygroundInstance",
        "summary": "更新实验场实例元信息",
        "description": "只允许修改 `instance_name`、`display_name`、`description`、`logo`，其余字段不可改。\n\n覆盖语义：`display_name`、`description` 缺省或传空串都会清空；`logo` 缺省保持原值，显式传入则覆盖。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentPlaygroundInstanceRequest"
              },
              "examples": {
                "update-agent-playground-instance-request": {
                  "$ref": "#/components/examples/update-agent-playground-instance-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/update-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "409": {
            "$ref": "#/components/responses/agent-playground-conflict"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteAgentPlaygroundInstance",
        "summary": "删除实验场实例",
        "description": "删除实例，同时清除该实例的通知。\n\n幂等：对不存在或删除中的实例同样返回 200 且 `deleted: true`。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/delete-agent-playground-instance-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/pause": {
      "post": {
        "operationId": "pauseAgentPlaygroundInstance",
        "summary": "暂停实验场实例",
        "description": "暂停实例，工作区内容保留。\n\n任意状态都可调用且幂等，响应 `status` 立即为 `sleeping`。\n\n实例空闲一段时间后也会被系统自动休眠，自动休眠不更新 `user_modified_at`。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/pause-agent-playground-instance-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/resume": {
      "post": {
        "operationId": "resumeAgentPlaygroundInstance",
        "summary": "恢复实验场实例",
        "description": "恢复实例运行。任意状态都可调用（幂等）。\n\n响应 `status` 按调用前的状态给出：\n\n- `sleeping`：返回 `running`。唤醒通常秒级完成，期间查询详情可能短暂返回 `starting`。\n- `starting` / `failed`：返回 `starting`。\n- `running`：返回 `running`。\n\n`failed` 实例恢复不会触发重建，请改用重启接口。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/resume-agent-playground-instance-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/restart": {
      "post": {
        "operationId": "restartAgentPlaygroundInstance",
        "summary": "冷重启实验场实例",
        "description": "冷重启：实例内进程与内存状态重置，工作区内容保留。\n\n任意状态都可调用，`sleeping` / `failed` 实例会被拉起。异步操作，响应 `status` 为 `starting`。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/restart-agent-playground-instance-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/agents": {
      "get": {
        "operationId": "getAgentPlaygroundInstanceAgents",
        "summary": "获取实例内 Agent 信息",
        "description": "返回实例内所有 Agent 的概要（`summary`）与详情（`detail`）。用于确认下发结果，以及拿到下发接口需要的 `agent_id`。\n\n休眠实例返回最近一次已知的数据，不会被唤醒；实例还在启动时返回空列表而不是报错，可以直接轮询；\n实例内 Agent 服务尚未就绪时返回 503，稍后重试。\n\n框架差异：qwenpaw 可有多个 Agent，persona 为工作区中的 Markdown 文件，`mcp_clients.tools` 仅对启用的客户端返回；\nms-agent 恒为 1 个 `default` Agent，persona 固定 `AGENTS.md`、`PROFILE.md`，`mcp_clients.tools` 恒为空数组。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-agent-playground-instance-agents-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          },
          "502": {
            "$ref": "#/components/responses/agent-playground-bad-gateway"
          },
          "503": {
            "$ref": "#/components/responses/agent-playground-service-unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/setup/model": {
      "post": {
        "operationId": "setupAgentPlaygroundModel",
        "summary": "向实例下发模型配置",
        "description": "为目标 Agent 配置模型：按模型引用解析后下发给运行中的实例，并**设为该 Agent 的生效模型**。\n重复下发同一个模型是幂等的。\n\n下发类接口的公共约定：\n\n- 调用者须是实例 owner，且实例 `status` 为 `running`，否则返回 400（休眠实例请先恢复）。\n- 同步下发，最长等待 50 秒，超时返回 504（操作可能仍在实例内继续完成）。\n- 实例内返回的错误会透传，其余实例内失败返回 503。\n- 成功返回最新的实例对象，下发不改变实例 `status`。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupAgentPlaygroundModelRequest"
              },
              "examples": {
                "setup-agent-playground-model-request": {
                  "$ref": "#/components/examples/setup-agent-playground-model-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/setup-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          },
          "502": {
            "$ref": "#/components/responses/agent-playground-bad-gateway"
          },
          "503": {
            "$ref": "#/components/responses/agent-playground-service-unavailable"
          },
          "504": {
            "$ref": "#/components/responses/agent-playground-request-timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/setup/mcp": {
      "post": {
        "operationId": "setupAgentPlaygroundMcp",
        "summary": "向实例下发 MCP 配置",
        "description": "为目标 Agent 添加一个 MCP 连接，`server_config` 校验通过后原样下发。\n\n**仅新增**：目标 Agent 下已有同名 client key 时返回 409，不会覆盖。qwenpaw 会把 key 中的斜杠与反斜杠\n替换为 `-`，实例内实际 key 以实例内 Agent 信息接口为准。\n\n连接方式：带 `command` 的配置按 stdio 处理；带 `url` 且未写 `type` 时按 SSE 处理，\nStreamable HTTP 服务必须显式写 `\"type\": \"streamable_http\"`。\n\n前置条件、超时与错误透传规则同下发模型接口。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupAgentPlaygroundMcpRequest"
              },
              "examples": {
                "setup-agent-playground-mcp-request": {
                  "$ref": "#/components/examples/setup-agent-playground-mcp-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/setup-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "409": {
            "$ref": "#/components/responses/agent-playground-conflict"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          },
          "502": {
            "$ref": "#/components/responses/agent-playground-bad-gateway"
          },
          "503": {
            "$ref": "#/components/responses/agent-playground-service-unavailable"
          },
          "504": {
            "$ref": "#/components/responses/agent-playground-request-timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/setup/skill": {
      "post": {
        "operationId": "setupAgentPlaygroundSkill",
        "summary": "向实例下发 Skill",
        "description": "按 Skill Hub 引用把 Skill 安装到运行中实例的目标 Agent。\n\n- 引用格式不合法返回 400（`invalid skill ref, expected path/name`）；Skill Hub 中不存在返回 400（`skill not found`）。\n- 私有 Skill 只有有读权限的账号能下发（本人、组织成员、`@` 命名空间）；没有权限时与「不存在」返回同一个错误。\n- **仅新增**：实例内已有同名 Skill 返回 409，不会覆盖。\n- 安装失败返回 503，超时返回 504。\n\n前置条件与错误透传规则同下发模型接口。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupAgentPlaygroundSkillRequest"
              },
              "examples": {
                "setup-agent-playground-skill-request": {
                  "$ref": "#/components/examples/setup-agent-playground-skill-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/setup-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "409": {
            "$ref": "#/components/responses/agent-playground-conflict"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          },
          "502": {
            "$ref": "#/components/responses/agent-playground-bad-gateway"
          },
          "503": {
            "$ref": "#/components/responses/agent-playground-service-unavailable"
          },
          "504": {
            "$ref": "#/components/responses/agent-playground-request-timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/import": {
      "post": {
        "operationId": "importToAgentPlaygroundInstance",
        "summary": "向实例导入 Model / MCP / Skill",
        "description": "往已有实例追加导入 model / mcp / skill，可附带一句话 `message` 开启对话。**休眠实例会被自动唤醒**。\n\n应用顺序与创建时一致；实例内已存在的同名 MCP / Skill 视为已完成，失败的项会被跳过并经 `init_error` 通知返回。\n\n- 四个内容字段至少传一个，否则返回 400。导入内容恒作用于实例内 `default` Agent（本接口不支持 `agent_id`）。\n- 引用在受理时同步校验，不合法返回 400，`message` 指明是哪一项。\n- 成功响应 `status` 为 `starting`，完成后回到 `running`；结果经一次性通知返回（`import_result` / `conversation`）。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportToAgentPlaygroundInstanceRequest"
              },
              "examples": {
                "import-to-agent-playground-instance-request": {
                  "$ref": "#/components/examples/import-to-agent-playground-instance-request"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/import-to-agent-playground-instance-success"
          },
          "400": {
            "$ref": "#/components/responses/agent-playground-bad-request"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/agent/playground/instances/{uuid}/notifications": {
      "get": {
        "operationId": "getAgentPlaygroundInstanceNotifications",
        "summary": "拉取实例一次性通知",
        "description": "返回并**消费**实例的全部未读通知（按产生顺序）：同一条通知只会返回一次，适合轮询后一次性展示。\n通知保留 7 天，超期未拉取的也会被清理；实例删除时一并清除。\n\n通知类型：\n\n- `import_result`：创建或导入的内容应用完成（未附带 `message`）。从 Agent Hub 创建时另有 `agent_repo`。\n- `conversation`：内容应用完成且附带了一句话，payload 含会话信息。\n- `agent_import`：从 Agent Hub 导入 Agent 完成，payload 含新建 Agent 的 `agent_id`。\n- `init_error`：某一项内容被跳过（payload 含 `item` / `error` / `code`），实例仍会 `running`。\n- `framework_update_error`：框架版本更新失败（payload 含 `target` / `error` / `code`）。\n\n`payload` 为原样 JSON、键名不做转换；其中 `conversation` / `agent` 部分不同框架结构不同，\n用 `framework` 字段区分。\n",
        "tags": [
          "Agent Playground"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/agent_playground_instance_uuid"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/get-agent-playground-instance-notifications-success"
          },
          "401": {
            "$ref": "#/components/responses/agent-playground-unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/agent-playground-forbidden"
          },
          "404": {
            "$ref": "#/components/responses/agent-playground-not-found"
          },
          "500": {
            "$ref": "#/components/responses/agent-playground-internal-server-error"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "User": {
        "allOf": [
          {
            "$ref": "#/components/schemas/UserPublic"
          },
          {
            "$ref": "#/components/schemas/UserPrivate"
          }
        ],
        "description": "用户完整信息(包含私有信息)"
      },
      "UserResponse": {
        "type": "object",
        "description": "用户信息响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功响应时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/User",
            "description": "用户信息"
          },
          "request_id": {
            "type": "string",
            "description": "请求ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "description": "错误响应格式",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "错误响应时始终为 false",
            "examples": [
              false
            ]
          },
          "code": {
            "type": "string",
            "description": "错误码",
            "examples": [
              "InputParameterError"
            ]
          },
          "message": {
            "type": "string",
            "description": "错误消息",
            "examples": [
              "Unauthorized access"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "code",
          "message",
          "request_id"
        ]
      },
      "Model": {
        "type": "object",
        "description": "模型摘要信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "模型仓库名（repo_id，格式为 owner/repo_name）",
            "examples": [
              "iic/QwenLong-L1.5-30B-A3B",
              "ZhipuAI/AutoGLM-Phone-9B"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型展示名称",
            "examples": [
              "QwenLong-L1.5-30B-A3B",
              "AutoGLM-Phone-9B"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型简介",
            "examples": [
              ""
            ]
          },
          "downloads": {
            "type": "integer",
            "description": "下载量",
            "examples": [
              1466,
              28525
            ]
          },
          "likes": {
            "type": "integer",
            "description": "喜欢量",
            "examples": [
              25,
              265
            ]
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "许可证",
            "examples": [
              "apache-2.0",
              "MIT License"
            ]
          },
          "tasks": {
            "type": "array",
            "description": "任务列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "text-generation"
              ],
              [
                "image-captioning"
              ]
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间（ISO 8601 UTC）",
            "examples": [
              "2025-12-14T12:26:15Z"
            ]
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "description": "Git 文件或设置的最后修改时间（ISO 8601 UTC）",
            "examples": [
              "2025-12-16T03:34:26Z"
            ]
          },
          "file_size": {
            "type": "integer",
            "description": "文件大小（字节）",
            "examples": [
              61081671123
            ]
          },
          "params": {
            "type": "integer",
            "description": "参数量",
            "examples": [
              30532122624
            ]
          },
          "tags": {
            "type": "array",
            "description": "标签列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "license:apache-2.0",
                "model_type:qwen3_moe",
                "library:transformer",
                "library:safetensors",
                "library:pytorch",
                "task:text-generation",
                "deploy:swingdeploy"
              ]
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否普通私有模型；申请制模型返回 false，请结合 gated 和 visibility 判断访问模式",
            "examples": [
              false
            ]
          },
          "gated": {
            "type": "boolean",
            "description": "是否申请制模型，通过申请后可访问",
            "examples": [
              false
            ]
          }
        },
        "required": [
          "id",
          "downloads",
          "likes",
          "tasks",
          "created_at",
          "last_modified",
          "file_size",
          "params",
          "private",
          "gated"
        ]
      },
      "ModelList": {
        "type": "object",
        "description": "模型列表与分页信息",
        "properties": {
          "models": {
            "type": "array",
            "description": "结果模型列表",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "符合筛选条件的模型总数",
            "examples": [
              43127
            ]
          },
          "page_number": {
            "type": "integer",
            "description": "当前页码",
            "examples": [
              1
            ]
          },
          "page_size": {
            "type": "integer",
            "description": "每页大小",
            "examples": [
              10
            ]
          }
        },
        "required": [
          "models",
          "total_count",
          "page_number",
          "page_size"
        ]
      },
      "ModelListResponse": {
        "type": "object",
        "description": "列出模型的标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ModelList",
            "description": "模型列表数据"
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "ModelDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Model"
          },
          {
            "type": "object",
            "description": "模型详情，包含 README 和当前模型类型",
            "properties": {
              "readme": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "README 内容",
                "examples": [
                  "hello"
                ]
              },
              "model_category": {
                "$ref": "#/components/schemas/ModelCategory"
              },
              "owner": {
                "type": "string"
              },
              "repo_name": {
                "type": "string"
              },
              "visibility": {
                "type": "string",
                "enum": [
                  "public",
                  "private",
                  "gated"
                ]
              },
              "gated_mode": {
                "type": "string",
                "enum": [
                  "auto",
                  "manual"
                ],
                "description": "申请制审批方式。仅 gated=true 时返回；auto 表示申请后自动通过，manual 表示需要人工审批。"
              },
              "aigc_type": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AigcModelType"
                  }
                ],
                "description": "【AIGC 必填】模型子类型，可选值为 Checkpoint、LoRA、VAE（区分大小写）；其他值返回 HTTP 400。"
              },
              "base_model_architecture_type": {
                "type": "string",
                "description": "【AIGC 必填】基础模型架构类型（一级选择）。可选值查询 GET /model/aigc/options",
                "examples": [
                  "Z_IMAGE_TURBO",
                  "FLUX_2"
                ]
              },
              "base_model_architecture_subtype": {
                "type": "string",
                "description": "【AIGC 必填】基础模型架构子类型（二级选择），需与 base_model_architecture_type 匹配。可选值查询 GET /model/aigc/options",
                "examples": [
                  "Z_IMAGE_TURBO",
                  "FLUX2_DEV"
                ]
              },
              "content_categories": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AigcContentCategories"
                  }
                ],
                "description": "【AIGC 可选】内容类别三级联动"
              },
              "primary_subject_area": {
                "allOf": [
                  {
                    "type": "string"
                  }
                ],
                "description": "【科学 必填】一级学科分类，实际值以 GET /model/science/options 为准，例如 life-sciences"
              },
              "secondary_specialization": {
                "allOf": [
                  {
                    "type": "string"
                  }
                ],
                "description": "【科学 必填】二级专业分类，应与 primary_subject_area 匹配；实际值以 GET /model/science/options 为准，例如 dna"
              },
              "cover_image": {
                "type": "string",
                "description": "【Science 可选】模型封面图；可省略或传空字符串，非空时须为 HTTP(S) URL。",
                "format": "uri"
              },
              "versions": {
                "type": "array",
                "description": "仅 AIGC 返回；其他类型不返回专区字段。",
                "items": {
                  "$ref": "#/components/schemas/ModelVersion"
                }
              }
            }
          }
        ]
      },
      "ModelDetailResponse": {
        "type": "object",
        "description": "获取模型详情的标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ModelDetail",
            "description": "模型详情数据"
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "Dataset": {
        "type": "object",
        "description": "数据集摘要信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "数据集仓库名（repo_id，格式为 owner/repo_name）",
            "examples": [
              "DAMO_NLP/jd",
              "iic/nlp_domain_classification_chinese_testset"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "数据集展示名称",
            "examples": [
              "商品评论情感预测",
              "中文文本领域分类测试集"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "数据集简介",
            "examples": [
              "",
              "..."
            ]
          },
          "file_size": {
            "type": "integer",
            "description": "文件大小（字节）",
            "examples": [
              0
            ]
          },
          "downloads": {
            "type": "integer",
            "description": "下载量",
            "examples": [
              53996,
              2401
            ]
          },
          "likes": {
            "type": "integer",
            "description": "喜欢量",
            "examples": [
              102,
              23
            ]
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "许可证",
            "examples": [
              "Apache License 2.0",
              "cc-by-4.0"
            ]
          },
          "tasks": {
            "type": "array",
            "description": "任务列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "text-classification"
              ],
              []
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间（ISO 8601 UTC）",
            "examples": [
              "2022-09-28T06:30:31Z",
              "2025-11-25T14:30:22Z"
            ]
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "description": "Git 文件或设置的最后修改时间（ISO 8601 UTC）",
            "examples": [
              "2022-10-30T03:36:39Z",
              "2026-01-01T00:31:42Z"
            ]
          },
          "tags": {
            "type": "array",
            "description": "标签列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "license:Apache License 2.0",
                "task:text-classification"
              ],
              [
                "license:cc-by-4.0",
                "custom_tag:common-crawl"
              ]
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否普通私有数据集；申请制数据集返回 false，请结合 gated 和 visibility 判断访问模式",
            "examples": [
              false
            ]
          },
          "gated": {
            "type": "boolean",
            "description": "是否申请制数据集，通过申请后可访问",
            "examples": [
              false
            ]
          },
          "login_required": {
            "type": "boolean",
            "description": "是否登录后才可下载",
            "examples": [
              false
            ]
          }
        },
        "required": [
          "id",
          "downloads",
          "likes",
          "private",
          "gated",
          "login_required",
          "created_at",
          "last_modified"
        ]
      },
      "DatasetList": {
        "type": "object",
        "description": "数据集列表与分页信息",
        "properties": {
          "datasets": {
            "type": "array",
            "description": "结果数据集列表",
            "items": {
              "$ref": "#/components/schemas/Dataset"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "符合筛选条件的数据集总数",
            "examples": [
              60
            ]
          },
          "page_number": {
            "type": "integer",
            "description": "当前页码",
            "examples": [
              1
            ]
          },
          "page_size": {
            "type": "integer",
            "description": "每页大小",
            "examples": [
              10
            ]
          }
        },
        "required": [
          "datasets",
          "total_count",
          "page_number",
          "page_size"
        ]
      },
      "DatasetListResponse": {
        "type": "object",
        "description": "列出数据集的标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/DatasetList",
            "description": "数据集列表数据"
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "DatasetDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Dataset"
          },
          {
            "type": "object",
            "description": "数据集详情信息",
            "properties": {
              "readme": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "README 内容",
                "examples": [
                  "hello"
                ]
              },
              "owner": {
                "type": "string"
              },
              "repo_name": {
                "type": "string"
              },
              "dataset_category": {
                "type": "string",
                "enum": [
                  "base",
                  "science"
                ]
              },
              "visibility": {
                "type": "string",
                "enum": [
                  "public",
                  "private",
                  "gated"
                ]
              },
              "gated_mode": {
                "type": "string",
                "enum": [
                  "auto",
                  "manual"
                ],
                "description": "申请制审批方式。仅 gated=true 时返回；auto 表示申请后自动通过，manual 表示需要人工审批。"
              },
              "login_required": {
                "type": "boolean"
              },
              "primary_subject_area": {
                "type": "string"
              },
              "secondary_specialization": {
                "type": "string"
              },
              "cover_image": {
                "type": "string"
              }
            }
          }
        ]
      },
      "DatasetDetailResponse": {
        "type": "object",
        "description": "获取数据集详情的标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/DatasetDetail",
            "description": "数据集详情数据"
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "McpServerLocale": {
        "type": "object",
        "description": "MCP服务在对应语言环境下的内容",
        "properties": {
          "name": {
            "type": "string",
            "description": "MCP服务在对应语言环境下的服务名称",
            "examples": [
              "Fetch网页内容抓取"
            ]
          },
          "description": {
            "type": "string",
            "description": "MCP服务在对应语言环境下的服务简介",
            "examples": [
              "该服务器使大型语言模型能够检索和处理网页内容..."
            ]
          },
          "readme": {
            "type": "string",
            "description": "MCP服务介绍（仅详情接口返回）",
            "examples": [
              "# Fetch MCP Server..."
            ]
          }
        }
      },
      "McpServerLocales": {
        "type": "object",
        "description": "不同语言环境下的内容展示",
        "properties": {
          "zh": {
            "$ref": "#/components/schemas/McpServerLocale",
            "description": "中文环境"
          },
          "en": {
            "$ref": "#/components/schemas/McpServerLocale",
            "description": "英文环境"
          }
        }
      },
      "McpOperationalUrl": {
        "type": "object",
        "description": "MCP服务托管链接信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "MCP服务链接命名标识",
            "examples": [
              "platform-pool"
            ]
          },
          "url": {
            "type": "string",
            "description": "MCP服务远程连接地址",
            "examples": [
              "https://mcp.api-inference.modelscope.net/xxxx/mcp"
            ]
          },
          "transport_type": {
            "type": "string",
            "description": "MCP服务链接传输方式",
            "examples": [
              "streamable_http",
              "sse"
            ]
          },
          "auth_required": {
            "type": "boolean",
            "description": "远程 url 连接时是否需要提供魔搭访问令牌鉴权",
            "examples": [
              false
            ]
          },
          "expiration": {
            "type": "string",
            "description": "MCP服务链接有效期",
            "examples": [
              "2025-10-01 21:00:00"
            ]
          },
          "accessible": {
            "type": "boolean",
            "description": "是否有权限访问该MCP服务详情。当所有者设置为非公开或MCP服务被删除时，无权访问。",
            "examples": [
              true
            ]
          }
        }
      },
      "McpServerSummary": {
        "type": "object",
        "description": "MCP服务摘要信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "服务ID。由平台后台收录的MCP，ID 默认为@author/server_name，当被社区用户认领后将会变更为user_name/server_name；由社区用户自发提交的MCP，ID 为user_name/server_name。",
            "examples": [
              "@modelcontextprotocol/fetch"
            ]
          },
          "name": {
            "type": "string",
            "description": "MCP服务在魔搭社区的名称",
            "examples": [
              "Fetch网页内容抓取"
            ]
          },
          "chinese_name": {
            "type": "string",
            "description": "MCP服务在魔搭社区的中文名称",
            "examples": [
              "Fetch网页内容抓取"
            ]
          },
          "description": {
            "type": "string",
            "description": "MCP服务简介",
            "examples": [
              "该服务器使大型语言模型能够检索和处理网页内容..."
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "logo图片URL链接",
            "examples": [
              "https://resources.modelscope.cn/..."
            ]
          },
          "publisher": {
            "type": "string",
            "description": "发布时原始ID",
            "examples": [
              "@modelcontextprotocol/fetch"
            ]
          },
          "categories": {
            "type": "array",
            "description": "该MCP服务所属分类",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "browser-automation"
              ]
            ]
          },
          "tags": {
            "type": "array",
            "description": "该MCP服务的标签列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "browser-automation"
              ]
            ]
          },
          "view_count": {
            "type": "integer",
            "description": "该MCP服务的累计访问量",
            "examples": [
              30667
            ]
          },
          "locales": {
            "$ref": "#/components/schemas/McpServerLocales"
          }
        },
        "required": [
          "id"
        ]
      },
      "McpServerDetail": {
        "type": "object",
        "description": "MCP服务详细信息",
        "allOf": [
          {
            "$ref": "#/components/schemas/McpServerSummary"
          },
          {
            "type": "object",
            "properties": {
              "author": {
                "type": "string",
                "description": "MCP服务开发者",
                "examples": [
                  "modelcontextprotocol"
                ]
              },
              "owner": {
                "type": "string",
                "description": "MCP服务归属的魔搭用户/组织ID",
                "examples": [
                  ""
                ]
              },
              "readme": {
                "type": "string",
                "description": "MCP服务介绍",
                "examples": [
                  "# Fetch MCP Server..."
                ]
              },
              "source_url": {
                "type": "string",
                "description": "MCP服务来源项目主页地址",
                "examples": [
                  "https://github.com/modelcontextprotocol/..."
                ]
              },
              "github_stars": {
                "type": "integer",
                "description": "该 MCP 服务对应 github 原始仓库的 stars 数量",
                "examples": [
                  1234
                ]
              },
              "is_hosted": {
                "type": "boolean",
                "description": "该MCP服务是否支持托管部署",
                "examples": [
                  true
                ]
              },
              "is_verified": {
                "type": "boolean",
                "description": "托管MCP服务是否经过平台验证测试",
                "examples": [
                  true
                ]
              },
              "env_schema": {
                "type": "object",
                "description": "该服务连接部署的环境变量配置",
                "additionalProperties": true
              },
              "server_config": {
                "type": "array",
                "description": "MCP服务配置信息",
                "items": {}
              },
              "operational_urls": {
                "type": "array",
                "description": "当get_operational_url=True且当前用户已连接该 MCP 服务时则返回，否则为空",
                "items": {
                  "$ref": "#/components/schemas/McpOperationalUrl"
                }
              }
            }
          }
        ]
      },
      "McpServerOperational": {
        "type": "object",
        "description": "用户托管的MCP服务信息",
        "allOf": [
          {
            "$ref": "#/components/schemas/McpServerSummary"
          },
          {
            "type": "object",
            "properties": {
              "operational_urls": {
                "type": "array",
                "description": "MCP服务托管链接列表",
                "items": {
                  "$ref": "#/components/schemas/McpOperationalUrl"
                }
              }
            }
          }
        ]
      },
      "McpServerListResponse": {
        "type": "object",
        "description": "MCP服务列表响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/McpServerList",
            "description": "MCP服务列表数据"
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "McpServerOperationalListResponse": {
        "type": "object",
        "description": "用户托管MCP服务列表响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/McpServerOperationalList",
            "description": "用户托管MCP服务列表数据"
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "McpServerDetailResponse": {
        "type": "object",
        "description": "MCP服务详情响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/McpServerDetail",
            "description": "MCP服务详情数据"
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "McpDeployResponse": {
        "type": "object",
        "description": "MCP服务部署响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/McpOperationalUrl",
            "description": "部署后的MCP服务链接信息"
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "McpUndeployResponse": {
        "type": "object",
        "description": "MCP服务解除部署响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "message": {
            "type": "string",
            "description": "响应消息",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "StudioHardware": {
        "type": "string",
        "description": "硬件配置，修改后需重新部署才能生效。\n可用值不固定，请通过 `GET /studios/hardware` 接口查询当前可用的硬件配置列表。\n免费资源常见格式为 `platform/...`、`xgpu/...`、`amd/...`；付费资源格式为 `paid/<InstanceType>`，例如 `paid/ecs.gn7i-c8g1.2xlarge`。\n",
        "examples": [
          "platform/2v-cpu-16g-mem",
          "paid/ecs.gn7i-c8g1.2xlarge"
        ]
      },
      "StudioSDKType": {
        "type": "string",
        "description": "SDK 类型，修改后需重新部署才能生效",
        "enum": [
          "gradio",
          "streamlit",
          "docker",
          "static"
        ]
      },
      "StudioSDKVersion": {
        "type": "string",
        "description": "SDK 版本，仅对 Gradio 类型生效，默认最新版，建议选用最新版本，修改后需重新部署才能生效。\n可用版本会随平台更新，请通过 `GET /studios/sdk-versions?sdk_type=gradio` 查询当前可用的 Gradio 版本列表。\n",
        "examples": [
          "6.2.0"
        ]
      },
      "StudioBaseImage": {
        "type": "string",
        "description": "基础镜像，仅 Docker 类型不支持，建议选用最新版本，修改后需重新部署才能生效。\n可用值不固定，请通过 `GET /studios/base-images` 接口查询当前可用的基础镜像列表。\n",
        "examples": [
          "ubuntu22.04-py311-torch2.9.1-modelscope1.35.0"
        ]
      },
      "CreateStudioRequest": {
        "type": "object",
        "description": "创建 Studio 请求参数",
        "properties": {
          "repo_name": {
            "type": "string",
            "description": "仓库名称",
            "maxLength": 64,
            "examples": [
              "my-demo-app"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "username"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "显示名称",
            "maxLength": 128,
            "examples": [
              "我的演示应用"
            ]
          },
          "license": {
            "type": "string",
            "description": "许可证，默认 apache-2.0",
            "default": "apache-2.0",
            "examples": [
              "apache-2.0"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/StudioVisibility"
          },
          "private": {
            "type": "boolean",
            "description": "Deprecated: 请使用 visibility 字段",
            "deprecated": true,
            "default": false
          },
          "description": {
            "type": "string",
            "description": "描述",
            "maxLength": 2000,
            "examples": [
              "这是一个演示应用"
            ]
          },
          "cover_image": {
            "type": "string",
            "description": "封面图 URL，为空时使用平台默认图"
          },
          "sdk_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioSDKType"
              }
            ],
            "default": "gradio"
          },
          "sdk_version": {
            "$ref": "#/components/schemas/StudioSDKVersion"
          },
          "base_image": {
            "$ref": "#/components/schemas/StudioBaseImage"
          },
          "hardware": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioHardware"
              }
            ],
            "default": "platform/2v-cpu-16g-mem",
            "description": "硬件配置。未传时使用默认免费硬件配置"
          }
        },
        "required": [
          "repo_name",
          "owner"
        ]
      },
      "CreateStudioResponse": {
        "type": "object",
        "description": "创建 Studio 响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Studio ID (owner/repo_name)",
                "examples": [
                  "username/my-demo-app"
                ]
              },
              "repo_name": {
                "type": "string",
                "description": "仓库名称",
                "examples": [
                  "my-demo-app"
                ]
              },
              "display_name": {
                "type": "string",
                "description": "显示名称",
                "examples": [
                  "我的演示应用"
                ]
              },
              "owner": {
                "type": "string",
                "description": "所有者",
                "examples": [
                  "username"
                ]
              },
              "url": {
                "type": "string",
                "description": "Studio URL",
                "examples": [
                  "https://modelscope.cn/studios/username/my-demo-app"
                ]
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "StudioConfig": {
        "type": "object",
        "description": "Studio 运行时配置",
        "properties": {
          "hardware": {
            "$ref": "#/components/schemas/StudioHardware"
          },
          "base_image": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioBaseImage"
              }
            ],
            "description": "基础镜像（Docker 类型不返回）"
          },
          "sdk_type": {
            "$ref": "#/components/schemas/StudioSDKType"
          },
          "sdk_version": {
            "type": "string",
            "description": "SDK 版本（仅 gradio 类型返回）"
          }
        }
      },
      "StudioRuntime": {
        "type": "object",
        "description": "Studio 运行时信息",
        "properties": {
          "status": {
            "type": "string",
            "description": "运行状态",
            "enum": [
              "Initialized",
              "Building",
              "BuildFailed",
              "Deploying",
              "DeployFailed",
              "Running",
              "Stopping",
              "Stopped",
              "Duplicating",
              "Sleeping"
            ]
          },
          "active_config": {
            "description": "当前实际运行中的配置",
            "$ref": "#/components/schemas/StudioConfig"
          },
          "created_at": {
            "type": "string",
            "description": "部署时间"
          },
          "error_message": {
            "type": "string",
            "description": "失败信息（仅在错误状态时返回）"
          }
        }
      },
      "GetStudioResponse": {
        "type": "object",
        "description": "获取 Studio 详情响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Studio ID (owner/repo_name)"
              },
              "repo_name": {
                "type": "string",
                "description": "仓库名称"
              },
              "display_name": {
                "type": "string",
                "description": "显示名称"
              },
              "owner": {
                "type": "string",
                "description": "所有者"
              },
              "description": {
                "type": "string",
                "description": "描述"
              },
              "cover_image": {
                "type": "string",
                "description": "封面图 URL"
              },
              "likes": {
                "type": "integer",
                "description": "喜欢数"
              },
              "view_count": {
                "type": "integer",
                "description": "访问量"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "visibility": {
                "$ref": "#/components/schemas/StudioVisibility"
              },
              "private": {
                "type": "boolean",
                "description": "Deprecated: 请使用 visibility 字段",
                "deprecated": true
              },
              "last_modified": {
                "type": "string",
                "description": "最后修改时间"
              },
              "sdk_type": {
                "$ref": "#/components/schemas/StudioSDKType"
              },
              "sdk_version": {
                "$ref": "#/components/schemas/StudioSDKVersion"
              },
              "hardware": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/StudioHardware"
                  }
                ],
                "description": "期望的硬件配置（数据库中保存的值）"
              },
              "base_image": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/StudioBaseImage"
                  }
                ],
                "description": "期望的基础镜像（Docker 类型不返回）"
              },
              "license": {
                "type": "string",
                "description": "许可证"
              },
              "host": {
                "type": "string",
                "description": "访问地址"
              },
              "mcp_support": {
                "type": "boolean",
                "description": "是否支持 MCP"
              },
              "runtime": {
                "$ref": "#/components/schemas/StudioRuntime"
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UpdateStudioSettingsRequest": {
        "type": "object",
        "description": "更新 Studio 设置请求参数（传入哪个字段修改哪个字段）",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "显示名称",
            "maxLength": 128
          },
          "license": {
            "type": "string",
            "description": "许可证"
          },
          "visibility": {
            "$ref": "#/components/schemas/StudioVisibility"
          },
          "private": {
            "type": "boolean",
            "description": "Deprecated: 请使用 visibility 字段",
            "deprecated": true
          },
          "description": {
            "type": "string",
            "description": "描述",
            "maxLength": 2000
          },
          "cover_image": {
            "type": "string",
            "description": "封面图 URL"
          },
          "sdk_type": {
            "$ref": "#/components/schemas/StudioSDKType"
          },
          "sdk_version": {
            "$ref": "#/components/schemas/StudioSDKVersion"
          },
          "base_image": {
            "$ref": "#/components/schemas/StudioBaseImage"
          },
          "hardware": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioHardware"
              }
            ],
            "description": "硬件配置，修改后需重新部署才能生效"
          }
        }
      },
      "AddStudioSecretRequest": {
        "type": "object",
        "description": "添加 Studio 密文变量请求参数",
        "properties": {
          "key": {
            "type": "string",
            "description": "密文变量名称",
            "maxLength": 128,
            "examples": [
              "API_KEY"
            ]
          },
          "value": {
            "type": "string",
            "description": "密文变量值（添加后不会公开展示）",
            "maxLength": 4096,
            "examples": [
              "sk-xxxxxxxxxxxx"
            ]
          },
          "description": {
            "type": "string",
            "description": "密文变量描述（用途说明），非必填",
            "maxLength": 512,
            "examples": [
              "推理服务使用的访问密钥"
            ]
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "UpdateStudioSecretRequest": {
        "type": "object",
        "description": "更新 Studio 密文变量请求参数",
        "properties": {
          "key": {
            "type": "string",
            "description": "密文变量名称",
            "maxLength": 128,
            "examples": [
              "API_KEY"
            ]
          },
          "value": {
            "type": "string",
            "description": "密文变量新值",
            "maxLength": 4096,
            "examples": [
              "sk-xxxxxxxxxxxx"
            ]
          },
          "description": {
            "type": "string",
            "description": "密文变量描述（用途说明），非必填；更新时不传则保留原有描述",
            "maxLength": 512,
            "examples": [
              "推理服务使用的访问密钥"
            ]
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "StudioSecretItem": {
        "type": "object",
        "description": "密文变量列表项（仅返回 key，不返回 value）",
        "properties": {
          "key": {
            "type": "string",
            "description": "密文变量名称"
          },
          "description": {
            "type": "string",
            "description": "密文变量描述（用途说明），未填写时不返回",
            "maxLength": 512
          }
        },
        "required": [
          "key"
        ]
      },
      "ListStudioSecretsResponse": {
        "type": "object",
        "description": "获取 Studio 密文变量列表响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "secrets": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StudioSecretItem"
                }
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "DeleteStudioSecretRequest": {
        "type": "object",
        "description": "删除 Studio 密文变量请求参数",
        "properties": {
          "key": {
            "type": "string",
            "description": "密文变量名称"
          }
        },
        "required": [
          "key"
        ]
      },
      "StudioRuntimeResponse": {
        "type": "object",
        "description": "Studio 运行时操作响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/StudioRuntime"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "StudioLogsResponse": {
        "type": "object",
        "description": "获取 Studio 日志响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "logs": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "page_num": {
                "type": "integer"
              },
              "page_size": {
                "type": "integer"
              },
              "total_count": {
                "type": "integer"
              },
              "total_page_num": {
                "type": "integer"
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "SuccessResponse": {
        "type": "object",
        "description": "通用成功响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "StudioVisibility": {
        "type": "string",
        "description": "创空间可见性：\n- public: 代码和体验都公开\n- protected: 体验公开，代码仓库不可见\n- private: 都不公开\n",
        "enum": [
          "public",
          "protected",
          "private"
        ]
      },
      "HardwareItem": {
        "type": "object",
        "description": "硬件配置项。免费资源仅返回基础标识字段；付费资源会返回 ECS 规格、资源明细和价格字段",
        "properties": {
          "name": {
            "type": "string",
            "description": "OpenAPI hardware 参数值。付费资源格式为 `paid/<InstanceType>`",
            "examples": [
              "platform/2v-cpu-16g-mem",
              "paid/ecs.gn7i-c8g1.2xlarge"
            ]
          },
          "resource_type": {
            "type": "string",
            "description": "资源类型，free 表示平台免费资源，paid 表示使用用户自己的云账号付费部署",
            "enum": [
              "free",
              "paid"
            ]
          },
          "instance_type": {
            "type": "string",
            "description": "ECS 规格名，仅付费资源返回",
            "examples": [
              "ecs.gn7i-c8g1.2xlarge"
            ]
          },
          "cpu": {
            "type": "integer",
            "description": "CPU 核数，仅付费资源返回"
          },
          "gpu": {
            "type": "integer",
            "description": "GPU 数量，仅付费资源返回"
          },
          "memory": {
            "type": "integer",
            "description": "内存（GB），仅付费资源返回"
          },
          "gpu_type": {
            "type": "string",
            "description": "GPU 类型，仅付费资源返回"
          },
          "gpu_memory": {
            "type": "integer",
            "description": "显存（GB），仅付费资源返回"
          },
          "supported_sdk_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "支持的 SDK 类型"
          },
          "has_stock": {
            "type": "boolean",
            "description": "是否有库存，仅付费资源返回"
          },
          "stock": {
            "type": "integer",
            "description": "库存数量"
          },
          "cost_after_discount": {
            "type": "number",
            "format": "float",
            "description": "折后价格，仅付费资源返回"
          },
          "original_cost": {
            "type": "number",
            "format": "float",
            "description": "原价，仅付费资源返回"
          }
        }
      },
      "ListHardwareResponse": {
        "type": "object",
        "description": "查询可用硬件配置响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "hardware": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/HardwareItem"
                }
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "SDKVersionItem": {
        "type": "object",
        "description": "SDK 版本项",
        "properties": {
          "sdk_type": {
            "type": "string",
            "description": "SDK 类型",
            "examples": [
              "gradio"
            ]
          },
          "tag": {
            "type": "string",
            "description": "版本标签",
            "examples": [
              "latest"
            ]
          },
          "version": {
            "type": "string",
            "description": "SDK 版本",
            "examples": [
              "6.2.0"
            ]
          }
        },
        "required": [
          "sdk_type",
          "tag",
          "version"
        ]
      },
      "ListSDKVersionsResponse": {
        "type": "object",
        "description": "查询可用 SDK 版本响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "sdk_versions": {
                "type": "array",
                "description": "SDK 版本列表。仅 `sdk_type=gradio` 时返回 Gradio 版本列表；其他 SDK 类型返回空数组",
                "items": {
                  "$ref": "#/components/schemas/SDKVersionItem"
                }
              },
              "total_count": {
                "type": "integer",
                "format": "int64",
                "description": "SDK 版本总数"
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "BaseImageItem": {
        "type": "object",
        "description": "基础镜像项",
        "properties": {
          "name": {
            "type": "string",
            "description": "镜像名称",
            "examples": [
              "ubuntu22.04-py311-torch2.9.1-modelscope1.35.0"
            ]
          },
          "tag": {
            "type": "string",
            "description": "标签",
            "examples": [
              "latest"
            ]
          }
        }
      },
      "ListBaseImagesResponse": {
        "type": "object",
        "description": "查询可用基础镜像响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "base_images": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BaseImageItem"
                }
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "AddStudioVariableRequest": {
        "type": "object",
        "description": "添加 Studio 明文变量请求参数（key 和 value 都公开可见，敏感信息请使用密文变量接口）",
        "properties": {
          "key": {
            "type": "string",
            "description": "明文变量名称",
            "maxLength": 128,
            "examples": [
              "GRADIO_TEMP_DIR"
            ]
          },
          "value": {
            "type": "string",
            "description": "明文变量值",
            "maxLength": 4096,
            "examples": [
              "/tmp/gradio"
            ]
          },
          "description": {
            "type": "string",
            "description": "明文变量描述（用途说明），非必填",
            "maxLength": 512,
            "examples": [
              "Gradio 运行时临时目录"
            ]
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "UpdateStudioVariableRequest": {
        "type": "object",
        "description": "更新 Studio 明文变量请求参数",
        "properties": {
          "key": {
            "type": "string",
            "description": "明文变量名称",
            "maxLength": 128,
            "examples": [
              "GRADIO_TEMP_DIR"
            ]
          },
          "value": {
            "type": "string",
            "description": "明文变量新值",
            "maxLength": 4096,
            "examples": [
              "/new/path"
            ]
          },
          "description": {
            "type": "string",
            "description": "明文变量描述（用途说明），非必填；更新时不传则保留原有描述",
            "maxLength": 512,
            "examples": [
              "Gradio 运行时临时目录"
            ]
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "DeleteStudioVariableRequest": {
        "type": "object",
        "description": "删除 Studio 明文变量请求参数",
        "properties": {
          "key": {
            "type": "string",
            "description": "明文变量名称"
          }
        },
        "required": [
          "key"
        ]
      },
      "StudioVariableItem": {
        "type": "object",
        "description": "明文变量列表项（返回 key 和 value）",
        "properties": {
          "key": {
            "type": "string",
            "description": "明文变量名称"
          },
          "value": {
            "type": "string",
            "description": "明文变量值"
          },
          "description": {
            "type": "string",
            "description": "明文变量描述（用途说明），未填写时不返回",
            "maxLength": 512
          }
        },
        "required": [
          "key",
          "value"
        ]
      },
      "ListStudioVariablesResponse": {
        "type": "object",
        "description": "获取 Studio 明文变量列表响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "variables": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StudioVariableItem"
                }
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "SkillLocale": {
        "type": "object",
        "description": "技能的单语言本地化信息",
        "properties": {
          "description": {
            "type": "string",
            "description": "技能描述的本地化翻译"
          },
          "category": {
            "type": "string",
            "description": "技能分类的本地化翻译"
          }
        }
      },
      "SkillLocales": {
        "type": "object",
        "description": "技能的多语言本地化信息",
        "properties": {
          "en": {
            "$ref": "#/components/schemas/SkillLocale"
          },
          "zh": {
            "$ref": "#/components/schemas/SkillLocale"
          }
        }
      },
      "SkillSummary": {
        "type": "object",
        "description": "技能摘要信息",
        "properties": {
          "_id": {
            "type": "string",
            "description": "技能内部唯一标识",
            "examples": [
              "62+FGAr3b7f4Bblezwx8hQ=="
            ]
          },
          "id": {
            "type": "string",
            "description": "技能 ID，格式为 @author/skill_name 或 owner/skill_name",
            "examples": [
              "@AMap-Web/amap-lbs-skill"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "技能展示名称",
            "examples": [
              "高德地图综合服务Skill"
            ]
          },
          "description": {
            "type": "string",
            "description": "技能描述"
          },
          "owner": {
            "type": "string",
            "description": "技能所有者（用户名或组织名）",
            "examples": [
              "guoyanlian01"
            ]
          },
          "license": {
            "type": "string",
            "description": "许可证",
            "examples": [
              "MIT License"
            ]
          },
          "developer": {
            "type": "string",
            "description": "开发者",
            "examples": [
              "AMap-Web"
            ]
          },
          "source_url": {
            "type": "string",
            "description": "源码地址"
          },
          "category": {
            "type": "string",
            "description": "技能分类",
            "examples": [
              "developer-tools"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "description": "标签列表，格式为 `key:value`，key 包括 category / license / developer / custom_tag",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "category:developer-tools",
                "license:MIT License",
                "developer:AMap-Web",
                "custom_tag:api-design"
              ]
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "logo 图片 URL"
          },
          "view_count": {
            "type": "integer",
            "description": "浏览量",
            "examples": [
              13460
            ]
          },
          "downloads": {
            "type": "integer",
            "description": "下载量",
            "examples": [
              1203
            ]
          },
          "locales": {
            "$ref": "#/components/schemas/SkillLocales"
          },
          "private": {
            "type": "boolean",
            "description": "是否为私有技能",
            "examples": [
              false
            ]
          },
          "custom_tag": {
            "type": [
              "array",
              "null"
            ],
            "description": "自定义标签列表（无标签时为 null）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "api-design",
                "general-tools"
              ],
              null
            ]
          }
        }
      },
      "SkillDetail": {
        "type": "object",
        "description": "技能详细信息，包含安装命令",
        "allOf": [
          {
            "$ref": "#/components/schemas/SkillSummary"
          },
          {
            "type": "object",
            "properties": {
              "install_command": {
                "type": "array",
                "description": "安装命令列表",
                "items": {
                  "type": "string"
                },
                "examples": [
                  [
                    "npx skills add https://modelscope.cn/skills/@AMap-Web/amap-lbs-skill",
                    "curl -fsSL https://modelscope.cn/skills/install.sh | bash -s -- @AMap-Web/amap-lbs-skill"
                  ]
                ]
              }
            }
          }
        ]
      },
      "SkillListResponse": {
        "type": "object",
        "description": "技能列表响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "c5bca202-aa4f-478b-b7e2-c568160583cb"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "skills": {
                "type": "array",
                "description": "技能列表",
                "items": {
                  "$ref": "#/components/schemas/SkillSummary"
                }
              },
              "total": {
                "type": "integer",
                "format": "int64",
                "description": "总记录数",
                "examples": [
                  20
                ]
              },
              "page_number": {
                "type": "integer",
                "description": "当前页码",
                "examples": [
                  1
                ]
              },
              "page_size": {
                "type": "integer",
                "description": "每页条数",
                "examples": [
                  20
                ]
              }
            }
          }
        }
      },
      "SkillDetailResponse": {
        "type": "object",
        "description": "技能详情响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "105c898f-fd6d-437d-aa0b-9006036782da"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/SkillDetail"
          }
        }
      },
      "CreateSkillRequest": {
        "type": "object",
        "description": "创建 Skill 请求参数",
        "properties": {
          "skill_name": {
            "type": "string",
            "description": "英文名称，创建后不可更改，仅允许小写字母、数字和连字符",
            "pattern": "^[a-z0-9-]+$",
            "maxLength": 64,
            "examples": [
              "my-awesome-skill"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "iSolver"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "展示名称",
            "maxLength": 128,
            "examples": [
              "我的技能"
            ]
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "来源地址",
            "examples": [
              "https://github.com/example/my-skill"
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否私有，默认 false（公开）",
            "default": false,
            "examples": [
              false
            ]
          },
          "description": {
            "type": "string",
            "description": "描述",
            "maxLength": 2000,
            "examples": [
              "这是一个示例技能"
            ]
          },
          "license": {
            "type": "string",
            "description": "开源协议证书，不填默认 Apache-2.0",
            "default": "Apache-2.0",
            "examples": [
              "Apache-2.0"
            ]
          },
          "category": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SkillCategory"
              }
            ],
            "description": "Skill 类型/分类",
            "examples": [
              "developer-tools"
            ]
          },
          "tags": {
            "type": "array",
            "description": "自定义标签",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "Skill Creation"
              ]
            ]
          },
          "logo_url": {
            "type": "string",
            "format": "uri",
            "description": "Skill 图标 URL",
            "examples": [
              "https://example.com/logo.png"
            ]
          },
          "skill_file": {
            "type": "string",
            "description": "Skill 项目文件 ID（通过 POST /files/upload 上传 zip 包后获取）。\nzip 包要求：\n- 最大 5MB\n- zip 根目录下必须包含且仅包含 1 个 SKILL.md 文件\n- 可包含子目录及其他辅助文件（如 prompts/、examples/ 等）\n- SKILL.md 必须包含 YAML front-matter（name、version、description）\n",
            "examples": [
              "8c378570-8991-431b-a82c-96f3d0b4f0f4"
            ]
          }
        },
        "required": [
          "skill_name",
          "owner",
          "license",
          "category",
          "skill_file"
        ]
      },
      "CreateSkillResponse": {
        "type": "object",
        "description": "创建 Skill 响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Skill ID (owner/skill_name)",
                "examples": [
                  "iSolver/my-awesome-skill"
                ]
              },
              "name": {
                "type": "string",
                "description": "Skill 英文名称",
                "examples": [
                  "my-awesome-skill"
                ]
              },
              "display_name": {
                "type": "string",
                "description": "展示名称",
                "examples": [
                  "我的技能"
                ]
              },
              "owner": {
                "type": "string",
                "description": "所有者",
                "examples": [
                  "iSolver"
                ]
              },
              "url": {
                "type": "string",
                "description": "Skill 页面 URL",
                "examples": [
                  "https://modelscope.cn/skills/iSolver/my-awesome-skill"
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UpdateSkillSettingsRequest": {
        "type": "object",
        "description": "更新 Skill 设置请求参数（传入哪个字段修改哪个字段，不传的字段不修改）",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "展示名称",
            "maxLength": 128,
            "examples": [
              "新的展示名称"
            ]
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "来源地址",
            "examples": [
              "https://github.com/example/my-skill"
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否私有",
            "examples": [
              true
            ]
          },
          "description": {
            "type": "string",
            "description": "描述",
            "maxLength": 2000,
            "examples": [
              "更新后的技能描述"
            ]
          },
          "license": {
            "type": "string",
            "description": "开源协议证书",
            "examples": [
              "Apache-2.0"
            ]
          },
          "category": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SkillCategory"
              }
            ],
            "description": "Skill 类型/分类",
            "examples": [
              "developer-tools"
            ]
          },
          "tags": {
            "type": "array",
            "description": "自定义标签（传入时整体覆盖原标签列表）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "Image/Video Gen",
                "Media Processing"
              ]
            ]
          },
          "logo_url": {
            "type": "string",
            "format": "uri",
            "description": "Skill 图标 URL（传空字符串恢复为平台默认图标）",
            "examples": [
              "https://example.com/new-logo.png"
            ]
          },
          "skill_file": {
            "type": "string",
            "description": "Skill 项目文件 ID（通过 POST /files/upload 上传 zip 包后获取，传入时整体覆盖原文件，不传则保留原文件不变）。\nzip 包要求：\n- 最大 5MB\n- zip 根目录下必须包含且仅包含 1 个 SKILL.md 文件\n- 可包含子目录及其他辅助文件（如 prompts/、examples/ 等）\n- SKILL.md 必须包含 YAML front-matter（name、version、description）\n",
            "examples": [
              "new-file-id-xxx"
            ]
          }
        }
      },
      "SkillCategory": {
        "type": "string",
        "description": "Skill 类型/分类枚举",
        "enum": [
          "skill-management",
          "developer-tools",
          "marketing-seo",
          "frontend-development",
          "ai-media",
          "code-quality-testing",
          "mobile-development",
          "cloud-devops",
          "other"
        ],
        "examples": [
          "developer-tools"
        ]
      },
      "AgentSystemFileConfig": {
        "type": "object",
        "description": "Agent 系统文件配置",
        "properties": {
          "name": {
            "type": "string",
            "description": "文件名",
            "examples": [
              "agent.json"
            ]
          },
          "content": {
            "type": "string",
            "description": "文件内容",
            "examples": [
              "{...}"
            ]
          }
        }
      },
      "AgentModelsConfig": {
        "type": "object",
        "description": "Agent 关联模型配置",
        "properties": {
          "model_name": {
            "type": "string",
            "description": "模型名称",
            "examples": [
              "qwen-max"
            ]
          },
          "path": {
            "type": "string",
            "description": "模型路径"
          },
          "provider_id": {
            "type": "string",
            "description": "模型提供商 ID",
            "examples": [
              "dashscope"
            ]
          },
          "base_url": {
            "type": "string",
            "description": "模型访问 Base URL",
            "examples": [
              "https://dashscope.aliyuncs.com"
            ]
          },
          "protocol": {
            "type": "string",
            "description": "通信协议",
            "examples": [
              "openai"
            ]
          },
          "provider": {
            "type": "string",
            "description": "模型提供商名称",
            "examples": [
              "DashScope"
            ]
          }
        }
      },
      "AgentMcpToolsConfig": {
        "type": "object",
        "description": "MCP 工具配置",
        "properties": {
          "name": {
            "type": "string",
            "description": "工具名称",
            "examples": [
              "get_weather"
            ]
          },
          "description": {
            "type": "string",
            "description": "工具描述",
            "examples": [
              "获取指定城市天气"
            ]
          }
        }
      },
      "AgentMcpConfig": {
        "type": "object",
        "description": "Agent 关联 MCP 配置",
        "properties": {
          "name": {
            "type": "string",
            "description": "MCP 服务名称",
            "examples": [
              "weather-mcp"
            ]
          },
          "description": {
            "type": "string",
            "description": "MCP 服务描述",
            "examples": [
              "天气查询 MCP"
            ]
          },
          "tools": {
            "type": [
              "array",
              "null"
            ],
            "description": "工具列表，可能为 null",
            "items": {
              "$ref": "#/components/schemas/AgentMcpToolsConfig"
            }
          }
        }
      },
      "AgentSkillConfig": {
        "type": "object",
        "description": "Agent 关联技能配置",
        "properties": {
          "name": {
            "type": "string",
            "description": "技能名称",
            "examples": [
              "search-skill"
            ]
          },
          "description": {
            "type": "string",
            "description": "技能描述",
            "examples": [
              "搜索技能"
            ]
          },
          "content": {
            "type": "string",
            "description": "技能内容（README）",
            "examples": [
              "# Search Skill\n..."
            ]
          }
        }
      },
      "CreateAgentRequest": {
        "type": "object",
        "description": "创建 Agent 请求参数",
        "properties": {
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "my_org"
            ]
          },
          "agent_name": {
            "type": "string",
            "description": "Agent 唯一名称",
            "examples": [
              "weather-agent"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "显示名称",
            "examples": [
              "天气助手"
            ]
          },
          "description": {
            "type": "string",
            "description": "描述信息",
            "examples": [
              "一个可以查询天气的 Agent"
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "Logo URL",
            "examples": [
              "https://example.com/logo.png"
            ]
          },
          "framework": {
            "type": "string",
            "description": "Agent 框架类型",
            "examples": [
              "ms-agent",
              "qwenpaw"
            ]
          },
          "license": {
            "type": "string",
            "description": "许可证类型",
            "examples": [
              "Apache License 2.0"
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否为私有 Agent，默认 false（公开）",
            "default": false,
            "examples": [
              false
            ]
          },
          "custom_tags": {
            "type": "array",
            "description": "自定义标签列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "weather",
                "demo"
              ]
            ]
          }
        },
        "required": [
          "owner",
          "agent_name",
          "framework"
        ]
      },
      "CreateAgentResponse": {
        "type": "object",
        "description": "创建 Agent 响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "2f1c8a3e-9b7d-4f21-a0c6-1e2d3f4a5b6c"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Agent 全局 ID，格式为 owner/agent_name",
                "examples": [
                  "my_org/weather-agent"
                ]
              },
              "name": {
                "type": "string",
                "description": "Agent 名称",
                "examples": [
                  "weather-agent"
                ]
              },
              "display_name": {
                "type": "string",
                "description": "显示名称",
                "examples": [
                  "天气助手"
                ]
              },
              "owner": {
                "type": "string",
                "description": "所有者",
                "examples": [
                  "my_org"
                ]
              },
              "url": {
                "type": "string",
                "description": "Agent 访问 URL",
                "examples": [
                  "https://modelscope.cn/agents/my_org/weather-agent"
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "AgentDetail": {
        "type": "object",
        "description": "Agent 详细信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "Agent ID，格式为 path/name",
            "examples": [
              "my_org/weather-agent"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "显示名称",
            "examples": [
              "天气助手"
            ]
          },
          "description": {
            "type": "string",
            "description": "描述信息",
            "examples": [
              "一个可以查询天气的 Agent"
            ]
          },
          "framework": {
            "type": "string",
            "description": "框架类型",
            "examples": [
              "ms-agent"
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "Logo URL",
            "examples": [
              "https://example.com/logo.png"
            ]
          },
          "license": {
            "type": "string",
            "description": "许可证类型",
            "examples": [
              "Apache License 2.0"
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否为私有 Agent",
            "examples": [
              false
            ]
          },
          "custom_tags": {
            "type": [
              "array",
              "null"
            ],
            "description": "自定义标签列表（无标签时为 null）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "weather",
                "demo"
              ]
            ]
          },
          "categories": {
            "type": [
              "array",
              "null"
            ],
            "description": "分类标签列表（无分类时为 null）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "tools"
              ]
            ]
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "description": "最后修改时间（UTC，RFC3339）",
            "examples": [
              "2026-07-16T10:30:00Z"
            ]
          },
          "downloads": {
            "type": "integer",
            "format": "int64",
            "description": "下载量",
            "examples": [
              15
            ]
          },
          "likes": {
            "type": "integer",
            "format": "int64",
            "description": "喜欢数",
            "examples": [
              8
            ]
          },
          "mcps": {
            "type": "array",
            "description": "关联 MCP 配置列表",
            "items": {
              "$ref": "#/components/schemas/AgentMcpConfig"
            }
          },
          "skills": {
            "type": "array",
            "description": "关联技能配置列表",
            "items": {
              "$ref": "#/components/schemas/AgentSkillConfig"
            }
          },
          "system_files": {
            "type": "array",
            "description": "系统文件列表",
            "items": {
              "$ref": "#/components/schemas/AgentSystemFileConfig"
            }
          },
          "models": {
            "type": "array",
            "description": "关联模型配置列表",
            "items": {
              "$ref": "#/components/schemas/AgentModelsConfig"
            }
          },
          "readme": {
            "type": "string",
            "description": "README 内容",
            "examples": [
              "# Weather Agent\n使用说明..."
            ]
          }
        }
      },
      "GetAgentResponse": {
        "type": "object",
        "description": "Agent 详情响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "7a2b1c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AgentDetail"
          }
        }
      },
      "AgentSummary": {
        "type": "object",
        "description": "Agent 摘要信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "Agent ID，格式为 path/name",
            "examples": [
              "my_org/weather-agent"
            ]
          },
          "name": {
            "type": "string",
            "description": "Agent 名称",
            "examples": [
              "weather-agent"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "my_org"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "展示名称",
            "examples": [
              "天气助手"
            ]
          },
          "description": {
            "type": "string",
            "description": "描述信息"
          },
          "framework": {
            "type": "string",
            "description": "框架类型",
            "examples": [
              "ms-agent"
            ]
          },
          "logo_url": {
            "type": "string",
            "description": "Logo URL"
          },
          "license": {
            "type": "string",
            "description": "许可证类型",
            "examples": [
              "Apache License 2.0"
            ]
          },
          "private": {
            "type": "boolean",
            "description": "是否为私有 Agent",
            "examples": [
              false
            ]
          },
          "categories": {
            "type": [
              "array",
              "null"
            ],
            "description": "分类标签列表（无分类时为 null）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "tools"
              ]
            ]
          },
          "custom_tags": {
            "type": [
              "array",
              "null"
            ],
            "description": "自定义标签列表（无标签时为 null）",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "weather",
                "demo"
              ]
            ]
          },
          "tags": {
            "type": "array",
            "description": "标签列表，格式为 `key:value`，key 包括 category / license / framework / custom_tag",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "category:tools",
                "license:Apache License 2.0",
                "framework:ms-agent",
                "custom_tag:weather"
              ]
            ]
          },
          "views": {
            "type": "integer",
            "format": "int64",
            "description": "浏览量",
            "examples": [
              319
            ]
          },
          "downloads": {
            "type": "integer",
            "format": "int64",
            "description": "下载量",
            "examples": [
              15
            ]
          },
          "likes": {
            "type": "integer",
            "format": "int64",
            "description": "喜欢数",
            "examples": [
              8
            ]
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "description": "最后修改时间（UTC，RFC3339）",
            "examples": [
              "2026-07-16T10:30:00Z"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间（UTC，RFC3339）",
            "examples": [
              "2026-07-01T08:00:00Z"
            ]
          }
        }
      },
      "AgentListResponse": {
        "type": "object",
        "description": "Agent 列表响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "c5bca202-aa4f-478b-b7e2-c568160583cb"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "agents": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "Agent 列表（无结果时为 null）",
                "items": {
                  "$ref": "#/components/schemas/AgentSummary"
                }
              },
              "total": {
                "type": "integer",
                "format": "int64",
                "description": "总记录数",
                "examples": [
                  20
                ]
              },
              "page_number": {
                "type": "integer",
                "description": "当前页码",
                "examples": [
                  1
                ]
              },
              "page_size": {
                "type": "integer",
                "description": "每页条数",
                "examples": [
                  10
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "GetBalanceResponse": {
        "type": "object",
        "description": "余额查询响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "total_balance": {
                "type": "number",
                "description": "总额度（可用额度 + 预扣额度）",
                "examples": [
                  1500
                ]
              },
              "available_balance": {
                "type": "number",
                "description": "可用额度",
                "examples": [
                  1300
                ]
              },
              "frozen_amount": {
                "type": "number",
                "description": "预扣额度（进行中任务未返回结果时预扣减）",
                "examples": [
                  200
                ]
              }
            }
          },
          "request_id": {
            "type": "string",
            "examples": [
              "c55709d2-4e09-4bd8-be84-d8518bc46363"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UploadFileRequest": {
        "type": "object",
        "description": "上传文件请求参数（multipart/form-data）",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "上传的文件，最大 5MB"
          },
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "description": "自定义文件名（选填），支持多级目录路径（如 images/sub/logo.png）；不提供则使用上传文件的原始文件名。不允许绝对路径或目录穿越（..）。",
            "examples": [
              "images/sub/logo.png"
            ]
          }
        },
        "required": [
          "file"
        ]
      },
      "UploadFileResponse": {
        "type": "object",
        "description": "上传文件响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "99ee2083-63e0-46dc-b393-623c22645078"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "文件 ID，可在其他接口中作为入参引用该文件",
                "examples": [
                  "8c378570-8991-431b-a82c-96f3d0b4f0f4"
                ]
              }
            },
            "required": [
              "id"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "JWK": {
        "type": "object",
        "description": "JSON Web Key（仅用于 Ed25519 公钥）",
        "required": [
          "kty",
          "crv",
          "x",
          "kid"
        ],
        "properties": {
          "kty": {
            "type": "string",
            "description": "密钥类型，固定 OKP",
            "enum": [
              "OKP"
            ],
            "examples": [
              "OKP"
            ]
          },
          "crv": {
            "type": "string",
            "description": "椭圆曲线类型，固定 Ed25519",
            "enum": [
              "Ed25519"
            ],
            "examples": [
              "Ed25519"
            ]
          },
          "x": {
            "type": "string",
            "description": "公钥 base64url 编码（无 padding）",
            "examples": [
              "f7QtzyEJhqFL8Jk5OYOq7010Ry9PipDGQkTzl7XtiEs"
            ]
          },
          "kid": {
            "type": "string",
            "description": "密钥 ID",
            "examples": [
              "agent-key-001"
            ]
          },
          "alg": {
            "type": "string",
            "description": "签名算法",
            "examples": [
              "EdDSA"
            ]
          },
          "use": {
            "type": "string",
            "description": "用途",
            "examples": [
              "sig"
            ]
          }
        }
      },
      "Principal": {
        "type": "object",
        "description": "Agent 归属主体",
        "properties": {
          "type": {
            "type": "string",
            "description": "主体类型",
            "enum": [
              "user",
              "org"
            ],
            "examples": [
              "user"
            ]
          },
          "id": {
            "type": "string",
            "description": "主体 ID",
            "examples": [
              "alice"
            ]
          }
        }
      },
      "AgentIdentityStatus": {
        "type": "string",
        "description": "Agent 状态",
        "enum": [
          "active",
          "paused"
        ],
        "examples": [
          "active"
        ]
      },
      "CreateAgentIdentityRequest": {
        "type": "object",
        "description": "创建 Agent 身份请求",
        "required": [
          "agent_name",
          "public_key"
        ],
        "properties": {
          "agent_name": {
            "type": "string",
            "description": "Agent 名称（最长 128 字符）",
            "maxLength": 128,
            "examples": [
              "my-agent"
            ]
          },
          "description": {
            "type": "string",
            "description": "Agent 描述（最长 2000 字符）",
            "maxLength": 2000
          },
          "public_key": {
            "$ref": "#/components/schemas/JWK"
          },
          "key_alg_type": {
            "type": "string",
            "description": "密钥算法类型，固定 Ed25519",
            "enum": [
              "Ed25519"
            ],
            "examples": [
              "Ed25519"
            ]
          },
          "token_expire_time": {
            "type": "integer",
            "description": "Token 过期时间（秒），可选值 300/600/1800/3600",
            "enum": [
              300,
              600,
              1800,
              3600
            ],
            "examples": [
              3600
            ]
          }
        }
      },
      "UpdateAgentIdentityRequest": {
        "type": "object",
        "description": "更新 Agent 身份设置请求",
        "properties": {
          "agent_name": {
            "type": "string",
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "token_expire_time": {
            "type": "integer",
            "enum": [
              300,
              600,
              1800,
              3600
            ]
          }
        }
      },
      "ResetKeyPairRequest": {
        "type": "object",
        "description": "重置密钥对请求（客户端本地生成新密钥后上传公钥）",
        "required": [
          "public_key"
        ],
        "properties": {
          "public_key": {
            "$ref": "#/components/schemas/JWK"
          },
          "key_alg_type": {
            "type": "string",
            "enum": [
              "Ed25519"
            ],
            "examples": [
              "Ed25519"
            ]
          }
        }
      },
      "PauseAgentRequest": {
        "type": "object",
        "description": "启用/停用 Agent 请求",
        "required": [
          "paused"
        ],
        "properties": {
          "paused": {
            "type": "boolean",
            "description": "true 表示停用，false 表示启用",
            "examples": [
              true
            ]
          }
        }
      },
      "AgentIdentity": {
        "type": "object",
        "description": "Agent 身份详情",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "Agent 唯一 ID",
            "examples": [
              "agent_id:modelscope:agent_1234567890ab"
            ]
          },
          "agent_name": {
            "type": "string",
            "examples": [
              "my-agent"
            ]
          },
          "description": {
            "type": "string"
          },
          "token_expire_time": {
            "type": "integer",
            "examples": [
              3600
            ]
          },
          "principal": {
            "$ref": "#/components/schemas/Principal"
          },
          "kid": {
            "type": "string",
            "description": "当前密钥 ID",
            "examples": [
              "agent-key-001"
            ]
          },
          "public_key": {
            "$ref": "#/components/schemas/JWK"
          },
          "status": {
            "$ref": "#/components/schemas/AgentIdentityStatus"
          },
          "create_time": {
            "type": "string",
            "description": "创建时间 (ISO 8601)",
            "examples": [
              "2026-06-03T10:00:00Z"
            ]
          },
          "update_time": {
            "type": "string",
            "description": "更新时间 (ISO 8601)",
            "examples": [
              "2026-06-03T10:30:00Z"
            ]
          }
        }
      },
      "AgentIdentityListItem": {
        "type": "object",
        "description": "Agent 身份列表项",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "agent_name": {
            "type": "string"
          },
          "kid": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentIdentityStatus"
          },
          "token_expire_time": {
            "type": "integer"
          },
          "create_time": {
            "type": "string"
          }
        }
      },
      "ListAgentIdentitiesData": {
        "type": "object",
        "description": "Agent 身份列表数据",
        "properties": {
          "agent_identities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentIdentityListItem"
            }
          },
          "total_count": {
            "type": "integer",
            "format": "int64"
          },
          "page_number": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          }
        }
      },
      "ResetKeyPairData": {
        "type": "object",
        "description": "重置密钥对返回数据",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "kid": {
            "type": "string"
          },
          "public_key": {
            "$ref": "#/components/schemas/JWK"
          }
        }
      },
      "AgentIdentityResponse": {
        "type": "object",
        "description": "Agent 身份详情响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AgentIdentity"
          },
          "message": {
            "type": "string",
            "examples": [
              "success"
            ]
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "ListAgentIdentitiesResponse": {
        "type": "object",
        "description": "Agent 身份列表响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ListAgentIdentitiesData"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "ResetKeyPairResponse": {
        "type": "object",
        "description": "重置密钥对响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ResetKeyPairData"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "DeleteAgentIdentityResponse": {
        "type": "object",
        "description": "删除 Agent 身份响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "PauseAgentResponse": {
        "type": "object",
        "description": "启用/停用 Agent 响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "TokenSignRequest": {
        "type": "object",
        "description": "Token 签发请求（Agent 用私钥签名 message=`agent_id|kid|audience|timestamp` 后提交）",
        "required": [
          "agent_id",
          "kid",
          "audience",
          "timestamp",
          "signature"
        ],
        "properties": {
          "agent_id": {
            "type": "string",
            "examples": [
              "agent_id:modelscope:agent_1234567890ab"
            ]
          },
          "kid": {
            "type": "string",
            "examples": [
              "agent-key-001"
            ]
          },
          "audience": {
            "type": "string",
            "description": "目标 Hub 应用的 client_id",
            "examples": [
              "hub-app-abcdef"
            ]
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "签名时间戳（Unix 秒），需在服务器时间 ±5 分钟之内",
            "examples": [
              1717410000
            ]
          },
          "signature": {
            "type": "string",
            "description": "Ed25519 签名 base64url 编码（无 padding）",
            "examples": [
              "MEUCIQDxxx..."
            ]
          }
        }
      },
      "TokenSignData": {
        "type": "object",
        "description": "Token 签发返回数据",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "签发的 JWT",
            "examples": [
              "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImlkcC1rZXktMDAxIn0..."
            ]
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ],
            "examples": [
              "Bearer"
            ]
          },
          "expire_at": {
            "type": "integer",
            "format": "int64",
            "description": "Token 失效时间（Unix 时间戳，单位秒）",
            "examples": [
              1717413600
            ]
          },
          "jti": {
            "type": "string",
            "description": "JWT ID",
            "examples": [
              "jti-1234567890"
            ]
          }
        }
      },
      "TokenSignResponse": {
        "type": "object",
        "description": "Token 签发响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/TokenSignData"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "TokenRecordItem": {
        "type": "object",
        "description": "Token 签发记录项",
        "properties": {
          "token_id": {
            "type": "string"
          },
          "audience": {
            "type": "string",
            "description": "目标 Hub 的 client_id"
          },
          "issued_at": {
            "type": "string",
            "description": "签发时间 (ISO 8601)"
          },
          "expire_at": {
            "type": "string",
            "description": "过期时间 (ISO 8601)"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "jwt": {
            "type": "string",
            "description": "JWT 字符串"
          }
        }
      },
      "ListTokenRecordsData": {
        "type": "object",
        "description": "Token 签发记录列表数据",
        "properties": {
          "token_records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TokenRecordItem"
            }
          },
          "total_count": {
            "type": "integer",
            "format": "int64"
          },
          "page_number": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          }
        }
      },
      "ListTokenRecordsResponse": {
        "type": "object",
        "description": "Token 签发记录列表响应",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ListTokenRecordsData"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "AgentIdConfiguration": {
        "type": "object",
        "description": "Agent IDP OIDC Discovery 配置",
        "properties": {
          "issuer": {
            "type": "string",
            "examples": [
              "https://modelscope.cn"
            ]
          },
          "token_endpoint": {
            "type": "string",
            "examples": [
              "https://modelscope.cn/openapi/v1/agent_id/token"
            ]
          },
          "jwks_uri": {
            "type": "string",
            "examples": [
              "https://modelscope.cn/openapi/v1/agent_id/.well-known/agentid-jwks"
            ]
          },
          "registration_endpoint": {
            "type": "string",
            "examples": [
              "https://modelscope.cn/openapi/v1/agent_ids"
            ]
          },
          "activity_endpoint": {
            "type": "string"
          },
          "id_token_signing_alg_values_supported": {
            "type": "string",
            "examples": [
              "EdDSA"
            ]
          }
        }
      },
      "JWKS": {
        "type": "object",
        "description": "JSON Web Key Set",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JWK"
            }
          }
        }
      },
      "Collection": {
        "type": "object",
        "description": "Collection 详情对象",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Collection 唯一标识，格式 {owner}/{slug}。新建为 {owner}/{title_slug}；历史为 {owner}/{title_slug}-{short_id}",
            "examples": [
              "iSolver/best-nlp-models-6a3b2c"
            ]
          },
          "title": {
            "type": "string",
            "description": "Collection 标题",
            "examples": [
              "最佳 NLP 模型合集"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collection 描述（Markdown）",
            "examples": [
              "精选的自然语言处理模型..."
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "iSolver"
            ]
          },
          "visibility": {
            "type": "string",
            "description": "可见性：public（公开）/ private（私有）",
            "enum": [
              "public",
              "private"
            ],
            "examples": [
              "public"
            ]
          },
          "theme": {
            "type": [
              "string",
              "null"
            ],
            "description": "主题标签，枚举值：Blue/Pink/Purple/Cyan",
            "examples": [
              "Blue"
            ]
          },
          "item_count": {
            "type": "integer",
            "description": "Collection 中条目数量",
            "examples": [
              12
            ]
          },
          "likes": {
            "type": "integer",
            "description": "喜欢数",
            "examples": [
              128
            ]
          },
          "view_count": {
            "type": "integer",
            "description": "浏览量",
            "examples": [
              1024
            ]
          },
          "items": {
            "type": "array",
            "description": "Collection 中的条目列表",
            "items": {
              "$ref": "#/components/schemas/CollectionItem"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间，ISO 8601 UTC",
            "examples": [
              "2025-01-15T08:00:00Z"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "更新时间，ISO 8601 UTC",
            "examples": [
              "2025-04-20T10:30:00Z"
            ]
          },
          "url": {
            "type": "string",
            "description": "Collection 页面 URL",
            "examples": [
              "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
            ]
          },
          "install_command": {
            "type": [
              "array",
              "null"
            ],
            "description": "当 items 包含 skill 时，返回下载命令数组",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "modelscope skill install @iSolver/my-skill"
              ]
            ]
          }
        },
        "required": [
          "slug",
          "title",
          "owner",
          "visibility",
          "item_count",
          "likes",
          "view_count",
          "items",
          "created_at",
          "updated_at",
          "url"
        ]
      },
      "CollectionItem": {
        "type": "object",
        "description": "Collection 条目对象。条目通过 item_type + item_object_id 唯一标识，不维护独立 item_id",
        "properties": {
          "item_type": {
            "type": "string",
            "description": "资源类型：model / dataset / studio / paper / skill / mcp",
            "enum": [
              "model",
              "dataset",
              "studio",
              "paper",
              "skill",
              "mcp"
            ],
            "examples": [
              "model"
            ]
          },
          "item_object_id": {
            "type": "string",
            "description": "资源标识，如 damo/nlp_bert_base 或论文 ID",
            "examples": [
              "damo/nlp_bert_base"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "用户对该条目的备注说明（Markdown）",
            "examples": [
              "这个模型在中文 NLP 任务上表现优异"
            ]
          },
          "position": {
            "type": "integer",
            "description": "排序位置（从 1 开始）",
            "examples": [
              1
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "添加时间，ISO 8601 UTC",
            "examples": [
              "2025-01-15T08:00:00Z"
            ]
          },
          "visibility": {
            "type": "string",
            "description": "可见性：public / protected / private。protected 对应“仅公开体验”语义",
            "enum": [
              "public",
              "protected",
              "private"
            ],
            "examples": [
              "public"
            ]
          },
          "gated": {
            "type": "boolean",
            "description": "visibility 为 public 时，是否需先申请并经同意后才可访问",
            "examples": [
              false
            ]
          },
          "protected_mode": {
            "type": "integer",
            "description": "protected（仅公开体验）模式标识；用于表达条目/资源的仅公开体验语义，具体取值含义以产品后端实现为准（如 0=无、2=仅公开体验）",
            "examples": [
              0
            ]
          }
        },
        "required": [
          "item_type",
          "item_object_id",
          "position",
          "created_at",
          "visibility",
          "gated",
          "protected_mode"
        ]
      },
      "FailedCollectionItem": {
        "type": "object",
        "description": "批量操作中失败的条目及原因",
        "properties": {
          "item_type": {
            "type": "string",
            "description": "资源类型",
            "examples": [
              "model"
            ]
          },
          "item_object_id": {
            "type": "string",
            "description": "资源标识",
            "examples": [
              "not/exist-model"
            ]
          },
          "reason": {
            "type": "string",
            "description": "失败原因错误码，如 ResourceNotFound、ItemAlreadyInCollection、ItemNotInCollection、PermissionDenied",
            "examples": [
              "ResourceNotFound"
            ]
          }
        },
        "required": [
          "item_type",
          "item_object_id",
          "reason"
        ]
      },
      "CreateCollectionRequest": {
        "type": "object",
        "description": "创建 Collection 请求",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 128,
            "description": "Collection 标题（最长 128 字符）",
            "examples": [
              "最佳 NLP 模型合集"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者(用户名或组织名)",
            "examples": [
              "iSolver"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collection 描述（Markdown）",
            "examples": [
              "精选的自然语言处理模型..."
            ]
          },
          "visibility": {
            "type": "string",
            "description": "可见性：public / private，默认 public",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "examples": [
              "public"
            ]
          },
          "theme": {
            "type": [
              "string",
              "null"
            ],
            "description": "主题标签，枚举值：Blue/Pink/Purple/Cyan",
            "examples": [
              "Blue"
            ]
          }
        },
        "required": [
          "title",
          "owner"
        ]
      },
      "UpdateCollectionRequest": {
        "type": "object",
        "description": "更新 Collection 请求。传入哪个字段即更新哪个字段，未传字段保持原值",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "description": "Collection 标题（最长 128 字符）",
            "examples": [
              "最佳 NLP 模型合集（已更名）"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Collection 描述（Markdown）",
            "examples": [
              "更新后的描述..."
            ]
          },
          "owner": {
            "type": [
              "string",
              "null"
            ],
            "description": "所有者",
            "examples": [
              "iSolver"
            ]
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "description": "可见性：public / private",
            "enum": [
              "public",
              "private",
              null
            ],
            "examples": [
              "private"
            ]
          },
          "theme": {
            "type": [
              "string",
              "null"
            ],
            "description": "主题标签，枚举值：Blue/Pink/Purple/Cyan",
            "examples": [
              "Purple"
            ]
          }
        }
      },
      "CollectionResponse": {
        "type": "object",
        "description": "获取 Collection 详情的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/Collection"
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "CollectionListResponse": {
        "type": "object",
        "description": "获取 Collection 列表的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "列表数据",
            "properties": {
              "collection_list": {
                "type": "array",
                "description": "Collection 列表，返回完整 Collection 对象",
                "items": {
                  "$ref": "#/components/schemas/Collection"
                }
              },
              "total_count": {
                "type": "integer",
                "description": "符合筛选条件的合集总数",
                "examples": [
                  128
                ]
              },
              "page_number": {
                "type": "integer",
                "description": "当前页码",
                "examples": [
                  1
                ]
              },
              "page_size": {
                "type": "integer",
                "description": "每页大小",
                "examples": [
                  10
                ]
              }
            },
            "required": [
              "collection_list",
              "total_count",
              "page_number",
              "page_size"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "CollectionItemListResponse": {
        "type": "object",
        "description": "获取 Collection 条目列表的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "条目列表数据",
            "properties": {
              "items": {
                "type": "array",
                "description": "条目列表",
                "items": {
                  "$ref": "#/components/schemas/CollectionItem"
                }
              },
              "total_count": {
                "type": "integer",
                "description": "条目总数",
                "examples": [
                  50
                ]
              },
              "page_number": {
                "type": "integer",
                "description": "当前页码",
                "examples": [
                  1
                ]
              },
              "page_size": {
                "type": "integer",
                "description": "每页大小",
                "examples": [
                  10
                ]
              }
            },
            "required": [
              "items",
              "total_count",
              "page_number",
              "page_size"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "CollectionItemRequest": {
        "type": "object",
        "description": "待添加条目",
        "properties": {
          "item_type": {
            "type": "string",
            "description": "资源类型：model / dataset / studio / paper / skill / mcp",
            "enum": [
              "model",
              "dataset",
              "studio",
              "paper",
              "skill",
              "mcp"
            ],
            "examples": [
              "model"
            ]
          },
          "item_object_id": {
            "type": "string",
            "description": "资源标识，如 damo/nlp_bert_base_chinese",
            "examples": [
              "damo/nlp_bert_base_chinese"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "备注（Markdown）",
            "examples": [
              "推荐用于中文文本分类"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "排序位置（从 1 开始）",
            "examples": [
              1
            ]
          }
        },
        "required": [
          "item_type",
          "item_object_id"
        ]
      },
      "AddCollectionItemsRequest": {
        "type": "object",
        "description": "批量添加条目请求",
        "properties": {
          "items": {
            "type": "array",
            "description": "待添加条目列表（最少 1 个元素）",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CollectionItemRequest"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "AddCollectionItemsResponse": {
        "type": "object",
        "description": "批量添加条目的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true（部分失败仍为 true，失败项见 failed_items）",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "添加结果",
            "properties": {
              "added_count": {
                "type": "integer",
                "description": "成功添加的条目数量",
                "examples": [
                  2
                ]
              },
              "url": {
                "type": "string",
                "description": "Collection 页面 URL",
                "examples": [
                  "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
                ]
              },
              "failed_items": {
                "type": "array",
                "description": "添加失败的条目及原因",
                "items": {
                  "$ref": "#/components/schemas/FailedCollectionItem"
                }
              }
            },
            "required": [
              "added_count",
              "url",
              "failed_items"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "UpdateCollectionItemRequest": {
        "type": "object",
        "description": "更新单个条目请求。传入哪个字段即更新哪个字段",
        "properties": {
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "备注（Markdown）",
            "examples": [
              "更新后的备注"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "排序位置（从 1 开始）",
            "examples": [
              2
            ]
          }
        }
      },
      "UpdateCollectionItemResponse": {
        "type": "object",
        "description": "更新单个条目的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/CollectionItem"
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "CreateGalleryRequest": {
        "type": "object",
        "description": "创建 Gallery 请求",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^[0-9a-zA-Z_.-]+$",
            "description": "Gallery 名称，最长 128 字符，仅允许字母、数字、下划线、连字符、点",
            "examples": [
              "my-gallery"
            ]
          },
          "owner": {
            "type": "string",
            "maxLength": 128,
            "description": "所属用户或组织名，最长 128 字符",
            "examples": [
              "my-org"
            ]
          },
          "files": {
            "type": "array",
            "maxItems": 50,
            "description": "文件 ID 列表（文件上传接口返回的 ID），最多 50 个，单个元素不能为空",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "examples": [
              [
                "8c378570-8991-431b-a82c-96f3d0b4f0f4"
              ]
            ]
          },
          "entry_file": {
            "type": "string",
            "minLength": 1,
            "description": "入口文件的相对路径，对应 files 中某个已上传文件；后缀须与 category 匹配（后缀不区分大小写）：notebook→.ipynb，website→.html，pdf→.pdf（file 类别不限后缀）",
            "examples": [
              "notebook/demo.ipynb"
            ]
          },
          "private": {
            "type": "boolean",
            "default": false,
            "description": "是否私有，默认 false（公开）",
            "examples": [
              false
            ]
          },
          "category": {
            "type": "string",
            "description": "类型（必传），可选值：notebook / website / pdf / file；除 file 外须与 entry_file 后缀匹配（后缀不区分大小写）：notebook→.ipynb，website→.html，pdf→.pdf",
            "enum": [
              "notebook",
              "website",
              "pdf",
              "file"
            ],
            "examples": [
              "notebook"
            ]
          },
          "labels": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 10,
            "description": "标签列表，最多 10 个，单个标签最长 20 字符",
            "items": {
              "type": "string",
              "maxLength": 20
            },
            "examples": [
              [
                "demo",
                "tutorial"
              ]
            ]
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "pattern": "^[0-9a-zA-Z_-]+$",
            "description": "自定义 URL 尾缀（选填），仅允许字母、数字、下划线、连字符，最长 128 字符；不填则不生成，填写后灵感流对应 URL：https://modelscope.cn/gallery/{owner}/{path}",
            "examples": [
              "my-custom-path"
            ]
          }
        },
        "required": [
          "name",
          "owner",
          "files",
          "entry_file",
          "category"
        ]
      },
      "CreateGalleryResponse": {
        "type": "object",
        "description": "创建 Gallery 的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "req-xxxxxx"
            ]
          },
          "data": {
            "type": "object",
            "description": "创建结果",
            "properties": {
              "id": {
                "type": "string",
                "description": "Gallery 唯一标识（UUID）",
                "examples": [
                  "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                ]
              },
              "url": {
                "type": "string",
                "description": "Gallery 访问链接",
                "examples": [
                  "https://modelscope.cn/gallery/my-org/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                ]
              }
            },
            "required": [
              "id",
              "url"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "BatchUpdateCollectionItem": {
        "type": "object",
        "description": "批量更新条目。通过 item_type + item_object_id 定位，传入哪个字段就修改哪个字段",
        "properties": {
          "item_type": {
            "type": "string",
            "description": "资源类型，用于定位",
            "enum": [
              "model",
              "dataset",
              "studio",
              "paper",
              "skill",
              "mcp"
            ],
            "examples": [
              "model"
            ]
          },
          "item_object_id": {
            "type": "string",
            "description": "资源标识，用于定位",
            "examples": [
              "damo/nlp_bert_base_chinese"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "备注（Markdown），不传则不修改",
            "examples": [
              "更新后的备注"
            ]
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "排序位置（从 1 开始），不传则不修改",
            "examples": [
              1
            ]
          }
        },
        "required": [
          "item_type",
          "item_object_id"
        ]
      },
      "UpdateCollectionItemsRequest": {
        "type": "object",
        "description": "批量更新条目请求",
        "properties": {
          "items": {
            "type": "array",
            "description": "待更新条目列表（最少 1 个元素）",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/BatchUpdateCollectionItem"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "UpdateCollectionItemsResponse": {
        "type": "object",
        "description": "批量更新条目的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true（部分失败仍为 true，失败项见 failed_items）",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "批量更新结果",
            "properties": {
              "updated_count": {
                "type": "integer",
                "description": "成功更新的条目数量",
                "examples": [
                  2
                ]
              },
              "failed_items": {
                "type": "array",
                "description": "更新失败的条目及原因",
                "items": {
                  "$ref": "#/components/schemas/FailedCollectionItem"
                }
              }
            },
            "required": [
              "updated_count",
              "failed_items"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "AgentPlaygroundModelSetupRef": {
        "type": "object",
        "description": "模型引用。创建实例的 `models`、导入的 `models` 与下发模型接口共用。\n\n三种引用形式，按优先级解析：\n\n- 按名称（推荐）：`provider_name` + `model_name`\n- 按供应商 ID：`provider_id` + `model_name`\n- 按模型 ID：`model_id`\n\n供应商只在「调用者本人创建的供应商 + 平台内置供应商」范围内查找，引用他人资源返回 403。\n平台内置供应商目前只有 `ModelScope API-Inference`，使用时 `model_name` 直接作为\nAPI-Inference 的模型 ID。\n",
        "properties": {
          "provider_name": {
            "type": "string",
            "description": "模型供应商名称；传了它就按名称解析，此时 `model_name` 必填",
            "examples": [
              "ModelScope API-Inference"
            ]
          },
          "model_name": {
            "type": "string",
            "description": "模型名称，也可写作 `model`",
            "examples": [
              "Qwen/Qwen3.5-27B"
            ]
          },
          "provider_id": {
            "type": "string",
            "description": "模型供应商 UUID（自定义供应商记录的 uuid），与实例内 Agent 信息里的 `provider_id` 不是同一个东西",
            "examples": [
              "4d32e63f-6f7b-11f1-b963-00163e27a6e0"
            ]
          },
          "model_id": {
            "type": "string",
            "description": "模型记录 UUID，也可写作 `uuid`",
            "examples": [
              "0a1f5c7e-3b2d-4a68-9f0c-5d7e1b2a3c4d"
            ]
          }
        }
      },
      "AgentPlaygroundMcpServerConfig": {
        "type": "object",
        "description": "MCP 连接配置，校验通过后原样下发给实例。\n\n- 可以是裸配置（`{\"type\": \"sse\", \"url\": \"...\"}`、`{\"command\": \"npx\", \"args\": [...]}`），\n  也可以是 `{\"mcpServers\": {\"<key>\": {...}}}` 包装形；包装形必须恰好包含 1 个条目。\n- `url` 与 `command` 必须有且只有一个非空；`url` 必须公网可达，指向内网或保留地址会被拒绝。\n- 带 `command` 的配置按 stdio 处理；带 `url` 且未写 `type` 时按 SSE 处理，\n  Streamable HTTP 服务必须显式写 `\"type\": \"streamable_http\"`。\n",
        "additionalProperties": true,
        "examples": [
          {
            "mcpServers": {
              "amap-maps": {
                "type": "sse",
                "url": "https://mcp.example.com/sse"
              }
            }
          }
        ]
      },
      "AgentPlaygroundMcpSetupRef": {
        "type": "object",
        "description": "MCP 引用。创建实例的 `mcps`、导入的 `mcps` 与下发 MCP 接口共用。",
        "properties": {
          "name": {
            "type": "string",
            "description": "实例内 MCP client key",
            "examples": [
              "amap-maps"
            ]
          },
          "source": {
            "type": "string",
            "description": "来源标记，只作记录，大小写不敏感；传其他值返回 400",
            "enum": [
              "ms-platform",
              "ms-deployed",
              "custom"
            ],
            "examples": [
              "custom"
            ]
          },
          "server_config": {
            "$ref": "#/components/schemas/AgentPlaygroundMcpServerConfig"
          }
        },
        "required": [
          "name",
          "server_config"
        ]
      },
      "AgentPlaygroundInstance": {
        "type": "object",
        "description": "实验场实例。\n\n`agent_count` / `model_count` / `mcp_count` / `skill_count` 为统计值，可能落后于最近一次下发或导入。\n",
        "properties": {
          "uuid": {
            "type": "string",
            "description": "实例 ID",
            "examples": [
              "51a7d9d2-a521-451a-baf5-367cb115a29a"
            ]
          },
          "owner": {
            "type": "string",
            "description": "实例归属账号，即调用者本人；暂不支持组织",
            "examples": [
              "username"
            ]
          },
          "instance_name": {
            "type": "string",
            "description": "实例名称，在本人名下唯一",
            "examples": [
              "my-agent"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "展示名称，可为空串",
            "examples": [
              "我的 Agent"
            ]
          },
          "description": {
            "type": "string",
            "description": "实例描述，可为空串",
            "examples": [
              "用于测试的 Agent Playground 实例"
            ]
          },
          "logo": {
            "type": "string",
            "description": "头像图片 URL，未设置时为空串",
            "examples": [
              "https://resources.modelscope.cn/avatar/my-agent.png"
            ]
          },
          "status": {
            "type": "string",
            "description": "实例状态：\n\n- `starting`：创建、唤醒、重启或导入内容应用中\n- `running`：运行中\n- `sleeping`：已休眠\n- `failed`：运行异常。不是终态，平台会继续尝试恢复，恢复后自动回到 `running`；\n  也可以直接调用重启 / 暂停 / 删除\n",
            "enum": [
              "starting",
              "running",
              "sleeping",
              "failed"
            ],
            "examples": [
              "running"
            ]
          },
          "framework_type": {
            "type": "string",
            "description": "框架类型，取值以平台配置为准，线上为 `qwenpaw` / `ms-agent`",
            "examples": [
              "qwenpaw"
            ]
          },
          "source": {
            "type": "string",
            "description": "创建来源：`playground`（普通创建）/ `agent_hub`（从 Agent Hub 创建）",
            "examples": [
              "playground"
            ]
          },
          "framework_version": {
            "type": "string",
            "description": "实例当前的框架版本",
            "examples": [
              "2.2.0"
            ]
          },
          "agent_count": {
            "type": "integer",
            "description": "实例内 Agent 数",
            "examples": [
              2
            ]
          },
          "model_count": {
            "type": "integer",
            "description": "模型数，跨 Agent 去重",
            "examples": [
              1
            ]
          },
          "mcp_count": {
            "type": "integer",
            "description": "MCP 数，跨 Agent 去重",
            "examples": [
              3
            ]
          },
          "skill_count": {
            "type": "integer",
            "description": "Skill 数，跨 Agent 去重",
            "examples": [
              17
            ]
          },
          "gmt_created": {
            "type": "string",
            "format": "date-time",
            "description": "创建时间，RFC 3339、UTC+8、秒级",
            "examples": [
              "2026-09-17T15:47:19+08:00"
            ]
          },
          "gmt_modified": {
            "type": "string",
            "format": "date-time",
            "description": "最后更新时间，由系统维护，不代表用户操作",
            "examples": [
              "2026-09-18T17:06:19+08:00"
            ]
          },
          "user_modified_at": {
            "type": "string",
            "format": "date-time",
            "description": "用户最近一次操作时间（创建 / 改名 / 暂停 / 恢复 / 重启 / 导入），实例列表默认按它倒序；自动休眠不会更新它",
            "examples": [
              "2026-09-17T15:47:19+08:00"
            ]
          }
        }
      },
      "AgentPlaygroundAgentModel": {
        "type": "object",
        "description": "实例内 Agent 可用的模型",
        "properties": {
          "provider_id": {
            "type": "string",
            "description": "实例内的供应商标识，与模型引用里的供应商名称 / UUID 不通用，不能回填给下发接口",
            "examples": [
              "playground-openai-3f2a9c1d"
            ]
          },
          "provider": {
            "type": "string",
            "description": "供应商展示名",
            "examples": [
              "Playground Openai (3f2a9c1d)"
            ]
          },
          "model": {
            "type": "string",
            "description": "模型 ID",
            "examples": [
              "Qwen/Qwen3.5-27B"
            ]
          },
          "type": {
            "type": "string",
            "description": "协议类型",
            "enum": [
              "openai",
              "anthropic"
            ],
            "examples": [
              "openai"
            ]
          },
          "base_url": {
            "type": "string",
            "description": "模型服务地址",
            "examples": [
              "https://api-inference.modelscope.cn/v1"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "是否为当前生效模型；其余为已配置可切换的模型",
            "examples": [
              true
            ]
          }
        }
      },
      "AgentPlaygroundPersonaFile": {
        "type": "object",
        "description": "persona 文件内容",
        "properties": {
          "content": {
            "type": "string",
            "description": "文件内容"
          },
          "enabled": {
            "type": "boolean",
            "description": "该文件是否进入系统提示词",
            "examples": [
              true
            ]
          }
        }
      },
      "AgentPlaygroundAgentSkill": {
        "type": "object",
        "description": "实例内已安装的 Skill",
        "properties": {
          "name": {
            "type": "string",
            "description": "Skill 名称",
            "examples": [
              "web-search"
            ]
          },
          "description": {
            "type": "string",
            "description": "Skill 描述"
          },
          "enabled": {
            "type": "boolean",
            "description": "是否启用",
            "examples": [
              true
            ]
          },
          "source": {
            "type": "string",
            "description": "来源标记",
            "examples": [
              "builtin"
            ]
          }
        }
      },
      "AgentPlaygroundMcpTool": {
        "type": "object",
        "description": "MCP 客户端暴露的工具",
        "properties": {
          "name": {
            "type": "string",
            "description": "工具名称",
            "examples": [
              "maps_geo"
            ]
          },
          "description": {
            "type": "string",
            "description": "工具描述"
          }
        }
      },
      "AgentPlaygroundMcpClient": {
        "type": "object",
        "description": "实例内已配置的 MCP 客户端",
        "properties": {
          "key": {
            "type": "string",
            "description": "实例内 MCP client key",
            "examples": [
              "amap-maps"
            ]
          },
          "name": {
            "type": "string",
            "description": "MCP 名称",
            "examples": [
              "amap-maps"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "是否启用",
            "examples": [
              true
            ]
          },
          "transport": {
            "type": "string",
            "description": "连接方式：`sse` / `streamable_http` / `stdio`",
            "examples": [
              "sse"
            ]
          },
          "url": {
            "type": "string",
            "description": "连接地址；stdio 类型为启动命令",
            "examples": [
              "https://mcp.example.com/sse"
            ]
          },
          "tools": {
            "type": [
              "array",
              "null"
            ],
            "description": "工具列表；仅对启用的客户端返回，ms-agent 恒为空数组",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundMcpTool"
            }
          }
        }
      },
      "AgentPlaygroundAgentSummary": {
        "type": "object",
        "description": "实例内 Agent 概要",
        "properties": {
          "id": {
            "type": "string",
            "description": "实例内 Agent 的 id，下发接口用它区分不同 Agent",
            "examples": [
              "default"
            ]
          },
          "name": {
            "type": "string",
            "description": "Agent 名称",
            "examples": [
              "Default Agent"
            ]
          },
          "description": {
            "type": "string",
            "description": "Agent 描述"
          },
          "enabled": {
            "type": "boolean",
            "description": "Agent 是否启用",
            "examples": [
              true
            ]
          },
          "models": {
            "type": [
              "array",
              "null"
            ],
            "description": "该 Agent 可用的模型",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundAgentModel"
            }
          }
        }
      },
      "AgentPlaygroundAgentDetail": {
        "type": "object",
        "description": "实例内 Agent 详情；qwenpaw 下某个 Agent 的详情拉取失败时为 null",
        "properties": {
          "id": {
            "type": "string",
            "description": "实例内 Agent 的 id",
            "examples": [
              "default"
            ]
          },
          "name": {
            "type": "string",
            "description": "Agent 名称",
            "examples": [
              "Default Agent"
            ]
          },
          "description": {
            "type": "string",
            "description": "Agent 描述"
          },
          "models": {
            "type": [
              "array",
              "null"
            ],
            "description": "该 Agent 可用的模型",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundAgentModel"
            }
          },
          "persona": {
            "type": "object",
            "description": "persona 文件映射：key 为文件名（如 `AGENTS.md`，大小写敏感），value 为 `{content, enabled}`。\n",
            "additionalProperties": {
              "$ref": "#/components/schemas/AgentPlaygroundPersonaFile"
            }
          },
          "skills": {
            "type": [
              "array",
              "null"
            ],
            "description": "已安装的 Skill",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundAgentSkill"
            }
          },
          "mcp_clients": {
            "type": [
              "array",
              "null"
            ],
            "description": "已配置的 MCP 客户端",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundMcpClient"
            }
          }
        }
      },
      "AgentPlaygroundAgentItem": {
        "type": "object",
        "description": "实例内单个 Agent 的概要与详情",
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/AgentPlaygroundAgentSummary"
          },
          "detail": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AgentPlaygroundAgentDetail"
              },
              {
                "type": "null"
              }
            ],
            "description": "Agent 详情；详情拉取失败时为 null（summary 仍返回）"
          }
        }
      },
      "AgentPlaygroundNotification": {
        "type": "object",
        "description": "实例一次性通知。拉取即消费，同一条通知只返回一次；保留 7 天。",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "通知 ID",
            "examples": [
              7
            ]
          },
          "kind": {
            "type": "string",
            "description": "通知类型：\n\n- `import_result`：创建或导入的内容应用完成（未附带 message）\n- `conversation`：内容应用完成且附带了一句话，payload 含会话信息\n- `agent_import`：从 Agent Hub 导入 Agent 完成\n- `init_error`：某一项内容被跳过，实例仍会 running\n- `framework_update_error`：框架版本更新失败\n",
            "enum": [
              "import_result",
              "conversation",
              "agent_import",
              "init_error",
              "framework_update_error"
            ],
            "examples": [
              "conversation"
            ]
          },
          "payload": {
            "type": "object",
            "description": "原样 JSON，键名不做转换。其中 `conversation` / `agent` 部分不同框架结构不同，\n用 `framework` 字段区分。\n",
            "additionalProperties": true
          },
          "gmt_created": {
            "type": "string",
            "format": "date-time",
            "description": "通知产生时间，RFC 3339、UTC+8、秒级",
            "examples": [
              "2026-07-12T15:32:47+08:00"
            ]
          }
        }
      },
      "CreateAgentPlaygroundInstanceRequest": {
        "type": "object",
        "description": "创建实例请求",
        "properties": {
          "instance_name": {
            "type": "string",
            "maxLength": 128,
            "description": "实例名称，去掉首尾空白后非空，本人名下唯一（冲突返回 409）",
            "examples": [
              "my-agent"
            ]
          },
          "display_name": {
            "type": "string",
            "maxLength": 256,
            "description": "展示名称，缺省为空串",
            "examples": [
              "我的 Agent"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1024,
            "description": "实例描述",
            "examples": [
              "用于测试的 Agent Playground 实例"
            ]
          },
          "logo": {
            "type": "string",
            "maxLength": 512,
            "description": "头像图片 URL，超长返回 400",
            "examples": [
              "https://resources.modelscope.cn/avatar/my-agent.png"
            ]
          },
          "framework_type": {
            "type": "string",
            "description": "框架类型，须为平台当前配置的框架，线上为 `qwenpaw` / `ms-agent`",
            "examples": [
              "qwenpaw"
            ]
          },
          "owner": {
            "type": "string",
            "description": "实例归属账号，缺省为调用者；只能填调用者本人，填其他账号或组织返回 403",
            "examples": [
              "username"
            ]
          },
          "models": {
            "type": "array",
            "description": "就绪后自动下发的模型，依次设为生效模型，最后一个生效。\n\n**不传时会自动配置平台默认模型。**\n",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundModelSetupRef"
            }
          },
          "mcps": {
            "type": "array",
            "description": "就绪后自动下发的 MCP",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundMcpSetupRef"
            }
          },
          "skills": {
            "type": "array",
            "description": "就绪后自动下发的 Skill Hub 引用，格式 `path/name`；私有 Skill 需调用者有读权限",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "@modelscope/web-search"
              ]
            ]
          },
          "message": {
            "type": "string",
            "description": "附带的一句话：内容全部就位后用它对 `default` Agent 发起对话，会话信息经一次性通知返回（kind=`conversation`）",
            "examples": [
              "帮我查一下明天的天气"
            ]
          }
        },
        "required": [
          "instance_name",
          "framework_type"
        ]
      },
      "CreateAgentPlaygroundInstanceFromAgentHubRequest": {
        "type": "object",
        "description": "从 Agent Hub 创建实例请求",
        "properties": {
          "instance_name": {
            "type": "string",
            "maxLength": 128,
            "description": "实例名称，本人名下唯一",
            "examples": [
              "playground-instance"
            ]
          },
          "display_name": {
            "type": "string",
            "maxLength": 256,
            "description": "展示名称",
            "examples": [
              "Playground Instance"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1024,
            "description": "实例描述",
            "examples": [
              "从 Agent Hub 导入的实例"
            ]
          },
          "logo": {
            "type": "string",
            "maxLength": 512,
            "description": "头像图片 URL"
          },
          "framework_type": {
            "type": "string",
            "description": "框架类型；内容同步目前只支持 `qwenpaw` / `ms-agent`",
            "examples": [
              "qwenpaw"
            ]
          },
          "owner": {
            "type": "string",
            "description": "实例归属账号，缺省为调用者"
          },
          "agent_owner": {
            "type": "string",
            "description": "Agent Hub 源 agent 的归属账号",
            "examples": [
              "jakexiao"
            ]
          },
          "agent_name": {
            "type": "string",
            "description": "Agent Hub 源 agent 的名称",
            "examples": [
              "FirstAgent"
            ]
          },
          "models": {
            "type": "array",
            "description": "内容同步完成后下发的模型。\n\n本接口**不会**自动配置默认模型：不传时实例内模型取决于源 agent 的内容，可能为空。\n",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundModelSetupRef"
            }
          },
          "mcps": {
            "type": "array",
            "description": "内容同步完成后下发的 MCP",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundMcpSetupRef"
            }
          },
          "skills": {
            "type": "array",
            "description": "内容同步完成后下发的 Skill Hub 引用，格式 `path/name`",
            "items": {
              "type": "string"
            }
          },
          "message": {
            "type": "string",
            "description": "附带的一句话，内容就位后用它对 `default` Agent 发起对话"
          }
        },
        "required": [
          "instance_name",
          "framework_type",
          "agent_owner",
          "agent_name"
        ]
      },
      "UpdateAgentPlaygroundInstanceRequest": {
        "type": "object",
        "description": "更新实例元信息请求。只允许修改这四个字段，`framework_type`、`owner` 与 init 内容都不能通过本接口修改。\n",
        "properties": {
          "instance_name": {
            "type": "string",
            "maxLength": 128,
            "description": "实例名称，非空，本人名下唯一（冲突返回 409）",
            "examples": [
              "my-agent-renamed"
            ]
          },
          "display_name": {
            "type": "string",
            "maxLength": 256,
            "description": "展示名称；整体覆盖语义，缺省或传空串都会清空",
            "examples": [
              "My Agent Renamed"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 1024,
            "description": "实例描述；缺省或传空串都会清空",
            "examples": [
              "Updated description"
            ]
          },
          "logo": {
            "type": "string",
            "maxLength": 512,
            "description": "头像图片 URL；与其他字段不同，缺省保持原值，显式传入则覆盖（空串清空）",
            "examples": [
              "https://resources.modelscope.cn/avatar/my-agent.png"
            ]
          }
        },
        "required": [
          "instance_name"
        ]
      },
      "ImportToAgentPlaygroundInstanceRequest": {
        "type": "object",
        "description": "向已有实例追加导入 model / mcp / skill 的请求。四者至少传一个，否则返回 400。\n导入内容恒作用于实例内 `default` Agent。\n",
        "properties": {
          "models": {
            "type": "array",
            "description": "追加下发的模型",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundModelSetupRef"
            }
          },
          "mcps": {
            "type": "array",
            "description": "追加下发的 MCP",
            "items": {
              "$ref": "#/components/schemas/AgentPlaygroundMcpSetupRef"
            }
          },
          "skills": {
            "type": "array",
            "description": "追加下发的 Skill Hub 引用，格式 `path/name`；私有 Skill 需调用者有读权限",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "@modelscope/web-search"
              ]
            ]
          },
          "message": {
            "type": "string",
            "description": "本批内容就位后用它对 `default` Agent 发起对话",
            "examples": [
              "帮我查一下明天的天气"
            ]
          }
        }
      },
      "SetupAgentPlaygroundModelRequest": {
        "type": "object",
        "description": "下发模型配置请求。在模型引用（`provider_name` + `model_name` 等）之外额外支持 `agent_id`。\n\n下发后该模型即目标 Agent 的生效模型；重复下发同一个模型是幂等的。\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentPlaygroundModelSetupRef"
          },
          {
            "type": "object",
            "properties": {
              "agent_id": {
                "type": "string",
                "description": "实例内目标 Agent 的 id，取自实例内 Agent 信息接口的 `detail.id`，缺省 `default`",
                "examples": [
                  "default"
                ]
              }
            }
          }
        ]
      },
      "SetupAgentPlaygroundMcpRequest": {
        "type": "object",
        "description": "下发 MCP 配置请求。仅新增：目标 Agent 下已有同名 client key 时返回 409，不会覆盖。\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentPlaygroundMcpSetupRef"
          },
          {
            "type": "object",
            "properties": {
              "agent_id": {
                "type": "string",
                "description": "实例内目标 Agent 的 id，缺省 `default`",
                "examples": [
                  "default"
                ]
              }
            }
          }
        ]
      },
      "SetupAgentPlaygroundSkillRequest": {
        "type": "object",
        "description": "下发 Skill 配置请求。按 Skill Hub 引用把 Skill 安装到目标 Agent。\n\n仅新增：实例内已有同名 Skill 返回 409，不会覆盖。\n",
        "properties": {
          "agent_id": {
            "type": "string",
            "description": "实例内目标 Agent 的 id，缺省 `default`",
            "examples": [
              "default"
            ]
          },
          "skill_ref": {
            "type": "string",
            "description": "Skill Hub 引用，格式 `path/name`（按最后一个 `/` 拆分，path 可带 `@` 前缀）",
            "examples": [
              "@modelscope/web-search"
            ]
          }
        },
        "required": [
          "skill_ref"
        ]
      },
      "AgentPlaygroundInstanceResponse": {
        "type": "object",
        "description": "单个实例响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "7d3f8f8a-8c1f-4d0b-8f1a-7b6a0d8a1a11"
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AgentPlaygroundInstance"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "AgentPlaygroundInstanceListResponse": {
        "type": "object",
        "description": "实例列表响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "bb971b6e-36f0-4c4c-a50e-ee3fb6d3ceba"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "instances": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "实例列表",
                "items": {
                  "$ref": "#/components/schemas/AgentPlaygroundInstance"
                }
              },
              "total_count": {
                "type": "integer",
                "format": "int64",
                "description": "总记录数",
                "examples": [
                  5
                ]
              },
              "page_number": {
                "type": "integer",
                "description": "当前页码",
                "examples": [
                  1
                ]
              },
              "page_size": {
                "type": "integer",
                "description": "每页条数",
                "examples": [
                  10
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "DeleteAgentPlaygroundInstanceResponse": {
        "type": "object",
        "description": "删除实例响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "0d2b7a54-1f6c-4a2b-9e33-2c7f9c1d8b40"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean",
                "description": "恒为 true（幂等：对不存在或删除中的实例同样返回）",
                "examples": [
                  true
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "AgentPlaygroundAgentListResponse": {
        "type": "object",
        "description": "实例内 Agent 信息响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "3c9a1b2d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "agents": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "实例内 Agent 列表；实例未就绪且无可用数据时为空列表",
                "items": {
                  "$ref": "#/components/schemas/AgentPlaygroundAgentItem"
                }
              },
              "refreshed_at": {
                "type": "integer",
                "format": "int64",
                "description": "这批数据的更新时间（Unix 秒），`0` 表示还没有取到过",
                "examples": [
                  1789722407
                ]
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "AgentPlaygroundNotificationListResponse": {
        "type": "object",
        "description": "实例一次性通知响应",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4a5b"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "notifications": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "未读通知列表，按产生顺序返回；返回后即消费",
                "items": {
                  "$ref": "#/components/schemas/AgentPlaygroundNotification"
                }
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UserPublic": {
        "type": "object",
        "description": "用户公开信息",
        "properties": {
          "username": {
            "type": "string",
            "description": "用户名",
            "examples": [
              "tester"
            ]
          },
          "nickname": {
            "type": "string",
            "description": "昵称",
            "examples": [
              "测试用户"
            ]
          },
          "description": {
            "type": "string",
            "description": "描述",
            "examples": [
              "这是一个测试用户"
            ]
          },
          "avatar_url": {
            "type": "string",
            "format": "uri",
            "description": "头像图片URL地址",
            "examples": [
              "https://resouces.modelscope.cn/avatar/516aa51f-5fb7-49eb-930c-e90500ae13ca.png"
            ]
          }
        },
        "required": [
          "username"
        ]
      },
      "UserPrivate": {
        "type": "object",
        "description": "用户私有信息(仅自己可见)",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "邮箱地址",
            "examples": [
              "test@modelscope.cn"
            ]
          }
        }
      },
      "CreateModelRequest": {
        "type": "object",
        "description": "创建通用模型仓库请求参数。本接口仅接收通用元数据字段，创建成功后 `model_category` 默认为 `base`。专区业务字段请通过 `PUT /models/{owner}/{repo_name}/category` 设置。",
        "additionalProperties": false,
        "properties": {
          "task": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型任务，取 GET /models/options 的 tasks[].id，例如 text-generation。省略、null 或空字符串表示不设置；未知任务返回 HTTP 400。",
            "examples": [
              "text-generation"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "alice",
              "my-org"
            ]
          },
          "repo_name": {
            "type": "string",
            "description": "仓库英文 ID，仅允许字母、数字、点、连字符和下划线，创建后不可修改",
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9._-]+$",
            "examples": [
              "my-model",
              "qwen-7b-finetuned"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "模型展示名称（中英文均可），用于 UI 展示",
            "maxLength": 128,
            "examples": [
              "我的大语言模型"
            ]
          },
          "license": {
            "type": "string",
            "description": "创建模型支持 /api/v1/licenses 返回的 19 个许可证名称及下列对应标识符（均原样保存、区分大小写）；省略或空字符串默认 apache-2.0。未列出的值返回 HTTP 400，other 必须提供 license_name。",
            "enum": [
              "",
              "apache-2.0",
              "Apache License 2.0",
              "gpl-2.0",
              "GPL-2.0",
              "lgpl-3.0",
              "LGPL-3.0",
              "mit",
              "MIT License",
              "lgpl-2.1",
              "LGPL-2.1",
              "gpl-3.0",
              "GPL-3.0",
              "afl-3.0",
              "AFL-3.0",
              "ecl-2.0",
              "ECL-2.0",
              "cc-by-4.0",
              "CC-BY-4.0",
              "creativeml-openrail-m",
              "cc-by-nc-nd",
              "CC-BY-NC-ND",
              "agpl-3.0",
              "cc-by-nc-4.0",
              "CC-BY-NC-4.0",
              "cc-by-nc-sa-4.0",
              "CC-BY-NC-SA-4.0",
              "odc-by-1.0",
              "ODC-BY-1.0",
              "cc-by-sa-4.0",
              "CC-BY-SA-4.0",
              "cc0-1.0",
              "CC0-1.0",
              "bsd-3-clause",
              "BSD-3-Clause",
              "other"
            ],
            "default": "apache-2.0",
            "examples": [
              "apache-2.0",
              "mit",
              "other"
            ]
          },
          "license_name": {
            "type": "string",
            "description": "自定义许可证名称。license=\"other\" 时必填，其他许可证下忽略"
          },
          "license_link": {
            "type": "string",
            "description": "【可选】自定义许可证链接，仅当 license=\"other\" 时生效。留空时仓库将自动在根目录创建 LICENSE.md 空白文件",
            "format": "uri"
          },
          "visibility": {
            "type": "string",
            "description": "仓库可见性，默认 public。protected 仅适用于 Studio，创建模型时不接受该值",
            "enum": [
              "public",
              "private",
              "gated"
            ],
            "default": "public"
          },
          "gated_mode": {
            "description": "创建时仅 visibility=\"gated\" 可传 gated_mode：auto 自动审批，manual 人工审批；省略或空字符串默认 auto。null、布尔值、数字及其他非法值返回 400。visibility 为 public/private（含省略后默认 public）时禁止传 gated_mode。请求仅接受文档列出的字段，未知字段返回 400。",
            "type": "string",
            "enum": [
              "auto",
              "manual",
              ""
            ]
          },
          "description": {
            "type": "string",
            "description": "模型简介",
            "maxLength": 2000,
            "examples": [
              "基于 Qwen 微调的对话模型"
            ]
          }
        },
        "required": [
          "owner",
          "repo_name"
        ]
      },
      "ModelCreated": {
        "type": "object",
        "description": "创建成功后返回的模型仓库核心信息",
        "properties": {
          "id": {
            "type": "string",
            "description": "模型仓库唯一标识（格式：owner/repo_name）",
            "examples": [
              "alice/my-model"
            ]
          },
          "repo_name": {
            "type": "string",
            "description": "仓库英文 ID",
            "examples": [
              "my-model"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型展示名称",
            "examples": [
              "我的大语言模型"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "alice"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "模型平台访问地址",
            "examples": [
              "https://modelscope.cn/models/alice/my-model"
            ]
          }
        },
        "required": [
          "id",
          "repo_name",
          "owner",
          "url"
        ]
      },
      "CreateModelResponse": {
        "type": "object",
        "description": "创建模型标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ModelCreated"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "ModelCategory": {
        "type": "string",
        "description": "模型大类。POST /models 创建后默认为 base；设置/变更专区类型请调用 PUT /models/{owner}/{repo_name}/category。\n- base: 通用模型，无专区业务字段；传入 base 可回退为通用模型\n- aigc: AIGC 专区模型，需填写 aigc_type / base_model_architecture_type / base_model_architecture_subtype / version_name 等\n- science: 科学模型专区，需填写 primary_subject_area / secondary_specialization",
        "enum": [
          "base",
          "aigc",
          "science"
        ],
        "examples": [
          "base",
          "aigc",
          "science"
        ]
      },
      "AigcModelType": {
        "type": "string",
        "description": "AIGC 模型子类型，可选值为 Checkpoint、LoRA、VAE（区分大小写）；其他值返回 HTTP 400。仅适用于 AIGC 模型。",
        "enum": [
          "Checkpoint",
          "LoRA",
          "VAE"
        ],
        "examples": [
          "Checkpoint",
          "LoRA",
          "VAE"
        ]
      },
      "AigcContentCategories": {
        "type": "object",
        "description": "AIGC 模型内容类别（三级联动，仅 model_category=aigc 时有效）",
        "properties": {
          "style": {
            "type": "string",
            "description": "设计风格",
            "examples": [
              "设计风格-插画",
              "设计风格-写实"
            ]
          },
          "function": {
            "type": "string",
            "description": "模型功能",
            "examples": [
              "模型功能-文生图",
              "模型功能-图生图"
            ]
          },
          "element": {
            "type": "string",
            "description": "内容元素",
            "examples": [
              "内容元素-人物",
              "内容元素-风景"
            ]
          }
        }
      },
      "SampleImage": {
        "type": "object",
        "additionalProperties": false,
        "description": "AIGC 样例图片。请求和响应仅使用 url、prompt、negative_prompt；url 必填，prompt 和 negative_prompt 选填；不接受 text 字段。",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTP(S) 图片 URL"
          },
          "prompt": {
            "type": "string",
            "maxLength": 2000,
            "description": "正向提示词"
          },
          "negative_prompt": {
            "type": "string",
            "maxLength": 1000,
            "description": "负向提示词"
          }
        },
        "required": [
          "url"
        ]
      },
      "ModelVersion": {
        "type": "object",
        "required": [
          "version_id",
          "version_name",
          "weight_files",
          "sample_images",
          "created_at"
        ],
        "properties": {
          "version_id": {
            "type": "integer",
            "format": "int64"
          },
          "version_name": {
            "type": "string"
          },
          "weight_files": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "path_in_repo",
                "size",
                "sha"
              ],
              "properties": {
                "path_in_repo": {
                  "type": "string"
                },
                "size": {
                  "type": "integer",
                  "format": "int64"
                },
                "sha": {
                  "type": "string"
                }
              }
            }
          },
          "sample_images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SampleImage"
            }
          },
          "trigger_words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "version_description": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WeightFileReference": {
        "type": "object",
        "description": "AIGC 模型版本权重文件引用。文件需已上传至仓库，通过 path_in_repo 指定相对路径。",
        "properties": {
          "path_in_repo": {
            "type": "string",
            "description": "权重文件在仓库内的相对路径。支持的后缀（不区分大小写）：.safetensors、.ckpt、.pt、.pth、.bin、.gguf、.ggml、.h5、.hdf5、.npz、.msgpack、.pdparams、.params、.onnx。每个文件均须符合，非权重后缀返回 400；英文 message 会指出无效字段，引导用户指定正确权重路径、先通过 Git 或网页上传权重，并列出全部支持格式。文件须已存在；后缀检查不代表已验证文件内容或推理兼容性。",
            "examples": [
              "model.safetensors",
              "checkpoints/model.ckpt",
              "vae/diffusion_pytorch_model.bin"
            ]
          }
        },
        "required": [
          "path_in_repo"
        ]
      },
      "SetModelCategoryRequest": {
        "type": "object",
        "description": "设置类型；目标为 AIGC（包括创建新 tag）时必须提供架构、version_name、非空 weight_files 和 sample_images。已有 tag 权重不可修改。目标为 Science 时 primary_subject_area、secondary_specialization 必填，cover_image 选填；base 只需 model_category。基础模型由架构子类型确定。",
        "additionalProperties": false,
        "properties": {
          "model_category": {
            "$ref": "#/components/schemas/ModelCategory"
          },
          "aigc_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AigcModelType"
              }
            ],
            "description": "【AIGC 必填】模型子类型，可选值为 Checkpoint、LoRA、VAE（区分大小写）；其他值返回 HTTP 400。"
          },
          "base_model_architecture_type": {
            "type": "string",
            "description": "【AIGC 必填】基础模型架构类型（一级选择）。可选值查询 GET /model/aigc/options",
            "examples": [
              "Z_IMAGE_TURBO",
              "FLUX_2"
            ]
          },
          "base_model_architecture_subtype": {
            "type": "string",
            "description": "【AIGC 必填】基础模型架构子类型（二级选择），需与 base_model_architecture_type 匹配。可选值查询 GET /model/aigc/options",
            "examples": [
              "Z_IMAGE_TURBO",
              "FLUX2_DEV"
            ]
          },
          "content_categories": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AigcContentCategories"
              }
            ],
            "description": "【AIGC 可选】内容类别三级联动"
          },
          "version_name": {
            "type": "string",
            "description": "【AIGC 必填】版本名称，建议使用语义化版本，如 v1.0",
            "maxLength": 20,
            "examples": [
              "v1.0"
            ]
          },
          "trigger_words": {
            "type": "array",
            "description": "【AIGC 可选】触发词列表",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "anime style"
              ]
            ]
          },
          "sample_images": {
            "type": "array",
            "description": "AIGC tag 必填且非空；tag 样例图片。",
            "items": {
              "$ref": "#/components/schemas/SampleImage"
            },
            "minItems": 1
          },
          "weight_files": {
            "type": "array",
            "description": "AIGC tag 必填且非空；仓库中已存在的权重文件路径。",
            "items": {
              "$ref": "#/components/schemas/WeightFileReference"
            },
            "minItems": 1
          },
          "cover_image": {
            "type": "string",
            "description": "【Science 可选】模型封面图；可省略或传空字符串，非空时须为 HTTP(S) URL。",
            "anyOf": [
              {
                "format": "uri",
                "pattern": "^https?://"
              },
              {
                "const": ""
              }
            ]
          },
          "primary_subject_area": {
            "allOf": [
              {
                "type": "string"
              }
            ],
            "description": "【科学 必填】一级学科分类，实际值以 GET /model/science/options 为准，例如 life-sciences"
          },
          "secondary_specialization": {
            "allOf": [
              {
                "type": "string"
              }
            ],
            "description": "【科学 必填】二级专业分类，应与 primary_subject_area 匹配；实际值以 GET /model/science/options 为准，例如 dna"
          },
          "version_description": {
            "type": "string",
            "description": "AIGC tag 版本描述"
          }
        },
        "required": [
          "model_category"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "model_category": {
                  "const": "aigc"
                }
              },
              "required": [
                "model_category"
              ]
            },
            "then": {
              "required": [
                "aigc_type",
                "base_model_architecture_type",
                "base_model_architecture_subtype",
                "version_name",
                "weight_files",
                "sample_images"
              ],
              "properties": {
                "model_category": {},
                "content_categories": {},
                "trigger_words": {},
                "version_description": {},
                "aigc_type": {},
                "base_model_architecture_type": {},
                "base_model_architecture_subtype": {},
                "version_name": {},
                "weight_files": {},
                "sample_images": {}
              }
            }
          },
          {
            "if": {
              "properties": {
                "model_category": {
                  "const": "science"
                }
              },
              "required": [
                "model_category"
              ]
            },
            "then": {
              "required": [
                "primary_subject_area",
                "secondary_specialization"
              ],
              "properties": {
                "model_category": {},
                "cover_image": {},
                "primary_subject_area": {},
                "secondary_specialization": {}
              }
            }
          }
        ]
      },
      "SetModelCategoryResponse": {
        "type": "object",
        "description": "设置/变更模型类型标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ModelCreated"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "UpdateModelCategoryRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "类型由服务器读取当前仓库确定，不接受 model_category（传入返回 400），类型转换使用 PUT /category；tag 字段用 version_id 定位；已有 tag 的权重不可修改，请 PUT /category 创建新 tag。省略不变，显式空值清空；必填约束仍需满足。",
        "properties": {
          "version_id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "仅适用于 AIGC：更新 trigger_words、version_description 或 sample_images 时必填，取自 GET 详情 versions[].version_id。Science 更新学科或 cover_image 不需要且不应传此字段；Science 详情不返回 versions。"
          },
          "aigc_type": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AigcModelType"
                  }
                ],
                "description": "【AIGC 字段；省略保持不变，不能清空】模型子类型，可选值为 Checkpoint、LoRA、VAE（区分大小写）；其他值返回 HTTP 400。"
              },
              {
                "type": "null"
              }
            ]
          },
          "base_model_architecture_type": {
            "anyOf": [
              {
                "type": "string",
                "description": "【AIGC 字段；省略保持不变，不能清空】基础模型架构类型（一级选择）。可选值查询 GET /model/aigc/options",
                "examples": [
                  "Z_IMAGE_TURBO",
                  "FLUX_2"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "base_model_architecture_subtype": {
            "anyOf": [
              {
                "type": "string",
                "description": "【AIGC 字段；省略保持不变，不能清空】基础模型架构子类型（二级选择），需与 base_model_architecture_type 匹配。可选值查询 GET /model/aigc/options",
                "examples": [
                  "Z_IMAGE_TURBO",
                  "FLUX2_DEV"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "content_categories": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AigcContentCategories"
                  }
                ],
                "description": "【AIGC 可选】内容类别三级联动"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger_words": {
            "anyOf": [
              {
                "type": "array",
                "description": "【AIGC 可选】触发词列表",
                "items": {
                  "type": "string"
                },
                "examples": [
                  [
                    "anime style"
                  ]
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sample_images": {
            "type": "array",
            "description": "可省略以保持原样；传入时替换指定 version_id 的全部样例图，必须非空。图片由现有媒体审核流程处理。",
            "items": {
              "$ref": "#/components/schemas/SampleImage"
            },
            "minItems": 1
          },
          "version_description": {
            "anyOf": [
              {
                "type": "string",
                "description": "AIGC tag 版本描述"
              },
              {
                "type": "null"
              }
            ]
          },
          "primary_subject_area": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "type": "string"
                  }
                ],
                "description": "【科学 字段；省略保持不变，不能清空】一级学科分类，实际值以 GET /model/science/options 为准，例如 life-sciences"
              },
              {
                "type": "null"
              }
            ]
          },
          "secondary_specialization": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "type": "string"
                  }
                ],
                "description": "【科学 字段；省略保持不变，不能清空】二级专业分类，应与 primary_subject_area 匹配；实际值以 GET /model/science/options 为准，例如 dna"
              },
              {
                "type": "null"
              }
            ]
          },
          "cover_image": {
            "anyOf": [
              {
                "type": "string",
                "description": "【仅科学 可选】模型封面图 URL",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ModelOptionItem": {
        "type": "object",
        "description": "单个可选项，包含 type（自描述分类）、id 和 label；label 可用于各处直接展示，提交参数使用 id",
        "properties": {
          "type": {
            "type": "string",
            "description": "选项所属分类（自描述）",
            "examples": [
              "aigc_type",
              "specialization"
            ]
          },
          "id": {
            "type": "string",
            "description": "实际传入 API 的值",
            "examples": [
              "LoRA"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。提交参数请使用 id，不要使用 label。",
            "examples": [
              "LoRA"
            ]
          }
        },
        "required": [
          "type",
          "id",
          "label"
        ]
      },
      "BaseArchitectureOption": {
        "type": "object",
        "description": "AIGC 基础模型架构（一级）及其可用子类型（二级）",
        "properties": {
          "type": {
            "type": "string",
            "description": "选项所属分类（自描述），固定为 \"base_architecture\"",
            "examples": [
              "base_architecture"
            ]
          },
          "id": {
            "type": "string",
            "description": "架构类型标识（一级）",
            "examples": [
              "Z_IMAGE_TURBO"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。提交参数请使用 id，不要使用 label。",
            "examples": [
              "Z_IMAGE_TURBO"
            ]
          },
          "subtypes": {
            "type": "array",
            "description": "该架构下可用的子类型列表（二级）",
            "items": {
              "$ref": "#/components/schemas/ModelOptionItem"
            }
          }
        },
        "required": [
          "type",
          "id",
          "label",
          "subtypes"
        ]
      },
      "AigcModelOptions": {
        "type": "object",
        "description": "AIGC 专区配置项枚举",
        "properties": {
          "aigc_types": {
            "type": "array",
            "description": "AIGC 模型子类型选项",
            "items": {
              "$ref": "#/components/schemas/ModelOptionItem"
            }
          },
          "base_architectures": {
            "type": "array",
            "description": "AIGC 基础模型架构级联树（一级 type + 二级 subtype）",
            "items": {
              "$ref": "#/components/schemas/BaseArchitectureOption"
            }
          },
          "content_styles": {
            "type": "array",
            "description": "AIGC 内容类别 - 设计风格选项",
            "items": {
              "$ref": "#/components/schemas/ModelOptionItem"
            }
          },
          "content_functions": {
            "type": "array",
            "description": "AIGC 内容类别 - 模型功能选项",
            "items": {
              "$ref": "#/components/schemas/ModelOptionItem"
            }
          },
          "content_elements": {
            "type": "array",
            "description": "AIGC 内容类别 - 内容元素选项",
            "items": {
              "$ref": "#/components/schemas/ModelOptionItem"
            }
          }
        },
        "required": [
          "aigc_types",
          "base_architectures",
          "content_styles",
          "content_functions",
          "content_elements"
        ]
      },
      "AigcModelOptionsResponse": {
        "type": "object",
        "description": "AIGC 专区配置项枚举标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AigcModelOptions"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "ScienceOptionItem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "specialization"
            ]
          },
          "id": {
            "type": "string",
            "description": "二级专业方向标识，用于 secondary_specialization。",
            "examples": [
              "medicine"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称；提交参数使用 id。",
            "examples": [
              "医学"
            ]
          }
        },
        "required": [
          "type",
          "id",
          "label"
        ]
      },
      "ScienceSubjectOption": {
        "type": "object",
        "description": "科学模型一级学科及其下属二级专业方向",
        "properties": {
          "type": {
            "type": "string",
            "description": "选项所属分类（自描述），固定为 \"subject_area\"",
            "examples": [
              "subject_area"
            ]
          },
          "id": {
            "type": "string",
            "description": "一级学科标识",
            "examples": [
              "life-sciences"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。提交参数请使用 id，不要使用 label。",
            "examples": [
              "生命科学"
            ]
          },
          "specializations": {
            "type": "array",
            "description": "该学科下的二级专业方向列表",
            "items": {
              "$ref": "#/components/schemas/ScienceOptionItem"
            }
          }
        },
        "required": [
          "type",
          "id",
          "label",
          "specializations"
        ]
      },
      "ScienceModelOptions": {
        "type": "object",
        "description": "科学模型专区配置项枚举",
        "properties": {
          "subject_areas": {
            "type": "array",
            "description": "学科分类树（一级学科 + 二级专业方向）",
            "items": {
              "$ref": "#/components/schemas/ScienceSubjectOption"
            }
          }
        },
        "required": [
          "subject_areas"
        ]
      },
      "ScienceModelOptionsResponse": {
        "type": "object",
        "description": "科学模型专区配置项枚举标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ScienceModelOptions"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "CreateDatasetRequest": {
        "type": "object",
        "description": "创建通用数据集仓库；成功后 dataset_category 为 base。科学专区字段通过 PUT /datasets/{owner}/{repo_name}/category 设置。",
        "additionalProperties": false,
        "properties": {
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "alice",
              "my-org"
            ]
          },
          "repo_name": {
            "type": "string",
            "description": "仓库英文 ID，仅允许字母、数字、点、连字符和下划线，创建后不可修改",
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9._-]+$",
            "examples": [
              "my-dataset",
              "multilingual-dialogues"
            ]
          },
          "display_name": {
            "type": "string",
            "description": "数据集展示名称",
            "maxLength": 128,
            "examples": [
              "我的对话数据集"
            ]
          },
          "license": {
            "type": "string",
            "description": "许可证（SPDX 标识符），默认 apache-2.0。当传入 \"other\" 时可通过 license_name 和 license_link 自定义许可证",
            "default": "apache-2.0",
            "examples": [
              "apache-2.0",
              "mit",
              "other"
            ]
          },
          "license_name": {
            "type": "string",
            "description": "自定义许可证名称。license=\"other\" 时必填，其他许可证下忽略"
          },
          "license_link": {
            "type": "string",
            "description": "【可选】自定义许可证链接，仅当 license=\"other\" 时生效。留空时仓库将自动在根目录创建 LICENSE.md 空白文件",
            "format": "uri"
          },
          "visibility": {
            "type": "string",
            "description": "仓库可见性，默认 public。protected 仅适用于 Studio，创建数据集时不接受该值",
            "enum": [
              "public",
              "private",
              "gated"
            ],
            "default": "public"
          },
          "gated_mode": {
            "description": "创建时仅 visibility=\"gated\" 可传 gated_mode：auto 自动审批，manual 人工审批；省略或空字符串默认 auto。null、布尔值、数字及其他非法值返回 400。visibility 为 public/private（含省略后默认 public）时禁止传 gated_mode。请求仅接受文档列出的字段，未知字段返回 400。",
            "type": "string",
            "enum": [
              "auto",
              "manual",
              ""
            ]
          },
          "description": {
            "type": "string",
            "description": "数据集简介",
            "maxLength": 2000,
            "examples": [
              "用于多语言对话训练的数据集"
            ]
          }
        },
        "required": [
          "owner",
          "repo_name"
        ]
      },
      "DatasetCreated": {
        "type": "object",
        "description": "创建或更新后的数据集仓库标识",
        "properties": {
          "id": {
            "type": "string",
            "description": "数据集仓库唯一标识（格式：owner/repo_name）",
            "examples": [
              "alice/my-dataset"
            ]
          },
          "repo_name": {
            "type": "string",
            "description": "仓库英文 ID",
            "examples": [
              "my-dataset"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "数据集展示名称",
            "examples": [
              "我的数据集"
            ]
          },
          "owner": {
            "type": "string",
            "description": "所有者（用户名或组织名）",
            "examples": [
              "alice"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "数据集平台访问地址",
            "examples": [
              "https://modelscope.cn/datasets/alice/my-dataset"
            ]
          }
        },
        "required": [
          "id",
          "repo_name",
          "owner",
          "url"
        ]
      },
      "DatasetWriteResponse": {
        "type": "object",
        "description": "创建或更新数据集的标准响应；所有成功和错误响应均有 request_id。",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/DatasetCreated"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "McpServerList": {
        "type": "object",
        "description": "MCP服务列表与分页信息",
        "properties": {
          "mcp_server_list": {
            "type": "array",
            "description": "MCP服务列表",
            "items": {
              "$ref": "#/components/schemas/McpServerSummary"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "搜索符合条件的mcp server总个数",
            "examples": [
              100
            ]
          }
        },
        "required": [
          "mcp_server_list",
          "total_count"
        ]
      },
      "McpServerOperationalList": {
        "type": "object",
        "description": "用户托管MCP服务列表",
        "properties": {
          "mcp_server_list": {
            "type": "array",
            "description": "用户托管MCP服务列表",
            "items": {
              "$ref": "#/components/schemas/McpServerOperational"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "服务链接总数",
            "examples": [
              5
            ]
          }
        },
        "required": [
          "mcp_server_list",
          "total_count"
        ]
      },
      "data": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Studio ID (owner/repo_name)"
          },
          "repo_name": {
            "type": "string",
            "description": "仓库名称"
          },
          "display_name": {
            "type": "string",
            "description": "显示名称"
          },
          "owner": {
            "type": "string",
            "description": "所有者"
          },
          "description": {
            "type": "string",
            "description": "描述"
          },
          "cover_image": {
            "type": "string",
            "description": "封面图 URL"
          },
          "likes": {
            "type": "integer",
            "description": "喜欢数"
          },
          "view_count": {
            "type": "integer",
            "description": "访问量"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "visibility": {
            "$ref": "#/components/schemas/StudioVisibility"
          },
          "private": {
            "type": "boolean",
            "description": "Deprecated: 请使用 visibility 字段",
            "deprecated": true
          },
          "last_modified": {
            "type": "string",
            "description": "最后修改时间"
          },
          "sdk_type": {
            "$ref": "#/components/schemas/StudioSDKType"
          },
          "sdk_version": {
            "$ref": "#/components/schemas/StudioSDKVersion"
          },
          "hardware": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioHardware"
              }
            ],
            "description": "期望的硬件配置（数据库中保存的值）"
          },
          "base_image": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StudioBaseImage"
              }
            ],
            "description": "期望的基础镜像（Docker 类型不返回）"
          },
          "license": {
            "type": "string",
            "description": "许可证"
          },
          "host": {
            "type": "string",
            "description": "访问地址"
          },
          "mcp_support": {
            "type": "boolean",
            "description": "是否支持 MCP"
          },
          "runtime": {
            "$ref": "#/components/schemas/StudioRuntime"
          }
        }
      },
      "ListStudiosResponse": {
        "type": "object",
        "description": "获取创空间列表响应",
        "properties": {
          "studios": {
            "type": "array",
            "description": "创空间列表",
            "items": {
              "$ref": "#/components/schemas/data"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "符合筛选条件的创空间总数",
            "examples": [
              120
            ]
          },
          "page_number": {
            "type": "integer",
            "description": "当前页码",
            "examples": [
              1
            ]
          },
          "page_size": {
            "type": "integer",
            "description": "每页大小",
            "examples": [
              10
            ]
          }
        },
        "required": [
          "studios",
          "total_count",
          "page_number",
          "page_size"
        ]
      },
      "CollectionMutationResponse": {
        "type": "object",
        "description": "创建/更新 Collection 的标准响应",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "变更结果",
            "properties": {
              "slug": {
                "type": "string",
                "description": "Collection slug（重命名时可能变化）",
                "examples": [
                  "iSolver/best-nlp-models-6a3b2c"
                ]
              },
              "title": {
                "type": "string",
                "description": "Collection 标题",
                "examples": [
                  "最佳 NLP 模型合集"
                ]
              },
              "url": {
                "type": "string",
                "description": "Collection 页面 URL",
                "examples": [
                  "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
                ]
              }
            },
            "required": [
              "slug",
              "title",
              "url"
            ]
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "EmptyDataResponse": {
        "type": "object",
        "description": "删除/移除类操作的标准响应，结果以 success 字段为准，data 为空对象",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "成功时始终为 true",
            "examples": [
              true
            ]
          },
          "request_id": {
            "type": "string",
            "description": "请求 ID",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
            ]
          },
          "data": {
            "type": "object",
            "description": "空对象"
          }
        },
        "required": [
          "success",
          "request_id",
          "data"
        ]
      },
      "ModelSettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "PATCH：省略不变，显式空值清空；visibility 决定访问模式，gated_mode 用于申请制仓库的审批方式；可同时传 visibility=gated 开启申请制。",
        "properties": {
          "task": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型任务，取 GET /models/options 的 tasks[].id。省略保持不变；null 或空字符串清空。未知任务返回 HTTP 400。",
            "examples": [
              "text-generation"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型展示名称（中英文均可），用于 UI 展示",
            "maxLength": 128,
            "examples": [
              "我的大语言模型"
            ]
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "许可证标识；省略保持不变，显式 null 或空串清空。",
            "examples": [
              "apache-2.0",
              "mit",
              "other"
            ]
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "public",
              "private",
              "gated",
              "",
              null
            ],
            "description": "仓库访问模式；public/private 关闭申请制，gated 开启申请制；省略保持不变。"
          },
          "gated_mode": {
            "type": "string",
            "enum": [
              "auto",
              "manual",
              ""
            ],
            "description": "gated_mode 取 auto 自动审批、manual 人工审批；显式 visibility=\"gated\" 时，gated_mode 省略或空字符串默认 auto；两字段均省略保持原设置；无论 visibility 取值，显式 null、布尔值、数字及其他非法值均返回 400；visibility 为 public/private 时禁止传 gated_mode（含空串和 null），否则返回 400；PATCH 省略 visibility 时，仅当前仓库已是申请制才可用 gated_mode 修改审批方式。关闭申请制请将 visibility 改为 public 或 private。"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "模型简介",
            "maxLength": 2000,
            "examples": [
              "基于 Qwen 微调的对话模型"
            ]
          }
        }
      },
      "DatasetCategoryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dataset_category"
        ],
        "properties": {
          "dataset_category": {
            "type": "string",
            "enum": [
              "base",
              "science"
            ]
          },
          "primary_subject_area": {
            "type": [
              "string",
              "null"
            ]
          },
          "secondary_specialization": {
            "type": [
              "string",
              "null"
            ]
          },
          "cover_image": {
            "type": [
              "string",
              "null"
            ],
            "description": "科学数据集封面；显式空值清空。"
          }
        }
      },
      "UpdateDatasetCategoryRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "类型由服务器读取当前仓库确定，不接受 dataset_category（传入返回 400），类型转换使用 PUT /category。",
        "properties": {
          "primary_subject_area": {
            "type": [
              "string",
              "null"
            ]
          },
          "secondary_specialization": {
            "type": [
              "string",
              "null"
            ]
          },
          "cover_image": {
            "type": [
              "string",
              "null"
            ],
            "description": "科学数据集封面；显式空值清空。"
          }
        }
      },
      "DatasetSettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "PATCH：省略不变，显式空值清空；visibility 决定访问模式，gated_mode 用于申请制仓库的审批方式；可同时传 visibility=gated 开启申请制。",
        "properties": {
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "数据集展示名称（中英文均可），用于 UI 展示",
            "maxLength": 128,
            "examples": [
              "我的数据集"
            ]
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "许可证标识；省略保持不变，显式 null 或空串清空。",
            "examples": [
              "apache-2.0",
              "mit",
              "other"
            ]
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "public",
              "private",
              "gated",
              "",
              null
            ],
            "description": "仓库访问模式；public/private 关闭申请制，gated 开启申请制；省略保持不变。"
          },
          "gated_mode": {
            "type": "string",
            "enum": [
              "auto",
              "manual",
              ""
            ],
            "description": "gated_mode 取 auto 自动审批、manual 人工审批；显式 visibility=\"gated\" 时，gated_mode 省略或空字符串默认 auto；两字段均省略保持原设置；无论 visibility 取值，显式 null、布尔值、数字及其他非法值均返回 400；visibility 为 public/private 时禁止传 gated_mode（含空串和 null），否则返回 400；PATCH 省略 visibility 时，仅当前仓库已是申请制才可用 gated_mode 修改审批方式。关闭申请制请将 visibility 改为 public 或 private。"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "数据集简介",
            "maxLength": 2000,
            "examples": [
              "用于文本分类的数据集"
            ]
          }
        }
      },
      "DeleteFilesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "file_paths"
        ],
        "properties": {
          "file_paths": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string"
            },
            "description": "仓库相对文件路径；不允许目录、重复或越界路径。"
          },
          "revision": {
            "type": "string",
            "default": "master",
            "description": "目标分支，不接受 tag。"
          },
          "commit_message": {
            "type": "string",
            "default": "Delete files"
          }
        }
      },
      "DeleteFilesResponse": {
        "type": "object",
        "required": [
          "success",
          "request_id",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "required": [
              "deleted_files",
              "failed_files",
              "total_files",
              "commit_sha"
            ],
            "properties": {
              "deleted_files": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "failed_files": {
                "type": "array",
                "maxItems": 0,
                "items": {
                  "type": "string"
                },
                "description": "成功时为空；任何失败整个请求失败，不产生部分删除。"
              },
              "total_files": {
                "type": "integer"
              },
              "commit_sha": {
                "type": "string"
              }
            }
          }
        }
      },
      "DatasetScienceOptionItem": {
        "type": "object",
        "description": "单个可选项，包含 type（自描述分类）、id 和 label；label 可用于各处直接展示，提交参数使用 id",
        "properties": {
          "type": {
            "type": "string",
            "description": "选项所属分类（自描述）",
            "examples": [
              "specialization"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。提交参数请使用 id，不要使用 label。",
            "examples": [
              "医学"
            ]
          },
          "id": {
            "type": "string",
            "description": "实际传入 API 的值",
            "examples": [
              "medicine"
            ]
          }
        },
        "required": [
          "type",
          "id",
          "label"
        ]
      },
      "DatasetScienceSubjectOption": {
        "type": "object",
        "description": "科学数据集一级学科及其下属二级专业方向",
        "properties": {
          "type": {
            "type": "string",
            "description": "选项所属分类（自描述），固定为 \"subject_area\"",
            "examples": [
              "subject_area"
            ]
          },
          "label": {
            "type": "string",
            "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。提交参数请使用 id，不要使用 label。",
            "examples": [
              "生命科学"
            ]
          },
          "specializations": {
            "type": "array",
            "description": "该学科下的二级专业方向列表",
            "items": {
              "$ref": "#/components/schemas/DatasetScienceOptionItem"
            }
          },
          "id": {
            "type": "string",
            "description": "一级学科标识",
            "examples": [
              "life-sciences"
            ]
          }
        },
        "required": [
          "type",
          "id",
          "label",
          "specializations"
        ]
      },
      "ScienceDatasetOptions": {
        "type": "object",
        "description": "科学数据集专区配置项枚举",
        "properties": {
          "subject_areas": {
            "type": "array",
            "description": "学科分类树（一级学科 + 二级专业方向）",
            "items": {
              "$ref": "#/components/schemas/DatasetScienceSubjectOption"
            }
          }
        },
        "required": [
          "subject_areas"
        ]
      },
      "ScienceDatasetOptionsResponse": {
        "type": "object",
        "description": "科学数据集专区配置项枚举标准响应包裹格式",
        "properties": {
          "success": {
            "type": "boolean",
            "examples": [
              true
            ]
          },
          "data": {
            "$ref": "#/components/schemas/ScienceDatasetOptions"
          },
          "request_id": {
            "type": "string",
            "examples": [
              "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
            ]
          }
        },
        "required": [
          "success",
          "data",
          "request_id"
        ]
      },
      "ModelOptionsResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "request_id"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "tasks",
              "license"
            ],
            "properties": {
              "tasks": {
                "type": "array",
                "description": "模型任务选项。id 是任务标识字符串，可用于创建模型、更新模型设置的 task，以及 GET /models 的 filter.task。",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "id",
                    "label"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "task"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "description": "接口接受的任务标识字符串。",
                      "examples": [
                        "text-generation"
                      ]
                    },
                    "label": {
                      "type": "string",
                      "description": "可用于各处直接展示的名称，例如选项列表、筛选项和标签。传参使用 id，不要使用 label。",
                      "examples": [
                        "文本生成"
                      ]
                    }
                  }
                }
              },
              "license": {
                "type": "array",
                "description": "模型许可证选项。id 可直接作为创建或更新模型的 license 入参；other 仍需在创建时提供 license_name。",
                "items": {
                  "type": "object",
                  "required": [
                    "type",
                    "id",
                    "label"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "license"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "description": "接口接受的许可证标识字符串。",
                      "examples": [
                        "apache-2.0",
                        "mit",
                        "other"
                      ]
                    },
                    "label": {
                      "type": "string",
                      "description": "可用于各处直接展示的许可证名称。传参使用 id，不要使用 label。",
                      "examples": [
                        "Apache License 2.0",
                        "MIT License"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "responses": {
      "bad-request": {
        "description": "请求参数错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "input-parameter-error": {
                "$ref": "#/components/examples/input-parameter-error"
              }
            }
          }
        }
      },
      "unauthorized": {
        "description": "认证失败（token 无效、过期或未提供）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "invalid-authentication": {
                "$ref": "#/components/examples/invalid-authentication"
              }
            }
          }
        }
      },
      "forbidden": {
        "description": "权限不足（token 有效但无权执行该操作，或配额超限）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "operation-not-allowed": {
                "$ref": "#/components/examples/operation-not-allowed"
              },
              "quota-limit-exceed": {
                "$ref": "#/components/examples/quota-limit-exceed"
              }
            }
          }
        }
      },
      "not-found": {
        "description": "资源未找到",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "resource-not-found": {
                "$ref": "#/components/examples/resource-not-found"
              }
            }
          }
        }
      },
      "internal-server-error": {
        "description": "内部服务错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "internal-server-error": {
                "$ref": "#/components/examples/internal-server-error"
              }
            }
          }
        }
      },
      "service-unavailable": {
        "description": "服务不可用",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "service-unavailable": {
                "$ref": "#/components/examples/service-unavailable"
              }
            }
          }
        }
      },
      "get-current-user-success": {
        "description": "成功获取当前用户信息",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "examples": {
              "user-all-response": {
                "$ref": "#/components/examples/user-all-response"
              }
            }
          }
        }
      },
      "list-models-success": {
        "description": "成功获取模型列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ModelListResponse"
            },
            "examples": {
              "list-models-response": {
                "$ref": "#/components/examples/list-models-response"
              }
            }
          }
        }
      },
      "get-model-success": {
        "description": "成功获取模型详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ModelDetailResponse"
            },
            "examples": {
              "get-model-response": {
                "$ref": "#/components/examples/get-model-response"
              }
            }
          }
        }
      },
      "list-datasets-success": {
        "description": "成功获取数据集列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DatasetListResponse"
            },
            "examples": {
              "list-datasets-response": {
                "$ref": "#/components/examples/list-datasets-response"
              }
            }
          }
        }
      },
      "get-dataset-success": {
        "description": "成功获取数据集详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DatasetDetailResponse"
            },
            "examples": {
              "get-dataset-response": {
                "$ref": "#/components/examples/get-dataset-response"
              }
            }
          }
        }
      },
      "list-mcp-servers-success": {
        "description": "成功获取MCP服务列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpServerListResponse"
            },
            "examples": {
              "list-mcp-servers-response": {
                "$ref": "#/components/examples/list-mcp-servers-response"
              }
            }
          }
        }
      },
      "list-operational-mcp-servers-success": {
        "description": "成功获取用户托管MCP服务列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpServerOperationalListResponse"
            },
            "examples": {
              "list-operational-mcp-servers-response": {
                "$ref": "#/components/examples/list-operational-mcp-servers-response"
              }
            }
          }
        }
      },
      "get-mcp-server-success": {
        "description": "成功获取MCP服务详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpServerDetailResponse"
            },
            "examples": {
              "get-mcp-server-response": {
                "$ref": "#/components/examples/get-mcp-server-response"
              }
            }
          }
        }
      },
      "deploy-mcp-server-success": {
        "description": "成功部署MCP服务",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpDeployResponse"
            },
            "examples": {
              "deploy-mcp-server-response": {
                "$ref": "#/components/examples/deploy-mcp-server-response"
              }
            }
          }
        }
      },
      "undeploy-mcp-server-success": {
        "description": "成功解除MCP服务部署",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpUndeployResponse"
            },
            "examples": {
              "undeploy-mcp-server-response": {
                "$ref": "#/components/examples/undeploy-mcp-server-response"
              }
            }
          }
        }
      },
      "create-studio-success": {
        "description": "成功创建 Studio",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateStudioResponse"
            },
            "examples": {
              "create-studio-response": {
                "$ref": "#/components/examples/create-studio-response"
              }
            }
          }
        }
      },
      "get-studio-success": {
        "description": "成功获取 Studio 详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetStudioResponse"
            },
            "examples": {
              "get-studio-response": {
                "$ref": "#/components/examples/get-studio-response"
              }
            }
          }
        }
      },
      "update-studio-settings-success": {
        "description": "成功更新 Studio 设置",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetStudioResponse"
            },
            "examples": {
              "update-studio-settings-response": {
                "$ref": "#/components/examples/get-studio-response"
              }
            }
          }
        }
      },
      "studio-operation-success": {
        "description": "Studio 操作成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessResponse"
            }
          }
        }
      },
      "studio-runtime-success": {
        "description": "Studio 运行时操作成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/StudioRuntimeResponse"
            },
            "examples": {
              "studio-runtime-response": {
                "$ref": "#/components/examples/studio-runtime-response"
              }
            }
          }
        }
      },
      "get-studio-logs-success": {
        "description": "成功获取 Studio 日志",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/StudioLogsResponse"
            },
            "examples": {
              "get-studio-logs-response": {
                "$ref": "#/components/examples/get-studio-logs-response"
              }
            }
          }
        }
      },
      "list-hardware-success": {
        "description": "成功获取可用硬件配置列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListHardwareResponse"
            }
          }
        }
      },
      "list-sdk-versions-success": {
        "description": "成功获取可用 SDK 版本列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListSDKVersionsResponse"
            },
            "examples": {
              "list-sdk-versions-response": {
                "$ref": "#/components/examples/list-sdk-versions-response"
              }
            }
          }
        }
      },
      "list-base-images-success": {
        "description": "成功获取可用基础镜像列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListBaseImagesResponse"
            }
          }
        }
      },
      "list-studio-variables-success": {
        "description": "成功获取明文变量列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListStudioVariablesResponse"
            }
          }
        }
      },
      "list-skills-success": {
        "description": "成功获取技能列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SkillListResponse"
            },
            "examples": {
              "list-skills-response": {
                "$ref": "#/components/examples/list-skills-response"
              }
            }
          }
        }
      },
      "get-skill-success": {
        "description": "成功获取技能详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SkillDetailResponse"
            },
            "examples": {
              "get-skill-response": {
                "$ref": "#/components/examples/get-skill-response"
              }
            }
          }
        }
      },
      "create-skill-success": {
        "description": "成功创建技能",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateSkillResponse"
            },
            "examples": {
              "create-skill-response": {
                "$ref": "#/components/examples/create-skill-response"
              }
            }
          }
        }
      },
      "update-skill-settings-success": {
        "description": "成功更新技能设置",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessResponse"
            },
            "examples": {
              "update-skill-settings-response": {
                "$ref": "#/components/examples/update-skill-settings-response"
              }
            }
          }
        }
      },
      "skill-bad-request": {
        "description": "请求参数错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-input-parameter-error": {
                "$ref": "#/components/examples/skill-input-parameter-error"
              }
            }
          }
        }
      },
      "skill-unauthorized": {
        "description": "未通过认证",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-invalid-authentication": {
                "$ref": "#/components/examples/skill-invalid-authentication"
              }
            }
          }
        }
      },
      "skill-not-found": {
        "description": "技能未找到",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-not-found": {
                "$ref": "#/components/examples/skill-not-found"
              }
            }
          }
        }
      },
      "skill-conflict": {
        "description": "资源冲突（如 Skill 已存在）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-duplicate-entity": {
                "$ref": "#/components/examples/skill-duplicate-entity"
              }
            }
          }
        }
      },
      "skill-internal-server-error": {
        "description": "内部服务错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-internal-server-error": {
                "$ref": "#/components/examples/skill-internal-server-error"
              }
            }
          }
        }
      },
      "skill-service-unavailable": {
        "description": "服务不可用",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "skill-service-unavailable": {
                "$ref": "#/components/examples/skill-service-unavailable"
              }
            }
          }
        }
      },
      "list-agents-success": {
        "description": "成功获取 Agent 列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentListResponse"
            },
            "examples": {
              "list-agents-response": {
                "$ref": "#/components/examples/list-agents-response"
              }
            }
          }
        }
      },
      "create-agent-success": {
        "description": "成功创建 Agent",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateAgentResponse"
            },
            "examples": {
              "create-agent-response": {
                "$ref": "#/components/examples/create-agent-response"
              }
            }
          }
        }
      },
      "get-agent-success": {
        "description": "成功获取 Agent 详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetAgentResponse"
            },
            "examples": {
              "get-agent-response": {
                "$ref": "#/components/examples/get-agent-response"
              }
            }
          }
        }
      },
      "agent-bad-request": {
        "description": "请求参数错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-input-parameter-error": {
                "$ref": "#/components/examples/agent-input-parameter-error"
              }
            }
          }
        }
      },
      "agent-unauthorized": {
        "description": "未通过认证",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-invalid-authentication": {
                "$ref": "#/components/examples/agent-invalid-authentication"
              }
            }
          }
        }
      },
      "agent-forbidden": {
        "description": "无权访问该 Agent",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-operation-not-allowed": {
                "$ref": "#/components/examples/agent-operation-not-allowed"
              }
            }
          }
        }
      },
      "agent-quota-limit-exceeded": {
        "description": "分页查询总量（page_number × page_size）超出上限",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-quota-limit-exceed": {
                "$ref": "#/components/examples/agent-quota-limit-exceed"
              }
            }
          }
        }
      },
      "agent-not-found": {
        "description": "Agent 未找到",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-not-found": {
                "$ref": "#/components/examples/agent-not-found"
              }
            }
          }
        }
      },
      "agent-list-failed": {
        "description": "Agent 列表查询失败",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-list-failed": {
                "$ref": "#/components/examples/agent-list-failed"
              }
            }
          }
        }
      },
      "agent-internal-server-error": {
        "description": "内部服务错误",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-internal-server-error": {
                "$ref": "#/components/examples/agent-internal-server-error"
              }
            }
          }
        }
      },
      "upload-file-success": {
        "description": "成功上传文件",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UploadFileResponse"
            },
            "examples": {
              "upload-file-response": {
                "$ref": "#/components/examples/upload-file-response"
              }
            }
          }
        }
      },
      "create-agent-identity-success": {
        "description": "成功创建 Agent 身份",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentIdentityResponse"
            },
            "examples": {
              "create-agent-identity-response": {
                "$ref": "#/components/examples/create-agent-identity-response"
              }
            }
          }
        }
      },
      "get-agent-identity-success": {
        "description": "成功获取 Agent 身份详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentIdentityResponse"
            },
            "examples": {
              "get-agent-identity-response": {
                "$ref": "#/components/examples/get-agent-identity-response"
              }
            }
          }
        }
      },
      "update-agent-identity-success": {
        "description": "成功更新 Agent 身份设置",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentIdentityResponse"
            },
            "examples": {
              "update-agent-identity-response": {
                "$ref": "#/components/examples/update-agent-identity-response"
              }
            }
          }
        }
      },
      "list-agent-identities-success": {
        "description": "成功获取 Agent 身份列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListAgentIdentitiesResponse"
            },
            "examples": {
              "list-agent-identities-response": {
                "$ref": "#/components/examples/list-agent-identities-response"
              }
            }
          }
        }
      },
      "reset-key-pair-success": {
        "description": "成功重置 Agent 密钥对",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ResetKeyPairResponse"
            },
            "examples": {
              "reset-key-pair-response": {
                "$ref": "#/components/examples/reset-key-pair-response"
              }
            }
          }
        }
      },
      "pause-agent-success": {
        "description": "成功启用/停用 Agent",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PauseAgentResponse"
            },
            "examples": {
              "pause-agent-response": {
                "$ref": "#/components/examples/pause-agent-response"
              }
            }
          }
        }
      },
      "delete-agent-identity-success": {
        "description": "成功删除 Agent 身份",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DeleteAgentIdentityResponse"
            },
            "examples": {
              "delete-agent-identity-response": {
                "$ref": "#/components/examples/delete-agent-identity-response"
              }
            }
          }
        }
      },
      "issue-token-success": {
        "description": "成功签发 Token",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TokenSignResponse"
            },
            "examples": {
              "issue-token-response": {
                "$ref": "#/components/examples/issue-token-response"
              }
            }
          }
        }
      },
      "list-token-records-success": {
        "description": "成功获取 Token 签发记录列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListTokenRecordsResponse"
            },
            "examples": {
              "list-token-records-response": {
                "$ref": "#/components/examples/list-token-records-response"
              }
            }
          }
        }
      },
      "agentid-configuration-success": {
        "description": "成功获取 Agent IDP OIDC 配置",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentIdConfiguration"
            },
            "examples": {
              "agentid-configuration-response": {
                "$ref": "#/components/examples/agentid-configuration-response"
              }
            }
          }
        }
      },
      "agentid-jwks-success": {
        "description": "成功获取 JWKS",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JWKS"
            },
            "examples": {
              "agentid-jwks-response": {
                "$ref": "#/components/examples/agentid-jwks-response"
              }
            }
          }
        }
      },
      "get-collection-success": {
        "description": "成功获取合集详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionResponse"
            },
            "examples": {
              "get-collection-response": {
                "$ref": "#/components/examples/get-collection-response"
              }
            }
          }
        }
      },
      "create-collection-success": {
        "description": "成功创建合集",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionMutationResponse"
            },
            "examples": {
              "create-collection-response": {
                "$ref": "#/components/examples/create-collection-response"
              }
            }
          }
        }
      },
      "update-collection-success": {
        "description": "成功更新合集",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionMutationResponse"
            },
            "examples": {
              "update-collection-response": {
                "$ref": "#/components/examples/update-collection-response"
              }
            }
          }
        }
      },
      "delete-collection-success": {
        "description": "成功删除合集",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EmptyDataResponse"
            },
            "examples": {
              "delete-collection-response": {
                "$ref": "#/components/examples/delete-collection-response"
              }
            }
          }
        }
      },
      "list-collections-success": {
        "description": "成功获取合集列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionListResponse"
            },
            "examples": {
              "list-collections-response": {
                "$ref": "#/components/examples/list-collections-response"
              }
            }
          }
        }
      },
      "list-collection-items-success": {
        "description": "成功获取合集条目列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CollectionItemListResponse"
            },
            "examples": {
              "list-collection-items-response": {
                "$ref": "#/components/examples/list-collection-items-response"
              }
            }
          }
        }
      },
      "add-collection-items-success": {
        "description": "成功添加合集条目（部分失败仍返回 success=true，见 failed_items）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AddCollectionItemsResponse"
            },
            "examples": {
              "add-collection-items-response": {
                "$ref": "#/components/examples/add-collection-items-response"
              }
            }
          }
        }
      },
      "update-collection-item-success": {
        "description": "成功更新单个合集条目",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UpdateCollectionItemResponse"
            },
            "examples": {
              "update-collection-item-response": {
                "$ref": "#/components/examples/update-collection-item-response"
              }
            }
          }
        }
      },
      "remove-collection-item-success": {
        "description": "成功移除合集条目",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EmptyDataResponse"
            },
            "examples": {
              "remove-collection-item-response": {
                "$ref": "#/components/examples/remove-collection-item-response"
              }
            }
          }
        }
      },
      "update-collection-items-success": {
        "description": "成功批量更新合集条目（部分失败仍返回 success=true，见 failed_items）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UpdateCollectionItemsResponse"
            },
            "examples": {
              "update-collection-items-response": {
                "$ref": "#/components/examples/update-collection-items-response"
              }
            }
          }
        }
      },
      "create-gallery-success": {
        "description": "成功创建 Gallery",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateGalleryResponse"
            },
            "examples": {
              "create-gallery-response": {
                "$ref": "#/components/examples/create-gallery-response"
              }
            }
          }
        }
      },
      "create-agent-playground-instance-success": {
        "description": "成功受理创建请求（异步创建，`status` 为 `starting`）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "create-agent-playground-instance-response": {
                "$ref": "#/components/examples/create-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "create-agent-playground-instance-from-agent-hub-success": {
        "description": "成功受理创建请求（`source` 为 `agent_hub`，`status` 为 `starting`）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "create-agent-playground-instance-from-agent-hub-response": {
                "$ref": "#/components/examples/create-agent-playground-instance-from-agent-hub-response"
              }
            }
          }
        }
      },
      "list-agent-playground-instances-success": {
        "description": "成功获取实例列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceListResponse"
            },
            "examples": {
              "list-agent-playground-instances-response": {
                "$ref": "#/components/examples/list-agent-playground-instances-response"
              }
            }
          }
        }
      },
      "get-agent-playground-instance-success": {
        "description": "成功获取实例详情",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "get-agent-playground-instance-response": {
                "$ref": "#/components/examples/get-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "update-agent-playground-instance-success": {
        "description": "成功更新实例元信息",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "update-agent-playground-instance-response": {
                "$ref": "#/components/examples/update-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "delete-agent-playground-instance-success": {
        "description": "成功受理删除（幂等）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DeleteAgentPlaygroundInstanceResponse"
            },
            "examples": {
              "delete-agent-playground-instance-response": {
                "$ref": "#/components/examples/delete-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "pause-agent-playground-instance-success": {
        "description": "成功受理暂停",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "pause-agent-playground-instance-response": {
                "$ref": "#/components/examples/pause-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "resume-agent-playground-instance-success": {
        "description": "成功受理恢复",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "resume-agent-playground-instance-response": {
                "$ref": "#/components/examples/resume-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "restart-agent-playground-instance-success": {
        "description": "成功受理重启（异步操作，`status` 为 `starting`）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "restart-agent-playground-instance-response": {
                "$ref": "#/components/examples/restart-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "get-agent-playground-instance-agents-success": {
        "description": "成功获取实例内 Agent 信息",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundAgentListResponse"
            },
            "examples": {
              "get-agent-playground-instance-agents-response": {
                "$ref": "#/components/examples/get-agent-playground-instance-agents-response"
              }
            }
          }
        }
      },
      "setup-agent-playground-instance-success": {
        "description": "成功下发配置，返回最新的实例对象（下发不改变实例 `status`）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "setup-agent-playground-instance-response": {
                "$ref": "#/components/examples/setup-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "import-to-agent-playground-instance-success": {
        "description": "成功受理导入（`status` 为 `starting`，结果经一次性通知返回）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundInstanceResponse"
            },
            "examples": {
              "import-to-agent-playground-instance-response": {
                "$ref": "#/components/examples/import-to-agent-playground-instance-response"
              }
            }
          }
        }
      },
      "get-agent-playground-instance-notifications-success": {
        "description": "成功获取并消费未读通知",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPlaygroundNotificationListResponse"
            },
            "examples": {
              "get-agent-playground-instance-notifications-response": {
                "$ref": "#/components/examples/get-agent-playground-instance-notifications-response"
              }
            }
          }
        }
      },
      "agent-playground-bad-request": {
        "description": "参数非法、引用不存在、实例状态不满足前置条件、实例数超配额或内容安全不通过",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-input-parameter-error": {
                "$ref": "#/components/examples/agent-playground-input-parameter-error"
              }
            }
          }
        }
      },
      "agent-playground-unauthorized": {
        "description": "未认证或 Token 无效",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-invalid-authentication": {
                "$ref": "#/components/examples/agent-playground-invalid-authentication"
              }
            }
          }
        }
      },
      "agent-playground-forbidden": {
        "description": "非资源 owner、跨账号操作或 Token 权限档不足",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-operation-not-allowed": {
                "$ref": "#/components/examples/agent-playground-operation-not-allowed"
              }
            }
          }
        }
      },
      "agent-playground-not-found": {
        "description": "实例或 Agent Hub agent 不存在",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-resource-not-found": {
                "$ref": "#/components/examples/agent-playground-resource-not-found"
              }
            }
          }
        }
      },
      "agent-playground-conflict": {
        "description": "实例名重复；实例内同名 MCP 或 Skill 已存在；并发写冲突（可直接重试）",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-duplicate-entity": {
                "$ref": "#/components/examples/agent-playground-duplicate-entity"
              }
            }
          }
        }
      },
      "agent-playground-internal-server-error": {
        "description": "服务端内部错误，排查请携带 `request_id`",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-internal-server-error": {
                "$ref": "#/components/examples/agent-playground-internal-server-error"
              }
            }
          }
        }
      },
      "agent-playground-bad-gateway": {
        "description": "实例内服务未就绪或实例内操作失败，可稍后重试",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-service-unavailable": {
                "$ref": "#/components/examples/agent-playground-service-unavailable"
              }
            }
          }
        }
      },
      "agent-playground-service-unavailable": {
        "description": "实例内服务未就绪或实例内操作失败，可稍后重试",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-service-unavailable": {
                "$ref": "#/components/examples/agent-playground-service-unavailable"
              }
            }
          }
        }
      },
      "agent-playground-request-timeout": {
        "description": "实例内操作超时；操作可能仍在实例内继续执行",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "agent-playground-request-timeout": {
                "$ref": "#/components/examples/agent-playground-request-timeout"
              }
            }
          }
        }
      },
      "create-model-success": {
        "description": "模型创建成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateModelResponse"
            },
            "examples": {
              "create-model-response": {
                "$ref": "#/components/examples/model-repo-info-response"
              }
            }
          }
        }
      },
      "conflict": {
        "description": "资源冲突",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "duplicate-entity": {
                "$ref": "#/components/examples/duplicate-entity"
              }
            }
          }
        }
      },
      "set-model-category-success": {
        "description": "模型类型设置/变更成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SetModelCategoryResponse"
            },
            "examples": {
              "set-model-category-response": {
                "$ref": "#/components/examples/model-repo-info-response"
              }
            }
          }
        }
      },
      "aigc-model-options-success": {
        "description": "成功返回 AIGC 模型配置项枚举",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AigcModelOptionsResponse"
            },
            "examples": {
              "aigc-model-options-response": {
                "$ref": "#/components/examples/aigc-model-options-response"
              }
            }
          }
        }
      },
      "too-many-requests": {
        "description": "请求过于频繁",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "rate-limit-exceed": {
                "$ref": "#/components/examples/rate-limit-exceed"
              }
            }
          }
        }
      },
      "science-model-options-success": {
        "description": "成功返回科学模型配置项枚举",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ScienceModelOptionsResponse"
            },
            "examples": {
              "science-model-options-response": {
                "$ref": "#/components/examples/science-model-options-response"
              }
            }
          }
        }
      },
      "list-studios-success": {
        "description": "成功获取创空间列表",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ListStudiosResponse"
            }
          }
        }
      },
      "get-balance-success": {
        "description": "余额查询成功",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GetBalanceResponse"
            },
            "examples": {
              "get-balance-response": {
                "$ref": "#/components/examples/get-balance-response"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "ModelScope API Token"
      }
    },
    "parameters": {
      "owner": {
        "name": "owner",
        "in": "path",
        "description": "仓库 owner（组织或个人）",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "OpenDataLab",
            "Qwen",
            "iic"
          ]
        }
      },
      "repo_name": {
        "name": "repo_name",
        "in": "path",
        "description": "仓库 repo_name 名称",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "AICC",
            "Qwen-Image-Edit-2511"
          ]
        }
      },
      "mcp_server_id": {
        "name": "id",
        "in": "path",
        "description": "服务ID。由平台后台收录的MCP，ID 默认为@author/server_name，当被社区用户认领后将会变更为user_name/server_name；由社区用户自发提交的MCP，ID 为user_name/server_name。",
        "required": true,
        "schema": {
          "type": "string",
          "examples": [
            "@modelcontextprotocol/fetch",
            "username/server-name"
          ]
        }
      },
      "studio_owner": {
        "name": "owner",
        "in": "path",
        "description": "所有者（用户名或组织名）",
        "required": true,
        "schema": {
          "type": "string",
          "examples": [
            "username",
            "organization"
          ]
        }
      },
      "studio_repo_name": {
        "name": "repo_name",
        "in": "path",
        "description": "仓库名称",
        "required": true,
        "schema": {
          "type": "string",
          "examples": [
            "my-demo-app"
          ]
        }
      },
      "studio_log_type": {
        "name": "log_type",
        "in": "path",
        "description": "日志类型：build（构建日志）或 run（运行日志）",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "build",
            "run"
          ],
          "examples": [
            "run"
          ]
        }
      },
      "skill_owner_path": {
        "name": "owner",
        "in": "path",
        "description": "技能作者/所有者，支持 `@author` 格式（官方认证）或 `owner`（用户名或组织名），其中 `@` 无需 URL 编码",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        },
        "examples": {
          "author": {
            "value": "@iSolver",
            "summary": "官方认证作者"
          },
          "user": {
            "value": "iSolver",
            "summary": "用户名或组织名"
          }
        }
      },
      "skill_name_path": {
        "name": "skill_name",
        "in": "path",
        "description": "技能英文名称，仅允许小写字母、数字和连字符",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[a-z0-9-]+$",
          "examples": [
            "my-awesome-skill"
          ]
        }
      },
      "agent_id": {
        "name": "id",
        "in": "path",
        "description": "Agent ID，格式为 path/name（例如 my_org/weather-agent），其中 / 无需 URL 编码",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "my_org/weather-agent"
          ]
        }
      },
      "agent_playground_instance_uuid": {
        "name": "uuid",
        "in": "path",
        "description": "实验场实例 ID",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "51a7d9d2-a521-451a-baf5-367cb115a29a"
          ]
        }
      },
      "collection_owner_path": {
        "name": "owner",
        "in": "path",
        "description": "Collection 所有者（用户名或组织名）。具体长度与格式约束以当前产品页面实现为准。",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "iSolver"
          ]
        }
      },
      "collection_slug_path": {
        "name": "slug",
        "in": "path",
        "description": "Collection slug 尾段，由 owner 和 title 字段按一定规则自动生成；创建接口会返回该字段。",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "best-nlp-models-6a3b2c"
          ]
        }
      },
      "collection_item_type_path": {
        "name": "item_type",
        "in": "path",
        "description": "资源类型：model / dataset / studio / paper / skill / mcp",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "model",
            "dataset",
            "studio",
            "paper",
            "skill",
            "mcp"
          ],
          "examples": [
            "model"
          ]
        }
      },
      "collection_item_object_id_path": {
        "name": "item_object_id",
        "in": "path",
        "description": "资源标识，如 damo/nlp_bert_base。可包含 `/`（作为 items/{item_type}/ 之后的整段剩余路径），无需 URL 编码。",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "examples": [
            "damo/nlp_bert_base"
          ]
        }
      }
    },
    "examples": {
      "user-all-response": {
        "value": {
          "success": true,
          "data": {
            "username": "tester",
            "nickname": "测试用户",
            "description": "这是一个测试用户",
            "email": "test@modelscope.cn",
            "avatar_url": "https://resouces.modelscope.cn/avatar/516aa51f-5fb7-49eb-930c-e90500ae13ca.png"
          },
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
        }
      },
      "list-models-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "models": [
              {
                "id": "iic/QwenLong-L1.5-30B-A3B",
                "display_name": "QwenLong-L1.5-30B-A3B",
                "description": "",
                "downloads": 1466,
                "likes": 25,
                "license": "apache-2.0",
                "tasks": [
                  "text-generation"
                ],
                "created_at": "2025-12-14T12:26:15Z",
                "last_modified": "2025-12-16T03:34:26Z",
                "file_size": 61081671123,
                "params": 30532122624,
                "tags": [
                  "license:apache-2.0",
                  "model_type:qwen3_moe",
                  "library:transformer",
                  "library:safetensors",
                  "library:pytorch",
                  "task:text-generation",
                  "deploy:swingdeploy"
                ],
                "private": false,
                "gated": false
              },
              {
                "id": "ZhipuAI/AutoGLM-Phone-9B",
                "display_name": "AutoGLM-Phone-9B",
                "description": "",
                "downloads": 28525,
                "likes": 265,
                "license": "MIT License",
                "tasks": [
                  "image-captioning"
                ],
                "created_at": "2025-12-08T08:00:28Z",
                "last_modified": "2025-12-09T15:22:57Z",
                "file_size": 20605693975,
                "params": 5368163840,
                "tags": [
                  "license:MIT License",
                  "model_type:glm4v",
                  "library:safetensors",
                  "library:pytorch",
                  "task:image-captioning",
                  "deploy:swingdeploy"
                ],
                "private": false,
                "gated": false
              }
            ],
            "total_count": 43127,
            "page_number": 1,
            "page_size": 2
          }
        }
      },
      "get-model-response": {
        "summary": "普通模型",
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "created_at": "2026-09-21T06:36:57Z",
            "description": "用于文本生成的模型",
            "display_name": "示例模型",
            "downloads": 0,
            "file_size": 0,
            "gated": false,
            "id": "alice/my-model",
            "last_modified": "2026-09-21T06:37:01Z",
            "license": "apache-2.0",
            "likes": 0,
            "model_category": "base",
            "owner": "alice",
            "params": 0,
            "private": true,
            "readme": "# 示例模型\n这里是仓库介绍。",
            "repo_name": "my-model",
            "tags": [
              "license:apache-2.0"
            ],
            "tasks": [],
            "visibility": "private"
          }
        }
      },
      "list-datasets-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "datasets": [
              {
                "id": "DAMO_NLP/jd",
                "display_name": "商品评论情感预测",
                "description": "该数据集包含从2011年1月1日到2014年3月31日（3年多）某电商网站的消费者购买行为，用户评分，评论和产品元数据，涵盖15个一级产品类别，987个二级产品类别，近2个百万用户，超过10万种产品和超过6,000万条评论。该数据集中的每个文本评论都包含三个子评论：正面评论，负面评论和整体评论。",
                "file_size": 0,
                "downloads": 53996,
                "likes": 102,
                "license": "Apache License 2.0",
                "tasks": [
                  "text-classification"
                ],
                "created_at": "2022-09-28T06:30:31Z",
                "last_modified": "2022-10-30T03:36:39Z",
                "tags": [
                  "license:Apache License 2.0",
                  "task:text-classification"
                ],
                "private": false,
                "gated": false,
                "login_required": false
              },
              {
                "id": "iic/nlp_domain_classification_chinese_testset",
                "display_name": "中文文本领域分类测试集",
                "description": "中文文本领域分类测试集，涉及国民经济行业标准的18个行业，部分收集自公开数据",
                "file_size": 0,
                "downloads": 2401,
                "likes": 23,
                "license": "Apache License 2.0",
                "tasks": [
                  "text-classification"
                ],
                "created_at": "2023-02-06T09:21:21Z",
                "last_modified": "2024-09-02T15:16:35Z",
                "tags": [
                  "license:Apache License 2.0",
                  "task:text-classification",
                  "custom_tag:文本领域",
                  "custom_tag:领域",
                  "custom_tag:文本分类"
                ],
                "private": false,
                "gated": false,
                "login_required": false
              }
            ],
            "total_count": 60,
            "page_number": 1,
            "page_size": 2
          }
        }
      },
      "get-dataset-response": {
        "summary": "普通数据集",
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "created_at": "2025-11-26T11:01:59Z",
            "dataset_category": "base",
            "description": "示例数据集说明",
            "display_name": "示例数据集",
            "downloads": 7239,
            "file_size": 121668031,
            "gated": false,
            "id": "alice/my-dataset",
            "last_modified": "2026-05-06T12:10:16Z",
            "license": "apache-2.0",
            "likes": 9,
            "login_required": false,
            "owner": "alice",
            "private": false,
            "readme": "# 示例数据集\n这里是仓库介绍。",
            "repo_name": "my-dataset",
            "tags": [
              "license:apache-2.0",
              "custom_tag:RoboCOIN",
              "custom_tag:LeRobot"
            ],
            "tasks": [],
            "visibility": "public"
          }
        }
      },
      "list-mcp-servers-response": {
        "value": {
          "success": true,
          "data": {
            "mcp_server_list": [
              {
                "id": "@modelcontextprotocol/fetch",
                "name": "Fetch网页内容抓取",
                "chinese_name": "Fetch网页内容抓取",
                "description": "该服务器使大型语言模型能够检索和处理网页内容，支持多种格式的内容提取和转换。",
                "logo_url": "https://resources.modelscope.cn/mcp-cover-img/fetch.png",
                "publisher": "@modelcontextprotocol/fetch",
                "categories": [
                  "browser-automation"
                ],
                "tags": [
                  "browser-automation",
                  "web-scraping"
                ],
                "view_count": 30667,
                "locales": {
                  "zh": {
                    "name": "Fetch网页内容抓取",
                    "description": "该服务器使大型语言模型能够检索和处理网页内容..."
                  },
                  "en": {
                    "name": "Fetch",
                    "description": "A server that enables LLMs to retrieve and process web content..."
                  }
                }
              },
              {
                "id": "@anthropic/claude-mcp",
                "name": "Claude MCP",
                "chinese_name": "Claude MCP服务",
                "description": "Anthropic 官方 MCP 服务，提供 Claude 模型的标准化访问接口。",
                "logo_url": "https://resources.modelscope.cn/mcp-cover-img/claude.png",
                "publisher": "@anthropic/claude-mcp",
                "categories": [
                  "ai-assistant"
                ],
                "tags": [
                  "ai-assistant",
                  "claude"
                ],
                "view_count": 15234,
                "locales": {
                  "zh": {
                    "name": "Claude MCP服务",
                    "description": "Anthropic 官方 MCP 服务..."
                  },
                  "en": {
                    "name": "Claude MCP",
                    "description": "Official Anthropic MCP service..."
                  }
                }
              }
            ],
            "total_count": 100
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-operational-mcp-servers-response": {
        "value": {
          "success": true,
          "data": {
            "mcp_server_list": [
              {
                "id": "@modelcontextprotocol/fetch",
                "name": "Fetch网页内容抓取",
                "chinese_name": "Fetch网页内容抓取",
                "description": "该服务器使大型语言模型能够检索和处理网页内容...",
                "logo_url": "https://resources.modelscope.cn/mcp-cover-img/fetch.png",
                "publisher": "@modelcontextprotocol/fetch",
                "categories": [
                  "browser-automation"
                ],
                "tags": [
                  "browser-automation"
                ],
                "view_count": 30667,
                "operational_urls": [
                  {
                    "id": "platform-pool",
                    "url": "https://mcp.api-inference.modelscope.net/abc123/mcp",
                    "transport_type": "streamable_http",
                    "auth_required": false,
                    "expiration": "2025-10-01 21:00:00",
                    "accessible": true
                  }
                ]
              }
            ],
            "total_count": 1
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "get-mcp-server-response": {
        "value": {
          "success": true,
          "data": {
            "id": "@modelcontextprotocol/fetch",
            "name": "Fetch网页内容抓取",
            "chinese_name": "Fetch网页内容抓取",
            "description": "该服务器使大型语言模型能够检索和处理网页内容，支持多种格式的内容提取和转换。",
            "logo_url": "https://resources.modelscope.cn/mcp-cover-img/fetch.png",
            "publisher": "@modelcontextprotocol/fetch",
            "author": "modelcontextprotocol",
            "owner": "",
            "readme": "# Fetch MCP Server\n\nA Model Context Protocol server that provides web content fetching capabilities.\n\n## Features\n\n- Fetch web pages and extract content\n- Support for multiple output formats\n- Automatic content cleaning and formatting",
            "source_url": "https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",
            "github_stars": 1234,
            "is_hosted": true,
            "is_verified": true,
            "categories": [
              "browser-automation"
            ],
            "tags": [
              "browser-automation",
              "web-scraping"
            ],
            "view_count": 30667,
            "env_schema": {},
            "server_config": [],
            "operational_urls": [],
            "locales": {
              "zh": {
                "name": "Fetch网页内容抓取",
                "description": "该服务器使大型语言模型能够检索和处理网页内容...",
                "readme": "# Fetch MCP Server\n\n提供网页内容抓取能力的 MCP 服务。"
              },
              "en": {
                "name": "Fetch",
                "description": "A server that enables LLMs to retrieve and process web content...",
                "readme": "# Fetch MCP Server\n\nA Model Context Protocol server that provides web content fetching capabilities."
              }
            }
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "deploy-mcp-server-response": {
        "value": {
          "success": true,
          "data": {
            "id": "platform-pool",
            "url": "https://mcp.api-inference.modelscope.net/abc123def456/mcp",
            "transport_type": "streamable_http",
            "auth_required": false,
            "expiration": "2025-10-01 21:00:00"
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "undeploy-mcp-server-response": {
        "value": {
          "success": true,
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "create-studio-response": {
        "value": {
          "success": true,
          "data": {
            "id": "username/my-demo-app",
            "repo_name": "my-demo-app",
            "display_name": "我的演示应用",
            "owner": "username",
            "url": "https://modelscope.cn/studios/username/my-demo-app"
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "get-studio-response": {
        "value": {
          "success": true,
          "data": {
            "id": "username/my-demo-app",
            "repo_name": "my-demo-app",
            "display_name": "我的演示应用",
            "owner": "username",
            "description": "一个演示创空间应用",
            "likes": 100,
            "view_count": 5000,
            "tags": [
              "nlp",
              "chatbot"
            ],
            "visibility": "public",
            "private": false,
            "last_modified": "2025-01-15T10:30:00Z",
            "sdk_type": "gradio",
            "sdk_version": "6.2.0",
            "hardware": "platform/2v-cpu-16g-mem",
            "base_image": "ubuntu22.04-py311-torch2.9.1-modelscope1.35.0",
            "license": "apache-2.0",
            "host": "https://username-my-demo-app.ms.show",
            "mcp_support": false,
            "runtime": {
              "status": "Running",
              "active_config": {
                "hardware": "platform/2v-cpu-16g-mem",
                "base_image": "ubuntu22.04-py311-torch2.9.1-modelscope1.35.0",
                "sdk_type": "gradio",
                "sdk_version": "6.2.0"
              },
              "created_at": "2025-01-15T10:30:00Z"
            }
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "studio-runtime-response": {
        "value": {
          "success": true,
          "data": {
            "status": "Running",
            "active_config": {
              "hardware": "platform/2v-cpu-16g-mem",
              "base_image": "ubuntu22.04-py311-torch2.9.1-modelscope1.35.0",
              "sdk_type": "gradio",
              "sdk_version": "6.2.0"
            },
            "created_at": "2025-01-15T10:30:00Z"
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "get-studio-logs-response": {
        "value": {
          "success": true,
          "data": {
            "logs": [
              "2025-01-15 10:30:00 INFO Starting application...",
              "2025-01-15 10:30:01 INFO Application started successfully"
            ],
            "page_num": 1,
            "page_size": 100,
            "total_count": 500,
            "total_page_num": 5
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-sdk-versions-response": {
        "value": {
          "success": true,
          "data": {
            "sdk_versions": [
              {
                "sdk_type": "gradio",
                "tag": "latest",
                "version": "6.2.0"
              },
              {
                "sdk_type": "gradio",
                "tag": "stable",
                "version": "5.49.1"
              }
            ],
            "total_count": 2
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-skills-response": {
        "value": {
          "success": true,
          "request_id": "c5bca202-aa4f-478b-b7e2-c568160583cb",
          "data": {
            "skills": [
              {
                "_id": "CIK3H+DYKlSAMlHnX60AUg==",
                "id": "@AMap-Web/amap-lbs-skill",
                "display_name": "高德地图综合服务Skill",
                "description": "高德地图综合服务，支持POI搜索、路径规划、旅游规划、周边搜索和热力图数据可视化",
                "owner": "",
                "license": "MIT License",
                "developer": "AMap-Web",
                "source_url": "https://github.com/AMap-Web/amap-lbs-skill",
                "category": "developer-tools",
                "tags": [
                  "category:developer-tools",
                  "license:MIT License",
                  "developer:AMap-Web",
                  "custom_tag:api-design",
                  "custom_tag:general-tools"
                ],
                "logo_url": "",
                "view_count": 6144,
                "downloads": 791,
                "locales": {
                  "en": {
                    "description": "Amap comprehensive services, supporting POI search, route planning, travel planning, nearby search, and heatmap data visualization",
                    "category": "DevTools"
                  },
                  "zh": {
                    "description": "高德地图综合服务，支持POI搜索、路径规划、旅游规划、周边搜索和热力图数据可视化",
                    "category": "开发工具"
                  }
                },
                "private": false,
                "custom_tag": [
                  "api-design",
                  "general-tools"
                ]
              },
              {
                "_id": "0ry9hAiAiJ+2pklbvQjepg==",
                "id": "@steipete/summarize",
                "display_name": "summarize",
                "description": "使用summarize CLI（适用于网页、PDF、图片、音频、YouTube）来总结URL或文件。",
                "owner": "steipete",
                "license": "",
                "developer": "steipete",
                "source_url": "https://clawhub.ai/steipete/summarize",
                "category": "ai-media",
                "tags": [
                  "category:ai-media",
                  "developer:steipete",
                  "custom_tag:image-video-gen",
                  "custom_tag:media-processing"
                ],
                "logo_url": "",
                "view_count": 4696,
                "downloads": 690,
                "locales": {
                  "en": {
                    "description": "Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).",
                    "category": "MediaAI"
                  },
                  "zh": {
                    "description": "使用summarize CLI（适用于网页、PDF、图片、音频、YouTube）来总结URL或文件。",
                    "category": "媒体处理"
                  }
                },
                "private": false,
                "custom_tag": [
                  "image-video-gen",
                  "media-processing"
                ]
              }
            ],
            "total": 20,
            "page_number": 1,
            "page_size": 20
          }
        }
      },
      "get-skill-response": {
        "value": {
          "success": true,
          "request_id": "105c898f-fd6d-437d-aa0b-9006036782da",
          "data": {
            "_id": "CIK3H+DYKlSAMlHnX60AUg==",
            "id": "@AMap-Web/amap-lbs-skill",
            "display_name": "高德地图综合服务Skill",
            "description": "高德地图综合服务，支持POI搜索、路径规划、旅游规划、周边搜索和热力图数据可视化",
            "owner": "",
            "license": "MIT License",
            "developer": "AMap-Web",
            "source_url": "https://github.com/AMap-Web/amap-lbs-skill",
            "category": "developer-tools",
            "tags": [
              "category:developer-tools",
              "license:MIT License",
              "developer:AMap-Web",
              "custom_tag:api-design",
              "custom_tag:general-tools"
            ],
            "logo_url": "",
            "view_count": 6144,
            "downloads": 791,
            "locales": {
              "en": {
                "description": "Amap comprehensive services, supporting POI search, route planning, travel planning, nearby search, and heatmap data visualization",
                "category": "DevTools"
              },
              "zh": {
                "description": "高德地图综合服务，支持POI搜索、路径规划、旅游规划、周边搜索和热力图数据可视化",
                "category": "开发工具"
              }
            },
            "private": false,
            "custom_tag": [
              "api-design",
              "general-tools"
            ],
            "install_command": [
              "npx skills add https://modelscope.cn/skills/@AMap-Web/amap-lbs-skill",
              "curl -fsSL https://modelscope.cn/skills/install.sh | bash -s -- @AMap-Web/amap-lbs-skill"
            ]
          }
        }
      },
      "create-skill-response": {
        "value": {
          "success": true,
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363",
          "data": {
            "id": "iSolver/my-awesome-skill",
            "name": "my-awesome-skill",
            "display_name": "我的技能",
            "owner": "iSolver",
            "url": "https://modelscope.cn/skills/iSolver/my-awesome-skill"
          }
        }
      },
      "update-skill-settings-response": {
        "value": {
          "success": true,
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-agents-response": {
        "value": {
          "success": true,
          "request_id": "c5bca202-aa4f-478b-b7e2-c568160583cb",
          "data": {
            "agents": [
              {
                "id": "my_org/weather-agent",
                "name": "weather-agent",
                "owner": "my_org",
                "display_name": "天气助手",
                "description": "一个可以查询天气的 Agent",
                "framework": "ms-agent",
                "logo_url": "https://example.com/logo.png",
                "license": "Apache License 2.0",
                "private": false,
                "categories": [
                  "tools"
                ],
                "custom_tags": [
                  "weather",
                  "demo"
                ],
                "tags": [
                  "category:tools",
                  "license:Apache License 2.0",
                  "framework:ms-agent",
                  "custom_tag:weather",
                  "custom_tag:demo"
                ],
                "views": 319,
                "downloads": 15,
                "likes": 8,
                "last_modified": "2026-07-16T10:30:00Z",
                "created_at": "2026-07-01T08:00:00Z"
              },
              {
                "id": "zhangsan/deep-research",
                "name": "deep-research",
                "owner": "zhangsan",
                "display_name": "深度研报助手",
                "description": "多步检索与研报写作 Agent",
                "framework": "qwenpaw",
                "logo_url": "",
                "license": "MIT License",
                "private": false,
                "categories": null,
                "custom_tags": null,
                "tags": [
                  "license:MIT License",
                  "framework:qwenpaw"
                ],
                "views": 149,
                "downloads": 3,
                "likes": 1,
                "last_modified": "2026-07-10T08:12:00Z",
                "created_at": "2026-07-02T08:00:00Z"
              }
            ],
            "total": 20,
            "page_number": 1,
            "page_size": 10
          }
        }
      },
      "create-agent-response": {
        "value": {
          "success": true,
          "request_id": "2f1c8a3e-9b7d-4f21-a0c6-1e2d3f4a5b6c",
          "data": {
            "id": "my_org/weather-agent",
            "name": "weather-agent",
            "display_name": "天气助手",
            "owner": "my_org",
            "url": "https://modelscope.cn/agents/my_org/weather-agent"
          }
        }
      },
      "get-agent-response": {
        "value": {
          "success": true,
          "request_id": "7a2b1c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
          "data": {
            "id": "my_org/weather-agent",
            "display_name": "天气助手",
            "description": "一个可以查询天气的 Agent",
            "framework": "ms-agent",
            "logo_url": "https://example.com/logo.png",
            "license": "Apache License 2.0",
            "private": false,
            "custom_tags": [
              "weather",
              "demo"
            ],
            "categories": [
              "tools"
            ],
            "last_modified": "2026-07-16T10:30:00Z",
            "downloads": 15,
            "likes": 8,
            "mcps": [
              {
                "name": "weather-mcp",
                "description": "天气查询 MCP",
                "tools": null
              }
            ],
            "skills": [
              {
                "name": "search-skill",
                "description": "搜索技能",
                "content": "# Search Skill\n..."
              }
            ],
            "system_files": [
              {
                "name": "agent.json",
                "content": "{...}"
              }
            ],
            "models": [
              {
                "model_name": "qwen-max",
                "provider_id": "dashscope",
                "base_url": "https://dashscope.aliyuncs.com",
                "protocol": "openai",
                "provider": "DashScope"
              }
            ],
            "readme": "# Weather Agent\n使用说明..."
          }
        }
      },
      "upload-file-response": {
        "value": {
          "success": true,
          "request_id": "99ee2083-63e0-46dc-b393-623c22645078",
          "data": {
            "id": "8c378570-8991-431b-a82c-96f3d0b4f0f4"
          }
        }
      },
      "create-agent-identity-response": {
        "value": {
          "success": true,
          "data": {
            "agent_id": "agent_id:modelscope:agent_1234567890ab",
            "agent_name": "my-agent",
            "description": "用于演示的测试 Agent",
            "token_expire_time": 3600,
            "principal": {
              "type": "user",
              "id": "alice"
            },
            "kid": "agent-key-001",
            "public_key": {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "f7QtzyEJhqFL8Jk5OYOq7010Ry9PipDGQkTzl7XtiEs",
              "kid": "agent-key-001",
              "alg": "EdDSA",
              "use": "sig"
            },
            "status": "active",
            "create_time": "2026-06-08T10:00:00Z"
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "get-agent-identity-response": {
        "value": {
          "success": true,
          "data": {
            "agent_id": "agent_id:modelscope:agent_1234567890ab",
            "agent_name": "my-agent",
            "description": "用于演示的测试 Agent",
            "token_expire_time": 3600,
            "principal": {
              "type": "user",
              "id": "alice"
            },
            "kid": "agent-key-001",
            "public_key": {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "f7QtzyEJhqFL8Jk5OYOq7010Ry9PipDGQkTzl7XtiEs",
              "kid": "agent-key-001",
              "alg": "EdDSA",
              "use": "sig"
            },
            "status": "active",
            "create_time": "2026-06-08T10:00:00Z",
            "update_time": "2026-06-08T10:30:00Z"
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "update-agent-identity-response": {
        "value": {
          "success": true,
          "data": {
            "agent_id": "agent_id:modelscope:agent_1234567890ab",
            "agent_name": "my-agent-renamed",
            "description": "更新后的描述",
            "token_expire_time": 1800,
            "principal": {
              "type": "user",
              "id": "alice"
            },
            "kid": "agent-key-001",
            "public_key": {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "f7QtzyEJhqFL8Jk5OYOq7010Ry9PipDGQkTzl7XtiEs",
              "kid": "agent-key-001",
              "alg": "EdDSA",
              "use": "sig"
            },
            "status": "active",
            "create_time": "2026-06-08T10:00:00Z",
            "update_time": "2026-06-08T11:00:00Z"
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-agent-identities-response": {
        "value": {
          "success": true,
          "data": {
            "agent_identities": [
              {
                "agent_id": "agent_id:modelscope:agent_1234567890ab",
                "agent_name": "my-agent",
                "kid": "agent-key-001",
                "status": "active",
                "token_expire_time": 3600,
                "create_time": "2026-06-08T10:00:00Z"
              },
              {
                "agent_id": "agent-cdef01234567",
                "agent_name": "build-bot",
                "kid": "agent-key-002",
                "status": "paused",
                "token_expire_time": 1800,
                "create_time": "2026-06-07T15:20:00Z"
              }
            ],
            "total_count": 2,
            "page_number": 1,
            "page_size": 20
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "reset-key-pair-response": {
        "value": {
          "success": true,
          "data": {
            "agent_id": "agent_id:modelscope:agent_1234567890ab",
            "kid": "agent-key-002",
            "public_key": {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "UnZsPxBV8ZyK5zhQlpnT1nf5GjxJQbpHQMwoS0jZeNc",
              "kid": "agent-key-002",
              "alg": "EdDSA",
              "use": "sig"
            }
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "pause-agent-response": {
        "value": {
          "success": true,
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "delete-agent-identity-response": {
        "value": {
          "success": true,
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "issue-token-response": {
        "value": {
          "success": true,
          "data": {
            "access_token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImlkcC1rZXktMDAxIn0.eyJpc3MiOiJodHRwczovL21vZGVsc2NvcGUuY24iLCJzdWIiOiJhZ2VudC0xMjM0NTY3ODkwYWIiLCJhdWQiOiJodWItYXBwLWFiY2RlZjEyMzQ1NiIsImV4cCI6MTcxNzQxMzYwMCwiaWF0IjoxNzE3NDEwMDAwLCJqdGkiOiJqdGktMTIzNDU2Nzg5MCJ9.dummy_signature_base64url",
            "token_type": "Bearer",
            "expire_at": 1717413600,
            "jti": "jti-1234567890"
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "list-token-records-response": {
        "value": {
          "success": true,
          "data": {
            "token_records": [
              {
                "token_id": "jti-1234567890",
                "audience": "hub-app-abcdef123456",
                "issued_at": "2026-06-08T11:30:00Z",
                "expire_at": "2026-06-08T12:30:00Z",
                "status": "active",
                "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImlkcC1rZXktMDAxIn0.eyJpc3MiOiJodHRwczovL21vZGVsc2NvcGUuY24iLCJzdWIiOiJhZ2VudC0xMjM0NTY3ODkwYWIiLCJhdWQiOiJodWItYXBwLWFiY2RlZjEyMzQ1NiIsImV4cCI6MTcxNzQxMzYwMCwiaWF0IjoxNzE3NDEwMDAwLCJqdGkiOiJqdGktMTIzNDU2Nzg5MCJ9.dummy_signature_base64url"
              },
              {
                "token_id": "jti-2345678901",
                "audience": "hub-app-fedcba654321",
                "issued_at": "2026-06-07T09:15:00Z",
                "expire_at": "2026-06-07T10:15:00Z",
                "status": "expired",
                "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImlkcC1rZXktMDAxIn0.eyJpc3MiOiJodHRwczovL21vZGVsc2NvcGUuY24iLCJzdWIiOiJhZ2VudC0xMjM0NTY3ODkwYWIiLCJhdWQiOiJodWItYXBwLWZlZGNiYTY1NDMyMSIsImV4cCI6MTcxNzMyMjUwMCwiaWF0IjoxNzE3MzE4OTAwLCJqdGkiOiJqdGktMjM0NTY3ODkwMSJ9.dummy_signature_base64url"
              }
            ],
            "total_count": 2,
            "page_number": 1,
            "page_size": 20
          },
          "message": "success",
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "agentid-configuration-response": {
        "value": {
          "issuer": "https://modelscope.cn",
          "token_endpoint": "https://modelscope.cn/openapi/v1/agent_id/token",
          "jwks_uri": "https://modelscope.cn/openapi/v1/agent_id/.well-known/agentid-jwks",
          "registration_endpoint": "https://modelscope.cn/openapi/v1/agent_ids",
          "activity_endpoint": "https://modelscope.cn/openapi/v1/agent_ids/{agent_id}/jwt_id_tokens",
          "id_token_signing_alg_values_supported": "EdDSA"
        }
      },
      "agentid-jwks-response": {
        "value": {
          "keys": [
            {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "UnZsPxBV8ZyK5zhQlpnT1nf5GjxJQbpHQMwoS0jZeNc",
              "kid": "idp-key-001",
              "alg": "EdDSA",
              "use": "sig"
            },
            {
              "kty": "OKP",
              "crv": "Ed25519",
              "x": "WoxPa7_oZOn1HtdPNn-3Btu7UKmtMVRUyQMlYMM0SnQ",
              "kid": "idp-key-002",
              "alg": "EdDSA",
              "use": "sig"
            }
          ]
        }
      },
      "get-collection-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "slug": "iSolver/best-nlp-models-6a3b2c",
            "title": "最佳 NLP 模型合集",
            "description": "精选的自然语言处理模型...",
            "owner": "iSolver",
            "visibility": "public",
            "theme": "Blue",
            "item_count": 2,
            "likes": 128,
            "view_count": 1024,
            "items": [
              {
                "item_type": "model",
                "item_object_id": "damo/nlp_bert_base",
                "note": "这个模型在中文 NLP 任务上表现优异",
                "position": 1,
                "created_at": "2025-01-15T08:00:00Z",
                "visibility": "public",
                "gated": false,
                "protected_mode": 2
              },
              {
                "item_type": "dataset",
                "item_object_id": "damo/nlp_corpus",
                "note": null,
                "position": 2,
                "created_at": "2025-01-16T09:00:00Z",
                "visibility": "public",
                "gated": false,
                "protected_mode": 2
              }
            ],
            "created_at": "2025-01-15T08:00:00Z",
            "updated_at": "2025-04-20T10:30:00Z",
            "url": "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
          }
        }
      },
      "create-collection-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "slug": "iSolver/best-nlp-models-6a3b2c",
            "title": "最佳 NLP 模型合集",
            "url": "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
          }
        }
      },
      "update-collection-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "slug": "iSolver/best-nlp-models-renamed-6a3b2c",
            "title": "最佳 NLP 模型合集（已更名）",
            "url": "https://modelscope.cn/collections/iSolver/best-nlp-models-renamed-6a3b2c"
          }
        }
      },
      "delete-collection-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {}
        }
      },
      "list-collections-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "collection_list": [
              {
                "slug": "iSolver/best-nlp-models-6a3b2c",
                "title": "最佳 NLP 模型合集",
                "description": "精选的自然语言处理模型...",
                "owner": "iSolver",
                "visibility": "public",
                "theme": "Blue",
                "item_count": 12,
                "likes": 128,
                "view_count": 1024,
                "items": [],
                "created_at": "2025-01-15T08:00:00Z",
                "updated_at": "2025-04-20T10:30:00Z",
                "url": "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c"
              }
            ],
            "total_count": 128,
            "page_number": 1,
            "page_size": 10
          }
        }
      },
      "list-collection-items-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "items": [
              {
                "item_type": "model",
                "item_object_id": "damo/nlp_bert_base",
                "note": "这个模型在中文 NLP 任务上表现优异",
                "position": 1,
                "created_at": "2025-01-15T08:00:00Z",
                "visibility": "public",
                "gated": false,
                "protected_mode": 2
              }
            ],
            "total_count": 50,
            "page_number": 1,
            "page_size": 10
          }
        }
      },
      "add-collection-items-request": {
        "value": {
          "items": [
            {
              "item_type": "model",
              "item_object_id": "damo/nlp_bert_base_chinese",
              "note": "推荐用于中文文本分类",
              "position": 1
            },
            {
              "item_type": "dataset",
              "item_object_id": "damo/nlp_corpus"
            }
          ]
        }
      },
      "add-collection-items-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "added_count": 2,
            "url": "https://modelscope.cn/collections/iSolver/best-nlp-models-6a3b2c",
            "failed_items": [
              {
                "item_type": "model",
                "item_object_id": "not/exist-model",
                "reason": "ResourceNotFound"
              }
            ]
          }
        }
      },
      "update-collection-item-request": {
        "value": {
          "note": "更新后的备注",
          "position": 2
        }
      },
      "update-collection-item-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "item_type": "model",
            "item_object_id": "damo/nlp_bert_base",
            "note": "更新后的备注",
            "position": 2,
            "created_at": "2025-01-15T08:00:00Z",
            "visibility": "public",
            "gated": false,
            "protected_mode": 2
          }
        }
      },
      "remove-collection-item-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {}
        }
      },
      "update-collection-items-request": {
        "value": {
          "items": [
            {
              "item_type": "model",
              "item_object_id": "damo/nlp_bert_base",
              "position": 1
            },
            {
              "item_type": "dataset",
              "item_object_id": "damo/nlp_corpus",
              "note": "更新备注",
              "position": 2
            }
          ]
        }
      },
      "update-collection-items-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3",
          "data": {
            "updated_count": 2,
            "failed_items": [
              {
                "item_type": "model",
                "item_object_id": "not/exist-model",
                "reason": "ItemNotInCollection"
              }
            ]
          }
        }
      },
      "create-gallery-request": {
        "value": {
          "name": "my-gallery",
          "owner": "my-org",
          "files": [
            "8c378570-8991-431b-a82c-96f3d0b4f0f4",
            "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          ],
          "entry_file": "notebook/demo.ipynb",
          "private": false,
          "category": "notebook",
          "labels": [
            "demo",
            "tutorial"
          ],
          "path": "my-custom-path"
        }
      },
      "create-gallery-response": {
        "value": {
          "success": true,
          "request_id": "req-xxxxxx",
          "data": {
            "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
            "url": "https://modelscope.cn/gallery/my-org/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
        }
      },
      "create-agent-playground-instance-request": {
        "value": {
          "instance_name": "my-agent",
          "display_name": "我的 Agent",
          "description": "用于测试的 Agent Playground 实例",
          "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
          "framework_type": "qwenpaw",
          "models": [
            {
              "provider_name": "ModelScope API-Inference",
              "model_name": "Qwen/Qwen3.5-27B"
            }
          ],
          "mcps": [
            {
              "name": "amap-maps",
              "source": "custom",
              "server_config": {
                "mcpServers": {
                  "amap-maps": {
                    "type": "sse",
                    "url": "https://mcp.example.com/sse"
                  }
                }
              }
            }
          ],
          "skills": [
            "@modelscope/web-search"
          ],
          "message": "帮我查一下明天的天气"
        }
      },
      "create-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "7d3f8f8a-8c1f-4d0b-8f1a-7b6a0d8a1a11",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "starting",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 0,
            "model_count": 0,
            "mcp_count": 0,
            "skill_count": 0,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-17T15:47:19+08:00",
            "user_modified_at": "2026-09-17T15:47:19+08:00"
          }
        }
      },
      "create-agent-playground-instance-from-agent-hub-request": {
        "value": {
          "instance_name": "playground-instance",
          "display_name": "Playground Instance",
          "description": "从 Agent Hub 导入的实例",
          "framework_type": "qwenpaw",
          "agent_owner": "jakexiao",
          "agent_name": "FirstAgent",
          "models": [
            {
              "provider_name": "ModelScope API-Inference",
              "model_name": "Qwen/Qwen3.5-27B"
            }
          ]
        }
      },
      "create-agent-playground-instance-from-agent-hub-response": {
        "value": {
          "success": true,
          "request_id": "1b9d5c7e-2a34-4f6b-8d0e-3c5a7b9d1f24",
          "data": {
            "uuid": "8f2c4a1e-7b63-4d95-a0c8-2e6f1b3d5a79",
            "owner": "username",
            "instance_name": "playground-instance",
            "display_name": "Playground Instance",
            "description": "从 Agent Hub 导入的实例",
            "logo": "",
            "status": "starting",
            "framework_type": "qwenpaw",
            "source": "agent_hub",
            "framework_version": "2.2.0",
            "agent_count": 0,
            "model_count": 0,
            "mcp_count": 0,
            "skill_count": 0,
            "gmt_created": "2026-09-18T10:12:05+08:00",
            "gmt_modified": "2026-09-18T10:12:05+08:00",
            "user_modified_at": "2026-09-18T10:12:05+08:00"
          }
        }
      },
      "list-agent-playground-instances-response": {
        "value": {
          "success": true,
          "request_id": "bb971b6e-36f0-4c4c-a50e-ee3fb6d3ceba",
          "data": {
            "instances": [
              {
                "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
                "owner": "username",
                "instance_name": "my-agent",
                "display_name": "我的 Agent",
                "description": "用于测试的 Agent Playground 实例",
                "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
                "status": "running",
                "framework_type": "qwenpaw",
                "source": "playground",
                "framework_version": "2.2.0",
                "agent_count": 2,
                "model_count": 1,
                "mcp_count": 3,
                "skill_count": 17,
                "gmt_created": "2026-09-17T15:47:19+08:00",
                "gmt_modified": "2026-09-18T17:06:19+08:00",
                "user_modified_at": "2026-09-17T15:47:19+08:00"
              },
              {
                "uuid": "8f2c4a1e-7b63-4d95-a0c8-2e6f1b3d5a79",
                "owner": "username",
                "instance_name": "playground-instance",
                "display_name": "Playground Instance",
                "description": "",
                "logo": "",
                "status": "sleeping",
                "framework_type": "ms-agent",
                "source": "agent_hub",
                "framework_version": "1.7.0.dev35316159068",
                "agent_count": 1,
                "model_count": 1,
                "mcp_count": 0,
                "skill_count": 0,
                "gmt_created": "2026-09-18T10:12:05+08:00",
                "gmt_modified": "2026-09-18T18:30:41+08:00",
                "user_modified_at": "2026-09-18T10:12:05+08:00"
              }
            ],
            "total_count": 2,
            "page_number": 1,
            "page_size": 10
          }
        }
      },
      "get-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "a4c8e2f1-5b7d-4906-8e3a-1f2c4d6b8a05",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "running",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T17:06:19+08:00",
            "user_modified_at": "2026-09-17T15:47:19+08:00"
          }
        }
      },
      "update-agent-playground-instance-request": {
        "value": {
          "instance_name": "my-agent-renamed",
          "display_name": "My Agent Renamed",
          "description": "Updated description",
          "logo": "https://resources.modelscope.cn/avatar/my-agent.png"
        }
      },
      "update-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "6e1a9c3b-8d42-4f07-b5e9-7a0c2d4f6b18",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent-renamed",
            "display_name": "My Agent Renamed",
            "description": "Updated description",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "running",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T17:06:19+08:00",
            "user_modified_at": "2026-09-18T17:06:19+08:00"
          }
        }
      },
      "delete-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "0d2b7a54-1f6c-4a2b-9e33-2c7f9c1d8b40",
          "data": {
            "deleted": true
          }
        }
      },
      "pause-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "2f8b6d0a-4c19-4e73-9a5f-8b1d3e5c7a92",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "sleeping",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T18:30:41+08:00",
            "user_modified_at": "2026-09-18T18:30:41+08:00"
          }
        }
      },
      "resume-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "9c3e5a7b-1d24-4068-8f0a-6b2d4c8e1f37",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "running",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T18:42:03+08:00",
            "user_modified_at": "2026-09-18T18:42:03+08:00"
          }
        }
      },
      "restart-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "5a7c9e1b-3f80-4d62-9c4e-0a8b2d6f4c13",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "starting",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T18:45:27+08:00",
            "user_modified_at": "2026-09-18T18:45:27+08:00"
          }
        }
      },
      "get-agent-playground-instance-agents-response": {
        "value": {
          "success": true,
          "request_id": "3c9a1b2d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
          "data": {
            "agents": [
              {
                "summary": {
                  "id": "default",
                  "name": "Default Agent",
                  "description": "",
                  "enabled": true,
                  "models": [
                    {
                      "provider_id": "playground-openai-3f2a9c1d",
                      "provider": "Playground Openai (3f2a9c1d)",
                      "model": "Qwen/Qwen3.5-27B",
                      "type": "openai",
                      "base_url": "https://api-inference.modelscope.cn/v1",
                      "enabled": true
                    }
                  ]
                },
                "detail": {
                  "id": "default",
                  "name": "Default Agent",
                  "description": "",
                  "models": [
                    {
                      "provider_id": "playground-openai-3f2a9c1d",
                      "provider": "Playground Openai (3f2a9c1d)",
                      "model": "Qwen/Qwen3.5-27B",
                      "type": "openai",
                      "base_url": "https://api-inference.modelscope.cn/v1",
                      "enabled": true
                    }
                  ],
                  "persona": {
                    "AGENTS.md": {
                      "content": "# AGENTS.md\n\nYou are a helpful agent.",
                      "enabled": true
                    },
                    "HEARTBEAT.md": {
                      "content": "",
                      "enabled": false
                    }
                  },
                  "skills": [
                    {
                      "name": "web-search",
                      "description": "",
                      "enabled": true,
                      "source": "builtin"
                    }
                  ],
                  "mcp_clients": [
                    {
                      "key": "amap-maps",
                      "name": "amap-maps",
                      "enabled": true,
                      "transport": "sse",
                      "url": "https://mcp.example.com/sse",
                      "tools": [
                        {
                          "name": "maps_geo",
                          "description": "地理编码"
                        }
                      ]
                    }
                  ]
                }
              }
            ],
            "refreshed_at": 1789722407
          }
        }
      },
      "setup-agent-playground-model-request": {
        "value": {
          "agent_id": "default",
          "provider_name": "ModelScope API-Inference",
          "model_name": "Qwen/Qwen3.5-27B"
        }
      },
      "setup-agent-playground-mcp-request": {
        "value": {
          "agent_id": "default",
          "name": "amap-maps",
          "source": "custom",
          "server_config": {
            "mcpServers": {
              "amap-maps": {
                "type": "sse",
                "url": "https://mcp.example.com/sse"
              }
            }
          }
        }
      },
      "setup-agent-playground-skill-request": {
        "value": {
          "agent_id": "default",
          "skill_ref": "@modelscope/web-search"
        }
      },
      "setup-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "8b4d2f6a-0c57-4e19-a3b8-5d7f9c1e2a64",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "running",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T19:02:11+08:00",
            "user_modified_at": "2026-09-17T15:47:19+08:00"
          }
        }
      },
      "import-to-agent-playground-instance-request": {
        "value": {
          "models": [
            {
              "provider_name": "ModelScope API-Inference",
              "model_name": "Qwen/Qwen3.5-27B"
            }
          ],
          "mcps": [
            {
              "name": "amap-maps",
              "source": "custom",
              "server_config": {
                "mcpServers": {
                  "amap-maps": {
                    "type": "sse",
                    "url": "https://mcp.example.com/sse"
                  }
                }
              }
            }
          ],
          "skills": [
            "@modelscope/web-search"
          ],
          "message": "帮我查一下明天的天气"
        }
      },
      "import-to-agent-playground-instance-response": {
        "value": {
          "success": true,
          "request_id": "c7e9a1b3-5d02-4f68-9a4c-1b3d5e7f9a02",
          "data": {
            "uuid": "51a7d9d2-a521-451a-baf5-367cb115a29a",
            "owner": "username",
            "instance_name": "my-agent",
            "display_name": "我的 Agent",
            "description": "用于测试的 Agent Playground 实例",
            "logo": "https://resources.modelscope.cn/avatar/my-agent.png",
            "status": "starting",
            "framework_type": "qwenpaw",
            "source": "playground",
            "framework_version": "2.2.0",
            "agent_count": 2,
            "model_count": 1,
            "mcp_count": 3,
            "skill_count": 17,
            "gmt_created": "2026-09-17T15:47:19+08:00",
            "gmt_modified": "2026-09-18T19:15:38+08:00",
            "user_modified_at": "2026-09-18T19:15:38+08:00"
          }
        }
      },
      "get-agent-playground-instance-notifications-response": {
        "value": {
          "success": true,
          "request_id": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4a5b",
          "data": {
            "notifications": [
              {
                "id": 7,
                "kind": "conversation",
                "payload": {
                  "framework": "qwenpaw",
                  "agent_id": "default",
                  "agent_name": "Default",
                  "message": "帮我查一下明天的天气",
                  "conversation": {
                    "framework": "qwenpaw",
                    "agent_id": "default",
                    "agent_name": "Default",
                    "channel": "console",
                    "session_id": "pg-4150b1f6-chat-0",
                    "chat_id": "f9ef8968-a0eb-4e70-bca3-d40e93197e85",
                    "chat_name": "帮我查一下明天的天气"
                  }
                },
                "gmt_created": "2026-07-12T15:32:47+08:00"
              },
              {
                "id": 8,
                "kind": "init_error",
                "payload": {
                  "item": "mcp:2",
                  "error": "invalid mcp server config",
                  "code": "InputParameterError"
                },
                "gmt_created": "2026-07-12T15:33:02+08:00"
              }
            ]
          }
        }
      },
      "agent-playground-input-parameter-error": {
        "value": {
          "success": false,
          "request_id": "bb971b6e-36f0-4c4c-a50e-ee3fb6d3ceba",
          "code": "InputParameterError",
          "message": "Input parameter is invalid: instance count limit reached (8/8), delete an existing instance first | 输入参数无效: 实例数量已达上限 (8/8)，请先删除一个实例"
        }
      },
      "agent-playground-invalid-authentication": {
        "value": {
          "success": false,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "code": "InvalidAuthentication",
          "message": "Invalid authentication | 认证无效"
        }
      },
      "agent-playground-operation-not-allowed": {
        "value": {
          "success": false,
          "request_id": "8a1c3e5f-7b92-4d06-8c4a-2e6b0d4f8a13",
          "code": "OperationNotAllowed",
          "message": "Operation not allowed | 无权执行该操作"
        }
      },
      "agent-playground-resource-not-found": {
        "value": {
          "success": false,
          "request_id": "5f7a9c1e-3b0d-4682-9e4f-7c1a3d5b9e02",
          "code": "ResourceNotFound",
          "message": "Resource not found: instance | 资源不存在: 实例"
        }
      },
      "agent-playground-duplicate-entity": {
        "value": {
          "success": false,
          "request_id": "1c3e5a7b-9d02-4f46-8a1b-3d5f7a9c1e04",
          "code": "DuplicateEntity",
          "message": "instance name already exists: my-agent | 实例名称已存在: my-agent"
        }
      },
      "agent-playground-internal-server-error": {
        "value": {
          "success": false,
          "request_id": "9e1b3d5f-7a0c-4248-9b3e-5a7c9e1b3d5f",
          "code": "InternalServerError",
          "message": "Internal server error, please try again later. | 服务器内部错误，请稍后重试。"
        }
      },
      "agent-playground-service-unavailable": {
        "value": {
          "success": false,
          "request_id": "2a4c6e8b-0d13-4957-8e2a-4c6e8b0d1357",
          "code": "ServiceUnavailable",
          "message": "Agent service in the instance is starting, please try again later. | 实例内 Agent 服务启动中，请稍后重试。"
        }
      },
      "agent-playground-request-timeout": {
        "value": {
          "success": false,
          "request_id": "6b8d0f2a-4c15-4e79-9b1d-3f5a7c9e1b0d",
          "code": "RequestTimeout",
          "message": "Request timed out, please try again later. | 请求超时，请稍后重试。"
        }
      },
      "invalid-authentication": {
        "value": {
          "success": false,
          "code": "InvalidAuthentication",
          "message": "Invalid authentication, please check your Authorization header",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd3"
        }
      },
      "internal-server-error": {
        "value": {
          "success": false,
          "code": "InternalServerError",
          "message": "Internal server error: database connection failed",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd8"
        }
      },
      "service-unavailable": {
        "value": {
          "success": false,
          "code": "ServiceUnavailable",
          "message": "Service unavailable: model inference service is down",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd9"
        }
      },
      "model-repo-info-response": {
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "id": "alice/my-anime-lora",
            "repo_name": "my-anime-lora",
            "display_name": "我的动漫 LoRA",
            "owner": "alice",
            "url": "https://modelscope.cn/models/alice/my-anime-lora"
          }
        }
      },
      "input-parameter-error": {
        "value": {
          "success": false,
          "code": "InputParameterError",
          "message": "Input parameter 'model_id' is invalid: cannot be empty",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2"
        }
      },
      "operation-not-allowed": {
        "value": {
          "success": false,
          "code": "OperationNotAllowed",
          "message": "Operation not allowed: you don't have permission to access this studio",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be0"
        }
      },
      "quota-limit-exceed": {
        "value": {
          "success": false,
          "code": "QuotaLimitExceed",
          "message": "Quota limit exceeded: API calls per minute",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd4"
        }
      },
      "duplicate-entity": {
        "value": {
          "success": false,
          "code": "DuplicateEntity",
          "message": "Duplicate entity: model already exists",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd6"
        }
      },
      "resource-not-found": {
        "value": {
          "success": false,
          "code": "ResourceNotFound",
          "message": "Resource not found: model Qwen/Qwen3-72B",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd5"
        }
      },
      "aigc-model-options-response": {
        "summary": "AIGC 配置选项（部分枚举）",
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "aigc_types": [
              {
                "label": "Checkpoint",
                "type": "aigc_type",
                "id": "Checkpoint"
              },
              {
                "label": "LoRA",
                "type": "aigc_type",
                "id": "LoRA"
              },
              {
                "label": "VAE",
                "type": "aigc_type",
                "id": "VAE"
              }
            ],
            "base_architectures": [
              {
                "label": "Z-Image",
                "subtypes": [
                  {
                    "label": "Z-Image-Turbo",
                    "type": "base_architecture_subtype",
                    "id": "Z_IMAGE_TURBO"
                  },
                  {
                    "label": "Z-Image",
                    "type": "base_architecture_subtype",
                    "id": "Z_IMAGE"
                  }
                ],
                "type": "base_architecture",
                "id": "Z_IMAGE_TURBO"
              },
              {
                "label": "Wan2.2",
                "subtypes": [
                  {
                    "label": "Wan2.2-TI2V-5B",
                    "type": "base_architecture_subtype",
                    "id": "WAN_VIDEO_2_2_TI2V_5_B"
                  }
                ],
                "type": "base_architecture",
                "id": "WAN_VIDEO_2_2_TI2V_5_B"
              },
              {
                "label": "Ace-Step",
                "subtypes": [
                  {
                    "label": "Acestep-Xl-Sft",
                    "type": "base_architecture_subtype",
                    "id": "ACESTEP_XL_SFT"
                  },
                  {
                    "label": "Acestep-Xl-Turbo",
                    "type": "base_architecture_subtype",
                    "id": "ACESTEP_XL_TURBO"
                  }
                ],
                "type": "base_architecture",
                "id": "ACESTEP_XL"
              }
            ],
            "content_elements": [
              {
                "label": "logo图标",
                "type": "content_element",
                "id": "logo"
              },
              {
                "label": "商品",
                "type": "content_element",
                "id": "commodity"
              }
            ],
            "content_functions": [
              {
                "label": "人物加强",
                "type": "content_function",
                "id": "character-enhancement"
              },
              {
                "label": "画风加强",
                "type": "content_function",
                "id": "art-style-strong"
              }
            ],
            "content_styles": [
              {
                "label": "写实摄影",
                "type": "content_style",
                "id": "photography"
              },
              {
                "label": "插画设计",
                "type": "content_style",
                "id": "illustration-design"
              }
            ]
          }
        }
      },
      "rate-limit-exceed": {
        "value": {
          "success": false,
          "code": "RateLimitExceed",
          "message": "Rate limit exceeded: 100 requests per minute",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd7"
        }
      },
      "science-model-options-response": {
        "summary": "科学模型学科选项（部分枚举）",
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "subject_areas": [
              {
                "label": "生命科学",
                "specializations": [
                  {
                    "label": "医学",
                    "type": "specialization",
                    "id": "medicine"
                  },
                  {
                    "label": "RNA",
                    "type": "specialization",
                    "id": "rna"
                  },
                  {
                    "label": "DNA",
                    "type": "specialization",
                    "id": "dna"
                  }
                ],
                "type": "subject_area",
                "id": "life-sciences"
              },
              {
                "label": "物质科学",
                "specializations": [
                  {
                    "label": "分子结构",
                    "type": "specialization",
                    "id": "molecular-structure"
                  },
                  {
                    "label": "材料结构",
                    "type": "specialization",
                    "id": "material-structure"
                  },
                  {
                    "label": "化学反应",
                    "type": "specialization",
                    "id": "chemical-reaction"
                  }
                ],
                "type": "subject_area",
                "id": "physical-science"
              }
            ]
          }
        }
      },
      "skill-input-parameter-error": {
        "value": {
          "success": false,
          "code": "InputParameterError",
          "message": "Input parameter 'page_size' is invalid: must be between 1 and 100",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be1"
        }
      },
      "skill-invalid-authentication": {
        "value": {
          "success": false,
          "code": "InvalidAuthentication",
          "message": "Invalid authentication, please check your Authorization header",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be5"
        }
      },
      "skill-internal-server-error": {
        "value": {
          "success": false,
          "code": "InternalServerError",
          "message": "Internal server error: failed to query skill marketplace",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be3"
        }
      },
      "skill-service-unavailable": {
        "value": {
          "success": false,
          "code": "ServiceUnavailable",
          "message": "Service unavailable: skill marketplace is temporarily unavailable",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be4"
        }
      },
      "skill-duplicate-entity": {
        "value": {
          "success": false,
          "code": "DuplicateEntity",
          "message": "Duplicate entity: skill iSolver/my-awesome-skill already exists",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be6"
        }
      },
      "skill-not-found": {
        "value": {
          "success": false,
          "code": "ResourceNotFound",
          "message": "Resource not found: skill @Alipay/alipay-payment-integration",
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375be2"
        }
      },
      "agent-input-parameter-error": {
        "value": {
          "success": false,
          "code": "InputParameterError",
          "message": "Input parameter is invalid: invalid request body",
          "request_id": "2f1c8a3e-9b7d-4f21-a0c6-1e2d3f4a5b6c"
        }
      },
      "agent-invalid-authentication": {
        "value": {
          "success": false,
          "code": "InvalidAuthentication",
          "message": "Invalid authentication: user not authenticated",
          "request_id": "2f1c8a3e-9b7d-4f21-a0c6-1e2d3f4a5b6c"
        }
      },
      "agent-quota-limit-exceed": {
        "value": {
          "success": false,
          "code": "QuotaLimitExceed",
          "message": "Quota limit exceeded: quota limit exceed 2400 agents",
          "request_id": "c5bca202-aa4f-478b-b7e2-c568160583cb"
        }
      },
      "agent-list-failed": {
        "value": {
          "success": false,
          "code": "ResourceNotFound",
          "message": "Resource not found: failed to list agents",
          "request_id": "c5bca202-aa4f-478b-b7e2-c568160583cb"
        }
      },
      "agent-internal-server-error": {
        "value": {
          "success": false,
          "code": "InternalServerError",
          "message": "Internal server error: failed to create agent",
          "request_id": "2f1c8a3e-9b7d-4f21-a0c6-1e2d3f4a5b6c"
        }
      },
      "agent-operation-not-allowed": {
        "value": {
          "success": false,
          "code": "OperationNotAllowed",
          "message": "Operation not allowed: no permission to access this agent",
          "request_id": "7a2b1c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
        }
      },
      "agent-not-found": {
        "value": {
          "success": false,
          "code": "ResourceNotFound",
          "message": "Resource not found: agent my_org/weather-agent",
          "request_id": "7a2b1c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
        }
      },
      "get-balance-response": {
        "value": {
          "success": true,
          "data": {
            "total_balance": 1000,
            "available_balance": 998.5,
            "frozen_amount": 1.5
          },
          "request_id": "c55709d2-4e09-4bd8-be84-d8518bc46363"
        }
      },
      "science-dataset-options-response": {
        "summary": "科学数据集学科选项（部分枚举）",
        "value": {
          "success": true,
          "request_id": "4d3f4b7d-95be-4e6f-95eb-d75178375bd2",
          "data": {
            "subject_areas": [
              {
                "label": "生命科学",
                "specializations": [
                  {
                    "label": "医学",
                    "type": "specialization",
                    "id": "medicine"
                  },
                  {
                    "label": "RNA",
                    "type": "specialization",
                    "id": "rna"
                  },
                  {
                    "label": "DNA",
                    "type": "specialization",
                    "id": "dna"
                  }
                ],
                "type": "subject_area",
                "id": "life-sciences"
              },
              {
                "label": "物质科学",
                "specializations": [
                  {
                    "label": "分子结构",
                    "type": "specialization",
                    "id": "molecular-structure"
                  },
                  {
                    "label": "材料结构",
                    "type": "specialization",
                    "id": "material-structure"
                  },
                  {
                    "label": "化学反应",
                    "type": "specialization",
                    "id": "chemical-reaction"
                  }
                ],
                "type": "subject_area",
                "id": "physical-science"
              }
            ]
          }
        }
      }
    }
  }
}
