{
  "openapi": "3.1.0",
  "info": {
    "title": "Glacier AI Public API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.berserkapi.com/api"
    }
  ],
  "paths": {
    "/v1/assets": {
      "get": {
        "operationId": "listApiAssets",
        "parameters": [
          {
            "description": "不传 = all：公共素材在前，然后是我的素材",
            "explode": false,
            "in": "query",
            "name": "scope",
            "schema": {
              "$ref": "#/components/schemas/AssetScope",
              "description": "不传 = all：公共素材在前，然后是我的素材"
            }
          },
          {
            "description": "不传 = 全部类型",
            "explode": false,
            "in": "query",
            "name": "kind",
            "schema": {
              "$ref": "#/components/schemas/MediaKind",
              "description": "不传 = 全部类型"
            }
          },
          {
            "description": "按名称模糊搜索",
            "explode": false,
            "in": "query",
            "name": "search",
            "schema": {
              "description": "按名称模糊搜索",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 24,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "上一页返回的 nextCursor",
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "description": "上一页返回的 nextCursor",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetPage"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "列出可用素材",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/upload-limits": {
      "get": {
        "operationId": "getApiUploadLimits",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadLimits"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询上传限制",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/uploads": {
      "post": {
        "description": "按返回的 method、headers、fileField 上传到 uploadUrl，然后调用 completeApiUpload。不要把 API Key 发到上传地址。",
        "operationId": "createApiUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadTicket"
                }
              }
            },
            "description": "Created"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "申请素材直传凭证",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/{assetId}": {
      "delete": {
        "operationId": "deleteApiAsset",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "删除素材并取消相关任务",
        "tags": [
          "public-assets"
        ]
      },
      "get": {
        "operationId": "getApiAsset",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetDetail"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询素材与版本",
        "tags": [
          "public-assets"
        ]
      },
      "patch": {
        "operationId": "updateApiAsset",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAssetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "修改素材名称",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/{assetId}/complete": {
      "post": {
        "description": "幂等；校验真实文件格式、大小、尺寸和时长后入库。",
        "operationId": "completeApiUpload",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "确认素材上传完成",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/{assetId}/versions/{versionId}": {
      "delete": {
        "operationId": "deleteApiAssetVersion",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          },
          {
            "description": "版本 ID",
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "description": "版本 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "删除处理版本",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/assets/{assetId}/versions/{versionId}/watermark-marks": {
      "put": {
        "operationId": "saveApiWatermarkMarks",
        "parameters": [
          {
            "description": "素材 ID",
            "in": "path",
            "name": "assetId",
            "required": true,
            "schema": {
              "description": "素材 ID",
              "type": "string"
            }
          },
          {
            "description": "版本 ID",
            "in": "path",
            "name": "versionId",
            "required": true,
            "schema": {
              "description": "版本 ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveWatermarkMarksInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "保存水印标记",
        "tags": [
          "public-assets"
        ]
      }
    },
    "/v1/benefits": {
      "get": {
        "operationId": "getApiSubscriptionBenefits",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionBenefits"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询 API 账户套餐权益",
        "tags": [
          "public-billing"
        ]
      }
    },
    "/v1/tasks": {
      "get": {
        "operationId": "listApiTasks",
        "parameters": [
          {
            "description": "只看某个素材的任务",
            "explode": false,
            "in": "query",
            "name": "assetId",
            "schema": {
              "description": "只看某个素材的任务",
              "type": "string"
            }
          },
          {
            "description": "只看某个工具的任务（如 detect 取检测报告）",
            "explode": false,
            "in": "query",
            "name": "toolId",
            "schema": {
              "description": "只看某个工具的任务（如 detect 取检测报告）",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "status",
            "schema": {
              "$ref": "#/components/schemas/TaskStatus"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Task"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询账户任务记录",
        "tags": [
          "public-tasks"
        ]
      },
      "post": {
        "description": "需要 write 权限与 Idempotency-Key。预扣积分并返回 202、Location 和 Retry-After。账户内同键同参数返回原任务，不重复计费；不同参数返回 409。402 余额不足，429 配额已满，503 暂无算力。任务清理后旧幂等键仍保留，重试返回 410。",
        "operationId": "createApiTask",
        "parameters": [
          {
            "description": "一次逻辑提交一个唯一键；网络重试使用原键与原请求体；不同参数复用返回 409",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "description": "一次逻辑提交一个唯一键；网络重试使用原键与原请求体；不同参数复用返回 409",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTask"
                }
              }
            },
            "description": "Accepted",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "description": "建议轮询间隔（秒）",
                  "format": "int64",
                  "type": "integer"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "异步提交处理任务",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tasks/quote": {
      "post": {
        "description": "read 权限即可；不创建任务、不扣费。problem 非 null 表示当前无法提交。价格、余额与配额以实际提交时为准。",
        "operationId": "quoteApiTask",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskQuote"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询任务报价",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tasks/{taskId}": {
      "get": {
        "operationId": "getApiTask",
        "parameters": [
          {
            "description": "任务 ID",
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "description": "任务 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTask"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "description": "建议轮询间隔（秒）",
                  "format": "int64",
                  "type": "integer"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询任务状态与进度",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tasks/{taskId}/cancel": {
      "post": {
        "description": "幂等。排队中立即取消并退款；运行中在 worker 确认后退款，停止前已完成的照常收费。请继续查询实际状态。",
        "operationId": "cancelApiTask",
        "parameters": [
          {
            "description": "任务 ID",
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "description": "任务 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTask"
                }
              }
            },
            "description": "OK",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "description": "建议轮询间隔（秒）",
                  "format": "int64",
                  "type": "integer"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "取消异步任务",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tasks/{taskId}/result": {
      "get": {
        "description": "任务未成功返回 409；产物已删除返回 410。报告任务返回 report 或 watermarkFind，遮罩预览任务返回 maskPreviewUrl。重复查询刷新文件签名地址，不收费。",
        "operationId": "getApiTaskResult",
        "parameters": [
          {
            "description": "任务 ID",
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "description": "任务 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTaskResult"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "获取处理结果与临时下载地址",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tasks/{taskId}/watermark-analysis": {
      "get": {
        "operationId": "getApiWatermarkAnalysis",
        "parameters": [
          {
            "description": "任务 ID",
            "in": "path",
            "name": "taskId",
            "required": true,
            "schema": {
              "description": "任务 ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatermarkAnalysis"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "获取水印识别分析报告",
        "tags": [
          "public-tasks"
        ]
      }
    },
    "/v1/tools": {
      "get": {
        "description": "包含全部图像、视频工具及 watermark-find、watermark-mask 辅助步骤。价格为空表示暂未开放。",
        "operationId": "listApiTools",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Tool"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "开放 API 工具目录与参数",
        "tags": [
          "public-tools"
        ]
      }
    },
    "/v1/wallet": {
      "get": {
        "operationId": "getApiWallet",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSummary"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "查询 API 账户积分余额",
        "tags": [
          "public-billing"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "bearerFormat": "gk_<secret>",
        "description": "在账户设置创建 API Key，仅用于 /api/v1/*。",
        "scheme": "bearer",
        "type": "http"
      }
    },
    "schemas": {
      "AssetScope": {
        "enum": [
          "all",
          "mine",
          "public"
        ],
        "type": "string"
      },
      "MediaKind": {
        "enum": [
          "image",
          "video"
        ],
        "type": "string"
      },
      "AssetPage": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Asset"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "type": "object"
      },
      "Asset": {
        "additionalProperties": false,
        "properties": {
          "coverUrl": {
            "description": "视频封面（上传时截取的原件首帧 JPEG，长边不超过 1920）；图片或截取失败时为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "durationMs": {
            "description": "视频与动图有值（动图为各帧时长之和）",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "expiresAt": {
            "description": "素材保留期限；null 表示沿用原保留规则",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "height": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "isPublic": {
            "description": "公共素材（示范素材）：所有用户可见、不可删除；对它发起处理时自动复制到个人素材库，任务的 assetId 为副本",
            "type": "boolean"
          },
          "kind": {
            "$ref": "#/components/schemas/MediaKind"
          },
          "mimeType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sizeBytes": {
            "format": "int64",
            "type": "integer"
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "原件地址（已签名，可直接用于 <img>/<video>）",
            "type": "string"
          },
          "versionCount": {
            "description": "现存版本数（含原件；删除的版本不计）",
            "format": "int64",
            "type": "integer"
          },
          "width": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "expiresAt",
          "id",
          "name",
          "kind",
          "mimeType",
          "sizeBytes",
          "width",
          "height",
          "durationMs",
          "url",
          "thumbnailUrl",
          "coverUrl",
          "versionCount",
          "isPublic",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "Problem": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "description": "可直接展示给用户的中文文案",
            "type": "string"
          },
          "errors": {
            "description": "参数校验失败的明细（仅 400 / 422）",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": "array"
          },
          "status": {
            "description": "HTTP 状态码，与响应状态一致",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "status",
          "detail"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "location": {
            "description": "Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'",
            "type": "string"
          },
          "message": {
            "description": "Error message text",
            "type": "string"
          },
          "value": {
            "description": "The value at the given location"
          }
        },
        "type": "object"
      },
      "UploadLimits": {
        "additionalProperties": false,
        "properties": {
          "image": {
            "$ref": "#/components/schemas/MediaLimits"
          },
          "video": {
            "$ref": "#/components/schemas/MediaLimits"
          }
        },
        "required": [
          "image",
          "video"
        ],
        "type": "object"
      },
      "MediaLimits": {
        "additionalProperties": false,
        "properties": {
          "maxAspect": {
            "description": "长边 / 短边上限",
            "format": "int64",
            "type": "integer"
          },
          "maxBytes": {
            "description": "文件大小上限（字节）",
            "format": "int64",
            "type": "integer"
          },
          "maxDurationMs": {
            "description": "视频时长上限（毫秒）",
            "format": "int64",
            "type": "integer"
          },
          "maxFrameRate": {
            "description": "视频帧率上限（帧/秒）",
            "format": "int64",
            "type": "integer"
          },
          "maxFrames": {
            "description": "视频帧数上限",
            "format": "int64",
            "type": "integer"
          },
          "maxPixels": {
            "description": "总像素（宽 × 高）上限",
            "format": "int64",
            "type": "integer"
          },
          "maxSide": {
            "description": "长边上限（像素）",
            "format": "int64",
            "type": "integer"
          },
          "minSide": {
            "description": "短边下限（像素）",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "maxBytes",
          "minSide",
          "maxSide",
          "maxPixels",
          "maxAspect",
          "maxDurationMs",
          "maxFrameRate",
          "maxFrames"
        ],
        "type": "object"
      },
      "CreateUploadInput": {
        "additionalProperties": false,
        "properties": {
          "mimeType": {
            "type": "string"
          },
          "multipart": {
            "description": "用表单（multipart/form-data）POST 上传：给只能发表单的客户端（微信小程序 wx.uploadFile）；默认 PUT 原始字节",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "sizeBytes": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "mimeType",
          "sizeBytes"
        ],
        "type": "object"
      },
      "UploadTicket": {
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "fileField": {
            "description": "method 为 POST（表单上传）时文件所在的字段名；PUT 为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "headers": {
            "items": {
              "items": {
                "type": "string"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "type": "array"
          },
          "method": {
            "$ref": "#/components/schemas/UploadMethod"
          },
          "uploadUrl": {
            "type": "string"
          }
        },
        "required": [
          "assetId",
          "uploadUrl",
          "method",
          "headers",
          "fileField",
          "expiresAt"
        ],
        "type": "object"
      },
      "UploadMethod": {
        "enum": [
          "PUT",
          "POST"
        ],
        "type": "string"
      },
      "AssetDetail": {
        "additionalProperties": false,
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/Asset"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/AssetVersion"
            },
            "type": "array"
          }
        },
        "required": [
          "asset",
          "versions"
        ],
        "type": "object"
      },
      "AssetVersion": {
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "downloadUrl": {
            "description": "下载地址（响应带 Content-Disposition: attachment，文件名形如 原名_V2_超分.mp4）",
            "type": "string"
          },
          "durationMs": {
            "description": "视频与动图有值（动图为各帧时长之和）",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "frameCount": {
            "description": "帧数，视频与动图有值（图片的 frameCount > 1 即动图，按帧计费）；旧版本为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "frameRate": {
            "description": "平均帧率（帧/秒），视频与动图有值（动图各帧时长不同，只用于展示）；旧版本为 null",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "height": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "index": {
            "description": "版本号，0 = 原件；只增不减，删除过的版本号不复用（版本列表可能不连续）",
            "format": "int64",
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "maskUrl": {
            "description": "去水印的识别遮罩视频（H.264，与输入版本 sourceVersionId 按时间对齐，亮 = 被修复的像素，分辨率可能低于原视频），前端对比时叠加在原视频上；其他版本为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "mimeType": {
            "type": "string"
          },
          "previewPending": {
            "description": "预览正在后台转码，完成后 previewUrl 才有值；期间可轮询 getAsset",
            "type": "boolean"
          },
          "previewUrl": {
            "description": "浏览器可播放的 H.264 预览；为 null 时直接播放 url（原视频浏览器可播放、图片、转码失败）",
            "type": [
              "string",
              "null"
            ]
          },
          "sizeBytes": {
            "format": "int64",
            "type": "integer"
          },
          "sourceVersionId": {
            "description": "由哪个版本处理而来（前端默认与它对比）；原件为 null；该版本可能已被删除",
            "type": [
              "string",
              "null"
            ]
          },
          "thumbnailUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "toolId": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "description": "原始文件地址（已签名）",
            "type": "string"
          },
          "watermarkMarks": {
            "description": "用户在这个版本上的去水印标记（随版本保存，下次打开继续编辑）；没有为空数组",
            "items": {
              "$ref": "#/components/schemas/MaskRegion"
            },
            "type": "array"
          },
          "watermarkObjects": {
            "description": "用户给这个版本上各个水印起的名字；没有为空数组（前端显示「水印 n」）",
            "items": {
              "$ref": "#/components/schemas/WatermarkObject"
            },
            "type": "array"
          },
          "width": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "assetId",
          "index",
          "label",
          "toolId",
          "sourceVersionId",
          "url",
          "thumbnailUrl",
          "previewUrl",
          "previewPending",
          "downloadUrl",
          "mimeType",
          "sizeBytes",
          "width",
          "height",
          "durationMs",
          "frameRate",
          "frameCount",
          "maskUrl",
          "watermarkMarks",
          "watermarkObjects",
          "createdAt"
        ],
        "type": "object"
      },
      "MaskRegion": {
        "additionalProperties": false,
        "properties": {
          "color": {
            "description": "纯色水印的颜色（#rrggbb，如白字 #ffffff）；不填表示不按颜色收紧遮罩",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "type": "string"
          },
          "endMs": {
            "description": "作用区间的结束时间（毫秒，含），须带 timeMs 且不早于它；不填表示只作用于 timeMs 这一帧。positive 带 endMs 表示确认这一段要修复",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "height": {
            "description": "高度（占画面高度的比例）",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "kind": {
            "$ref": "#/components/schemas/MaskRegionKind",
            "description": "标记类型：positive（默认）这里有水印；negative 减选，这里不是水印；absent 这一段没有这个水印（须带 objectId）；suggested 自动查找的建议，用户确认（改成 positive）前不参与识别"
          },
          "objectId": {
            "description": "水印编号（前端同一种颜色）：同一编号在不同时间点的标记是同一个水印，各自向前后跟踪到彼此相遇；不填表示每处标记各是一个水印",
            "format": "int64",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          },
          "strokes": {
            "description": "涂抹的画笔轨迹；为空表示框选（整个框都是水印）",
            "items": {
              "$ref": "#/components/schemas/BrushStroke"
            },
            "maxItems": 64,
            "type": "array"
          },
          "timeMs": {
            "description": "标记时的视频时间点（毫秒）；不填表示整段视频固定位置",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "width": {
            "description": "宽度（占画面宽度的比例）",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "x": {
            "description": "左边缘（占画面宽度的比例）",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "y": {
            "description": "上边缘（占画面高度的比例）",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "width",
          "height"
        ],
        "type": "object"
      },
      "MaskRegionKind": {
        "enum": [
          "positive",
          "negative",
          "absent",
          "suggested"
        ],
        "type": "string"
      },
      "BrushStroke": {
        "additionalProperties": false,
        "properties": {
          "points": {
            "description": "轨迹点 [x, y]（相对画面）",
            "items": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "maxItems": 4000,
            "minItems": 1,
            "type": "array"
          },
          "radius": {
            "description": "画笔半径（占画面宽度的比例）",
            "format": "double",
            "maximum": 0.25,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "radius",
          "points"
        ],
        "type": "object"
      },
      "WatermarkObject": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "水印名称",
            "maxLength": 24,
            "minLength": 1,
            "type": "string"
          },
          "objectId": {
            "format": "int64",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "objectId",
          "name"
        ],
        "type": "object"
      },
      "UpdateAssetInput": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "素材名称（首尾空白会去掉）；可与其他素材重名",
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SaveWatermarkMarksInput": {
        "additionalProperties": false,
        "properties": {
          "objects": {
            "description": "各个水印的名字（整体替换）；不传 = 清空",
            "items": {
              "$ref": "#/components/schemas/WatermarkObject"
            },
            "maxItems": 8,
            "type": "array"
          },
          "regions": {
            "description": "该版本上的全部标记（整体替换）；空数组 = 清空",
            "items": {
              "$ref": "#/components/schemas/MaskRegion"
            },
            "maxItems": 64,
            "type": "array"
          }
        },
        "required": [
          "regions"
        ],
        "type": "object"
      },
      "SubscriptionBenefits": {
        "additionalProperties": false,
        "properties": {
          "concurrency": {
            "format": "int64",
            "type": "integer"
          },
          "imagesRemaining": {
            "format": "int64",
            "type": "integer"
          },
          "maxVideoMinutes": {
            "format": "int64",
            "type": "integer"
          },
          "paidPlan": {
            "type": "boolean"
          },
          "periodEndsAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "planId": {
            "type": "string"
          },
          "retentionDays": {
            "format": "int64",
            "type": "integer"
          },
          "rushesRemaining": {
            "format": "int64",
            "type": "integer"
          },
          "storageGB": {
            "format": "int64",
            "type": "integer"
          },
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/SubscriptionTerm"
            },
            "type": "array"
          },
          "topupBonusPercent": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "planId",
          "paidPlan",
          "concurrency",
          "storageGB",
          "retentionDays",
          "maxVideoMinutes",
          "topupBonusPercent",
          "imagesRemaining",
          "rushesRemaining",
          "periodEndsAt",
          "subscriptions"
        ],
        "type": "object"
      },
      "SubscriptionTerm": {
        "additionalProperties": false,
        "properties": {
          "endsAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "planId",
          "startsAt",
          "endsAt"
        ],
        "type": "object"
      },
      "TaskStatus": {
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "canceled"
        ],
        "type": "string"
      },
      "Task": {
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string"
          },
          "assetName": {
            "type": "string"
          },
          "costCredits": {
            "description": "消耗的积分：建任务时按报价预扣，失败、取消时全额退回",
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "engine": {
            "description": "任务使用的推理引擎：超分（rrdb / seedvr2 / flashvsr / swiftvr / recavsr / relayvsr / flashvsr_plus_turbo / flashvsr_plus_base）或本机去水印（sttn / propainter），建任务时记下；其他任务为空串",
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "finishedAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "maskPreviewUrl": {
            "description": "去水印识别预览（watermark-mask）成功后的识别遮罩视频（H.264 灰度，亮 = 将被修复的像素，与输入版本按时间对齐）；其他任务为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "modelLoading": {
            "description": "处理节点正在加载模型（冷启动或空闲卸载后重新加载），此时进度不前进；只在 running 时可能为 true",
            "type": "boolean"
          },
          "outputVersionDeleted": {
            "description": "产出的版本已被用户删除（文件已删，记录保留用于对账）",
            "type": "boolean"
          },
          "outputVersionId": {
            "description": "成功后产出的素材版本；其他状态为 null；检测类工具不产出版本",
            "type": [
              "string",
              "null"
            ]
          },
          "outputVersionIndex": {
            "description": "产出的版本号，与 outputVersionId 同时有值；版本删除后不变（对账用）",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "params": {
            "$ref": "#/components/schemas/TaskParams"
          },
          "processingStartProgress": {
            "description": "processingStartedAt 时的进度 0 ~ 1",
            "format": "double",
            "type": "number"
          },
          "processingStartedAt": {
            "description": "本轮推理开始的时间（认领或模型加载完成时），估算剩余时间的起点；非运行中或加载模型中为 null",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "description": "0 ~ 1",
            "format": "double",
            "type": "number"
          },
          "queuePosition": {
            "description": "排队中时在同一队列中的位置（从 1 开始，1 = 下一个被处理）；其他状态为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "queueRunning": {
            "description": "排队中时同一队列正在处理的任务数（所有用户，含分段），>0 说明算力已占满在等待；其他状态为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "report": {
            "$ref": "#/components/schemas/DetectReport",
            "description": "检测类工具成功后的报告；其他任务为 null"
          },
          "sourceVersionId": {
            "description": "以哪个版本为输入；null 表示原件",
            "type": [
              "string",
              "null"
            ]
          },
          "sourceVersionIndex": {
            "description": "输入版本号（0 = 原件），建任务时记下，版本删除后不变",
            "format": "int64",
            "type": "integer"
          },
          "startedAt": {
            "description": "开始处理的时间（第一次被 worker 认领）",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus"
          },
          "toolId": {
            "type": "string"
          },
          "toolName": {
            "description": "工具名称（含不在工具列表里的隐藏工具，如水印追踪）",
            "type": "string"
          },
          "watermarkAnalysis": {
            "description": "有识别分析报告（每个水印每一段的状态、需要复核的区间），用 getWatermarkAnalysis 读取；水印追踪、本机去水印成功后才有",
            "type": "boolean"
          },
          "watermarkFind": {
            "$ref": "#/components/schemas/WatermarkFindReport",
            "description": "自动查找水印（watermark-find）成功后的候选水印；其他任务为 null"
          },
          "watermarkRevision": {
            "description": "这次水印追踪的原尺寸遮罩可复用：提交去水印时 params.value.revisionId 传本任务 ID，直接用这份遮罩、不再重新识别",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "assetId",
          "assetName",
          "sourceVersionId",
          "sourceVersionIndex",
          "toolId",
          "toolName",
          "params",
          "costCredits",
          "engine",
          "status",
          "progress",
          "modelLoading",
          "queuePosition",
          "queueRunning",
          "error",
          "outputVersionId",
          "outputVersionIndex",
          "outputVersionDeleted",
          "report",
          "maskPreviewUrl",
          "watermarkAnalysis",
          "watermarkRevision",
          "watermarkFind",
          "createdAt",
          "startedAt",
          "processingStartedAt",
          "processingStartProgress",
          "finishedAt"
        ],
        "type": "object"
      },
      "TaskParams": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "none",
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "scale",
                "type": "string"
              },
              "value": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "fps",
                "type": "string"
              },
              "value": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "faceProtect",
                "type": "string"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "regions",
                "type": "string"
              },
              "value": {
                "items": {
                  "$ref": "#/components/schemas/MaskRegion"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "watermark",
                "type": "string"
              },
              "value": {
                "$ref": "#/components/schemas/WatermarkParams"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "type": "object"
          }
        ]
      },
      "WatermarkParams": {
        "additionalProperties": false,
        "properties": {
          "objects": {
            "description": "水印名称（只用于显示，不影响识别）",
            "items": {
              "$ref": "#/components/schemas/WatermarkObject"
            },
            "maxItems": 8,
            "type": "array"
          },
          "regions": {
            "description": "全部标记",
            "items": {
              "$ref": "#/components/schemas/MaskRegion"
            },
            "maxItems": 64,
            "type": "array"
          },
          "revisionId": {
            "description": "复用的识别结果：同一输入版本、同一组标记、成功的 watermark-mask 任务 ID。去水印直接用它的原尺寸遮罩，不再重新识别；标记变了、识别版本过期时返回 409",
            "type": "string"
          }
        },
        "required": [
          "regions"
        ],
        "type": "object"
      },
      "DetectReport": {
        "additionalProperties": false,
        "properties": {
          "degraded": {
            "description": "有检测器失败，结果可信度降低",
            "type": "boolean"
          },
          "detectors": {
            "description": "各检测器的判定依据",
            "items": {
              "$ref": "#/components/schemas/DetectorEvidence"
            },
            "type": "array"
          },
          "modelVersion": {
            "description": "算法版本，便于追溯",
            "type": "string"
          },
          "probability": {
            "description": "校准后的 AI 概率，用于判定",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "score": {
            "description": "AI 率展示分 0 ~ 100，越高越像 AI；展示模型不可用时为 null",
            "format": "double",
            "maximum": 100,
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "threshold": {
            "description": "判定阈值：probability ≥ threshold 判为 AI",
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "verdict": {
            "$ref": "#/components/schemas/DetectVerdict",
            "description": "判定结论（权威）"
          }
        },
        "required": [
          "score",
          "probability",
          "threshold",
          "verdict",
          "degraded",
          "detectors",
          "modelVersion"
        ],
        "type": "object"
      },
      "DetectorEvidence": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "检测器标识，如 vpvp_videomae、qwen25_vit_448p",
            "type": "string"
          },
          "margin": {
            "description": "归一化偏离度：> 0 倾向 AI，< 0 倾向真实；检测器失败时为 null",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "margin"
        ],
        "type": "object"
      },
      "DetectVerdict": {
        "enum": [
          "ai",
          "real"
        ],
        "type": "string"
      },
      "WatermarkFindReport": {
        "additionalProperties": false,
        "properties": {
          "candidates": {
            "description": "候选水印，按出现时长从长到短",
            "items": {
              "$ref": "#/components/schemas/WatermarkCandidate"
            },
            "type": "array"
          },
          "modelVersion": {
            "type": "string"
          }
        },
        "required": [
          "candidates",
          "modelVersion"
        ],
        "type": "object"
      },
      "WatermarkCandidate": {
        "additionalProperties": false,
        "properties": {
          "box": {
            "$ref": "#/components/schemas/WatermarkBox"
          },
          "endMs": {
            "description": "大致消失的时间；一直到结尾为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "evidence": {
            "description": "找到它的依据：stable（时间上稳定的笔画）、text（文字检测）、concept（概念分割）、short_event（只在首尾短暂出现，证据较少）",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "keyframesMs": {
            "description": "建议标记的时间点（毫秒）：第一次稳定出现、中间、最后；位置以 box 为准",
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "type": "array"
          },
          "name": {
            "description": "可信的文字识别结果（如账号名）；没有为 null，前端显示「水印 n」，不编造名称",
            "type": [
              "string",
              "null"
            ]
          },
          "objectId": {
            "description": "建议的水印编号",
            "format": "int64",
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          },
          "startMs": {
            "description": "大致出现的时间",
            "format": "int64",
            "type": "integer"
          },
          "subtitle": {
            "description": "更像字幕（画面下方居中、内容在变）：默认不选",
            "type": "boolean"
          },
          "thumbnail": {
            "description": "候选所在画面的缩略图（JPEG data URI），给建议清单核对用；没有为 null",
            "maxLength": 65536,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "objectId",
          "name",
          "box",
          "keyframesMs",
          "startMs",
          "endMs",
          "evidence",
          "subtitle",
          "thumbnail"
        ],
        "type": "object"
      },
      "WatermarkBox": {
        "additionalProperties": false,
        "properties": {
          "height": {
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "width": {
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "x": {
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "y": {
            "format": "double",
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "width",
          "height"
        ],
        "type": "object"
      },
      "CreateTaskInput": {
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string"
          },
          "fitToLimits": {
            "description": "素材分辨率超出工具上限时，先等比缩小到上限内再处理（见 TaskQuote.canFit）；不传 = 超限直接拒绝",
            "type": "boolean"
          },
          "maxCostCredits": {
            "description": "最高允许扣费积分；超过时返回 409，不扣费。不传报价 id 的客户端可用此字段控制价格变化",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "params": {
            "$ref": "#/components/schemas/TaskParams"
          },
          "quoteId": {
            "description": "quoteTask 返回的报价 id；有效期内按原报价成交，一份报价只创建一个任务",
            "type": "string"
          },
          "rush": {
            "type": "boolean"
          },
          "sourceVersionId": {
            "description": "以哪个版本为输入；不传表示原件",
            "type": "string"
          },
          "toolId": {
            "type": "string"
          },
          "useImagePack": {
            "type": "boolean"
          }
        },
        "required": [
          "assetId",
          "toolId",
          "params"
        ],
        "type": "object"
      },
      "ApiTask": {
        "additionalProperties": false,
        "properties": {
          "assetId": {
            "type": "string"
          },
          "assetName": {
            "type": "string"
          },
          "costCredits": {
            "description": "消耗的积分：建任务时按报价预扣，失败、取消时全额退回",
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "engine": {
            "description": "任务使用的推理引擎：超分（rrdb / seedvr2 / flashvsr / swiftvr / recavsr / relayvsr / flashvsr_plus_turbo / flashvsr_plus_base）或本机去水印（sttn / propainter），建任务时记下；其他任务为空串",
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "finishedAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "maskPreviewUrl": {
            "description": "去水印识别预览（watermark-mask）成功后的识别遮罩视频（H.264 灰度，亮 = 将被修复的像素，与输入版本按时间对齐）；其他任务为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "modelLoading": {
            "description": "处理节点正在加载模型（冷启动或空闲卸载后重新加载），此时进度不前进；只在 running 时可能为 true",
            "type": "boolean"
          },
          "outputVersionDeleted": {
            "description": "产出的版本已被用户删除（文件已删，记录保留用于对账）",
            "type": "boolean"
          },
          "outputVersionId": {
            "description": "成功后产出的素材版本；其他状态为 null；检测类工具不产出版本",
            "type": [
              "string",
              "null"
            ]
          },
          "outputVersionIndex": {
            "description": "产出的版本号，与 outputVersionId 同时有值；版本删除后不变（对账用）",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "params": {
            "$ref": "#/components/schemas/TaskParams"
          },
          "processingStartProgress": {
            "description": "processingStartedAt 时的进度 0 ~ 1",
            "format": "double",
            "type": "number"
          },
          "processingStartedAt": {
            "description": "本轮推理开始的时间（认领或模型加载完成时），估算剩余时间的起点；非运行中或加载模型中为 null",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "progress": {
            "description": "0 ~ 1",
            "format": "double",
            "type": "number"
          },
          "queuePosition": {
            "description": "排队中时在同一队列中的位置（从 1 开始，1 = 下一个被处理）；其他状态为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "queueRunning": {
            "description": "排队中时同一队列正在处理的任务数（所有用户，含分段），>0 说明算力已占满在等待；其他状态为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "report": {
            "$ref": "#/components/schemas/DetectReport",
            "description": "检测类工具成功后的报告；其他任务为 null"
          },
          "sourceVersionId": {
            "description": "以哪个版本为输入；null 表示原件",
            "type": [
              "string",
              "null"
            ]
          },
          "sourceVersionIndex": {
            "description": "输入版本号（0 = 原件），建任务时记下，版本删除后不变",
            "format": "int64",
            "type": "integer"
          },
          "startedAt": {
            "description": "开始处理的时间（第一次被 worker 认领）",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus"
          },
          "toolId": {
            "type": "string"
          },
          "toolName": {
            "description": "工具名称（含不在工具列表里的隐藏工具，如水印追踪）",
            "type": "string"
          },
          "urls": {
            "$ref": "#/components/schemas/ApiTaskURLs"
          },
          "watermarkAnalysis": {
            "description": "有识别分析报告（每个水印每一段的状态、需要复核的区间），用 getWatermarkAnalysis 读取；水印追踪、本机去水印成功后才有",
            "type": "boolean"
          },
          "watermarkFind": {
            "$ref": "#/components/schemas/WatermarkFindReport",
            "description": "自动查找水印（watermark-find）成功后的候选水印；其他任务为 null"
          },
          "watermarkRevision": {
            "description": "这次水印追踪的原尺寸遮罩可复用：提交去水印时 params.value.revisionId 传本任务 ID，直接用这份遮罩、不再重新识别",
            "type": "boolean"
          }
        },
        "required": [
          "urls",
          "id",
          "assetId",
          "assetName",
          "sourceVersionId",
          "sourceVersionIndex",
          "toolId",
          "toolName",
          "params",
          "costCredits",
          "engine",
          "status",
          "progress",
          "modelLoading",
          "queuePosition",
          "queueRunning",
          "error",
          "outputVersionId",
          "outputVersionIndex",
          "outputVersionDeleted",
          "report",
          "maskPreviewUrl",
          "watermarkAnalysis",
          "watermarkRevision",
          "watermarkFind",
          "createdAt",
          "startedAt",
          "processingStartedAt",
          "processingStartProgress",
          "finishedAt"
        ],
        "type": "object"
      },
      "ApiTaskURLs": {
        "additionalProperties": false,
        "properties": {
          "cancel": {
            "description": "POST 取消任务的同源相对路径",
            "type": "string"
          },
          "result": {
            "description": "获取结果及刷新签名下载地址的同源相对路径",
            "type": "string"
          },
          "status": {
            "description": "查询任务状态的同源相对路径",
            "type": "string"
          }
        },
        "required": [
          "status",
          "result",
          "cancel"
        ],
        "type": "object"
      },
      "TaskQuote": {
        "additionalProperties": false,
        "properties": {
          "balanceCredits": {
            "description": "当前积分余额，前端据此提示「积分不足 · 去购买」",
            "format": "int64",
            "type": "integer"
          },
          "canFit": {
            "description": "素材只在分辨率上超出工具上限，传 fitToLimits = true 可先缩小再处理",
            "type": "boolean"
          },
          "costCredits": {
            "description": "消耗的积分，提交时按这个数预扣（报价即成交价）",
            "format": "int64",
            "type": "integer"
          },
          "expiresAt": {
            "description": "报价有效期；过期后需重新报价",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "fixedCredits": {
            "description": "每任务固定费（积分）",
            "format": "int64",
            "type": "integer"
          },
          "imageUnits": {
            "format": "int64",
            "type": "integer"
          },
          "minCredits": {
            "description": "最低消耗（积分）",
            "format": "int64",
            "type": "integer"
          },
          "needsTopup": {
            "description": "problem 可通过购买积分解决（没买过积分的账户的视频时长限制）",
            "type": "boolean"
          },
          "outputHeight": {
            "format": "int64",
            "type": "integer"
          },
          "outputWidth": {
            "description": "处理后的画面宽度；problem 非 null 时为 0",
            "format": "int64",
            "type": "integer"
          },
          "priceId": {
            "description": "本次使用的价目版本 id",
            "type": [
              "string",
              "null"
            ]
          },
          "problem": {
            "description": "不能提交的原因（与 createTask 返回 400 时的文案一致）；null 表示可以提交",
            "type": [
              "string",
              "null"
            ]
          },
          "quoteId": {
            "description": "有效报价的 id；problem 非空时为 null",
            "type": [
              "string",
              "null"
            ]
          },
          "resized": {
            "description": "是否会先缩小输入（fitToLimits = true 且素材超出工具上限）",
            "type": "boolean"
          },
          "unitCredits": {
            "description": "单价（积分 / U；按次计费为每次的积分；分档计价为所在档每张的积分，动图为每帧）",
            "format": "int64",
            "type": "integer"
          },
          "unitDivisor": {
            "description": "单价分母；实际单价为 unitCredits / unitDivisor",
            "format": "int64",
            "type": "integer"
          },
          "unitSize": {
            "description": "计量单位像素或像素帧数；0 表示媒体默认单位",
            "format": "int64",
            "type": "integer"
          },
          "unitsMilli": {
            "description": "计费量 U × 1000（视频与动图 1 U = 1080p·30fps·1 秒输出画面，图片 1 U = 1600 万输出像素；按次计费为 1000）",
            "format": "int64",
            "type": "integer"
          },
          "usesFreeRush": {
            "type": "boolean"
          }
        },
        "required": [
          "imageUnits",
          "usesFreeRush",
          "quoteId",
          "expiresAt",
          "priceId",
          "fixedCredits",
          "unitSize",
          "unitDivisor",
          "costCredits",
          "unitsMilli",
          "unitCredits",
          "minCredits",
          "balanceCredits",
          "outputWidth",
          "outputHeight",
          "resized",
          "problem",
          "canFit",
          "needsTopup"
        ],
        "type": "object"
      },
      "ApiTaskResult": {
        "additionalProperties": false,
        "properties": {
          "maskPreviewUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "output": {
            "$ref": "#/components/schemas/AssetVersion",
            "description": "文件处理任务的输出版本；报告与遮罩预览类任务为空"
          },
          "report": {
            "$ref": "#/components/schemas/DetectReport"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus"
          },
          "taskId": {
            "type": "string"
          },
          "urlExpiresAt": {
            "description": "本次签名文件链接的有效期；到期重新 GET result，勿重新提交任务",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "watermarkAnalysisUrl": {
            "description": "使用 API Key 请求的分析报告地址",
            "type": [
              "string",
              "null"
            ]
          },
          "watermarkFind": {
            "$ref": "#/components/schemas/WatermarkFindReport"
          }
        },
        "required": [
          "taskId",
          "status",
          "output",
          "report",
          "watermarkFind",
          "maskPreviewUrl",
          "watermarkAnalysisUrl",
          "urlExpiresAt"
        ],
        "type": "object"
      },
      "WatermarkAnalysis": {
        "additionalProperties": false,
        "properties": {
          "detectionVersion": {
            "description": "识别算法版本（如 wm-mask@9）",
            "type": "string"
          },
          "frames": {
            "format": "int64",
            "type": "integer"
          },
          "height": {
            "format": "int64",
            "type": "integer"
          },
          "marksHash": {
            "description": "标记的规范化哈希",
            "type": "string"
          },
          "objects": {
            "description": "每个水印（同一水印同时出现在几处时各一项，objectId 相同）",
            "items": {
              "$ref": "#/components/schemas/WatermarkAnalysisObject"
            },
            "type": "array"
          },
          "policy": {
            "description": "不确定策略：skip / legacy / bridge",
            "type": "string"
          },
          "rate": {
            "description": "帧率（帧号与毫秒的换算）",
            "format": "double",
            "type": "number"
          },
          "review": {
            "description": "需要复核的区间（按时间排序）",
            "items": {
              "$ref": "#/components/schemas/WatermarkReview"
            },
            "type": "array"
          },
          "static": {
            "description": "不带时间的标记（整段固定处理）的说明",
            "items": {
              "$ref": "#/components/schemas/WatermarkStaticNote"
            },
            "type": "array"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          },
          "width": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version",
          "detectionVersion",
          "marksHash",
          "policy",
          "frames",
          "rate",
          "width",
          "height",
          "objects",
          "review",
          "static"
        ],
        "type": "object"
      },
      "WatermarkAnalysisObject": {
        "additionalProperties": false,
        "properties": {
          "color": {
            "$ref": "#/components/schemas/WatermarkColor",
            "description": "自动估计的水印颜色；没有稳定的纯色证据为 null"
          },
          "intervals": {
            "description": "有候选的时间段（没有候选的时间不在其中）",
            "items": {
              "$ref": "#/components/schemas/WatermarkInterval"
            },
            "type": "array"
          },
          "name": {
            "description": "内部名称（#0、#0.1）",
            "type": "string"
          },
          "objectId": {
            "description": "水印编号；旧标记没有编号为 null",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "pose": {
            "description": "位姿检测的每次尝试",
            "items": {
              "$ref": "#/components/schemas/WatermarkPoseAttempt"
            },
            "type": "array"
          },
          "shape": {
            "$ref": "#/components/schemas/WatermarkShape"
          }
        },
        "required": [
          "objectId",
          "name",
          "intervals",
          "shape",
          "color",
          "pose"
        ],
        "type": "object"
      },
      "WatermarkColor": {
        "additionalProperties": false,
        "properties": {
          "alpha": {
            "description": "不透明度中位数（启发式）",
            "format": "double",
            "type": "number"
          },
          "rgb": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "samples": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "rgb",
          "samples",
          "alpha"
        ],
        "type": "object"
      },
      "WatermarkInterval": {
        "additionalProperties": false,
        "properties": {
          "endFrame": {
            "format": "int64",
            "type": "integer"
          },
          "endMs": {
            "format": "int64",
            "type": "integer"
          },
          "reasons": {
            "description": "原因码（前端按码显示说明），如 match、bg_clutter、score_between、template_ambiguous（分数够但模板在背景上也能到这么高）、arb_rejected（这一帧没有可靠位置）、pose_inferred（位姿插值 / 延伸的推断帧）、handoff_conflict、bridged、auto_color",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source": {
            "description": "决定来源：observed / pose / bridge / manual / user-absent；空串 = 没有选中的候选",
            "type": "string"
          },
          "startFrame": {
            "format": "int64",
            "type": "integer"
          },
          "startMs": {
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "$ref": "#/components/schemas/WatermarkState"
          }
        },
        "required": [
          "startFrame",
          "endFrame",
          "startMs",
          "endMs",
          "state",
          "source",
          "reasons"
        ],
        "type": "object"
      },
      "WatermarkState": {
        "enum": [
          "present",
          "bridge",
          "manual",
          "uncertain",
          "absent"
        ],
        "type": "string"
      },
      "WatermarkPoseAttempt": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "description": "失败原因码：too_few_anchors / align_failed / no_separation / empty",
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source",
          "ok",
          "reason",
          "detail"
        ],
        "type": "object"
      },
      "WatermarkShape": {
        "additionalProperties": false,
        "properties": {
          "quality": {
            "description": "refined / user / box / keyframe / fallback / sibling（碎片，用另一关键帧的形状）/ invalid（形状无效，不执行）/ stroke（涂抹按笔画收紧）",
            "type": "string"
          },
          "reason": {
            "description": "自动收紧失败的原因",
            "type": "string"
          }
        },
        "required": [
          "quality",
          "reason"
        ],
        "type": "object"
      },
      "WatermarkReview": {
        "additionalProperties": false,
        "properties": {
          "box": {
            "$ref": "#/components/schemas/WatermarkBox",
            "description": "检测到的位置（相对画面）：audit_event 有，其余为 null"
          },
          "endFrame": {
            "format": "int64",
            "type": "integer"
          },
          "endMs": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "objectId": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "description": "handoff_conflict（几个来源的位置冲突）/ bridged（短空档补全）/ long_uncertain（较长时间不确定）/ position_jump（位置跳变）/ appear / disappear / pose_failed / pose_unconfirmed（只有位姿检测、接不上可信证据，未处理）/ layout_conflict（与一起移动的另一个水印在其关键帧上的位置对不上，未处理）/ shape_invalid（关键帧上只认出水印的碎片，未处理）/ blurred_unseen（画面太糊、看不见水印，未处理）/ layout_unverified（按一起移动的另一个水印推算的位置没能确认，未处理）/ audit_event（首尾、跳变处在没处理的位置检测到短暂出现的水印，未处理，见 box）/ residue（去除后疑似残留）",
            "type": "string"
          },
          "score": {
            "description": "检测分数（启发式的 z 分数，不是置信度）：audit_event 有，其余为 null",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "startFrame": {
            "format": "int64",
            "type": "integer"
          },
          "startMs": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "objectId",
          "name",
          "startFrame",
          "endFrame",
          "startMs",
          "endMs",
          "reason",
          "box",
          "score"
        ],
        "type": "object"
      },
      "WatermarkStaticNote": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "objectId": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "shape": {
            "type": "string"
          }
        },
        "required": [
          "objectId",
          "name",
          "shape",
          "reason"
        ],
        "type": "object"
      },
      "Tool": {
        "additionalProperties": false,
        "properties": {
          "animated": {
            "description": "能处理动图（多帧的 GIF / WebP / APNG / AVIF）：每一帧都处理，产物沿用原格式；为 false 的图片工具不接受动图",
            "type": "boolean"
          },
          "animatedPrice": {
            "$ref": "#/components/schemas/ToolPrice",
            "description": "处理动图的价格（积分）：bands 是每帧的价格（按每帧的输出像素分档），消耗 = max(minCredits, 所在档 × 帧数)；null 表示不处理动图或暂未开放"
          },
          "billing": {
            "$ref": "#/components/schemas/ToolBilling"
          },
          "description": {
            "type": "string"
          },
          "group": {
            "$ref": "#/components/schemas/ToolGroup"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/MediaKind"
          },
          "limits": {
            "$ref": "#/components/schemas/MediaLimits",
            "description": "对处理后画面的上限（超分按放大后的尺寸计算；时长、帧数按输入计算），超限的任务会被拒绝"
          },
          "name": {
            "type": "string"
          },
          "param": {
            "$ref": "#/components/schemas/ToolParamSpec"
          },
          "price": {
            "$ref": "#/components/schemas/ToolPrice",
            "description": "当前价格（积分）；null 表示暂未开放。实际消耗以 quoteTask 为准"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "kind",
          "group",
          "param",
          "price",
          "billing",
          "limits",
          "animated",
          "animatedPrice"
        ],
        "type": "object"
      },
      "ToolPrice": {
        "additionalProperties": false,
        "properties": {
          "bands": {
            "description": "按输出像素分档的每次价格（像素上限递增）；为空表示不分档",
            "items": {
              "$ref": "#/components/schemas/PriceBand"
            },
            "type": "array"
          },
          "fixedCredits": {
            "description": "每任务固定费（积分）；整单费用不低于 minCredits",
            "format": "int64",
            "type": "integer"
          },
          "minCredits": {
            "format": "int64",
            "type": "integer"
          },
          "unitCredits": {
            "format": "int64",
            "type": "integer"
          },
          "unitDivisor": {
            "description": "单价分母，实际单价为 unitCredits / unitDivisor；用整数精确表达小数价格",
            "format": "int64",
            "type": "integer"
          },
          "unitSize": {
            "description": "每计量单位的像素或像素帧数；0 表示沿用默认 U，图片为1600万像素、视频为62208000像素帧",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "unitCredits",
          "minCredits",
          "fixedCredits",
          "unitSize",
          "unitDivisor",
          "bands"
        ],
        "type": "object"
      },
      "PriceBand": {
        "additionalProperties": false,
        "properties": {
          "credits": {
            "description": "这一档每次的积分",
            "format": "int64",
            "maximum": 10000000,
            "minimum": 0,
            "type": "integer"
          },
          "maxPixels": {
            "description": "这一档输出像素（宽 × 高）的上限",
            "format": "int64",
            "maximum": 1000000000,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "maxPixels",
          "credits"
        ],
        "type": "object"
      },
      "ToolBilling": {
        "enum": [
          "fixed",
          "work"
        ],
        "type": "string"
      },
      "ToolGroup": {
        "enum": [
          "enhance",
          "restore",
          "detect"
        ],
        "type": "string"
      },
      "ToolParamSpec": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "none",
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "default": {
                "format": "int64",
                "type": "integer"
              },
              "options": {
                "items": {
                  "format": "int64",
                  "type": "integer"
                },
                "type": "array"
              },
              "smallInputMaxPixels": {
                "format": "int64",
                "type": "integer"
              },
              "smallInputMaxSide": {
                "format": "int64",
                "type": "integer"
              },
              "type": {
                "const": "scale",
                "type": "string"
              }
            },
            "required": [
              "type",
              "default",
              "options",
              "smallInputMaxPixels",
              "smallInputMaxSide"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "default": {
                "format": "int64",
                "type": "integer"
              },
              "options": {
                "items": {
                  "format": "int64",
                  "type": "integer"
                },
                "type": "array"
              },
              "type": {
                "const": "fps",
                "type": "string"
              }
            },
            "required": [
              "type",
              "default",
              "options"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "default": {
                "type": "boolean"
              },
              "type": {
                "const": "faceProtect",
                "type": "string"
              }
            },
            "required": [
              "type",
              "default"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "maxRegions": {
                "format": "int64",
                "type": "integer"
              },
              "type": {
                "const": "regions",
                "type": "string"
              }
            },
            "required": [
              "type",
              "maxRegions"
            ],
            "type": "object"
          }
        ]
      },
      "WalletSummary": {
        "additionalProperties": false,
        "properties": {
          "balanceCredits": {
            "description": "积分余额（含未到期的赠送积分）",
            "format": "int64",
            "type": "integer"
          },
          "giftCredits": {
            "description": "其中未到期的赠送积分（扣除时先扣）",
            "format": "int64",
            "type": "integer"
          },
          "giftExpiresAt": {
            "description": "最早一批赠送积分的到期时间；没有赠送积分时为 null",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "giftExpiringCredits": {
            "description": "最早到期的那一批还剩的积分",
            "format": "int64",
            "type": "integer"
          },
          "purchasedCredits": {
            "format": "int64",
            "type": "integer"
          },
          "subscriptionCredits": {
            "format": "int64",
            "type": "integer"
          },
          "subscriptionExpiresAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "subscriptionExpiringCredits": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "subscriptionExpiresAt",
          "subscriptionExpiringCredits",
          "subscriptionCredits",
          "purchasedCredits",
          "balanceCredits",
          "giftCredits",
          "giftExpiresAt",
          "giftExpiringCredits"
        ],
        "type": "object"
      }
    }
  }
}