{
  "openapi": "3.1.0",
  "info": {
    "title": "H3Hub API",
    "description": "Open-source AI video generation inference platform (MVP).",
    "version": "0.1.0"
  },
  "paths": {
    "/api/v1/video/generate": {
      "post": {
        "tags": [
          "video"
        ],
        "summary": "Generate Video",
        "description": "Submit a video generation task.",
        "operationId": "generate_video_api_v1_video_generate_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/generate-tags": {
      "post": {
        "tags": [
          "agent"
        ],
        "summary": "Generate Tags Route",
        "description": "发布弹窗预生成作品标签（LLM，纯文本；失败时前端可忽略继续发布）。",
        "operationId": "generate_tags_route_api_v1_agent_generate_tags_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateTagsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateTagsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agent/optimize-prompt": {
      "post": {
        "tags": [
          "agent"
        ],
        "summary": "Optimize Prompt Route",
        "operationId": "optimize_prompt_route_api_v1_agent_optimize_prompt_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptimizePromptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptimizePromptResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/task": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "List Tasks",
        "description": "当前用户的任务列表（按创建时间倒序，支持状态筛选与分页）。",
        "operationId": "list_tasks_api_v1_task_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/task/{task_id}": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "Get Task",
        "description": "Query task status.",
        "operationId": "get_task_api_v1_task__task_id__get",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tasks"
        ],
        "summary": "Delete Task",
        "description": "软删除自己的任务：仅终态（completed/failed）可删，生成中任务等结束再删。",
        "operationId": "delete_task_api_v1_task__task_id__delete",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/task/{task_id}/enhance": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Enhance Task",
        "description": "“变清晰”：对已完成的生成结果做纯 Real-ESRGAN 超分（不重渲 H3）。\n目标清晰度可调（1080p / 2K），按目标单价计费（DB app_settings.enhance_prices 可在线覆盖）；\n创建 model=enhance 子任务，由 Worker 直接对源结果 upscale，无需 H3 采样。\n幂等：已有 enhance 子任务则返回既有（首个目标生效）。",
        "operationId": "enhance_task_api_v1_task__task_id__enhance_post",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EnhanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tasks": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "List Tasks",
        "description": "当前用户的任务列表（按创建时间倒序，支持状态筛选与分页）。",
        "operationId": "list_tasks_api_v1_tasks_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tasks/{task_id}": {
      "get": {
        "tags": [
          "tasks"
        ],
        "summary": "Get Task",
        "description": "Query task status.",
        "operationId": "get_task_api_v1_tasks__task_id__get",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tasks"
        ],
        "summary": "Delete Task",
        "description": "软删除自己的任务：仅终态（completed/failed）可删，生成中任务等结束再删。",
        "operationId": "delete_task_api_v1_tasks__task_id__delete",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tasks/{task_id}/enhance": {
      "post": {
        "tags": [
          "tasks"
        ],
        "summary": "Enhance Task",
        "description": "“变清晰”：对已完成的生成结果做纯 Real-ESRGAN 超分（不重渲 H3）。\n目标清晰度可调（1080p / 2K），按目标单价计费（DB app_settings.enhance_prices 可在线覆盖）；\n创建 model=enhance 子任务，由 Worker 直接对源结果 upscale，无需 H3 采样。\n幂等：已有 enhance 子任务则返回既有（首个目标生效）。",
        "operationId": "enhance_task_api_v1_tasks__task_id__enhance_post",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EnhanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/result/{task_id}": {
      "get": {
        "tags": [
          "results"
        ],
        "summary": "Get Result",
        "description": "Download the generated video.\n\nR2 暂存：result_url 形如 videos/{task_id}.mp4，302 跳转预签名 GET（24h）；\n兼容旧本地落盘（直接 FileResponse）。",
        "operationId": "get_result_api_v1_result__task_id__get",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{user_id}/avatar": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Get User Avatar",
        "description": "公开头像取图：302 跳转 R2 预签名 GET（免登录，供 <img> 加载）。",
        "operationId": "get_user_avatar_api_v1_users__user_id__avatar_get",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Register",
        "description": "注册：创建用户；邀请码选填，仅用于获得注册赠送余额；\n邮箱验证开启时先验证再登录（不发令牌）。",
        "operationId": "register_api_v1_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__schemas__auth__RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TokenPair"
                    },
                    {
                      "$ref": "#/components/schemas/VerificationRequired"
                    }
                  ],
                  "title": "Response Register Api V1 Auth Register Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login",
        "description": "登录：账户锁定检查 → 密码校验 → TOTP 两阶段（启用时）。",
        "operationId": "login_api_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/mfa": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Mfa Confirm",
        "description": "第二步：校验 TOTP 验证码，签发正式会话与令牌。",
        "operationId": "mfa_confirm_api_v1_auth_mfa_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaConfirmRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Refresh",
        "description": "刷新令牌轮换：旧令牌作废、签发新对；复用已吊销令牌则整户吊销。",
        "operationId": "refresh_api_v1_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPair"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Logout",
        "description": "登出：吊销当前刷新令牌（访问令牌短效，到期自然失效）。",
        "operationId": "logout_api_v1_auth_logout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RefreshRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/resend-verification": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Resend Verification",
        "description": "重新发送注册邮箱验证邮件（未验证用户；无论结果如何都返回成功，防枚举）。",
        "operationId": "resend_verification_api_v1_auth_resend_verification_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendVerificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/forgot-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Forgot Password",
        "description": "忘记密码：给已注册用户发送重置链接（未注册也返回成功，防邮箱枚举）。",
        "operationId": "forgot_password_api_v1_auth_forgot_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/reset-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Reset Password",
        "description": "通过邮件重置链接设置新密码；一次性令牌，用后即焚并吊销全部会话。",
        "operationId": "reset_password_api_v1_auth_reset_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/confirm-change-password": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Confirm Change Password",
        "description": "点击修改密码确认邮件中的链接后执行：应用 pending 新密码并吊销全部会话。",
        "operationId": "confirm_change_password_api_v1_auth_confirm_change_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/verify-email": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Verify Email",
        "description": "邮箱验证（开关开启时使用）。",
        "operationId": "verify_email_api_v1_auth_verify_email_get",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "me"
        ],
        "summary": "Me",
        "description": "当前用户资料。",
        "operationId": "me_api_v1_me_get",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/profile": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Update Profile",
        "description": "更新昵称（展示名，非唯一、非登录凭证）。",
        "operationId": "update_profile_api_v1_me_profile_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/avatar/presign": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Presign Avatar Upload",
        "description": "签发 R2 头像上传 URL（键：avatars/{user_id}.{ext}）。",
        "operationId": "presign_avatar_upload_api_v1_me_avatar_presign_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvatarPresignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/avatar/complete": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Complete Avatar Upload",
        "description": "完成头像上传：HEAD 校验对象存在后更新 avatar 字段，并删除旧头像对象。",
        "operationId": "complete_avatar_upload_api_v1_me_avatar_complete_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvatarCompleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/avatar/put": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Proxy Avatar Upload",
        "description": "头像直传失败时的兜底：塔台接收原始字节并服务端写 R2。\n\n校验同 complete（object_key 必须属于当前用户），写完后前端照常调\n/avatar/complete。规避浏览器直传 R2 的 CORS/CSP/网络限制。",
        "operationId": "proxy_avatar_upload_api_v1_me_avatar_put_post",
        "parameters": [
          {
            "name": "object_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "title": "Object Key"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/transactions": {
      "get": {
        "tags": [
          "me"
        ],
        "summary": "My Transactions",
        "description": "余额流水。",
        "operationId": "my_transactions_api_v1_me_transactions_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app__api__routes__me__TransactionListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/api-keys": {
      "get": {
        "tags": [
          "me"
        ],
        "summary": "List Keys",
        "description": "我的 API Key 列表（永不返回明文）。",
        "operationId": "list_keys_api_v1_me_api_keys_get",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Create Key",
        "description": "生成一把新 API Key（明文仅此一次返回）。",
        "operationId": "create_key_api_v1_me_api_keys_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/api-keys/{key_id}/revoke": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Revoke Key",
        "description": "吊销一把 API Key（立即失效）。",
        "operationId": "revoke_key_api_v1_me_api_keys__key_id__revoke_post",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/topup": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Topup",
        "description": "模拟充值（MVP 不接真实支付；正式计费上线前仅供测试）。",
        "operationId": "topup_api_v1_me_topup_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__routes__me__TopupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/password": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Change Password",
        "description": "修改密码：校验旧密码。\n\n邮箱验证开启（EMAIL_VERIFICATION_REQUIRED）时走两段式：先发确认邮件，\n点击邮件链接后才真正更新密码；否则直接更新并吊销全部刷新令牌。",
        "operationId": "change_password_api_v1_me_password_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/sessions": {
      "get": {
        "tags": [
          "me"
        ],
        "summary": "My Sessions",
        "description": "当前账号的活动会话列表（用于设备管理）。",
        "operationId": "my_sessions_api_v1_me_sessions_get",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/sessions/{session_id}/revoke": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Revoke My Session",
        "description": "吊销指定会话；吊销当前会话时同步清除 Cookie。",
        "operationId": "revoke_my_session_api_v1_me_sessions__session_id__revoke_post",
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/logout-all": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Logout All",
        "description": "登出所有设备：吊销全部会话与刷新令牌。",
        "operationId": "logout_all_api_v1_me_logout_all_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/totp/setup": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Totp Setup",
        "description": "生成并加密保存 TOTP 密钥，返回绑定信息（secret 仅本次展示）。",
        "operationId": "totp_setup_api_v1_me_totp_setup_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TotpSetupOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/totp/confirm": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Totp Confirm",
        "description": "校验验证码并启用 TOTP。",
        "operationId": "totp_confirm_api_v1_me_totp_confirm_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TotpCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/totp/disable": {
      "post": {
        "tags": [
          "me"
        ],
        "summary": "Totp Disable",
        "description": "解绑 TOTP：需当前密码 + 验证码（防盗号后单凭验证码解绑）。",
        "operationId": "totp_disable_api_v1_me_totp_disable_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TotpDisableRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/pricing": {
      "get": {
        "tags": [
          "pricing"
        ],
        "summary": "Get Pricing",
        "operationId": "get_pricing_api_v1_pricing_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/upload/presign": {
      "post": {
        "tags": [
          "upload"
        ],
        "summary": "Presign Media Upload",
        "description": "校验参考媒体并签发 R2 预签名 PUT（浏览器直传，600s 有效）。",
        "operationId": "presign_media_upload_api_v1_upload_presign_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresignMediaRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upload/{media_id}/complete": {
      "post": {
        "tags": [
          "upload"
        ],
        "summary": "Complete Media Upload",
        "description": "前端直传完成后确认：校验 R2 对象存在并置 active。",
        "operationId": "complete_media_upload_api_v1_upload__media_id__complete_post",
        "parameters": [
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Media Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upload/{media_id}/put": {
      "post": {
        "tags": [
          "upload"
        ],
        "summary": "Proxy Media Upload",
        "description": "浏览器直传失败时的兜底：塔台接收原始字节并服务端写 R2。\n\n前置 presign 已建 pending 行并确定 object_key；本接口只负责把文件字节\n落到 R2，之后前端照常调 complete。规避浏览器直传 R2 的 CORS/CSP/网络限制。",
        "operationId": "proxy_media_upload_api_v1_upload__media_id__put_post",
        "parameters": [
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Media Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/topup": {
      "post": {
        "tags": [
          "billing",
          "billing"
        ],
        "summary": "Create Topup",
        "description": "创建充值订单。provider=mock 即时到账；yipay 通道预埋（未配置 503）。",
        "operationId": "create_topup_api_v1_billing_topup_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__routes__billing__TopupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopupOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/topup/{order_id}": {
      "get": {
        "tags": [
          "billing",
          "billing"
        ],
        "summary": "Get Topup",
        "description": "查询充值订单状态（易支付接入后，前端轮询到账用）。",
        "operationId": "get_topup_api_v1_billing_topup__order_id__get",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopupOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/billing/callback/yipay": {
      "get": {
        "tags": [
          "billing",
          "billing"
        ],
        "summary": "Yipay Callback",
        "description": "易支付异步通知：RSA 验签（平台公钥）→ 校验 TRADE_SUCCESS → 幂等入账。",
        "operationId": "yipay_callback_api_v1_billing_callback_yipay_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "billing",
          "billing"
        ],
        "summary": "Yipay Callback",
        "description": "易支付异步通知：RSA 验签（平台公钥）→ 校验 TRADE_SUCCESS → 幂等入账。",
        "operationId": "yipay_callback_api_v1_billing_callback_yipay_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/works": {
      "get": {
        "tags": [
          "works"
        ],
        "summary": "List Works",
        "description": "公开作品浏览（published 且未删除；featured/hot/new 排序 + 分页）。",
        "operationId": "list_works_api_v1_works_get",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(new|hot|featured)$",
              "default": "new",
              "title": "Sort"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "works"
        ],
        "summary": "Publish Work",
        "description": "把自己的已完成任务发布为作品（社区预埋，幂等校验：一任务一作品）。",
        "operationId": "publish_work_api_v1_works_post",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkPublish"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/by-task/{task_id}": {
      "get": {
        "tags": [
          "works"
        ],
        "summary": "Get Work By Task",
        "description": "按任务查作品（owner 专属：作品详情页预埋互动区用）。\n\n未发布/不属于当前用户 → 返回 200 + null（而非 404）：\n浏览器会为 404 打印网络错误日志，作品详情页每次打开都刷一条，\n用 null 语义避免噪音（2026-08-13）。",
        "operationId": "get_work_by_task_api_v1_works_by_task__task_id__get",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorkOut"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get Work By Task Api V1 Works By Task  Task Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/task/{task_id}": {
      "get": {
        "tags": [
          "works"
        ],
        "summary": "Get Public Work By Task",
        "description": "按任务查公开作品（任何人可看，published 且未删除才返回）。\n\n社区作品卡链接复用 /works?id=<task_id>，跨用户打开时任务接口 404，\n前端回退到本接口展示作品视图（2026-08-14）。",
        "operationId": "get_public_work_by_task_api_v1_works_task__task_id__get",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/WorkOut"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get Public Work By Task Api V1 Works Task  Task Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/{work_id}": {
      "get": {
        "tags": [
          "works"
        ],
        "summary": "Get Work",
        "operationId": "get_work_api_v1_works__work_id__get",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "works"
        ],
        "summary": "Delete Work",
        "operationId": "delete_work_api_v1_works__work_id__delete",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/{work_id}/like": {
      "post": {
        "tags": [
          "works"
        ],
        "summary": "Like Work",
        "operationId": "like_work_api_v1_works__work_id__like_post",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "works"
        ],
        "summary": "Unlike Work",
        "operationId": "unlike_work_api_v1_works__work_id__like_delete",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/{work_id}/favorite": {
      "post": {
        "tags": [
          "works"
        ],
        "summary": "Favorite Work",
        "operationId": "favorite_work_api_v1_works__work_id__favorite_post",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "works"
        ],
        "summary": "Unfavorite Work",
        "operationId": "unfavorite_work_api_v1_works__work_id__favorite_delete",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/{work_id}/comments": {
      "get": {
        "tags": [
          "works"
        ],
        "summary": "List Comments",
        "operationId": "list_comments_api_v1_works__work_id__comments_get",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentListOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "works"
        ],
        "summary": "Add Comment",
        "operationId": "add_comment_api_v1_works__work_id__comments_post",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/works/{work_id}/comments/{comment_id}": {
      "delete": {
        "tags": [
          "works"
        ],
        "summary": "Delete Comment",
        "operationId": "delete_comment_api_v1_works__work_id__comments__comment_id__delete",
        "parameters": [
          {
            "name": "work_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Work Id"
            }
          },
          {
            "name": "comment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Comment Id"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcquireRequest": {
        "properties": {
          "worker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Worker Id"
          },
          "instance_uuid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Uuid"
          },
          "gpu_index": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Index"
          }
        },
        "type": "object",
        "title": "AcquireRequest"
      },
      "AdjustBalanceRequest": {
        "properties": {
          "amount": {
            "type": "number",
            "maximum": 100000.0,
            "minimum": -100000.0,
            "title": "Amount"
          },
          "note": {
            "type": "string",
            "maxLength": 255,
            "title": "Note",
            "default": "管理员调整"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "AdjustBalanceRequest"
      },
      "AdminUserOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "nickname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nickname"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "totp_enabled": {
            "type": "boolean",
            "title": "Totp Enabled",
            "default": false
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "user"
          },
          "balance": {
            "type": "number",
            "title": "Balance",
            "default": 0.0
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified",
            "default": false
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "api_access_enabled": {
            "type": "boolean",
            "title": "Api Access Enabled",
            "default": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "created_at"
        ],
        "title": "AdminUserOut"
      },
      "AdminWorkListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AdminWorkOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "AdminWorkListOut"
      },
      "AdminWorkOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "duration": {
            "type": "integer",
            "title": "Duration"
          },
          "resolution": {
            "type": "string",
            "title": "Resolution"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "result_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Url"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags",
            "default": []
          },
          "likes_count": {
            "type": "integer",
            "title": "Likes Count",
            "default": 0
          },
          "favorites_count": {
            "type": "integer",
            "title": "Favorites Count",
            "default": 0
          },
          "comments_count": {
            "type": "integer",
            "title": "Comments Count",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "task_id",
          "user_id",
          "prompt",
          "model",
          "duration",
          "resolution",
          "status",
          "created_at"
        ],
        "title": "AdminWorkOut"
      },
      "AdvancedSettings": {
        "properties": {
          "sol_attn": {
            "type": "boolean",
            "title": "Sol Attn",
            "default": false
          },
          "sage_attention": {
            "type": "boolean",
            "title": "Sage Attention",
            "default": false
          },
          "vae_offload": {
            "type": "boolean",
            "title": "Vae Offload",
            "default": false
          },
          "turbo_lora": {
            "type": "boolean",
            "title": "Turbo Lora",
            "default": false
          }
        },
        "type": "object",
        "title": "AdvancedSettings",
        "description": "任务级高级设置（前端「高级设置」齿轮菜单，逐任务生效）。\n\n- sol_attn: Sol-Attn 稀疏注意力（5090/SM120 专用，长序列提速 2-4x）\n- sage_attention: SageAttention 全局注意力加速（需节点已安装，切换会重启推理进程）\n- vae_offload: VAE/动态显存 Offload（--lowvram，低显存兜底，速度明显变慢）\n- turbo_lora: Turbo LoRA 快速采样（larryvrh EMA 8-step，需节点已放置 LoRA 文件）\n缺省全部 False；任务未携带时节点沿用自身 .h3hub.env 默认配置。"
      },
      "ApiKeyCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Name",
            "default": "default"
          }
        },
        "type": "object",
        "title": "ApiKeyCreate"
      },
      "ApiKeyCreated": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "created_at",
          "api_key"
        ],
        "title": "ApiKeyCreated"
      },
      "ApiKeyListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ApiKeyOut"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ApiKeyListOut"
      },
      "ApiKeyOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "prefix",
          "created_at"
        ],
        "title": "ApiKeyOut"
      },
      "ApiKeyStatusRequest": {
        "properties": {
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "is_active"
        ],
        "title": "ApiKeyStatusRequest"
      },
      "AuditListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "AuditListOut"
      },
      "AuditOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "admin_id": {
            "type": "string",
            "title": "Admin Id"
          },
          "admin_email": {
            "type": "string",
            "title": "Admin Email"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "target_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Type"
          },
          "target_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Id"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "default": "manual"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "admin_id",
          "admin_email",
          "action",
          "created_at"
        ],
        "title": "AuditOut"
      },
      "AvatarCompleteRequest": {
        "properties": {
          "object_key": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Object Key"
          }
        },
        "type": "object",
        "required": [
          "object_key"
        ],
        "title": "AvatarCompleteRequest"
      },
      "AvatarPresignRequest": {
        "properties": {
          "ext": {
            "type": "string",
            "maxLength": 8,
            "minLength": 2,
            "title": "Ext"
          }
        },
        "type": "object",
        "required": [
          "ext"
        ],
        "title": "AvatarPresignRequest"
      },
      "BalanceOut": {
        "properties": {
          "balance": {
            "type": "number",
            "title": "Balance"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "balance"
        ],
        "title": "BalanceOut"
      },
      "Body_upload_result_internal_results_upload_post": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "file"
        ],
        "title": "Body_upload_result_internal_results_upload_post"
      },
      "ChatOut": {
        "properties": {
          "reply": {
            "type": "string",
            "title": "Reply"
          },
          "actions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Actions",
            "default": []
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          }
        },
        "type": "object",
        "required": [
          "reply"
        ],
        "title": "ChatOut"
      },
      "ChatRequest": {
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ChatRequest"
      },
      "ClaimRequest": {
        "properties": {
          "gpu_id": {
            "type": "string",
            "title": "Gpu Id"
          },
          "instance_uuid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Uuid"
          },
          "gpu_index": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Index"
          }
        },
        "type": "object",
        "required": [
          "gpu_id"
        ],
        "title": "ClaimRequest"
      },
      "CommentCreate": {
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "content"
        ],
        "title": "CommentCreate"
      },
      "CommentListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CommentOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "CommentListOut"
      },
      "CommentOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "work_id": {
            "type": "string",
            "title": "Work Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "nickname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nickname"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "work_id",
          "user_id",
          "content",
          "created_at"
        ],
        "title": "CommentOut"
      },
      "CompleteRequest": {
        "properties": {
          "result_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Url"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "instance_uuid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Uuid"
          },
          "gpu_index": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Index"
          },
          "is_mock": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Mock"
          },
          "gpu_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Seconds"
          }
        },
        "type": "object",
        "title": "CompleteRequest"
      },
      "ConfirmChangePasswordRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 8,
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "token"
        ],
        "title": "ConfirmChangePasswordRequest"
      },
      "EnhancePricesUpdate": {
        "properties": {
          "enhance_prices": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Enhance Prices",
            "description": "{\"1080p\": 0.5, \"2k\": 0.8}"
          }
        },
        "type": "object",
        "required": [
          "enhance_prices"
        ],
        "title": "EnhancePricesUpdate"
      },
      "EnhanceRequest": {
        "properties": {
          "target": {
            "type": "string",
            "title": "Target",
            "default": "1080p"
          }
        },
        "type": "object",
        "title": "EnhanceRequest"
      },
      "FailTaskRequest": {
        "properties": {
          "error": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Error",
            "default": "管理员手动判定失败"
          }
        },
        "type": "object",
        "title": "FailTaskRequest"
      },
      "FleetDef": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "strategy": {
            "type": "string",
            "title": "Strategy",
            "default": "greedy"
          },
          "max_parallel": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Parallel"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "FleetDef"
      },
      "ForgotPasswordRequest": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ForgotPasswordRequest"
      },
      "GenerateInvitesRequest": {
        "properties": {
          "count": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Count",
            "default": 10
          },
          "note": {
            "type": "string",
            "maxLength": 255,
            "title": "Note",
            "default": ""
          },
          "credit": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 100000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Credit",
            "description": "注册赠送余额(元)；缺省=全局 signup_credit；0=不赠送"
          }
        },
        "type": "object",
        "title": "GenerateInvitesRequest"
      },
      "GenerateResponse": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "status"
        ],
        "title": "GenerateResponse"
      },
      "GenerateTagsRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 7000,
            "minLength": 1,
            "title": "Prompt"
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "GenerateTagsRequest",
        "description": "发布弹窗预生成作品标签（LLM，纯文本模式）。"
      },
      "GenerateTagsResponse": {
        "properties": {
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "tags"
        ],
        "title": "GenerateTagsResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HeartbeatRequest": {
        "properties": {
          "instance_uuid": {
            "type": "string",
            "title": "Instance Uuid"
          },
          "worker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Worker Id"
          },
          "patch_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Patch Version"
          },
          "gpu_available": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Available"
          },
          "gpu_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Tier"
          },
          "vram_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vram Mb"
          },
          "max_px_frames": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Px Frames"
          },
          "node_group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Node Group"
          }
        },
        "type": "object",
        "required": [
          "instance_uuid"
        ],
        "title": "HeartbeatRequest"
      },
      "InviteListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InviteOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "stats": {
            "additionalProperties": true,
            "type": "object",
            "title": "Stats"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "stats"
        ],
        "title": "InviteListOut"
      },
      "InviteOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "used_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used By"
          },
          "used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "replaced_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replaced By"
          },
          "credit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credit"
          }
        },
        "type": "object",
        "required": [
          "code",
          "created_at"
        ],
        "title": "InviteOut"
      },
      "LlmUsageListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/LlmUsageOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "totals": {
            "additionalProperties": true,
            "type": "object",
            "title": "Totals"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "totals"
        ],
        "title": "LlmUsageListOut"
      },
      "LlmUsageOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "user_email": {
            "type": "string",
            "title": "User Email"
          },
          "kind": {
            "type": "string",
            "title": "Kind",
            "default": "prompt_optimize"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "default": ""
          },
          "prompt_preview": {
            "type": "string",
            "title": "Prompt Preview",
            "default": ""
          },
          "refs_summary": {
            "type": "string",
            "title": "Refs Summary",
            "default": ""
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens",
            "default": 0
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens",
            "default": 0
          },
          "cost": {
            "type": "number",
            "title": "Cost",
            "default": 0.0
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms",
            "default": 0
          },
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "user_email",
          "created_at"
        ],
        "title": "LlmUsageOut"
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest"
      },
      "MediaListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MediaOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "MediaListOut"
      },
      "MediaOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "object_key": {
            "type": "string",
            "title": "Object Key"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type",
            "default": ""
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes",
            "default": 0
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "kind",
          "object_key",
          "status",
          "created_at",
          "expires_at"
        ],
        "title": "MediaOut"
      },
      "MfaConfirmRequest": {
        "properties": {
          "mfa_token": {
            "type": "string",
            "title": "Mfa Token"
          },
          "code": {
            "type": "string",
            "maxLength": 8,
            "minLength": 6,
            "title": "Code"
          }
        },
        "type": "object",
        "required": [
          "mfa_token",
          "code"
        ],
        "title": "MfaConfirmRequest"
      },
      "OptimizePromptRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 7000,
            "minLength": 1,
            "title": "Prompt"
          },
          "duration": {
            "type": "integer",
            "maximum": 60.0,
            "minimum": 1.0,
            "title": "Duration",
            "default": 5
          },
          "resolution": {
            "type": "string",
            "title": "Resolution",
            "default": "720p"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "ref_media_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 15,
            "title": "Ref Media Ids"
          },
          "model": {
            "type": "string",
            "pattern": "^(t2v|r2v|i2v)$",
            "title": "Model",
            "default": "t2v"
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "OptimizePromptRequest",
        "description": "LLM 提示词优化请求（创作页「LLM 提示词优化」开关，提交前自动调用）。"
      },
      "OptimizePromptResponse": {
        "properties": {
          "optimized_prompt": {
            "type": "string",
            "title": "Optimized Prompt"
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "optimized_prompt"
        ],
        "title": "OptimizePromptResponse"
      },
      "PasswordChangeRequest": {
        "properties": {
          "old_password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Old Password"
          },
          "new_password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 8,
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "old_password",
          "new_password"
        ],
        "title": "PasswordChangeRequest"
      },
      "PowerActionRequest": {
        "properties": {
          "confirm": {
            "type": "string",
            "title": "Confirm",
            "default": ""
          }
        },
        "type": "object",
        "title": "PowerActionRequest"
      },
      "PresignMediaRequest": {
        "properties": {
          "kind": {
            "type": "string",
            "pattern": "^(image|video|audio)$",
            "title": "Kind"
          },
          "filename": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Filename"
          },
          "content_type": {
            "type": "string",
            "maxLength": 128,
            "title": "Content Type",
            "default": ""
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Size Bytes"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "filename",
          "size_bytes"
        ],
        "title": "PresignMediaRequest"
      },
      "PresignRequest": {
        "properties": {
          "task_id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F-]{36}$",
            "title": "Task Id"
          }
        },
        "type": "object",
        "required": [
          "task_id"
        ],
        "title": "PresignRequest"
      },
      "PriceMatrixUpdate": {
        "properties": {
          "price_matrix": {
            "additionalProperties": true,
            "type": "object",
            "title": "Price Matrix",
            "description": "{\"t2v\": {...}, \"r2v\": {...}, \"i2v\": {...}}"
          }
        },
        "type": "object",
        "required": [
          "price_matrix"
        ],
        "title": "PriceMatrixUpdate"
      },
      "PricingModelUpdate": {
        "properties": {
          "pricing_model": {
            "type": "string",
            "pattern": "^(matrix|v2)$",
            "title": "Pricing Model"
          }
        },
        "type": "object",
        "required": [
          "pricing_model"
        ],
        "title": "PricingModelUpdate"
      },
      "PricingV2Update": {
        "properties": {
          "pricing_v2": {
            "additionalProperties": true,
            "type": "object",
            "title": "Pricing V2",
            "description": "多维度计价系数（见 docs/planning/价格多维度计价方案.md）"
          }
        },
        "type": "object",
        "required": [
          "pricing_v2"
        ],
        "title": "PricingV2Update"
      },
      "ProfileUpdateRequest": {
        "properties": {
          "nickname": {
            "type": "string",
            "maxLength": 24,
            "minLength": 1,
            "title": "Nickname"
          }
        },
        "type": "object",
        "required": [
          "nickname"
        ],
        "title": "ProfileUpdateRequest"
      },
      "ProgressRequest": {
        "properties": {
          "stage": {
            "type": "string",
            "pattern": "^(loading|sampling|encoding|upscaling)$",
            "title": "Stage"
          },
          "step": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Step"
          },
          "total_steps": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Steps"
          },
          "eta_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Eta Seconds"
          },
          "chunk_index": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunk Index"
          }
        },
        "type": "object",
        "required": [
          "stage"
        ],
        "title": "ProgressRequest"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token"
          }
        },
        "type": "object",
        "required": [
          "refresh_token"
        ],
        "title": "RefreshRequest"
      },
      "ResendVerificationRequest": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ResendVerificationRequest"
      },
      "ResetPasswordRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 8,
            "title": "Token"
          },
          "new_password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 8,
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "token",
          "new_password"
        ],
        "title": "ResetPasswordRequest"
      },
      "SchedulerFleetsUpdate": {
        "properties": {
          "fleets": {
            "additionalProperties": {
              "$ref": "#/components/schemas/FleetDef"
            },
            "type": "object",
            "title": "Fleets"
          }
        },
        "type": "object",
        "required": [
          "fleets"
        ],
        "title": "SchedulerFleetsUpdate"
      },
      "SchedulerGroupsUpdate": {
        "properties": {
          "groups": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object",
            "title": "Groups"
          }
        },
        "type": "object",
        "required": [
          "groups"
        ],
        "title": "SchedulerGroupsUpdate"
      },
      "SchedulerMembershipUpdate": {
        "properties": {
          "memberships": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Memberships"
          }
        },
        "type": "object",
        "required": [
          "memberships"
        ],
        "title": "SchedulerMembershipUpdate"
      },
      "SchedulerSettingsReset": {
        "properties": {
          "keys": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keys"
          },
          "groups": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Groups"
          },
          "all": {
            "type": "boolean",
            "title": "All",
            "default": false
          }
        },
        "type": "object",
        "title": "SchedulerSettingsReset"
      },
      "SchedulerSettingsUpdate": {
        "properties": {
          "overrides": {
            "additionalProperties": true,
            "type": "object",
            "title": "Overrides"
          }
        },
        "type": "object",
        "required": [
          "overrides"
        ],
        "title": "SchedulerSettingsUpdate"
      },
      "SchedulerWhitelistUpdate": {
        "properties": {
          "uuids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Uuids"
          }
        },
        "type": "object",
        "required": [
          "uuids"
        ],
        "title": "SchedulerWhitelistUpdate"
      },
      "SchedulerWiresUpdate": {
        "properties": {
          "wires": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WireSpec"
            },
            "type": "object",
            "title": "Wires"
          }
        },
        "type": "object",
        "required": [
          "wires"
        ],
        "title": "SchedulerWiresUpdate"
      },
      "TaskCreate": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 7000,
            "minLength": 1,
            "title": "Prompt"
          },
          "duration": {
            "type": "integer",
            "maximum": 60.0,
            "minimum": 1.0,
            "title": "Duration",
            "default": 5
          },
          "resolution": {
            "type": "string",
            "pattern": "^(360p|480p|720p)$",
            "title": "Resolution",
            "default": "720p"
          },
          "model": {
            "type": "string",
            "pattern": "^(t2v|r2v|i2v)$",
            "title": "Model",
            "default": "t2v"
          },
          "ref_media_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 15,
            "title": "Ref Media Ids"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "stage": {
            "type": "string",
            "pattern": "^(preview|final)$",
            "title": "Stage",
            "default": "preview"
          },
          "steps": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 50.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2048.0,
                "minimum": 256.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2048.0,
                "minimum": 256.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          },
          "llm_optimize": {
            "type": "boolean",
            "title": "Llm Optimize",
            "default": false
          },
          "advanced": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdvancedSettings"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "TaskCreate"
      },
      "TaskListAdminOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TaskOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "TaskListAdminOut"
      },
      "TaskListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TaskOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "TaskListOut"
      },
      "TaskOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "original_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Prompt"
          },
          "duration": {
            "type": "integer",
            "title": "Duration"
          },
          "resolution": {
            "type": "string",
            "title": "Resolution"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "default": "t2v"
          },
          "stage": {
            "type": "string",
            "title": "Stage",
            "default": "preview"
          },
          "parent_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent Task Id"
          },
          "final_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Final Task Id"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "steps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps"
          },
          "ref_media_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Ref Media Ids"
          },
          "enhance_target": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enhance Target"
          },
          "advanced": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Advanced"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "tier": {
            "type": "string",
            "title": "Tier",
            "default": "standard"
          },
          "chunk_count": {
            "type": "integer",
            "title": "Chunk Count",
            "default": 1
          },
          "gpu_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Id"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "result_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Url"
          },
          "is_mock": {
            "type": "boolean",
            "title": "Is Mock",
            "default": false
          },
          "cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost"
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "gpu_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Seconds"
          },
          "refunded": {
            "type": "boolean",
            "title": "Refunded",
            "default": false
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "progress": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress"
          },
          "queue_position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queue Position"
          },
          "gpu_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Tier"
          },
          "estimated_wait_s": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Wait S"
          },
          "ref_media": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Ref Media"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "prompt",
          "duration",
          "resolution",
          "status",
          "created_at"
        ],
        "title": "TaskOut"
      },
      "TokenPair": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "bearer"
          },
          "user": {
            "$ref": "#/components/schemas/UserOut"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "refresh_token",
          "user"
        ],
        "title": "TokenPair"
      },
      "TopupOut": {
        "properties": {
          "order_id": {
            "type": "string",
            "title": "Order Id"
          },
          "out_trade_no": {
            "type": "string",
            "title": "Out Trade No"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "balance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Balance"
          },
          "pay_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pay Url"
          },
          "pay_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pay Type"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "order_id",
          "out_trade_no",
          "status"
        ],
        "title": "TopupOut"
      },
      "TotpCodeRequest": {
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 8,
            "minLength": 6,
            "title": "Code"
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "TotpCodeRequest"
      },
      "TotpDisableAdminRequest": {
        "properties": {
          "confirm": {
            "type": "string",
            "title": "Confirm",
            "default": ""
          }
        },
        "type": "object",
        "title": "TotpDisableAdminRequest"
      },
      "TotpDisableRequest": {
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 8,
            "minLength": 6,
            "title": "Code"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "code",
          "password"
        ],
        "title": "TotpDisableRequest"
      },
      "TotpSetupOut": {
        "properties": {
          "otpauth_url": {
            "type": "string",
            "title": "Otpauth Url"
          },
          "secret": {
            "type": "string",
            "title": "Secret"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "otpauth_url",
          "secret"
        ],
        "title": "TotpSetupOut"
      },
      "UserApiAccessRequest": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "UserApiAccessRequest"
      },
      "UserListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AdminUserOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "UserListOut"
      },
      "UserOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "nickname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nickname"
          },
          "avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "user"
          },
          "balance": {
            "type": "number",
            "title": "Balance",
            "default": 0.0
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified",
            "default": false
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "created_at"
        ],
        "title": "UserOut"
      },
      "UserPasswordRequest": {
        "properties": {
          "new_password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 8,
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "new_password"
        ],
        "title": "UserPasswordRequest"
      },
      "UserRoleRequest": {
        "properties": {
          "role": {
            "type": "string",
            "pattern": "^(user|admin|operator|auditor)$",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "UserRoleRequest"
      },
      "UserStatusRequest": {
        "properties": {
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "is_active"
        ],
        "title": "UserStatusRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerificationRequired": {
        "properties": {
          "verification_required": {
            "type": "boolean",
            "title": "Verification Required",
            "default": true
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": ""
          },
          "verification_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verification Link"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "VerificationRequired",
        "description": "邮箱验证开启时注册的响应：不发令牌，提示查收邮件。"
      },
      "WhitelistMeRequest": {
        "properties": {
          "instance_uuid": {
            "type": "string",
            "title": "Instance Uuid"
          },
          "ip": {
            "type": "string",
            "title": "Ip",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "instance_uuid"
        ],
        "title": "WhitelistMeRequest"
      },
      "WireSpec": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind",
            "default": "route"
          },
          "weight": {
            "type": "integer",
            "title": "Weight",
            "default": 1
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": true
          }
        },
        "type": "object",
        "title": "WireSpec"
      },
      "WorkListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "WorkListOut"
      },
      "WorkOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "author_nickname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author Nickname"
          },
          "author_avatar": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author Avatar"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "default": "t2v"
          },
          "duration": {
            "type": "integer",
            "title": "Duration",
            "default": 5
          },
          "resolution": {
            "type": "string",
            "title": "Resolution",
            "default": "480p"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "width": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Width"
          },
          "height": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Height"
          },
          "result_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Url"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "published"
          },
          "is_featured": {
            "type": "boolean",
            "title": "Is Featured",
            "default": false
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "likes_count": {
            "type": "integer",
            "title": "Likes Count",
            "default": 0
          },
          "favorites_count": {
            "type": "integer",
            "title": "Favorites Count",
            "default": 0
          },
          "comments_count": {
            "type": "integer",
            "title": "Comments Count",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "liked": {
            "type": "boolean",
            "title": "Liked",
            "default": false
          },
          "favorited": {
            "type": "boolean",
            "title": "Favorited",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "task_id",
          "user_id",
          "prompt",
          "created_at"
        ],
        "title": "WorkOut"
      },
      "WorkPublish": {
        "properties": {
          "task_id": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Task Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 12,
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "task_id"
        ],
        "title": "WorkPublish"
      },
      "app__api__routes__admin__billing__TransactionListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/app__api__routes__admin__billing__TransactionOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "TransactionListOut"
      },
      "app__api__routes__admin__billing__TransactionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "amount",
          "kind",
          "created_at"
        ],
        "title": "TransactionOut"
      },
      "app__api__routes__billing__TopupRequest": {
        "properties": {
          "amount": {
            "type": "number",
            "maximum": 10000.0,
            "minimum": 0.01,
            "title": "Amount"
          },
          "pay_type": {
            "type": "string",
            "pattern": "^(alipay|wxpay)$",
            "title": "Pay Type",
            "default": "alipay"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "TopupRequest"
      },
      "app__api__routes__internal__RegisterRequest": {
        "properties": {
          "instance_uuid": {
            "type": "string",
            "title": "Instance Uuid"
          },
          "hostname": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hostname"
          },
          "patch_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Patch Version"
          },
          "gpu_available": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Available"
          },
          "gpu_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Tier"
          },
          "vram_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vram Mb"
          },
          "max_px_frames": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Px Frames"
          },
          "node_group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Node Group"
          }
        },
        "type": "object",
        "required": [
          "instance_uuid"
        ],
        "title": "RegisterRequest"
      },
      "app__api__routes__me__TopupRequest": {
        "properties": {
          "amount": {
            "type": "number",
            "maximum": 10000.0,
            "minimum": 0.01,
            "title": "Amount"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "TopupRequest"
      },
      "app__api__routes__me__TransactionListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/app__api__routes__me__TransactionOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "TransactionListOut"
      },
      "app__api__routes__me__TransactionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Id"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "amount",
          "kind",
          "created_at"
        ],
        "title": "TransactionOut"
      },
      "app__schemas__auth__RegisterRequest": {
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 8,
            "title": "Password"
          },
          "invite_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "minLength": 4
              },
              {
                "type": "null"
              }
            ],
            "title": "Invite Code"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "RegisterRequest"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.h3hub.cn",
      "description": "Production"
    },
    {
      "url": "http://localhost:8001",
      "description": "Local development"
    }
  ]
}