{
  "openapi": "3.1.0",
  "info": {
    "title": "闲力云 GPU 租赁 API",
    "version": "0.1.0",
    "description": "覆盖 GPU 计算试点的镜像导入、任务交付与设备查询。容器任务需要启用镜像服务，由授权的受控 Windows 节点执行。写入操作要求同源 Origin，缺少 Origin 时检查 Referer。"
  },
  "servers": [
    {
      "url": "/",
      "description": "已部署的闲力云控制台同源地址"
    }
  ],
  "security": [
    {
      "consoleSession": []
    }
  ],
  "tags": [
    {
      "name": "设备与算力"
    },
    {
      "name": "镜像管理"
    },
    {
      "name": "计算任务"
    }
  ],
  "paths": {
    "/api/nodes/available": {
      "get": {
        "tags": [
          "设备与算力"
        ],
        "operationId": "getAvailableNodes",
        "summary": "查询可接单节点",
        "description": "返回真实试点、只读节点注册源或本地演示环境的可用算力。真实试点仅列出本账号设备及已审核共享节点。",
        "x-xianliyun-availability": "available",
        "responses": {
          "200": {
            "description": "可用节点和当前数据来源。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeAvailability"
                },
                "examples": {
                  "pilot": {
                    "summary": "计算试点",
                    "value": {
                      "configured": true,
                      "demo": false,
                      "checkedAt": "2026-01-15T08:00:00.000Z",
                      "nodes": [
                        {
                          "id": "e53127f2-8d77-4a90-aa28-0887ea83eee3",
                          "name": "个人计算机",
                          "gpu": "NVIDIA RTX 4090",
                          "vramGb": 24,
                          "availableSlots": 1
                        }
                      ]
                    }
                  },
                  "registry": {
                    "summary": "注册源查询",
                    "value": {
                      "configured": true,
                      "checkedAt": "2026-01-15T08:00:00.000Z",
                      "nodes": []
                    }
                  },
                  "demo": {
                    "summary": "本地演示",
                    "value": {
                      "configured": false,
                      "demo": true,
                      "checkedAt": "2026-01-15T08:00:00.000Z",
                      "nodes": [
                        {
                          "name": "演示节点 01",
                          "gpu": "NVIDIA RTX 4060 Ti",
                          "vramGb": 16,
                          "availableSlots": 1
                        }
                      ]
                    }
                  },
                  "disabled": {
                    "summary": "未配置",
                    "value": {
                      "configured": false,
                      "nodes": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "当前无法查询节点。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "node_registry_unavailable": {
                    "value": {
                      "error": "node_registry_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nodes/onboarding": {
      "get": {
        "tags": [
          "设备与算力"
        ],
        "operationId": "getOnboardingNodes",
        "summary": "查询已绑定设备",
        "description": "计算试点为真实账号返回最多 100 台设备。演示会话或未配置的环境返回 enabled 为 false。",
        "x-xianliyun-availability": "pilot",
        "responses": {
          "200": {
            "description": "绑定状态及设备清单。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                },
                "examples": {
                  "pilot": {
                    "value": {
                      "enabled": true,
                      "nodes": [
                        {
                          "id": "e53127f2-8d77-4a90-aa28-0887ea83eee3",
                          "name": "个人计算机",
                          "online": true,
                          "verified": true,
                          "accepting": true,
                          "gpu": "NVIDIA RTX 4090",
                          "vramGb": 24,
                          "driver": null,
                          "version": null,
                          "lastHeartbeatAt": "2026-01-15T08:00:00.000Z",
                          "ready": true,
                          "idle": true,
                          "busy": false
                        }
                      ]
                    }
                  },
                  "disabled": {
                    "value": {
                      "enabled": false,
                      "nodes": [],
                      "download": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nodes/onboarding/codes": {
      "post": {
        "tags": [
          "设备与算力"
        ],
        "operationId": "createOnboardingCode",
        "summary": "生成设备绑定码",
        "description": "要求真实手机号账号和同源请求。请求无需正文。绑定码仅可使用一次，10 分钟后失效。",
        "x-xianliyun-availability": "pilot",
        "responses": {
          "200": {
            "description": "一次性绑定码及过期时间。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingCode"
                },
                "examples": {
                  "example": {
                    "value": {
                      "code": "0a1b2-c3d4e-5f678-9abcd",
                      "expiresAt": "2026-01-15T08:10:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/images": {
      "get": {
        "tags": [
          "镜像管理"
        ],
        "operationId": "listComputeImages",
        "summary": "列出我的执行镜像",
        "description": "列出当前真实账号最近登记的最多 100 个镜像版本及其审核状态。仅已通过审核的镜像可用于任务。",
        "x-xianliyun-availability": "pilot",
        "responses": {
          "200": {
            "description": "镜像清单。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageList"
                },
                "examples": {
                  "example": {
                    "value": {
                      "images": [
                        {
                          "id": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                          "name": "批量语音转录",
                          "image": "registry.example.com/xianliyun/worker@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                          "status": "approved"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "计算试点未配置，读取接口不可用。返回空响应。"
          },
          "503": {
            "description": "当前环境尚未配置镜像服务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/images/import": {
      "post": {
        "tags": [
          "镜像管理"
        ],
        "operationId": "importComputeImage",
        "summary": "从仓库导入镜像",
        "description": "从平台允许的仓库导入 Linux x86-64 镜像，复制到平台镜像仓库后锁定摘要并等待审核。",
        "x-xianliyun-availability": "pilot",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageImport"
              },
              "example": {
                "name": "批量语音转录",
                "reference": "registry.example.com/team/worker:1.0"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "登记结果，镜像初始状态为 pending。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageAdded"
                },
                "examples": {
                  "example": {
                    "value": {
                      "image": {
                        "id": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                        "name": "批量语音转录",
                        "image": "registry.example.com/xianliyun/worker@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "status": "pending"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "镜像名称、仓库地址或 JSON 无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_image_name": {
                    "value": {
                      "error": "invalid_image_name"
                    }
                  },
                  "invalid_image_reference": {
                    "value": {
                      "error": "invalid_image_reference"
                    }
                  },
                  "image_registry_forbidden": {
                    "value": {
                      "error": "image_registry_forbidden"
                    }
                  },
                  "invalid_json": {
                    "value": {
                      "error": "invalid_json"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "413": {
            "description": "镜像超过配置的大小上限。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_too_large": {
                    "value": {
                      "error": "image_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "请求体需使用 application/json。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "json_required": {
                    "value": {
                      "error": "json_required"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "导入失败或镜像不支持 Linux x86-64。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_failed": {
                    "value": {
                      "error": "image_import_failed"
                    }
                  },
                  "image_platform_unsupported": {
                    "value": {
                      "error": "image_platform_unsupported"
                    }
                  },
                  "image_archive_required": {
                    "value": {
                      "error": "image_archive_required"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "当前导入任务较多，请稍后重试。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_busy": {
                    "value": {
                      "error": "image_import_busy"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "当前环境尚未配置镜像服务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "导入镜像超时。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_timeout": {
                    "value": {
                      "error": "image_import_timeout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/images/upload": {
      "post": {
        "tags": [
          "镜像管理"
        ],
        "operationId": "uploadComputeImage",
        "summary": "上传并登记 Docker 镜像包",
        "description": "上传 docker image save 导出的 Linux x86-64 镜像包。导入后的版本等待审核。",
        "x-xianliyun-availability": "pilot",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "description": "镜像的显示名称。"
          },
          {
            "name": "Content-Length",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "请求体的字节数。浏览器上传 File 时自动生成。"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "以 application/octet-stream 发送 .tar 或 .tar.gz 镜像包的原始字节。上传和解压后大小默认均不超过 2 GiB。",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "登记结果，镜像初始状态为 pending。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageAdded"
                },
                "examples": {
                  "example": {
                    "value": {
                      "image": {
                        "id": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                        "name": "批量语音转录",
                        "image": "registry.example.com/xianliyun/worker@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "status": "pending"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "镜像名称或包文件无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_image_name": {
                    "value": {
                      "error": "invalid_image_name"
                    }
                  },
                  "image_archive_required": {
                    "value": {
                      "error": "image_archive_required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "411": {
            "description": "上传需要提供 Content-Length。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_upload_length_required": {
                    "value": {
                      "error": "image_upload_length_required"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "镜像超过配置的大小上限。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_too_large": {
                    "value": {
                      "error": "image_too_large"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "导入失败或镜像不支持 Linux x86-64。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_failed": {
                    "value": {
                      "error": "image_import_failed"
                    }
                  },
                  "image_platform_unsupported": {
                    "value": {
                      "error": "image_platform_unsupported"
                    }
                  },
                  "image_archive_required": {
                    "value": {
                      "error": "image_archive_required"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "当前导入任务较多，请稍后重试。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_busy": {
                    "value": {
                      "error": "image_import_busy"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "当前环境尚未配置镜像服务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "导入镜像超时。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_timeout": {
                    "value": {
                      "error": "image_import_timeout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/task-inputs": {
      "post": {
        "tags": [
          "计算任务"
        ],
        "operationId": "uploadComputeInput",
        "summary": "上传任务输入文件",
        "description": "上传单个输入文件，保存返回的 ID 用于后续预检与发布。任务执行时输入挂载至只读 /input。",
        "x-xianliyun-availability": "pilot",
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(/[A-Za-z0-9][A-Za-z0-9._-]{0,63})*$",
              "description": "使用斜杠分隔目录的相对路径。每段不得以点结尾，也不得使用 Windows 保留的文件名。"
            },
            "example": "audio/sample.wav",
            "description": "容器中 /input 下的相对路径。"
          },
          {
            "name": "Content-Length",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "请求体的字节数。浏览器上传 File 时自动生成。"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "以 application/octet-stream 发送文件原始字节。单个文件需非空，最大 128 MiB。",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "当前账号可用于任务的输入文件。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InputUploaded"
                },
                "examples": {
                  "example": {
                    "value": {
                      "input": {
                        "id": "b039920f-197e-49b0-81dd-fba87f42c315",
                        "path": "audio/sample.wav",
                        "bytes": 131072,
                        "sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "文件路径或文件长度无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_artifact_path": {
                    "value": {
                      "error": "invalid_artifact_path"
                    }
                  },
                  "invalid_input_size": {
                    "value": {
                      "error": "invalid_input_size"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "411": {
            "description": "上传需要提供有效的 Content-Length。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "input_length_required": {
                    "value": {
                      "error": "input_length_required"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "文件大小超过 128 MiB。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "file_too_large": {
                    "value": {
                      "error": "file_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "请求体需使用 application/octet-stream。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "binary_required": {
                    "value": {
                      "error": "binary_required"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "镜像服务未启用或文件上传繁忙。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  },
                  "input_upload_busy": {
                    "value": {
                      "error": "input_upload_busy"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/jobs/preflight": {
      "post": {
        "tags": [
          "计算任务"
        ],
        "operationId": "preflightComputeJob",
        "summary": "预检容器任务",
        "description": "检查镜像审核状态、输入文件、必交产物和资源要求，返回当前符合条件的受控 Windows 节点数量。预检读取配置与容量，确认发布后才入队。",
        "x-xianliyun-availability": "pilot",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreflightInput"
              },
              "example": {
                "kind": "container",
                "name": "音频转录试单",
                "imageId": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                "args": [
                  "--language",
                  "zh"
                ],
                "inputs": [
                  "b039920f-197e-49b0-81dd-fba87f42c315"
                ],
                "outputs": [
                  {
                    "path": "transcript.json",
                    "maxBytes": 1048576
                  }
                ],
                "gpuModels": [
                  "rtx-4090",
                  "rtx-5090"
                ],
                "minVramGb": 8,
                "timeoutSeconds": 600
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "可执行规格和当前节点容量。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreflightResult"
                },
                "examples": {
                  "example": {
                    "value": {
                      "name": "音频转录试单",
                      "imageId": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                      "image": "registry.example.com/xianliyun/worker@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "args": [
                        "--language",
                        "zh"
                      ],
                      "inputs": [
                        {
                          "id": "b039920f-197e-49b0-81dd-fba87f42c315",
                          "path": "audio/sample.wav",
                          "bytes": 131072,
                          "sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                        }
                      ],
                      "outputs": [
                        {
                          "path": "transcript.json",
                          "maxBytes": 1048576
                        }
                      ],
                      "total": 1,
                      "gpuModels": [
                        "rtx-4090",
                        "rtx-5090"
                      ],
                      "gpuModel": null,
                      "minVramGb": 8,
                      "timeoutSeconds": 600,
                      "capacity": {
                        "own": 1,
                        "shared": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求格式、启动参数、输入输出或资源要求无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": "invalid_json"
                    }
                  },
                  "container_task_required": {
                    "value": {
                      "error": "container_task_required"
                    }
                  },
                  "invalid_job_name": {
                    "value": {
                      "error": "invalid_job_name"
                    }
                  },
                  "invalid_image_id": {
                    "value": {
                      "error": "invalid_image_id"
                    }
                  },
                  "invalid_container_args": {
                    "value": {
                      "error": "invalid_container_args"
                    }
                  },
                  "invalid_task_inputs": {
                    "value": {
                      "error": "invalid_task_inputs"
                    }
                  },
                  "invalid_task_outputs": {
                    "value": {
                      "error": "invalid_task_outputs"
                    }
                  },
                  "invalid_artifact_path": {
                    "value": {
                      "error": "invalid_artifact_path"
                    }
                  },
                  "artifact_path_conflict": {
                    "value": {
                      "error": "artifact_path_conflict"
                    }
                  },
                  "invalid_output_limit": {
                    "value": {
                      "error": "invalid_output_limit"
                    }
                  },
                  "invalid_gpu_model": {
                    "value": {
                      "error": "invalid_gpu_model"
                    }
                  },
                  "invalid_min_vram": {
                    "value": {
                      "error": "invalid_min_vram"
                    }
                  },
                  "invalid_task_timeout": {
                    "value": {
                      "error": "invalid_task_timeout"
                    }
                  },
                  "invalid_request_id": {
                    "value": {
                      "error": "invalid_request_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "413": {
            "description": "JSON 请求体或任务文件总大小超过限制。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "request_too_large": {
                    "value": {
                      "error": "request_too_large"
                    }
                  },
                  "task_files_too_large": {
                    "value": {
                      "error": "task_files_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "请求体需使用 application/json。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "json_required": {
                    "value": {
                      "error": "json_required"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "镜像尚未通过审核，或不存在可供当前账号使用的输入文件。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_not_approved": {
                    "value": {
                      "error": "image_not_approved"
                    }
                  },
                  "input_not_found": {
                    "value": {
                      "error": "input_not_found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "当前环境尚未配置镜像服务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/jobs": {
      "get": {
        "tags": [
          "计算任务"
        ],
        "operationId": "listComputeJobs",
        "summary": "列出计算任务",
        "description": "在试点环境返回当前账号最新的最多 100 条任务记录。演示会话返回 enabled 为 false 的空列表。",
        "x-xianliyun-availability": "pilot",
        "responses": {
          "200": {
            "description": "按创建时间倒序返回的任务列表。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                },
                "examples": {
                  "pilot": {
                    "value": {
                      "jobs": [
                        {
                          "id": "f87488d5-5fc6-40b4-9803-1a50289ebd13",
                          "name": "音频转录试单",
                          "status": "queued",
                          "total": 1,
                          "queued": 1,
                          "active": 0,
                          "completed": 0,
                          "failed": 0,
                          "createdAt": "2026-01-15T08:00:00.000Z",
                          "allowShared": false
                        }
                      ]
                    }
                  },
                  "demo": {
                    "value": {
                      "enabled": false,
                      "jobs": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "计算试点未配置，读取接口不可用。返回空响应。"
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "计算任务"
        ],
        "operationId": "createComputeJob",
        "summary": "发布容器任务",
        "description": "创建单个 GPU 任务点，等待符合条件的受控节点领单。JSON 请求体最多 64 KiB。账号内使用同一 requestId 和相同内容重试时返回原任务 ID。",
        "x-xianliyun-availability": "pilot",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobInput"
              },
              "example": {
                "kind": "container",
                "name": "音频转录试单",
                "imageId": "877e82ad-5450-4d67-beec-c4eddbcb0125",
                "args": [
                  "--language",
                  "zh"
                ],
                "inputs": [
                  "b039920f-197e-49b0-81dd-fba87f42c315"
                ],
                "outputs": [
                  {
                    "path": "transcript.json",
                    "maxBytes": 1048576
                  }
                ],
                "gpuModels": [
                  "rtx-4090",
                  "rtx-5090"
                ],
                "minVramGb": 8,
                "timeoutSeconds": 600,
                "requestId": "client-request-001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "新建任务或幂等重试的任务 ID。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobCreated"
                },
                "examples": {
                  "example": {
                    "value": {
                      "id": "f87488d5-5fc6-40b4-9803-1a50289ebd13"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求格式、启动参数、输入输出或资源要求无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_json": {
                    "value": {
                      "error": "invalid_json"
                    }
                  },
                  "container_task_required": {
                    "value": {
                      "error": "container_task_required"
                    }
                  },
                  "invalid_job_name": {
                    "value": {
                      "error": "invalid_job_name"
                    }
                  },
                  "invalid_image_id": {
                    "value": {
                      "error": "invalid_image_id"
                    }
                  },
                  "invalid_container_args": {
                    "value": {
                      "error": "invalid_container_args"
                    }
                  },
                  "invalid_task_inputs": {
                    "value": {
                      "error": "invalid_task_inputs"
                    }
                  },
                  "invalid_task_outputs": {
                    "value": {
                      "error": "invalid_task_outputs"
                    }
                  },
                  "invalid_artifact_path": {
                    "value": {
                      "error": "invalid_artifact_path"
                    }
                  },
                  "artifact_path_conflict": {
                    "value": {
                      "error": "artifact_path_conflict"
                    }
                  },
                  "invalid_output_limit": {
                    "value": {
                      "error": "invalid_output_limit"
                    }
                  },
                  "invalid_gpu_model": {
                    "value": {
                      "error": "invalid_gpu_model"
                    }
                  },
                  "invalid_min_vram": {
                    "value": {
                      "error": "invalid_min_vram"
                    }
                  },
                  "invalid_task_timeout": {
                    "value": {
                      "error": "invalid_task_timeout"
                    }
                  },
                  "invalid_request_id": {
                    "value": {
                      "error": "invalid_request_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "需要真实账号及同源请求。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  },
                  "invalid_origin": {
                    "value": {
                      "error": "invalid_origin"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "计算试点未配置，写入接口不可用。返回空响应。"
          },
          "409": {
            "description": "同一 requestId 已用于不同内容。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "job_request_conflict": {
                    "value": {
                      "error": "job_request_conflict"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "JSON 请求体或任务文件总大小超过限制。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "request_too_large": {
                    "value": {
                      "error": "request_too_large"
                    }
                  },
                  "task_files_too_large": {
                    "value": {
                      "error": "task_files_too_large"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "请求体需使用 application/json。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "json_required": {
                    "value": {
                      "error": "json_required"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "镜像尚未通过审核，或不存在可供当前账号使用的输入文件。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_not_approved": {
                    "value": {
                      "error": "image_not_approved"
                    }
                  },
                  "input_not_found": {
                    "value": {
                      "error": "input_not_found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "当前环境尚未配置镜像服务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "image_import_unavailable": {
                    "value": {
                      "error": "image_import_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/compute/jobs/{id}": {
      "get": {
        "tags": [
          "计算任务"
        ],
        "operationId": "getComputeJob",
        "summary": "查询任务和结果",
        "description": "仅允许真实账号查看自己的任务。已验收文件的签名下载链接有效期为 5 分钟，过期后重新查询详情。",
        "x-xianliyun-availability": "pilot",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
            },
            "example": "f87488d5-5fc6-40b4-9803-1a50289ebd13"
          }
        ],
        "responses": {
          "200": {
            "description": "任务汇总和各任务点的进度及交付结果。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobDetail"
                },
                "examples": {
                  "example": {
                    "value": {
                      "job": {
                        "id": "f87488d5-5fc6-40b4-9803-1a50289ebd13",
                        "name": "音频转录试单",
                        "status": "completed",
                        "total": 1,
                        "queued": 0,
                        "active": 0,
                        "completed": 1,
                        "failed": 0,
                        "createdAt": "2026-01-15T08:00:00.000Z",
                        "allowShared": false
                      },
                      "items": [
                        {
                          "id": "e53127f2-8d77-4a90-aa28-0887ea83eee3",
                          "name": "音频转录试单",
                          "status": "completed",
                          "attempts": 1,
                          "completedAt": "2026-01-15T08:00:00.000Z",
                          "outputUrl": null,
                          "artifacts": [
                            {
                              "path": "transcript.json",
                              "bytes": 682,
                              "sha256": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
                              "url": "https://example.com/signed-result.json"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "需要有效的控制台登录会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "authentication_required": {
                    "value": {
                      "error": "authentication_required"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "真实手机号账号才可查询任务详情。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "real_account_required": {
                    "value": {
                      "error": "real_account_required"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "任务不存在或无权查看。计算试点未配置时可能是空响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "job_not_found": {
                    "value": {
                      "error": "job_not_found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "计算试点暂不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "compute_unavailable": {
                    "value": {
                      "error": "compute_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "consoleSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "xianli_session",
        "description": "登录控制台后由浏览器自动提交的 HttpOnly 会话。写入操作需在控制台同源页面发起。"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "AvailableNode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
            "description": "仅计算试点返回节点 ID。"
          },
          "name": {
            "type": "string"
          },
          "gpu": {
            "type": [
              "string",
              "null"
            ]
          },
          "vramGb": {
            "type": "number",
            "minimum": 0
          },
          "availableSlots": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "name",
          "gpu",
          "vramGb",
          "availableSlots"
        ]
      },
      "NodeAvailability": {
        "type": "object",
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "demo": {
            "type": "boolean",
            "description": "true 表示本地演示数据。"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailableNode"
            }
          }
        },
        "required": [
          "configured",
          "nodes"
        ]
      },
      "Node": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          },
          "name": {
            "type": "string"
          },
          "online": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "accepting": {
            "type": "boolean"
          },
          "gpu": {
            "type": [
              "string",
              "null"
            ]
          },
          "vramGb": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "driver": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastHeartbeatAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ready": {
            "type": "boolean"
          },
          "idle": {
            "type": "boolean"
          },
          "busy": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "online",
          "verified",
          "accepting",
          "gpu",
          "vramGb",
          "driver",
          "version",
          "lastHeartbeatAt",
          "ready",
          "idle",
          "busy"
        ]
      },
      "Onboarding": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "nodes": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          },
          "download": {
            "type": "boolean",
            "description": "试点未启用时，指示当前是否已有 Windows 安装包。"
          }
        },
        "required": [
          "enabled",
          "nodes"
        ]
      },
      "OnboardingCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[a-f0-9]{5}(-[a-f0-9]{5}){3}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "code",
          "expiresAt"
        ]
      },
      "Image": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "image": {
            "type": "string",
            "description": "平台镜像仓库中锁定摘要的执行地址。"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "description": "镜像审核状态。"
          }
        },
        "required": [
          "id",
          "name",
          "image",
          "status"
        ]
      },
      "ImageList": {
        "type": "object",
        "properties": {
          "images": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          }
        },
        "required": [
          "images"
        ]
      },
      "ImageAdded": {
        "type": "object",
        "properties": {
          "image": {
            "$ref": "#/components/schemas/Image"
          }
        },
        "required": [
          "image"
        ]
      },
      "ImageImport": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "镜像的显示名称。"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 320,
            "description": "包含仓库主机和镜像路径，可带标签或 SHA-256 摘要。"
          }
        },
        "required": [
          "name",
          "reference"
        ]
      },
      "Input": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(/[A-Za-z0-9][A-Za-z0-9._-]{0,63})*$",
            "description": "使用斜杠分隔目录的相对路径。每段不得以点结尾，也不得使用 Windows 保留的文件名。"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 134217728
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "id",
          "path",
          "bytes",
          "sha256"
        ]
      },
      "InputUploaded": {
        "type": "object",
        "properties": {
          "input": {
            "$ref": "#/components/schemas/Input"
          }
        },
        "required": [
          "input"
        ]
      },
      "RequiredOutput": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(/[A-Za-z0-9][A-Za-z0-9._-]{0,63})*$",
            "description": "容器中 /output 下的相对路径。"
          },
          "maxBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 134217728,
            "description": "此产物的大小上限，单位字节。"
          }
        },
        "required": [
          "path",
          "maxBytes"
        ]
      },
      "PreflightInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "container",
            "description": "客户自带镜像的批处理任务。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "任务名称。首尾空格会被去除，禁止控制字符。"
          },
          "imageId": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
            "description": "当前账号下已通过审核的镜像 ID。"
          },
          "args": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\x00-\\x1f\\x7f]+$"
            },
            "description": "传给镜像启动入口的参数。传空数组使用镜像默认配置。"
          },
          "inputs": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
            },
            "description": "已上传的输入文件 ID。可为空，文件总计最多 256 MiB。"
          },
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/RequiredOutput"
            },
            "description": "必交产物。路径不能重复或同时声明为文件和目录，大小上限合计最多 256 MiB。"
          },
          "gpuModels": {
            "type": "array",
            "maxItems": 2,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "rtx-4090",
                "rtx-5090"
              ]
            },
            "description": "可选的桌面显卡型号列表。命中任一型号且达到最低显存即可。空数组为不限型号。"
          },
          "gpuModel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "rtx-4090",
              "rtx-5090",
              null
            ],
            "deprecated": true,
            "description": "旧版单选字段。使用 gpuModels 时可省略此字段或传 null。两个字段均省略时不限型号。"
          },
          "minVramGb": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "description": "单张 NVIDIA GPU 的最低显存，单位 GiB。"
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "description": "容器允许运行的最长时间，单位秒。"
          }
        },
        "required": [
          "kind",
          "name",
          "imageId",
          "args",
          "inputs",
          "outputs",
          "minVramGb",
          "timeoutSeconds"
        ]
      },
      "JobInput": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "container",
            "description": "客户自带镜像的批处理任务。"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "任务名称。首尾空格会被去除，禁止控制字符。"
          },
          "imageId": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
            "description": "当前账号下已通过审核的镜像 ID。"
          },
          "args": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\x00-\\x1f\\x7f]+$"
            },
            "description": "传给镜像启动入口的参数。传空数组使用镜像默认配置。"
          },
          "inputs": {
            "type": "array",
            "maxItems": 8,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
            },
            "description": "已上传的输入文件 ID。可为空，文件总计最多 256 MiB。"
          },
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/RequiredOutput"
            },
            "description": "必交产物。路径不能重复或同时声明为文件和目录，大小上限合计最多 256 MiB。"
          },
          "gpuModels": {
            "type": "array",
            "maxItems": 2,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "rtx-4090",
                "rtx-5090"
              ]
            },
            "description": "可选的桌面显卡型号列表。命中任一型号且达到最低显存即可。空数组为不限型号。"
          },
          "gpuModel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "rtx-4090",
              "rtx-5090",
              null
            ],
            "deprecated": true,
            "description": "旧版单选字段。使用 gpuModels 时可省略此字段或传 null。两个字段均省略时不限型号。"
          },
          "minVramGb": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "description": "单张 NVIDIA GPU 的最低显存，单位 GiB。"
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "description": "容器允许运行的最长时间，单位秒。"
          },
          "requestId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._:-]{1,128}$",
            "description": "账号内唯一的幂等请求标识。"
          }
        },
        "required": [
          "kind",
          "name",
          "imageId",
          "args",
          "inputs",
          "outputs",
          "minVramGb",
          "timeoutSeconds",
          "requestId"
        ]
      },
      "PreflightResult": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "任务名称。首尾空格会被去除，禁止控制字符。"
          },
          "imageId": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
            "description": "当前账号下已通过审核的镜像 ID。"
          },
          "image": {
            "type": "string",
            "description": "平台锁定镜像摘要后的地址。"
          },
          "args": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\x00-\\x1f\\x7f]+$"
            },
            "description": "传给镜像启动入口的参数。传空数组使用镜像默认配置。"
          },
          "inputs": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/Input"
            },
            "description": "核验通过的输入文件。"
          },
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/RequiredOutput"
            },
            "description": "必交产物。路径不能重复或同时声明为文件和目录，大小上限合计最多 256 MiB。"
          },
          "gpuModels": {
            "type": "array",
            "maxItems": 2,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "rtx-4090",
                "rtx-5090"
              ]
            },
            "description": "可选的桌面显卡型号列表。命中任一型号且达到最低显存即可。空数组为不限型号。"
          },
          "gpuModel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "rtx-4090",
              "rtx-5090",
              null
            ],
            "deprecated": true,
            "description": "兼容旧版调用。只选一个型号时返回该型号，其余情况返回 null。"
          },
          "minVramGb": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "description": "单张 NVIDIA GPU 的最低显存，单位 GiB。"
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600,
            "description": "容器允许运行的最长时间，单位秒。"
          },
          "total": {
            "type": "integer",
            "const": 1
          },
          "capacity": {
            "type": "object",
            "properties": {
              "own": {
                "type": "integer",
                "minimum": 0
              },
              "shared": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "own",
              "shared"
            ],
            "description": "查询时本账号与平台可派单的受控节点数量。"
          }
        },
        "required": [
          "name",
          "imageId",
          "image",
          "args",
          "inputs",
          "outputs",
          "gpuModels",
          "gpuModel",
          "minVramGb",
          "timeoutSeconds",
          "total",
          "capacity"
        ]
      },
      "JobCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          }
        },
        "required": [
          "id"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "completed",
              "partial",
              "failed"
            ]
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "queued": {
            "type": "integer",
            "minimum": 0
          },
          "active": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "allowShared": {
            "type": "boolean",
            "description": "旧任务的共享设置。容器任务按受控节点池策略派单。"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "total",
          "queued",
          "active",
          "completed",
          "failed",
          "createdAt",
          "allowShared"
        ]
      },
      "DeliveredArtifact": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(/[A-Za-z0-9][A-Za-z0-9._-]{0,63})*$",
            "description": "使用斜杠分隔目录的相对路径。每段不得以点结尾，也不得使用 Windows 保留的文件名。"
          },
          "bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 134217728
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "签名下载链接，有效期 5 分钟。"
          }
        },
        "required": [
          "path",
          "bytes",
          "sha256",
          "url"
        ]
      },
      "JobItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "preparing",
              "running",
              "uploading",
              "completed",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "outputUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "旧模板记录的单文件下载地址，有效期 5 分钟。"
          },
          "artifacts": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/DeliveredArtifact"
            },
            "description": "通过验收的容器产物。"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "attempts",
          "completedAt",
          "outputUrl",
          "artifacts"
        ]
      },
      "JobList": {
        "type": "object",
        "properties": {
          "jobs": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Job"
            }
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "jobs"
        ]
      },
      "JobDetail": {
        "type": "object",
        "properties": {
          "job": {
            "$ref": "#/components/schemas/Job"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/JobItem"
            }
          }
        },
        "required": [
          "job",
          "items"
        ]
      }
    }
  }
}