{
  "paths": {
    "/api/v1/capabilities": {
      "get": {
        "operationId": "listCapabilities",
        "summary": "查看现在可用的功能",
        "tags": [
          "可用功能"
        ],
        "description": "查询当前 API 环境可用的功能、模型、上传格式及制作限制。",
        "x-required-scope": "projects:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicCapabilityPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works": {
      "get": {
        "operationId": "listProjects",
        "summary": "查看我的项目列表",
        "tags": [
          "项目与资源"
        ],
        "description": "查询可访问的项目。用 state 筛选状态，用 cursor 和 limit 分页。",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProjectPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createProject",
        "summary": "创建新项目",
        "tags": [
          "项目与资源"
        ],
        "description": "按 name 创建项目。使用返回的项目 ID 添加素材并开始制作。",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}": {
      "get": {
        "operationId": "getProject",
        "summary": "查看项目信息",
        "tags": [
          "项目与资源"
        ],
        "description": "返回项目名称、状态及当前 revision。修改或提交制作请求前，用此接口确认最新版本。",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateProject",
        "summary": "修改项目信息",
        "tags": [
          "项目与资源"
        ],
        "description": "修改项目名称或切换 active、archived 状态。If-Match 须使用最新 ETag。",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "使用最新响应的 ETag，包括引号。",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicProject"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/resources": {
      "get": {
        "operationId": "listResources",
        "summary": "查看已上传的素材列表",
        "tags": [
          "项目与资源"
        ],
        "description": "列出项目的剧本、角色、场景、道具、剧集和镜头记录。用 kind 选择类型。",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "script",
                "character",
                "scene",
                "prop",
                "episode",
                "shot"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResourcePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createResource",
        "summary": "上传剧本、图片等素材",
        "tags": [
          "项目与资源"
        ],
        "description": "通过 kind 和 data 添加剧本文本或镜头等制作记录。文件内容请通过 /uploads 上传。",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/resources/{resource_id}": {
      "get": {
        "operationId": "getResource",
        "summary": "查看单个素材",
        "tags": [
          "项目与资源"
        ],
        "description": "返回项目中 resource_id 指定素材的类型、内容及 revision。",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateResource",
        "summary": "修改素材",
        "tags": [
          "项目与资源"
        ],
        "description": "更新素材的 kind 和 data。通过 If-Match 提交最新 ETag，避免编辑冲突。",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "使用最新响应的 ETag，包括引号。",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicResource"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "获取文件上传地址",
        "tags": [
          "上传"
        ],
        "description": "登记文件信息并返回 upload_url。将文件内容 PUT 到该地址后，调用上传完成接口。 支持 TXT、Markdown、DOCX、PNG、JPEG、WebP、AVIF、WAV 和 ZIP。文件大小限制与 Studio 共用设置，请查看 GET /capabilities 的 upload_limits。剧本最多 5,000,000 字符。文件名不能包含路径分隔符。WAV 须为 PCM 或 IEEE float。",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploadTicket"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads/{upload_id}/complete": {
      "post": {
        "operationId": "completeUpload",
        "summary": "告知文件已上传完成",
        "tags": [
          "上传"
        ],
        "description": "根据登记信息验证已上传文件，并返回可用于制作的素材信息。",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/assets/{asset_id}": {
      "get": {
        "operationId": "getAsset",
        "summary": "查看成果文件信息和下载链接",
        "tags": [
          "素材与结果"
        ],
        "description": "返回素材信息及可用时的签名 download_url。请在地址过期前下载文件。",
        "x-required-scope": "assets:read",
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/plans": {
      "post": {
        "operationId": "createPlan",
        "deprecated": true,
        "summary": "确认制作计划和预计积分",
        "tags": [
          "项目与资源"
        ],
        "description": "先确认要制作什么、预计消耗多少积分，不会真正开始制作。",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicPlan"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/runs": {
      "post": {
        "operationId": "createRun",
        "deprecated": true,
        "summary": "开始制作",
        "tags": [
          "项目与资源"
        ],
        "description": "执行 plan_id 对应的制作计划并返回执行 ID。通过 getRun 查看状态和结果。",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs": {
      "get": {
        "operationId": "listRuns",
        "summary": "查看制作列表",
        "tags": [
          "制作执行"
        ],
        "description": "列出制作执行记录，可按项目、状态、client_reference 和时间范围筛选。",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "running",
                "awaiting_review",
                "stopping",
                "paused",
                "needs_attention",
                "partially_succeeded",
                "succeeded",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRunPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}": {
      "get": {
        "operationId": "getRun",
        "summary": "查看制作进度",
        "tags": [
          "制作执行"
        ],
        "description": "返回制作执行的当前状态、版本及可用结果。提交决策时使用此版本。",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/steps": {
      "get": {
        "operationId": "listRunSteps",
        "summary": "按阶段查看进度",
        "tags": [
          "制作执行"
        ],
        "description": "列出执行中的各个步骤及状态，查看哪些阶段正在等待、运行或已完成。",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStepPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/events": {
      "get": {
        "operationId": "listRunEvents",
        "summary": "查看制作过程中的记录",
        "tags": [
          "制作执行"
        ],
        "description": "查询执行中的状态变化、审核请求等事件，用于追踪制作过程。",
        "x-required-scope": "runs:read",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRunEventPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/runs/{run_id}/decisions": {
      "post": {
        "operationId": "decideRun",
        "summary": "确认继续或中止",
        "tags": [
          "制作执行"
        ],
        "description": "对制作执行提交 approve、stop、resume、cancel_remaining 或 retry_result 决策。expected_version 须为最新版本。 retry_result 仅恢复已保存视频任务的结果查询。请提交最新 expected_version 和 step_id。保留原任务和额度预留，不重新生成。仅支持提交后 24 小时内可恢复的视频。其他结果或用量不明的任务需运营人员审核。",
        "x-required-scope": "runs:write",
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRun"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "operationId": "createJob",
        "deprecated": true,
        "summary": "只执行单个功能",
        "tags": [
          "工作流功能"
        ],
        "description": "不用跑完整流程，只挑一个功能立即执行。analyze_script 读取剧本并生成分镜，generate_image 生成角色、场景、道具和分镜图，generate_video 为已选好图片的分镜生成视频，assemble_video 把所有分镜都有视频的剧集拼接成片。请求里请始终带上项目最新的 revision。Live 请求会先预留积分。",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}": {
      "get": {
        "operationId": "getJob",
        "summary": "查看任务状态和结果",
        "tags": [
          "工作流功能"
        ],
        "description": "返回任务当前状态及输出素材 ID。完成后用 getAsset 获取结果文件。",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/requests": {
      "get": {
        "operationId": "listRequests",
        "summary": "查看已发送的请求记录",
        "tags": [
          "请求日志"
        ],
        "description": "查询 API 请求日志，包括 HTTP 状态和耗时。可按项目及时间范围筛选。",
        "x-required-scope": "requests:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "run_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "job_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status_code",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            }
          },
          {
            "name": "method",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "GET",
                "POST",
                "PATCH",
                "PUT"
              ]
            }
          },
          {
            "name": "route_template",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRequestLogPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/requests/{request_id}": {
      "get": {
        "operationId": "getRequest",
        "summary": "查看单条请求记录",
        "tags": [
          "请求日志"
        ],
        "description": "通过 request_id 查询一次 API 调用的 HTTP 状态、耗时及关联执行或任务。",
        "x-required-scope": "requests:read",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicRequestLog"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "查看积分使用量",
        "tags": [
          "用量"
        ],
        "description": "返回查询期间的用量汇总，包括预留和已结算金额。",
        "x-required-scope": "usage:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUsage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "查看 Webhook 通知地址列表",
        "tags": [
          "Webhook"
        ],
        "description": "列出已注册的 Webhook 地址、订阅事件及启用状态。",
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookEndpointPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "添加 Webhook 通知地址",
        "tags": [
          "Webhook"
        ],
        "description": "注册 Webhook 地址，以接收指定项目的所选制作事件。",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookIssued"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-endpoints/{endpoint_id}": {
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "summary": "修改 Webhook 通知地址",
        "tags": [
          "Webhook"
        ],
        "description": "启用或停用 Webhook，或更改接收的事件类型。",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "使用最新响应的 ETag，包括引号。",
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$",
              "example": "\"1\""
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookEndpoint"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "查看 Webhook 发送记录",
        "tags": [
          "Webhook 投递"
        ],
        "description": "列出 Webhook 投递尝试及状态，用于确认通知是否成功送达。",
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookDeliveryPage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/webhook-deliveries/{delivery_id}/redeliver": {
      "post": {
        "operationId": "redeliverWebhook",
        "summary": "重新发送 Webhook",
        "tags": [
          "Webhook 投递"
        ],
        "description": "请求重新投递 delivery_id 指定的已有 Webhook 通知。",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicWebhookDelivery"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/uploads/{upload_id}/content": {
      "put": {
        "operationId": "uploadContent",
        "summary": "上传文件内容",
        "tags": [
          "上传"
        ],
        "description": "为已有上传凭证发送 application/octet-stream 文件内容。成功后调用 completeUpload。",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploaded"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/workflow": {
      "get": {
        "operationId": "getStudioWorkflow",
        "summary": "查询工作室制作数据",
        "tags": [
          "项目与资源"
        ],
        "description": "一次查询项目的剧本、剧集、设计、场景、素材、镜次、剪辑选择及最新 revision。",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioWorkflow"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/workflow/commands": {
      "post": {
        "operationId": "executeStudioCommand",
        "deprecated": true,
        "summary": "编辑工作室制作",
        "tags": [
          "项目与资源"
        ],
        "description": "编辑剧本、场景、设计或镜次选择等制作数据。选择 operation，提交对应 input 和最新 revision。",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/analyses": {
      "post": {
        "operationId": "analyzeStudioScript",
        "summary": "分析工作室剧本",
        "tags": [
          "项目与资源"
        ],
        "description": "分析项目剧本并提取制作结构。传入 script_text 可先更新剧本；省略则使用已保存剧本。用 getJob 跟踪任务。",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioAnalysis"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/cut/exports": {
      "post": {
        "operationId": "exportStudioCut",
        "deprecated": true,
        "summary": "导出工作室剪辑",
        "tags": [
          "项目与资源"
        ],
        "description": "按剧集和场景顺序合并视频。用 selections 指定镜次，allow_partial 决定是否允许缺失场景。用 getJob 查询导出进度。",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioCutExport"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/storyboard/videos": {
      "post": {
        "operationId": "generateStudioVideo",
        "deprecated": true,
        "summary": "生成分镜场景视频",
        "tags": [
          "项目与资源"
        ],
        "description": "按所选模型、时长和分辨率为 scene_id 生成视频。anchor_asset_id 可指定起始图像。用 getJob 跟踪任务。",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioVideo"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/designs/images": {
      "post": {
        "operationId": "generateStudioImage",
        "deprecated": true,
        "summary": "生成角色、场景、道具或宫格图图片",
        "tags": [
          "项目与资源"
        ],
        "description": "为 design_id 生成一至四张图像，可设置提示词和参考图。选择主图或变体槽位，用 getJob 查询结果。",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioImage"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/builds": {
      "post": {
        "operationId": "buildStudioScript",
        "summary": "从剧本构建完整制作",
        "tags": [
          "项目与资源"
        ],
        "description": "使用已验证的 script_asset_ids 和 revision 构建剧本、参考资料和分镜。full_rebuild 替换现有结构。图像和视频需单独生成。 按与 Studio 相同的价格结算实际返回的输入和输出令牌。无需设置单次请求的积分预算。 GET /jobs/{job_id} → output_asset_ids.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioBuild"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/library": {
      "get": {
        "operationId": "listStudioLibrary",
        "summary": "查询共享素材库",
        "tags": [
          "项目与资源"
        ],
        "description": "查询可导入项目的素材。scope=personal 查询个人素材库，默认 scope=studio 查询共享素材库。",
        "x-required-scope": "assets:read",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "schema": {
              "type": "string",
              "enum": [
                "studio",
                "personal"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioLibrary"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/imports": {
      "post": {
        "operationId": "importStudioAsset",
        "summary": "将素材导入作品",
        "tags": [
          "项目与资源"
        ],
        "description": "将 asset_id 指定的个人或共享素材复制到项目并返回副本。原始素材后续修改或删除不影响副本。",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioImport"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicAsset"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{project_id}/script/drafts": {
      "post": {
        "operationId": "draftStudioScript",
        "summary": "生成剧本初稿",
        "tags": [
          "项目与资源"
        ],
        "description": "传入 instructions、可选的 source_text、revision 和 max_output_tokens。保存为新剧本资料，不覆盖现有剧本。 按与 Studio 相同的价格结算实际返回的输入和输出令牌。无需设置单次请求的积分预算。 GET /jobs/{job_id} → output_asset_ids.",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StudioDraft"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}/build": {
      "get": {
        "operationId": "getStudioBuildProgress",
        "summary": "查询自动构建进度及资料",
        "tags": [
          "工作流功能"
        ],
        "description": "查询剧本自动构建任务的阶段、进度消息、原始资料及处理用文本。",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioBuildProgress"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters": {
      "get": {
        "operationId": "listCharacters",
        "summary": "角色 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 查询 (list). GET /api/v1/works/{work_id}/characters. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createCharacter",
        "summary": "角色 · 创建",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 创建. POST /api/v1/works/{work_id}/characters. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}": {
      "get": {
        "operationId": "getCharacter",
        "summary": "角色 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 查询. GET /api/v1/works/{work_id}/characters/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateCharacter",
        "summary": "角色 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 更新. PATCH /api/v1/works/{work_id}/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteCharacter",
        "summary": "角色 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 删除. DELETE /api/v1/works/{work_id}/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}/primary-image": {
      "put": {
        "operationId": "setCharacterImage",
        "summary": "角色 · 设置参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 设置参考图. PUT /api/v1/works/{work_id}/characters/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setCharacterImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/characters/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateCharacterImage",
        "summary": "角色 · 生成参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 生成参考图. POST /api/v1/works/{work_id}/characters/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateCharacterImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}": {
      "put": {
        "operationId": "attachSceneCharacter",
        "summary": "角色 · 关联到场景",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 关联到场景. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneCharacter",
        "summary": "角色 · 取消场景关联",
        "tags": [
          "项目与资源"
        ],
        "description": "角色 · 取消场景关联. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/characters/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneCharacterInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes": {
      "get": {
        "operationId": "listBackgroundScenes",
        "summary": "背景场景 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 查询 (list). GET /api/v1/works/{work_id}/background-scenes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createBackgroundScene",
        "summary": "背景场景 · 创建",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 创建. POST /api/v1/works/{work_id}/background-scenes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}": {
      "get": {
        "operationId": "getBackgroundScene",
        "summary": "背景场景 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 查询. GET /api/v1/works/{work_id}/background-scenes/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateBackgroundScene",
        "summary": "背景场景 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 更新. PATCH /api/v1/works/{work_id}/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteBackgroundScene",
        "summary": "背景场景 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 删除. DELETE /api/v1/works/{work_id}/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}/primary-image": {
      "put": {
        "operationId": "setBackgroundSceneImage",
        "summary": "背景场景 · 设置参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 设置参考图. PUT /api/v1/works/{work_id}/background-scenes/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setBackgroundSceneImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/background-scenes/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateBackgroundSceneImage",
        "summary": "背景场景 · 生成参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 生成参考图. POST /api/v1/works/{work_id}/background-scenes/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateBackgroundSceneImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}": {
      "put": {
        "operationId": "attachSceneBackgroundScene",
        "summary": "背景场景 · 关联到场景",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 关联到场景. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneBackgroundScene",
        "summary": "背景场景 · 取消场景关联",
        "tags": [
          "项目与资源"
        ],
        "description": "背景场景 · 取消场景关联. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/background-scenes/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneBackgroundSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props": {
      "get": {
        "operationId": "listProps",
        "summary": "道具 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 查询 (list). GET /api/v1/works/{work_id}/props. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createProp",
        "summary": "道具 · 创建",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 创建. POST /api/v1/works/{work_id}/props. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createPropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}": {
      "get": {
        "operationId": "getProp",
        "summary": "道具 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 查询. GET /api/v1/works/{work_id}/props/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateProp",
        "summary": "道具 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 更新. PATCH /api/v1/works/{work_id}/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updatePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteProp",
        "summary": "道具 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 删除. DELETE /api/v1/works/{work_id}/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deletePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}/primary-image": {
      "put": {
        "operationId": "setPropImage",
        "summary": "道具 · 设置参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 设置参考图. PUT /api/v1/works/{work_id}/props/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setPropImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/props/{reference_id}/image-generations": {
      "post": {
        "operationId": "generatePropImage",
        "summary": "道具 · 生成参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 生成参考图. POST /api/v1/works/{work_id}/props/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generatePropImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}": {
      "put": {
        "operationId": "attachSceneProp",
        "summary": "道具 · 关联到场景",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 关联到场景. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachScenePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneProp",
        "summary": "道具 · 取消场景关联",
        "tags": [
          "项目与资源"
        ],
        "description": "道具 · 取消场景关联. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/props/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachScenePropInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids": {
      "get": {
        "operationId": "listGrids",
        "summary": "网格 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 查询 (list). GET /api/v1/works/{work_id}/grids. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReferencePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createGrid",
        "summary": "网格 · 创建",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 创建. POST /api/v1/works/{work_id}/grids. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}": {
      "get": {
        "operationId": "getGrid",
        "summary": "网格 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 查询. GET /api/v1/works/{work_id}/grids/{reference_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicReference"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateGrid",
        "summary": "网格 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 更新. PATCH /api/v1/works/{work_id}/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteGrid",
        "summary": "网格 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 删除. DELETE /api/v1/works/{work_id}/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}/primary-image": {
      "put": {
        "operationId": "setGridImage",
        "summary": "网格 · 设置参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 设置参考图. PUT /api/v1/works/{work_id}/grids/{reference_id}/primary-image. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setGridImageInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/grids/{reference_id}/image-generations": {
      "post": {
        "operationId": "generateGridImage",
        "summary": "网格 · 生成参考图",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 生成参考图. POST /api/v1/works/{work_id}/grids/{reference_id}/image-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateGridImageInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}": {
      "put": {
        "operationId": "attachSceneGrid",
        "summary": "网格 · 关联到场景",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 关联到场景. PUT /api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/attachSceneGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "detachSceneGrid",
        "summary": "网格 · 取消场景关联",
        "tags": [
          "项目与资源"
        ],
        "description": "网格 · 取消场景关联. DELETE /api/v1/works/{work_id}/scenes/{scene_id}/references/grids/{reference_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reference_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/detachSceneGridInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes": {
      "get": {
        "operationId": "listEpisodes",
        "summary": "集 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "集 · 查询 (list). GET /api/v1/works/{work_id}/episodes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicEpisodePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createEpisode",
        "summary": "创建集",
        "tags": [
          "项目与资源"
        ],
        "description": "创建集. POST /api/v1/works/{work_id}/episodes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}": {
      "get": {
        "operationId": "getEpisode",
        "summary": "集 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "集 · 查询. GET /api/v1/works/{work_id}/episodes/{episode_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicEpisode"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateEpisode",
        "summary": "集 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "集 · 更新. PATCH /api/v1/works/{work_id}/episodes/{episode_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "deleteEpisode",
        "summary": "集 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "集 · 删除. DELETE /api/v1/works/{work_id}/episodes/{episode_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteEpisodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scenes": {
      "get": {
        "operationId": "listScenes",
        "summary": "场景 · 查询 (list)",
        "tags": [
          "项目与资源"
        ],
        "description": "场景 · 查询 (list). GET /api/v1/works/{work_id}/episodes/{episode_id}/scenes. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicScenePage"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createScene",
        "summary": "创建场景",
        "tags": [
          "项目与资源"
        ],
        "description": "创建场景. POST /api/v1/works/{work_id}/episodes/{episode_id}/scenes. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}": {
      "get": {
        "operationId": "getScene",
        "summary": "场景 · 查询",
        "tags": [
          "项目与资源"
        ],
        "description": "场景 · 查询. GET /api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}. GET",
        "x-required-scope": "projects:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicScene"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateScene",
        "summary": "场景 · 更新",
        "tags": [
          "项目与资源"
        ],
        "description": "场景 · 更新. PATCH /api/v1/works/{work_id}/episodes/{episode_id}/scenes/{scene_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/archive-imports": {
      "post": {
        "operationId": "createArchiveImport",
        "summary": "导入ZIP资料",
        "tags": [
          "项目与资源"
        ],
        "description": "导入ZIP资料. POST /api/v1/works/{work_id}/archive-imports. Use a verified ZIP asset_id and current revision. Preserves the archive and uses the same name-based material update rules as Studio. Check imported, failed and asset_ids on completion. Creation requires jobs:create, assets:read, assets:write and projects:write. Idempotency-Key; GET /api/v1/works/{work_id}/archive-imports/{import_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createArchiveImportInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicArchiveImport"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/archive-imports/{import_id}": {
      "get": {
        "operationId": "getArchiveImport",
        "summary": "查询ZIP导入进度",
        "tags": [
          "项目与资源"
        ],
        "description": "查询ZIP导入进度. GET /api/v1/works/{work_id}/archive-imports/{import_id}. Use a verified ZIP asset_id and current revision. Preserves the archive and uses the same name-based material update rules as Studio. Check imported, failed and asset_ids on completion. Creation requires jobs:create, assets:read, assets:write and projects:write. jobs:read",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "import_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicArchiveImport"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/uploads": {
      "post": {
        "operationId": "createWorkUploads",
        "summary": "准备批量上传文件",
        "tags": [
          "项目与资源"
        ],
        "description": "准备批量上传文件. POST /api/v1/works/{work_id}/uploads. Idempotency-Key + files (1–20) → PUT upload_url → POST /api/v1/uploads/{upload_id}/complete",
        "x-required-scope": "assets:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createWorkUploadsInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicUploadBatch"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}": {
      "delete": {
        "operationId": "deleteScene",
        "summary": "场景 · 删除",
        "tags": [
          "项目与资源"
        ],
        "description": "场景 · 删除. DELETE /api/v1/works/{work_id}/scenes/{scene_id}. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/deleteSceneInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/episodes/{episode_id}/scene-order": {
      "put": {
        "operationId": "reorderScenes",
        "summary": "调整场景顺序",
        "tags": [
          "项目与资源"
        ],
        "description": "调整场景顺序. PUT /api/v1/works/{work_id}/episodes/{episode_id}/scene-order. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "episode_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/reorderScenesInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/script": {
      "put": {
        "operationId": "saveScript",
        "summary": "保存剧本",
        "tags": [
          "项目与资源"
        ],
        "description": "保存剧本. PUT /api/v1/works/{work_id}/script. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/saveScriptInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/video-generations": {
      "post": {
        "operationId": "generateSceneVideo",
        "summary": "生成场景视频",
        "tags": [
          "项目与资源"
        ],
        "description": "生成场景视频. POST /api/v1/works/{work_id}/scenes/{scene_id}/video-generations. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/generateSceneVideoInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/scenes/{scene_id}/selected-take": {
      "put": {
        "operationId": "selectSceneTake",
        "summary": "选择最终镜头",
        "tags": [
          "项目与资源"
        ],
        "description": "选择最终镜头. PUT /api/v1/works/{work_id}/scenes/{scene_id}/selected-take. revision + Idempotency-Key",
        "x-required-scope": "projects:write",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scene_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/selectSceneTakeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicStudioMutation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/works/{work_id}/exports": {
      "post": {
        "operationId": "exportWork",
        "summary": "导出最终视频",
        "tags": [
          "项目与资源"
        ],
        "description": "导出最终视频. POST /api/v1/works/{work_id}/exports. revision + Idempotency-Key → GET /api/v1/jobs/{job_id}",
        "x-required-scope": "jobs:create",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "重试时使用相同的 Idempotency-Key 和请求体。",
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/exportWorkInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "成功",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "ETag": {
                "description": "可修改资源的版本。",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "建议轮询间隔，单位为秒。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublicJob"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "openapiDocument",
        "summary": "下载 API 规范",
        "description": "下载包含 API 路径、请求字段和响应结构的 OpenAPI 规范。",
        "tags": [
          "规范"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 规范",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/downloads/{asset_id}": {
      "get": {
        "operationId": "downloadAsset",
        "summary": "下载完成的文件",
        "tags": [
          "素材与结果"
        ],
        "security": [],
        "description": "使用 getAsset 返回的完整签名 download_url 下载文件。链接五分钟后过期。",
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expires",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signature",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "文件字节",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    }
  },
  "openapi": "3.1.0",
  "info": {
    "title": "FECINE Open API",
    "version": "1.1.0",
    "description": "FECINE 制作工作流 API。无需登录即可阅读，使用 FECINE API Key 执行请求。GET /capabilities 返回可用功能。Live 消耗积分，沙盒返回测试数据。重试 POST 时必须复用 Idempotency-Key。本文档从实际请求和响应契约生成。"
  },
  "servers": [
    {
      "url": "/",
      "description": "当前 FECINE 服务"
    }
  ],
  "security": [
    {
      "PartnerApiKey": []
    }
  ],
  "components": {
    "responses": {
      "ApiError": {
        "description": "返回 2xx 表示请求已被接受。201 表示已创建，202 表示已受理、还在处理，此时还没有结果，请轮询任务状态确认是否完成。\n成功响应都包含 request_id 和 data，只有文件下载和 API 规范响应例外。\n失败时，所有接口都返回结构相同的 error。程序里请用 error.code 做分支，message 是写给人看的原因和处理方法。\n能不能重发，看 retryable：只有为 true 时才自动重试，并按 retry_after_seconds 或 Retry-After 指定的时间等待后再发送。重试 POST 时请使用与第一次相同的 Idempotency-Key 和请求体，以免重复扣费或重复生成。\n遇到不认识的 error.code，按 HTTP 状态码和 retryable 处理即可。联系支持时请提供 request_id。任务受理之后发生的失败，请在任务状态和结果里查看，而不是在这个响应里。",
        "headers": {
          "X-Request-Id": {
            "description": "Request identifier for support.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "Retry-After": {
            "description": "Optional retry delay in seconds; check error.retryable.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "request_id": "11111111-1111-4111-8111-111111111111",
              "error": {
                "code": "INVALID_REQUEST",
                "message": "Invalid input. Check the required fields, types and values.",
                "retryable": false
              }
            }
          }
        },
        "x-error-codes": [
          {
            "code": "INVALID_REFERENCE",
            "status": "422",
            "description": "A selected reference is unavailable or does not belong to this project. Select a ready image from this project."
          },
          {
            "code": "MODEL_UNAVAILABLE",
            "status": "422",
            "description": "The selected model is unavailable. Refresh the model list and select another model."
          },
          {
            "code": "MODEL_POLICY_REQUIRED",
            "status": "503",
            "description": "No default model policy is configured. Specify a model or ask the administrator to configure the task policy."
          },
          {
            "code": "BUILD_REPLAY_CONFLICT",
            "status": "409",
            "description": "The build inputs changed. Review the saved build before continuing."
          },
          {
            "code": "INVALID_REQUEST",
            "status": "400,422",
            "description": "Invalid input. Check the required fields, types and values."
          },
          {
            "code": "INVALID_API_KEY",
            "status": "401",
            "description": "Invalid credentials or download signature. Check the API key or obtain a new download URL."
          },
          {
            "code": "INSUFFICIENT_SCOPE",
            "status": "403",
            "description": "Permission denied. Check the key scopes and project access."
          },
          {
            "code": "PARTNER_BLOCKED",
            "status": "403",
            "description": "Account blocked. Contact support."
          },
          {
            "code": "PARTNER_PAUSED",
            "status": "403",
            "description": "Account paused. Ask the administrator to resume access."
          },
          {
            "code": "RESOURCE_NOT_FOUND",
            "status": "404",
            "description": "Resource unavailable. Check its ID and access permissions."
          },
          {
            "code": "METHOD_NOT_ALLOWED",
            "status": "405",
            "description": "Unsupported HTTP method. Use the documented method."
          },
          {
            "code": "REQUEST_TIMEOUT",
            "status": "408",
            "description": "Request body timed out. Check the connection and upload size."
          },
          {
            "code": "IDEMPOTENCY_KEY_REQUIRED",
            "status": "400",
            "description": "Provide a valid Idempotency-Key header."
          },
          {
            "code": "IDEMPOTENCY_CONFLICT",
            "status": "409",
            "description": "This Idempotency-Key belongs to a different request. Reuse it only with the original request."
          },
          {
            "code": "IDEMPOTENCY_KEY_EXPIRED",
            "status": "409",
            "description": "Idempotency record expired. Check the original result before starting a new operation."
          },
          {
            "code": "PRECONDITION_FAILED",
            "status": "412",
            "description": "Provide the latest quoted ETag in If-Match."
          },
          {
            "code": "REVISION_CONFLICT",
            "status": "409",
            "description": "Resource changed. Read the latest revision before updating."
          },
          {
            "code": "RESOURCE_CONFLICT",
            "status": "409",
            "description": "Resource conflicts with existing data. Review the current resource."
          },
          {
            "code": "INVALID_TRANSITION",
            "status": "409",
            "description": "Action is unavailable in the current state. Read the latest state."
          },
          {
            "code": "RUN_IN_PROGRESS",
            "status": "409",
            "description": "A run is in progress. Check its status before starting another."
          },
          {
            "code": "JOB_RUNNING",
            "status": "409",
            "description": "A job is running. Wait for completion before editing."
          },
          {
            "code": "PLAN_EXPIRED",
            "status": "409",
            "description": "Plan expired. Create a new plan and review its quote."
          },
          {
            "code": "INSUFFICIENT_CREDITS",
            "status": "402",
            "description": "Insufficient credits. Check the balance and required credits."
          },
          {
            "code": "BUDGET_EXCEEDED",
            "status": "409,429",
            "description": "Budget limit exceeded. Review usage and the configured budget."
          },
          {
            "code": "RATE_LIMITED",
            "status": "429",
            "description": "Request rate exceeded. Follow retryable and Retry-After before retrying."
          },
          {
            "code": "CAPACITY_EXCEEDED",
            "status": "429",
            "description": "Capacity limit exceeded. Reduce the workload or wait for active work to finish."
          },
          {
            "code": "PAYLOAD_TOO_LARGE",
            "status": "413",
            "description": "Request body too large. Reduce it to the documented limit."
          },
          {
            "code": "UNSUPPORTED_MEDIA_TYPE",
            "status": "415",
            "description": "Unsupported content type or encoding. Use the documented Content-Type without Content-Encoding."
          },
          {
            "code": "UPLOAD_TOO_LARGE",
            "status": "422",
            "description": "Uploaded content exceeds its processing limit. Reduce the file size."
          },
          {
            "code": "UPLOAD_NOT_VERIFIED",
            "status": "422",
            "description": "Upload is incomplete, expired or invalid. Check the upload and verification steps."
          },
          {
            "code": "ASSET_KIND_MISMATCH",
            "status": "422",
            "description": "Asset type does not match the operation. Select a compatible asset."
          },
          {
            "code": "SELECTED_IMAGE_REQUIRED",
            "status": "422",
            "description": "Select a valid image before generating video."
          },
          {
            "code": "SELECTED_VIDEO_REQUIRED",
            "status": "422",
            "description": "Select valid videos for the requested shots before assembly."
          },
          {
            "code": "REFERENCE_LIMIT_EXCEEDED",
            "status": "422",
            "description": "Too many reference assets. Reduce them to the model limit."
          },
          {
            "code": "REFERENCE_IMAGE_REQUIRED",
            "status": "422",
            "description": "This model requires a reference image. Add an image or select a text-to-image model."
          },
          {
            "code": "INVALID_GENERATION_OPTIONS",
            "status": "422",
            "description": "Generation options are invalid. Check the model capabilities."
          },
          {
            "code": "PROMPT_REQUIRED",
            "status": "422",
            "description": "Provide a generation prompt."
          },
          {
            "code": "SCRIPT_TEXT_REQUIRED",
            "status": "422",
            "description": "Provide script text before starting this operation."
          },
          {
            "code": "SCENES_REQUIRED",
            "status": "422",
            "description": "Create scenes before starting this operation."
          },
          {
            "code": "VARIANT_NAME_REQUIRED",
            "status": "422",
            "description": "Provide a variant name."
          },
          {
            "code": "EPISODE_ALREADY_STRUCTURED",
            "status": "409",
            "description": "Episode already has shots. Review its existing structure."
          },
          {
            "code": "ONE_SCRIPT_PER_PROJECT",
            "status": "409",
            "description": "This project supports one script. Use the existing script."
          },
          {
            "code": "MULTIPLE_SCRIPTS_REQUIRE_REVIEW",
            "status": "409",
            "description": "Multiple scripts need review before continuing."
          },
          {
            "code": "NATIVE_CONTENT_ALREADY_EXISTS",
            "status": "409",
            "description": "Studio content already exists. Review it before continuing."
          },
          {
            "code": "LIVE_PROJECT_REQUIRED",
            "status": "409",
            "description": "This operation requires a live project."
          },
          {
            "code": "STUDIO_MIGRATION_REQUIRED",
            "status": "409",
            "description": "Project needs Studio migration. Contact support."
          },
          {
            "code": "UNSUPPORTED_CAPABILITY",
            "status": "422",
            "description": "Unsupported operation or profile. Check GET /capabilities."
          },
          {
            "code": "CAPABILITY_UNAVAILABLE",
            "status": "503",
            "description": "Capability currently unavailable. Check GET /capabilities."
          },
          {
            "code": "API_NOT_ACCEPTING",
            "status": "503",
            "description": "New requests are paused. Check service availability."
          },
          {
            "code": "DEPENDENCY_UNAVAILABLE",
            "status": "503",
            "description": "A required service is unavailable. Follow the retry guidance or contact support."
          },
          {
            "code": "PRICING_UNAVAILABLE",
            "status": "503",
            "description": "Pricing unavailable. A valid quote is required to proceed."
          },
          {
            "code": "MEDIA_TOOLS_UNAVAILABLE",
            "status": "503",
            "description": "Media processing unavailable. Contact support."
          },
          {
            "code": "STORAGE_READ_FAILED",
            "status": "503",
            "description": "Could not read the stored asset. Contact support with request_id."
          },
          {
            "code": "STORAGE_WRITE_FAILED",
            "status": "503",
            "description": "Could not save the asset. Check the result before retrying."
          },
          {
            "code": "INTERNAL_ERROR",
            "status": "500",
            "description": "Internal error. Follow retry guidance; include request_id when contacting support."
          },
          {
            "code": "RESPONSE_CONTRACT_VIOLATION",
            "status": "500",
            "description": "Server response validation failed. Contact support with request_id."
          },
          {
            "code": "INVALID_EXECUTION_CONTEXT",
            "status": "500",
            "description": "Execution context is invalid. Contact support."
          },
          {
            "code": "RETRY_TRANSACTION",
            "status": "503",
            "description": "Transaction could not complete. Follow the response retry guidance."
          },
          {
            "code": "CLAIM_LOST",
            "status": "409",
            "description": "Execution ownership changed. Check the current job state."
          },
          {
            "code": "PROVIDER_TIMEOUT",
            "status": "504",
            "description": "Generation service timed out. Check the existing job before submitting again."
          },
          {
            "code": "PROVIDER_TERMINAL_FAILURE",
            "status": "422",
            "description": "Generation failed. Review the job result and inputs."
          },
          {
            "code": "PROVIDER_RESULT_UNAVAILABLE",
            "status": "502",
            "description": "Generation result unavailable. Check the existing job and recovery options."
          },
          {
            "code": "INVALID_RESULT",
            "status": "422,503",
            "description": "Result failed validation. Review the job or contact support."
          },
          {
            "code": "RESULT_TOO_LARGE",
            "status": "422",
            "description": "Result exceeds the processing limit. Reduce the requested output."
          },
          {
            "code": "EXPORT_TOO_LARGE",
            "status": "422",
            "description": "Export exceeds the size limit. Reduce the export selection."
          },
          {
            "code": "RECOVERY_BACKOFF",
            "status": "409",
            "description": "Existing result recovery is delayed. Check again later; do not resubmit generation."
          },
          {
            "code": "VIDEO_RECOVERY_REVIEW_REQUIRED",
            "status": "503",
            "description": "The original video task needs scheduled recovery or operator review. Do not resubmit generation."
          },
          {
            "code": "RESULT_RECOVERY_REQUIRED",
            "status": "409,503",
            "description": "Existing result needs recovery. Check the run recovery options before resubmitting."
          },
          {
            "code": "RESULT_NOT_RECOVERABLE",
            "status": "409",
            "description": "Result cannot be recovered through this action. Review the run or contact support."
          },
          {
            "code": "RECOVERY_CAPACITY_EXCEEDED",
            "status": "409",
            "description": "Recovery limit reached. Contact support before further recovery attempts."
          },
          {
            "code": "USAGE_RECOVERY_REQUIRED",
            "status": "503",
            "description": "Usage needs reconciliation. Contact support; do not resubmit generation blindly."
          }
        ]
      }
    },
    "securitySchemes": {
      "PartnerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "FECINE API Key",
        "description": "输入您的 fec_live_* 或 fec_test_* FECINE 密钥。"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable error identifier. See components.responses.ApiError.x-error-codes; handle unknown codes safely."
              },
              "message": {
                "type": "string",
                "description": "Human-readable cause and action. Use code, not message, for program logic."
              },
              "retryable": {
                "type": "boolean",
                "description": "Whether automatic retry is allowed. Do not infer this from the HTTP status alone."
              },
              "retry_after_seconds": {
                "type": "integer",
                "minimum": 1,
                "description": "Wait at least this many seconds before an allowed retry."
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "error"
        ],
        "additionalProperties": false
      },
      "Money": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "micro_units": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        },
        "required": [
          "currency",
          "micro_units"
        ],
        "additionalProperties": false
      },
      "ProjectCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ProjectPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "additionalProperties": false,
        "description": "至少需要一个字段。"
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "revision",
          "state",
          "created_at",
          "client_reference"
        ],
        "additionalProperties": false
      },
      "ResourceInput": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "script"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 900000
                  },
                  "source_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "language": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 16
                  }
                },
                "required": [
                  "language"
                ],
                "additionalProperties": false,
                "description": "text 和 source_asset_id 必须且只能提供一个。"
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "character"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "scene"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "prop"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "reference_asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  }
                },
                "required": [
                  "description"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "episode"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "script_resource_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "raw_content": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "script_resource_id",
                  "sequence"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "shot"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "data": {
                "type": "object",
                "properties": {
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "character_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  },
                  "prop_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 8,
                    "default": []
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "video_prompt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "duration_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60
                  },
                  "selected_image_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "selected_video_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "episode_id",
                  "description",
                  "duration_seconds"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "name",
              "data"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Resource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "content": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "script"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 900000
                      },
                      "source_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "language": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 16
                      }
                    },
                    "required": [
                      "language"
                    ],
                    "additionalProperties": false,
                    "description": "text 和 source_asset_id 必须且只能提供一个。"
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "character"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "scene"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "prop"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "episode"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "script_resource_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "raw_content": {
                        "type": "string",
                        "maxLength": 20000
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      }
                    },
                    "required": [
                      "script_resource_id",
                      "sequence"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shot"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "episode_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "scene_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "character_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "prop_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "video_prompt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 4000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "duration_seconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "selected_image_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "selected_video_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "episode_id",
                      "description",
                      "duration_seconds"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "project_id",
          "revision",
          "content",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Capability": {
        "type": "object",
        "properties": {
          "studio_workflow": {
            "type": "object",
            "properties": {
              "equivalent": {
                "type": "boolean"
              },
              "stages": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "script",
                    "designs",
                    "storyboard",
                    "cut"
                  ]
                }
              },
              "project_access": {
                "type": "string",
                "enum": [
                  "read_only",
                  "read_write",
                  "mixed"
                ]
              },
              "gaps": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "operations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "enabled"
                  ],
                  "additionalProperties": false
                },
                "default": []
              },
              "commands": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "image_models": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "aspect_ratios": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "image_sizes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "max_reference_images": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "max_variants": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "id",
                    "enabled",
                    "aspect_ratios",
                    "image_sizes",
                    "max_reference_images",
                    "max_variants"
                  ],
                  "additionalProperties": false
                },
                "default": []
              }
            },
            "required": [
              "equivalent",
              "stages",
              "project_access",
              "gaps"
            ],
            "additionalProperties": false
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "output_profiles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "max_shots": {
            "type": "integer",
            "minimum": 1
          },
          "max_episode_seconds": {
            "type": "integer",
            "minimum": 1
          },
          "upload_mime_types": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "max_upload_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "upload_limits": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          },
          "job_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "analyze_script",
                "generate_image",
                "generate_video",
                "assemble_video"
              ]
            }
          },
          "operations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "type",
                "enabled"
              ],
              "additionalProperties": false
            }
          },
          "image_size": {
            "type": "string"
          },
          "max_reference_images": {
            "type": "integer"
          }
        },
        "required": [
          "studio_workflow",
          "template_id",
          "template_version",
          "enabled",
          "stages",
          "output_profiles",
          "unsupported_reasons",
          "max_shots",
          "max_episode_seconds",
          "upload_mime_types",
          "max_upload_bytes"
        ],
        "additionalProperties": false
      },
      "PlanInput": {
        "type": "object",
        "properties": {
          "template_id": {
            "type": "string",
            "const": "episode-production"
          },
          "template_version": {
            "type": "number",
            "const": 1
          },
          "project_revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "episode_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 10,
            "description": "剧集 ID 不可重复。"
          },
          "mode": {
            "type": "string",
            "enum": [
              "reviewed",
              "automatic"
            ]
          },
          "output_profile": {
            "type": "string",
            "enum": [
              "sandbox-episode-v1",
              "episode-standard-v1"
            ]
          }
        },
        "required": [
          "template_id",
          "template_version",
          "project_revision",
          "episode_ids",
          "mode",
          "output_profile"
        ],
        "additionalProperties": false
      },
      "PlannedStep": {
        "type": "object",
        "properties": {
          "stage_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "target_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "depends_on": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "requires_review": {
            "type": "boolean"
          },
          "max_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "stage_key",
          "target_ids",
          "depends_on",
          "requires_review",
          "max_cost"
        ],
        "additionalProperties": false
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "minimum": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "executable": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "budget_ceiling": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "depends_on": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "requires_review": {
                  "type": "boolean"
                },
                "max_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "stage_key",
                "target_ids",
                "depends_on",
                "requires_review",
                "max_cost"
              ],
              "additionalProperties": false
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "project_revision",
          "template_id",
          "template_version",
          "executable",
          "expires_at",
          "budget_ceiling",
          "steps",
          "unsupported_reasons"
        ],
        "additionalProperties": false
      },
      "RunInput": {
        "type": "object",
        "properties": {
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "plan_id"
        ],
        "additionalProperties": false
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budget_remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "unresolved_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "plan_id",
          "version",
          "state",
          "client_reference",
          "created_at",
          "completed_at",
          "budget_remaining",
          "committed_cost",
          "unresolved_cost",
          "output_asset_ids"
        ],
        "additionalProperties": false
      },
      "Step": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "stage_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "target_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "blocked",
              "ready",
              "queued",
              "running",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "unknown"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "ordinal": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "run_id",
          "stage_key",
          "target_id",
          "job_id",
          "state",
          "output_asset_ids",
          "error_code",
          "ordinal"
        ],
        "additionalProperties": false
      },
      "RunEvent": {
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "type": {
            "type": "string",
            "enum": [
              "run.state_changed",
              "run.review_required",
              "run.result_ready",
              "run.needs_attention"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "step_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "event_id",
          "run_id",
          "sequence",
          "type",
          "state",
          "step_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "DecisionInput": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "stop",
              "resume",
              "cancel_remaining",
              "retry_result"
            ],
            "description": "retry_result resumes result polling for an accepted Studio video on the original reservation; requires step_id and expected_version. It never resubmits generation. Unconfirmed usage without a saved video task requires operator review."
          },
          "expected_version": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "step_id": {
            "type": "string",
            "format": "uuid"
          },
          "selected_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 10
          }
        },
        "required": [
          "action",
          "expected_version"
        ],
        "additionalProperties": false
      },
      "JobInput": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "target_id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "analyze_script",
              "generate_image",
              "generate_video",
              "assemble_video"
            ]
          },
          "profile_id": {
            "type": "string",
            "maxLength": 100
          },
          "client_reference": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "project_id",
          "project_revision",
          "target_id",
          "type",
          "profile_id"
        ],
        "additionalProperties": false
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "ready",
              "blocked",
              "processing",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "needs_review"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "resource_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "project_id",
          "run_id",
          "state",
          "output_asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "UploadInput": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[^\\\\/\\x00-\\x1f]+$"
          },
          "mime_type": {
            "type": "string",
            "enum": [
              "text/plain",
              "text/markdown",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/avif",
              "audio/wav",
              "application/zip"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1073741824
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "project_id",
          "filename",
          "mime_type",
          "size_bytes",
          "sha256"
        ],
        "additionalProperties": false,
        "description": "支持 TXT、Markdown、DOCX、PNG、JPEG、WebP、AVIF、WAV 和 ZIP。文件大小限制与 Studio 共用设置，请查看 GET /capabilities 的 upload_limits。剧本最多 5,000,000 字符。文件名不能包含路径分隔符。WAV 须为 PCM 或 IEEE float。"
      },
      "UploadTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "asset_id",
          "upload_url",
          "method",
          "content_type",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "ready",
              "errored",
              "expired"
            ]
          },
          "mime_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "project_id",
          "state",
          "mime_type",
          "size_bytes",
          "download_url",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "RequestLog": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PATCH",
              "PUT"
            ]
          },
          "route_template": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "status_code": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "actor_kind": {
            "type": "string",
            "enum": [
              "api_key",
              "console"
            ]
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "request_id",
          "created_at",
          "method",
          "route_template",
          "status_code",
          "duration_ms",
          "actor_kind",
          "project_id",
          "run_id",
          "job_id",
          "replayed",
          "error_code"
        ],
        "additionalProperties": false
      },
      "Usage": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "http_requests": {
            "type": "integer",
            "minimum": 0
          },
          "runs": {
            "type": "integer",
            "minimum": 0
          },
          "jobs": {
            "type": "integer",
            "minimum": 0
          },
          "reserved": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "unresolved": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "amount_basis": {
            "type": "string",
            "enum": [
              "partner_limit"
            ]
          },
          "billing_mode": {
            "type": "string",
            "enum": [
              "pilot",
              "contract"
            ]
          }
        },
        "required": [
          "period_start",
          "period_end",
          "as_of",
          "http_requests",
          "runs",
          "jobs",
          "reserved",
          "committed",
          "unresolved",
          "remaining",
          "amount_basis",
          "billing_mode"
        ],
        "additionalProperties": false
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            },
            "minItems": 1,
            "maxItems": 4
          }
        },
        "required": [
          "url",
          "project_ids",
          "events"
        ],
        "additionalProperties": false
      },
      "WebhookPatch": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            },
            "minItems": 1,
            "maxItems": 4
          }
        },
        "additionalProperties": false,
        "description": "至少需要一个字段。"
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "project_ids",
          "events",
          "enabled",
          "verified",
          "secret_version",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WebhookIssued": {
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "project_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                }
              },
              "enabled": {
                "type": "boolean"
              },
              "verified": {
                "type": "boolean"
              },
              "secret_version": {
                "type": "integer",
                "minimum": 1
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "url",
              "project_ids",
              "events",
              "enabled",
              "verified",
              "secret_version",
              "created_at"
            ],
            "additionalProperties": false
          },
          "signing_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "endpoint"
        ],
        "additionalProperties": false
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "retrying",
              "exhausted"
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "state",
          "attempt",
          "http_status",
          "next_attempt_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Empty": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "CapabilityPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "studio_workflow": {
                  "type": "object",
                  "properties": {
                    "equivalent": {
                      "type": "boolean"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "script",
                          "designs",
                          "storyboard",
                          "cut"
                        ]
                      }
                    },
                    "project_access": {
                      "type": "string",
                      "enum": [
                        "read_only",
                        "read_write",
                        "mixed"
                      ]
                    },
                    "gaps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "path",
                          "enabled"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    },
                    "commands": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "image_models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "aspect_ratios": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "image_sizes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "max_reference_images": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "max_variants": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "enabled",
                          "aspect_ratios",
                          "image_sizes",
                          "max_reference_images",
                          "max_variants"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    }
                  },
                  "required": [
                    "equivalent",
                    "stages",
                    "project_access",
                    "gaps"
                  ],
                  "additionalProperties": false
                },
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "template_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "enabled": {
                  "type": "boolean"
                },
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "output_profiles": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "unsupported_reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "max_shots": {
                  "type": "integer",
                  "minimum": 1
                },
                "max_episode_seconds": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_mime_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "max_upload_bytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_limits": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "job_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "analyze_script",
                      "generate_image",
                      "generate_video",
                      "assemble_video"
                    ]
                  }
                },
                "operations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "image_size": {
                  "type": "string"
                },
                "max_reference_images": {
                  "type": "integer"
                }
              },
              "required": [
                "studio_workflow",
                "template_id",
                "template_version",
                "enabled",
                "stages",
                "output_profiles",
                "unsupported_reasons",
                "max_shots",
                "max_episode_seconds",
                "upload_mime_types",
                "max_upload_bytes"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ProjectPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "revision",
                "state",
                "created_at",
                "client_reference"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ResourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "project_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 900000
                            },
                            "source_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "language": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 16
                            }
                          },
                          "required": [
                            "language"
                          ],
                          "additionalProperties": false,
                          "description": "text 和 source_asset_id 必须且只能提供一个。"
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "character"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "scene"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "prop"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "episode"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "script_resource_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "raw_content": {
                              "type": "string",
                              "maxLength": 20000
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "script_resource_id",
                            "sequence"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "shot"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "episode_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "scene_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "character_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "prop_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "video_prompt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 4000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "duration_seconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            },
                            "selected_image_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "selected_video_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "episode_id",
                            "description",
                            "duration_seconds"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "project_id",
                "revision",
                "content",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RunPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "project_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "plan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "budget_remaining": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "micro_units": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    }
                  },
                  "required": [
                    "currency",
                    "micro_units"
                  ],
                  "additionalProperties": false
                },
                "committed_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unresolved_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "required": [
                "id",
                "project_id",
                "plan_id",
                "version",
                "state",
                "client_reference",
                "created_at",
                "completed_at",
                "budget_remaining",
                "committed_cost",
                "unresolved_cost",
                "output_asset_ids"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "StepPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "ready",
                    "queued",
                    "running",
                    "awaiting_review",
                    "succeeded",
                    "failed",
                    "cancelled",
                    "unknown"
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ordinal": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "run_id",
                "stage_key",
                "target_id",
                "job_id",
                "state",
                "output_asset_ids",
                "error_code",
                "ordinal"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RunEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "step_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "event_id",
                "run_id",
                "sequence",
                "type",
                "state",
                "step_id",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "RequestLogPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST",
                    "PATCH",
                    "PUT"
                  ]
                },
                "route_template": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "status_code": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 599
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0
                },
                "actor_kind": {
                  "type": "string",
                  "enum": [
                    "api_key",
                    "console"
                  ]
                },
                "project_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "run_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replayed": {
                  "type": "boolean"
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "request_id",
                "created_at",
                "method",
                "route_template",
                "status_code",
                "duration_ms",
                "actor_kind",
                "project_id",
                "run_id",
                "job_id",
                "replayed",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "project_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "run.state_changed",
                      "run.review_required",
                      "run.result_ready",
                      "run.needs_attention"
                    ]
                  }
                },
                "enabled": {
                  "type": "boolean"
                },
                "verified": {
                  "type": "boolean"
                },
                "secret_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "url",
                "project_ids",
                "events",
                "enabled",
                "verified",
                "secret_version",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "WebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "endpoint_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "retrying",
                    "exhausted"
                  ]
                },
                "attempt": {
                  "type": "integer",
                  "minimum": 0
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "next_attempt_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "state",
                "attempt",
                "http_status",
                "next_attempt_at",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ArchiveImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "deferred",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "phase": {
                    "type": "string",
                    "enum": [
                      "extracting",
                      "importing"
                    ]
                  },
                  "current": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "phase",
                  "current",
                  "total"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "progress",
          "imported",
          "failed",
          "asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "Episode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "title": {
            "type": "string"
          },
          "raw_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "title",
          "raw_content",
          "description"
        ],
        "additionalProperties": false
      },
      "Scene": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "episode_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "heading": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_prompt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "episode_id",
          "number",
          "heading",
          "description",
          "video_prompt"
        ],
        "additionalProperties": false
      },
      "EpisodePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ScenePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "Reference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "character",
              "scene",
              "prop",
              "grid"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "description",
          "tags",
          "primary_asset_id"
        ],
        "additionalProperties": false
      },
      "ReferencePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "UploadBatch": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "ticket": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "PUT"
                      ]
                    },
                    "content_type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "asset_id",
                    "upload_url",
                    "method",
                    "content_type",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "filename",
                "ticket"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "project_id",
          "items"
        ],
        "additionalProperties": false
      },
      "listCharactersInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getCharacterInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createCharacterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateCharacterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setCharacterImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateCharacterImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneCharacterInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listBackgroundScenesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getBackgroundSceneInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setBackgroundSceneImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateBackgroundSceneImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneBackgroundSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listPropsInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getPropInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createPropInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updatePropInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deletePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setPropImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generatePropImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachScenePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachScenePropInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listGridsInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getGridInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createGridInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "updateGridInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "maxItems": 8
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "name",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "setGridImageInput": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "current_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "asset_id",
          "current_asset_id",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateGridImageInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "attachSceneGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "detachSceneGridInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "listEpisodesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getEpisodeInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "listScenesInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "getSceneInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createArchiveImportInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "asset_id"
        ],
        "additionalProperties": false
      },
      "getArchiveImportInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "createWorkUploadsInput": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "^[^\\\\/\\x00-\\x1f]+$"
                },
                "mime_type": {
                  "type": "string",
                  "enum": [
                    "text/plain",
                    "text/markdown",
                    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
                    "image/png",
                    "image/jpeg",
                    "image/webp",
                    "image/avif",
                    "audio/wav",
                    "application/zip"
                  ]
                },
                "size_bytes": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 1073741824
                },
                "sha256": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "required": [
                "filename",
                "mime_type",
                "size_bytes",
                "sha256"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "files"
        ],
        "additionalProperties": false
      },
      "updateEpisodeInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "raw_content": {
            "type": "string",
            "maxLength": 20000
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "title",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteEpisodeInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "updateSceneInput": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "video_prompt": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "heading",
          "revision"
        ],
        "additionalProperties": false
      },
      "deleteSceneInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "reorderScenesInput": {
        "type": "object",
        "properties": {
          "scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 500
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "scene_ids",
          "revision"
        ],
        "additionalProperties": false
      },
      "createEpisodeInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "raw_content": {
            "type": "string",
            "maxLength": 20000
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "title",
          "revision"
        ],
        "additionalProperties": false
      },
      "createSceneInput": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "description": {
            "type": "string",
            "maxLength": 4000
          },
          "video_prompt": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "heading",
          "revision"
        ],
        "additionalProperties": false
      },
      "saveScriptInput": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 5000000
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          }
        },
        "required": [
          "text",
          "revision"
        ],
        "additionalProperties": false
      },
      "generateSceneVideoInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "anchor_asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 12
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "video-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "aspect_ratio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "generate_audio": {
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "duration_seconds",
          "resolution",
          "aspect_ratio"
        ],
        "additionalProperties": false
      },
      "selectSceneTakeInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "take_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "revision",
          "take_id"
        ],
        "additionalProperties": false
      },
      "exportWorkInput": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "allow_partial": {
            "type": "boolean",
            "default": true
          },
          "selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            },
            "maxItems": 200
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioBuildProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_version": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "wait_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "assistant",
                    "system_note"
                  ]
                },
                "stage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "content": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "streaming",
                    "final"
                  ]
                },
                "seq": {
                  "type": "number"
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "stage",
                "content",
                "status",
                "seq",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "filterMode": {
                  "type": "string",
                  "enum": [
                    "prompt_index",
                    "full_text"
                  ]
                },
                "sourceText": {
                  "type": "string"
                },
                "llmText": {
                  "type": "string"
                },
                "originalChars": {
                  "type": "number"
                },
                "preparedChars": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "name",
                "filterMode",
                "sourceText",
                "llmText",
                "originalChars",
                "preparedChars"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "state",
          "stage",
          "messages",
          "sources"
        ],
        "additionalProperties": false
      },
      "StudioDraft": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8000
          },
          "source_text": {
            "type": "string",
            "maxLength": 50000
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 256,
            "maximum": 8192,
            "default": 2048
          }
        },
        "required": [
          "revision",
          "instructions"
        ],
        "additionalProperties": false
      },
      "StudioImport": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "asset_id"
        ],
        "additionalProperties": false
      },
      "StudioLibrary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "mime",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "StudioCommand": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant"
                    ]
                  },
                  "current_asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "kind",
                  "current_asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "asset.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "trash.restore"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "entity_type": {
                    "type": "string",
                    "enum": [
                      "asset",
                      "design"
                    ]
                  }
                },
                "required": [
                  "id",
                  "entity_type"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.duplicate"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.settings.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 24
                    },
                    "maxItems": 8
                  },
                  "cover": {
                    "type": "string",
                    "enum": [
                      "amber",
                      "indigo",
                      "teal",
                      "rust",
                      "moss",
                      "ink",
                      "sage",
                      "bone",
                      "wine",
                      "wash",
                      "blush",
                      "void"
                    ]
                  },
                  "aspect": {
                    "type": "string",
                    "enum": [
                      "16:9",
                      "9:16",
                      "1:1",
                      "4:3",
                      "21:9"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "480p",
                      "720p",
                      "1080p",
                      "2k"
                    ]
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "realistic_general",
                      "realistic_urban",
                      "realistic_cinematic",
                      "2d_japanese_manga",
                      "2d_korean_urban",
                      "2d_korean",
                      "2d_otome",
                      "2d_chinese_manga",
                      "2d_classical",
                      "3d_chinese",
                      "3d_xianxia",
                      "3d_cartoon",
                      "cg_general",
                      "cg_cyberpunk",
                      "ink_gongbi",
                      "custom"
                    ]
                  },
                  "style_prompt": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "title",
                  "tags",
                  "cover",
                  "aspect",
                  "resolution",
                  "style",
                  "style_prompt"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.rename"
              },
              "input": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "project.state.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "archived"
                    ]
                  }
                },
                "required": [
                  "state"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "script.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 5000000
                  }
                },
                "required": [
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "script.bible.update"
              },
              "input": {
                "type": "object",
                "properties": {
                  "logline": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "synopsis": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "logline",
                  "synopsis"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "episode.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "number": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "raw_content": {
                    "type": "string",
                    "maxLength": 20000
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  }
                },
                "required": [
                  "title"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "episode.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "heading": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "number": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "video_prompt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "episode_id",
                  "heading"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.reorder"
              },
              "input": {
                "type": "object",
                "properties": {
                  "episode_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scene_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 500
                  }
                },
                "required": [
                  "episode_id",
                  "scene_ids"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.save"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "character",
                      "scene",
                      "prop",
                      "grid"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 8
                  }
                },
                "required": [
                  "kind",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.voice.set"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.detach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant",
                      "voice"
                    ]
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.asset.restore"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "current_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "restore_asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "variant"
                    ]
                  }
                },
                "required": [
                  "id",
                  "current_asset_id",
                  "restore_asset_id",
                  "kind"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "design.variant.rename"
              },
              "input": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "id",
                  "asset_id",
                  "name"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.design.attach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "design_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "design_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "scene.design.detach"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "design_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "design_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "cut.take.select"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "scene_id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "operation": {
                "type": "string",
                "const": "take.delete"
              },
              "input": {
                "type": "object",
                "properties": {
                  "scene_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "asset_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "scene_id",
                  "asset_id"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "revision",
              "operation",
              "input"
            ],
            "additionalProperties": false
          }
        ]
      },
      "StudioMutation": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "changed_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "changed_id",
          "revision",
          "studio_url"
        ],
        "additionalProperties": false
      },
      "StudioWorkflow": {
        "type": "object",
        "properties": {
          "api_runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                },
                "completed_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "error_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "created_at",
                "completed_at",
                "total_steps",
                "completed_steps",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          },
          "trash": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "entity_type": {
                  "type": "string",
                  "enum": [
                    "asset",
                    "design"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "deleted_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "entity_type",
                "name",
                "deleted_at"
              ],
              "additionalProperties": false
            }
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lineage_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "status",
                "mime",
                "lineage_id",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "settings": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cover": {
                "type": "string"
              },
              "aspect": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "style": {
                "type": "string"
              },
              "style_prompt": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "tags",
              "cover",
              "aspect",
              "resolution",
              "style",
              "style_prompt",
              "state"
            ],
            "additionalProperties": false
          },
          "script": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "logline": {
                "type": "string"
              },
              "synopsis": {
                "type": "string"
              }
            },
            "required": [
              "text",
              "logline",
              "synopsis"
            ],
            "additionalProperties": false
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "scenes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "scene_designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "design_id",
                "kind",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "takes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "asset_id",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "cut_selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            }
          },
          "design_assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "design_id",
                "asset_id",
                "kind",
                "name",
                "position"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "api_runs",
          "project_id",
          "revision",
          "studio_url",
          "trash",
          "assets",
          "settings",
          "script",
          "episodes",
          "designs",
          "scenes",
          "scene_designs",
          "takes",
          "cut_selections",
          "design_assets"
        ],
        "additionalProperties": false
      },
      "StudioAnalysis": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "script_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000000
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioBuild": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "script_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "default": []
          },
          "material_scope": {
            "type": "string",
            "enum": [
              "unclassified",
              "all"
            ],
            "default": "unclassified"
          },
          "preprocess": {
            "type": "object",
            "properties": {
              "ignoreAttachments": {
                "type": "boolean",
                "default": true
              },
              "discardKeywords": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100,
                "default": [
                  "提示词",
                  "prompt",
                  "Midjourney",
                  "Stable Diffusion",
                  "DALL-E",
                  "Image1",
                  "Image2",
                  "正向提示词",
                  "负向提示词",
                  "视觉描述",
                  "出图要求",
                  "技术规格",
                  "画面描述",
                  "镜头提示词",
                  "请生成",
                  "角色三视图",
                  "服装本体展示",
                  "局部材质与细节放大"
                ]
              },
              "keepLabels": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "maxItems": 100,
                "default": [
                  "资产名称",
                  "资产ID",
                  "资产版本",
                  "关联角色资产名称",
                  "关联角色资产ID",
                  "关联场景资产名称",
                  "关联场景资产ID",
                  "关联道具资产名称",
                  "关联道具资产ID",
                  "服装变体ID",
                  "服装名称",
                  "道具资产ID",
                  "道具名称",
                  "场景资产ID",
                  "场景名称",
                  "宫格图ID",
                  "集数",
                  "主题",
                  "场景",
                  "角色名称",
                  "用途"
                ]
              }
            },
            "additionalProperties": false
          },
          "rebuild_policy": {
            "type": "string",
            "const": "full_rebuild"
          }
        },
        "required": [
          "revision",
          "rebuild_policy"
        ],
        "additionalProperties": false
      },
      "StudioCutExport": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "allow_partial": {
            "type": "boolean",
            "default": true
          },
          "selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            },
            "maxItems": 200
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false
      },
      "StudioVideo": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "scene_id": {
            "type": "string",
            "format": "uuid"
          },
          "anchor_asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 12
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "video-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "aspect_ratio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "generate_audio": {
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "scene_id",
          "duration_seconds",
          "resolution",
          "aspect_ratio"
        ],
        "additionalProperties": false
      },
      "StudioImage": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "design_id": {
            "type": "string",
            "format": "uuid"
          },
          "variants": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "image-standard"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "aspect_ratio": {
            "type": "string",
            "pattern": "^(auto|[1-9]\\d*:[1-9]\\d*)$"
          },
          "image_size": {
            "type": "string",
            "maxLength": 40
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "reference_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 16,
            "default": []
          },
          "slot": {
            "type": "string",
            "enum": [
              "primary",
              "variant"
            ],
            "default": "primary"
          },
          "variant_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "current_asset_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "design_id"
        ],
        "additionalProperties": false
      },
      "Uploaded": {
        "type": "object",
        "properties": {
          "uploaded": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "uploaded"
        ],
        "additionalProperties": false
      },
      "PublicCapabilityPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "studio_workflow": {
                  "type": "object",
                  "properties": {
                    "equivalent": {
                      "type": "boolean"
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "script",
                          "designs",
                          "storyboard",
                          "cut"
                        ]
                      }
                    },
                    "project_access": {
                      "type": "string",
                      "enum": [
                        "read_only",
                        "read_write",
                        "mixed"
                      ]
                    },
                    "gaps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "path",
                          "enabled"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    },
                    "commands": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "default": []
                    },
                    "image_models": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "aspect_ratios": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "image_sizes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "max_reference_images": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "max_variants": {
                            "type": "integer",
                            "exclusiveMinimum": 0
                          }
                        },
                        "required": [
                          "id",
                          "enabled",
                          "aspect_ratios",
                          "image_sizes",
                          "max_reference_images",
                          "max_variants"
                        ],
                        "additionalProperties": false
                      },
                      "default": []
                    }
                  },
                  "required": [
                    "equivalent",
                    "stages",
                    "project_access",
                    "gaps"
                  ],
                  "additionalProperties": false
                },
                "template_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "template_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "enabled": {
                  "type": "boolean"
                },
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "output_profiles": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "unsupported_reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "max_shots": {
                  "type": "integer",
                  "minimum": 1
                },
                "max_episode_seconds": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_mime_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "max_upload_bytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "upload_limits": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "job_types": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "analyze_script",
                      "generate_image",
                      "generate_video",
                      "assemble_video"
                    ]
                  }
                },
                "operations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "type",
                      "enabled"
                    ],
                    "additionalProperties": false
                  }
                },
                "image_size": {
                  "type": "string"
                },
                "max_reference_images": {
                  "type": "integer"
                }
              },
              "required": [
                "studio_workflow",
                "template_id",
                "template_version",
                "enabled",
                "stages",
                "output_profiles",
                "unsupported_reasons",
                "max_shots",
                "max_episode_seconds",
                "upload_mime_types",
                "max_upload_bytes"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicProjectPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "active",
                    "archived"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name",
                "revision",
                "state",
                "created_at",
                "client_reference"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicProject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "revision",
          "state",
          "created_at",
          "client_reference"
        ],
        "additionalProperties": false
      },
      "PublicResourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "work_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "content": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 900000
                            },
                            "source_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "language": {
                              "type": "string",
                              "minLength": 2,
                              "maxLength": 16
                            }
                          },
                          "required": [
                            "language"
                          ],
                          "additionalProperties": false,
                          "description": "text 和 source_asset_id 必须且只能提供一个。"
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "character"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "scene"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "prop"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "reference_asset_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            }
                          },
                          "required": [
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "episode"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "script_resource_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "raw_content": {
                              "type": "string",
                              "maxLength": 20000
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "script_resource_id",
                            "sequence"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "shot"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "episode_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "scene_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "character_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "prop_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "maxItems": 8,
                              "default": []
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 4000
                            },
                            "video_prompt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 4000
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sequence": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "duration_seconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            },
                            "selected_image_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "selected_video_asset_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "required": [
                            "episode_id",
                            "description",
                            "duration_seconds"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "name",
                        "data"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "work_id",
                "revision",
                "content",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "content": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "script"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 900000
                      },
                      "source_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "language": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 16
                      }
                    },
                    "required": [
                      "language"
                    ],
                    "additionalProperties": false,
                    "description": "text 和 source_asset_id 必须且只能提供一个。"
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "character"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "scene"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "prop"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "reference_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      }
                    },
                    "required": [
                      "description"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "episode"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "script_resource_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "raw_content": {
                        "type": "string",
                        "maxLength": 20000
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      }
                    },
                    "required": [
                      "script_resource_id",
                      "sequence"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "shot"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "episode_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "scene_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "character_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "prop_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "maxItems": 8,
                        "default": []
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 4000
                      },
                      "video_prompt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 4000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "duration_seconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "selected_image_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "selected_video_asset_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "episode_id",
                      "description",
                      "duration_seconds"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "name",
                  "data"
                ],
                "additionalProperties": false
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "work_id",
          "revision",
          "content",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicUploadTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "upload_url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "content_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "asset_id",
          "upload_url",
          "method",
          "content_type",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "PublicAsset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "ready",
              "errored",
              "expired"
            ]
          },
          "mime_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "mime_type",
          "size_bytes",
          "download_url",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "PublicPlan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_revision": {
            "type": "integer",
            "minimum": 1
          },
          "template_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "template_version": {
            "type": "integer",
            "minimum": 1
          },
          "executable": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "budget_ceiling": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "depends_on": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "requires_review": {
                  "type": "boolean"
                },
                "max_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "stage_key",
                "target_ids",
                "depends_on",
                "requires_review",
                "max_cost"
              ],
              "additionalProperties": false
            }
          },
          "unsupported_reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "project_revision",
          "template_id",
          "template_version",
          "executable",
          "expires_at",
          "budget_ceiling",
          "steps",
          "unsupported_reasons"
        ],
        "additionalProperties": false
      },
      "PublicRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan_id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "awaiting_review",
              "stopping",
              "paused",
              "needs_attention",
              "partially_succeeded",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "client_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "budget_remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "unresolved_cost": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "plan_id",
          "version",
          "state",
          "client_reference",
          "created_at",
          "completed_at",
          "budget_remaining",
          "committed_cost",
          "unresolved_cost",
          "output_asset_ids"
        ],
        "additionalProperties": false
      },
      "PublicRunPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "work_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "plan_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "client_reference": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 128
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "budget_remaining": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "micro_units": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    }
                  },
                  "required": [
                    "currency",
                    "micro_units"
                  ],
                  "additionalProperties": false
                },
                "committed_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unresolved_cost": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "micro_units": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        }
                      },
                      "required": [
                        "currency",
                        "micro_units"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              },
              "required": [
                "id",
                "work_id",
                "plan_id",
                "version",
                "state",
                "client_reference",
                "created_at",
                "completed_at",
                "budget_remaining",
                "committed_cost",
                "unresolved_cost",
                "output_asset_ids"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicStepPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "stage_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "target_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "ready",
                    "queued",
                    "running",
                    "awaiting_review",
                    "succeeded",
                    "failed",
                    "cancelled",
                    "unknown"
                  ]
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ordinal": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "run_id",
                "stage_key",
                "target_id",
                "job_id",
                "state",
                "output_asset_ids",
                "error_code",
                "ordinal"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicRunEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "run_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 1
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "awaiting_review",
                    "stopping",
                    "paused",
                    "needs_attention",
                    "partially_succeeded",
                    "succeeded",
                    "failed",
                    "cancelled"
                  ]
                },
                "step_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "event_id",
                "run_id",
                "sequence",
                "type",
                "state",
                "step_id",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "ready",
              "blocked",
              "processing",
              "awaiting_review",
              "succeeded",
              "failed",
              "cancelled",
              "needs_review"
            ]
          },
          "output_asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "resource_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "skipped_scene_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "id",
          "work_id",
          "run_id",
          "state",
          "output_asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicRequestLogPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "request_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST",
                    "PATCH",
                    "PUT"
                  ]
                },
                "route_template": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "status_code": {
                  "type": "integer",
                  "minimum": 100,
                  "maximum": 599
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 0
                },
                "actor_kind": {
                  "type": "string",
                  "enum": [
                    "api_key",
                    "console"
                  ]
                },
                "work_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "run_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "job_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replayed": {
                  "type": "boolean"
                },
                "error_code": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "request_id",
                "created_at",
                "method",
                "route_template",
                "status_code",
                "duration_ms",
                "actor_kind",
                "work_id",
                "run_id",
                "job_id",
                "replayed",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicRequestLog": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PATCH",
              "PUT"
            ]
          },
          "route_template": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "status_code": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "duration_ms": {
            "type": "integer",
            "minimum": 0
          },
          "actor_kind": {
            "type": "string",
            "enum": [
              "api_key",
              "console"
            ]
          },
          "work_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "job_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "request_id",
          "created_at",
          "method",
          "route_template",
          "status_code",
          "duration_ms",
          "actor_kind",
          "work_id",
          "run_id",
          "job_id",
          "replayed",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicUsage": {
        "type": "object",
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "format": "date-time"
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "http_requests": {
            "type": "integer",
            "minimum": 0
          },
          "runs": {
            "type": "integer",
            "minimum": 0
          },
          "jobs": {
            "type": "integer",
            "minimum": 0
          },
          "reserved": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "committed": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "unresolved": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "micro_units": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "currency",
                  "micro_units"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "remaining": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "micro_units": {
                "type": "string",
                "pattern": "^[0-9]+$"
              }
            },
            "required": [
              "currency",
              "micro_units"
            ],
            "additionalProperties": false
          },
          "amount_basis": {
            "type": "string",
            "enum": [
              "partner_limit"
            ]
          },
          "billing_mode": {
            "type": "string",
            "enum": [
              "pilot",
              "contract"
            ]
          }
        },
        "required": [
          "period_start",
          "period_end",
          "as_of",
          "http_requests",
          "runs",
          "jobs",
          "reserved",
          "committed",
          "unresolved",
          "remaining",
          "amount_basis",
          "billing_mode"
        ],
        "additionalProperties": false
      },
      "PublicWebhookEndpointPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "work_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "run.state_changed",
                      "run.review_required",
                      "run.result_ready",
                      "run.needs_attention"
                    ]
                  }
                },
                "enabled": {
                  "type": "boolean"
                },
                "verified": {
                  "type": "boolean"
                },
                "secret_version": {
                  "type": "integer",
                  "minimum": 1
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "url",
                "work_ids",
                "events",
                "enabled",
                "verified",
                "secret_version",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicWebhookIssued": {
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "work_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "run.state_changed",
                    "run.review_required",
                    "run.result_ready",
                    "run.needs_attention"
                  ]
                }
              },
              "enabled": {
                "type": "boolean"
              },
              "verified": {
                "type": "boolean"
              },
              "secret_version": {
                "type": "integer",
                "minimum": 1
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "url",
              "work_ids",
              "events",
              "enabled",
              "verified",
              "secret_version",
              "created_at"
            ],
            "additionalProperties": false
          },
          "signing_secret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "endpoint"
        ],
        "additionalProperties": false
      },
      "PublicWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "work_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.state_changed",
                "run.review_required",
                "run.result_ready",
                "run.needs_attention"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "url",
          "work_ids",
          "events",
          "enabled",
          "verified",
          "secret_version",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicWebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "endpoint_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "event_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "sending",
                    "succeeded",
                    "retrying",
                    "exhausted"
                  ]
                },
                "attempt": {
                  "type": "integer",
                  "minimum": 0
                },
                "http_status": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "next_attempt_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "state",
                "attempt",
                "http_status",
                "next_attempt_at",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicWebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "succeeded",
              "retrying",
              "exhausted"
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "state",
          "attempt",
          "http_status",
          "next_attempt_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "PublicUploaded": {
        "type": "object",
        "properties": {
          "uploaded": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "uploaded"
        ],
        "additionalProperties": false
      },
      "PublicStudioWorkflow": {
        "type": "object",
        "properties": {
          "api_runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                },
                "completed_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "total_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed_steps": {
                  "type": "integer",
                  "minimum": 0
                },
                "error_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "state",
                "created_at",
                "completed_at",
                "total_steps",
                "completed_steps",
                "error_code"
              ],
              "additionalProperties": false
            }
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          },
          "trash": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "entity_type": {
                  "type": "string",
                  "enum": [
                    "asset",
                    "design"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "deleted_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "entity_type",
                "name",
                "deleted_at"
              ],
              "additionalProperties": false
            }
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lineage_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "status",
                "mime",
                "lineage_id",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "settings": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cover": {
                "type": "string"
              },
              "aspect": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "style": {
                "type": "string"
              },
              "style_prompt": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "title",
              "tags",
              "cover",
              "aspect",
              "resolution",
              "style",
              "style_prompt",
              "state"
            ],
            "additionalProperties": false
          },
          "script": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "logline": {
                "type": "string"
              },
              "synopsis": {
                "type": "string"
              }
            },
            "required": [
              "text",
              "logline",
              "synopsis"
            ],
            "additionalProperties": false
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "scenes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "scene_designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "design_id",
                "kind",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "takes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "scene_id",
                "asset_id",
                "position"
              ],
              "additionalProperties": false
            }
          },
          "cut_selections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scene_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "scene_id",
                "asset_id"
              ],
              "additionalProperties": false
            }
          },
          "design_assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "design_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "asset_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": [
                "design_id",
                "asset_id",
                "kind",
                "name",
                "position"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "api_runs",
          "work_id",
          "revision",
          "studio_url",
          "trash",
          "assets",
          "settings",
          "script",
          "episodes",
          "designs",
          "scenes",
          "scene_designs",
          "takes",
          "cut_selections",
          "design_assets"
        ],
        "additionalProperties": false
      },
      "PublicStudioMutation": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "changed_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "studio_url": {
            "type": "string"
          }
        },
        "required": [
          "work_id",
          "changed_id",
          "revision",
          "studio_url"
        ],
        "additionalProperties": false
      },
      "PublicStudioLibrary": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string"
                },
                "mime": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "is_current_version": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "kind",
                "media_type",
                "mime",
                "version",
                "is_current_version"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicStudioBuildProgress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "run_id": {
            "type": "string",
            "format": "uuid"
          },
          "run_version": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "wait_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "assistant",
                    "system_note"
                  ]
                },
                "stage": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "content": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "streaming",
                    "final"
                  ]
                },
                "seq": {
                  "type": "number"
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "stage",
                "content",
                "status",
                "seq",
                "created_at",
                "updated_at"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "filterMode": {
                  "type": "string",
                  "enum": [
                    "prompt_index",
                    "full_text"
                  ]
                },
                "sourceText": {
                  "type": "string"
                },
                "llmText": {
                  "type": "string"
                },
                "originalChars": {
                  "type": "number"
                },
                "preparedChars": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "name",
                "filterMode",
                "sourceText",
                "llmText",
                "originalChars",
                "preparedChars"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "state",
          "stage",
          "messages",
          "sources"
        ],
        "additionalProperties": false
      },
      "PublicReferencePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "character",
                    "scene",
                    "prop",
                    "grid"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "primary_asset_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "description",
                "tags",
                "primary_asset_id"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicReference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "character",
              "scene",
              "prop",
              "grid"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "description",
          "tags",
          "primary_asset_id"
        ],
        "additionalProperties": false
      },
      "PublicEpisodePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "title": {
                  "type": "string"
                },
                "raw_content": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "number",
                "title",
                "raw_content",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicEpisode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "title": {
            "type": "string"
          },
          "raw_content": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "number",
          "title",
          "raw_content",
          "description"
        ],
        "additionalProperties": false
      },
      "PublicScenePage": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "episode_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "number": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "heading": {
                  "type": "string"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "video_prompt": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "episode_id",
                "number",
                "heading",
                "description",
                "video_prompt"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "work_id",
          "revision",
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "PublicScene": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "episode_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "heading": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_prompt": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "episode_id",
          "number",
          "heading",
          "description",
          "video_prompt"
        ],
        "additionalProperties": false
      },
      "PublicArchiveImport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "deferred",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "phase": {
                    "type": "string",
                    "enum": [
                      "extracting",
                      "importing"
                    ]
                  },
                  "current": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "phase",
                  "current",
                  "total"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "work_id",
          "state",
          "progress",
          "imported",
          "failed",
          "asset_ids",
          "error_code"
        ],
        "additionalProperties": false
      },
      "PublicUploadBatch": {
        "type": "object",
        "properties": {
          "work_id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "filename": {
                  "type": "string"
                },
                "ticket": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "method": {
                      "type": "string",
                      "enum": [
                        "PUT"
                      ]
                    },
                    "content_type": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "asset_id",
                    "upload_url",
                    "method",
                    "content_type",
                    "expires_at"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "filename",
                "ticket"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "work_id",
          "items"
        ],
        "additionalProperties": false
      }
    }
  },
  "x-documentation-language": "zh",
  "tags": [
    {
      "name": "可用功能",
      "description": "可用功能",
      "x-tag-id": "capabilities"
    },
    {
      "name": "项目与资源",
      "description": "项目与资源",
      "x-tag-id": "projects"
    },
    {
      "name": "上传",
      "description": "上传",
      "x-tag-id": "uploads"
    },
    {
      "name": "素材与结果",
      "description": "素材与结果",
      "x-tag-id": "assets"
    },
    {
      "name": "制作执行",
      "description": "制作执行",
      "x-tag-id": "runs"
    },
    {
      "name": "工作流功能",
      "description": "工作流功能",
      "x-tag-id": "jobs"
    },
    {
      "name": "请求日志",
      "description": "请求日志",
      "x-tag-id": "requests"
    },
    {
      "name": "用量",
      "description": "用量",
      "x-tag-id": "usage"
    },
    {
      "name": "Webhook",
      "description": "Webhook",
      "x-tag-id": "webhook-endpoints"
    },
    {
      "name": "Webhook 投递",
      "description": "Webhook 投递",
      "x-tag-id": "webhook-deliveries"
    },
    {
      "name": "规范",
      "description": "规范",
      "x-tag-id": "Documentation"
    }
  ]
}
