{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 身形塑形",
    "description": "# 概览\nAI 身形塑形接口：塑形与瘦身\n用 AI 身体编辑，照片里更有底气！把身材瘦下去、塑形、优化，比例自然又亮眼。腰、手臂、大腿、胸，任何部位都能轻松调整；点一下就是自然出彩的效果。\n\n\n## 接入指南\n本指南将带您走完全流程：\n\nAI 身形塑形接口的流程：\n\n**接口地址：** `/s2s/v2.0/task/body-reshape`\n\n**需要鉴权：** `Authorization: Bearer YOUR_API_KEY`\n\n**流程步骤：**\n\n1. **准备图片上传：**\n    - 准备好要上传的自拍照。\n    - 调用 File 接口 `/s2s/v2.0/file` 取得上传 URL 与对应的 `file_id`。\n    - 用提供的上传 URL 把自拍照上传上去。\n\n2. **多人合照的可选预处理：**\n    - 图中有多于一人时，请先对自拍照做预处理。\n\n3. **设置 AI 身形塑形特效：**\n    - 先选好合适的 AI 身形塑形参数。\n\n4. **发起 AI 任务并取得 Task ID：**\n    - 把 `file_id` 连同选好的特效配置，通过 HTTP POST 请求送到 `/s2s/v2.0/task/body-reshape`。\n    - 响应会返回一个唯一的任务 ID，用于标识本次调用。\n\n5. **轮询任务状态（持续检查）：**\n    - 用取得的 `task_id` 通过 HTTP GET 请求定期轮询任务状态（例如 `GET /s2s/v2.0/task/body-reshape/${task_id}`）。\n    - 持续留意：\n    - `Task_status = \"success\"`（处理完成）。\n    - `Task_status = \"error\"`（视情况排查或重试）。\n    - 状态转为 success 后，按流程继续往下走。\n\n这套规整的流程能顺畅对接用户输入、自动监控任务，并顺利取回结果。\n\n---\n\n* API Playground\n\n用官方演练场交互式地体验和测试接口：\n\n**API Playground：**\n[http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/](http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/)\n\n---\n\n* 鉴权\n- 请在请求头中以 **Bearer Token** 方式带上您的 API 密钥：\n```\nAuthorization: Bearer YOUR_API_KEY\n```\nAPI Key 可在 https://yce.makeupar.com/api-console/en/api-keys/ 获取。\n\n\n* 1. 上传图片\n\n您可以把文件直接上传到服务器，也可以在 AI 任务参数中提供有效的图片 URL。\n\n* 上传接口\n\n```\nPOST /s2s/v2.0/file\n```\n\n如果您已有公开可访问的图片 URL，这一步可以跳过。\n\n---\n\n* 2. 准备特效模板\n\n* 预处理\n输出以像素坐标表示的检测边界框。请用结果的索引在稍后创建 AI 身形塑形任务。\n```\n{\n\"timed\": number,\n\"result\": [\n{\n \"left\": number,\n \"top\": number,\n \"width\": number,\n \"height\": number\n}\n]\n}\n```\n\n* 特效模板 JSON Schema\n```\n{\n\"version\": \"1.0\",\n\"index\": 0,\n\"features\": {\n\"arm\": 0, // -100~100\n\"breast_left\": 0, // -100~100\n\"breast_right\": 0, // -100~100\n\"hip\": 0, // -100~100\n\"hip_lift\": 0, // -100~100\n\"leg\": 0, // -100~100\n\"neck_left\": 0, // 0~100\n\"neck_right\": 0, // 0~100\n\"shoulder_left\": 0, // -100~100\n\"shoulder_right\": 0, // -100~100\n\"squared_shoulder_left\": 0, // -100~100\n\"squared_shoulder_right\": 0, // -100~100\n\"slim\": 0, // -100~100\n\"taller\": 0, // 0~100\n\"waist\": 0, // -100~100\n\"belly\": 0 // -100~100\n}\n}\n```\nindex：预处理检测到的身体对象下标。选填，默认 0。\nfeatures：至少需要 1 项非零的 AI 身形塑形参数，不能全为 0。\n\n\n* 请求示例（可直接发送）\n```\n{\n \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/body_reshape_02_7777218379.jpg\",\n \"version\": \"1.0\",\n \"index\": 0,\n \"features\": {\n\"arm\": 0,\n\"waist\": -20,\n\"taller\": 80,\n\"squared_shoulder_left\": 10,\n\"squared_shoulder_right\": 10,\n\"neck_left\": 0,\n\"neck_right\": 0,\n\"hip\": 10,\n\"breast_left\": 30,\n\"breast_right\": 30,\n\"slim\": -70,\n\"shoulder_left\": 30,\n\"shoulder_right\": 30,\n\"leg\": -30,\n\"hip_lift\": 0,\n\"belly\": -50\n }\n}\n```\n\n\n* 3. 创建 AI 身形塑形任务并轮询结果\n\n图片和完整的特效参数备齐后即可创建任务。接口异步处理请求，您需要轮询任务状态，直到状态变为 `success` 或 `error`。\n\n* 创建任务接口\n\n```\nPOST /s2s/v2.0/task/body-reshape\n```\n\n* 轮询接口\n\n```\nGET /s2s/v2.0/task/body-reshape/{task_id}\n```\n\n---\n\n## 文件规格与错误码\n\n* AI 身形塑形规格\n\n**支持的自拍视角**\n全身照，面部表情与身体姿态都要清楚可见。\n\n![](https://plugins-media.makeupar.com/strapi/assets/thumbnail_body_reshape_02_7777218379.jpg)\n\n**可见性与姿态要求**\n\n| **部位** | **源图必须满足的条件** |\n|------------|---------------------------------------------------|\n| **颈部** | 源图中颈部必须可见。 |\n| **手臂** | 双臂——上臂、前臂与手——都要完整呈现。 |\n| **腿部** | 整条腿都要在画面内。 |\n| **臀部** | 臀部需要在画面内。 |\n| **提臀** | 臀部需要在画面内。 |\n| **肩部** | • 肩部必须可见。<br>• 不允许举手。<br>• 不允许 90° 侧身姿态。 |\n| **腹部** | 腹部必须可见。 |\n| **腰部** | 腰部必须可见。 |\n| **胸部** | • 胸部区域需在画面内。<br>• 拍摄范围应包含臀部（即不能是\"不含臀部的半身照\"）。<br>• 胸部中间位置必须呈现。 |\n| **显瘦** | 肩部需要在画面内。 |\n| **增高** | • 臀部必须呈现。<br>• 半身照应包含腿部（即腿部可见）。 |\n\n\n\n**AI 身形塑形自定义参数说明**\n\n| 类别 | 参数 | 作用 | 最小值（-100 / 0） | 最大值（100） |\n| -------- | --------- | -------- | -------------------- | --------------- |\n| 手臂| Intensity | 调整手臂粗细 | 细 | 粗 |\n| 腹部| Intensity | 调整腹部凸起 | 平坦 | 凸出 |\n| 胸部| Intensity（左 / 右） | 分别调整两侧胸部体积 | 平坦 | 饱满 |\n| 提臀 | Intensity | 调整臀部曲线与上提（起到提臀效果） | 紧致（上提收紧） | 圆润（上提且更饱满） |\n| 臀宽 | Intensity | 调整臀部整体宽度 | 窄 | 宽 |\n| 腿部| Intensity | 调整腿部粗细 | 细 | 粗|\n| 颈部| Intensity（左 / 右） | 分别调整两侧颈部轮廓与收紧 | 原样（0）| 收进去 |\n| 肩宽 | Intensity（左 / 右） | 分别调整两侧肩部跨度 | 窄 | 宽 |\n| 肩型 | Intensity（左 / 右） | 分别调整两侧肩部角度与斜度 | 溜肩 | 平肩 |\n| 显瘦| Intensity | 调整整体身体曲线 | 纤瘦 | 曲线明显 |\n| 增高| Intensity | 调整整体人物身高 | 原样（0） | 更高 |\n| 腰部| Intensity | 调整腰线的宽窄 | 窄 | 宽 |\n\n**说明：** *“左”与“右”以人物自身视角为准，不是观看者屏幕的左右侧。*\n\n\n---\n\n* 支持的格式与尺寸\n\n|AI 功能|支持尺寸|支持文件大小|支持格式|\n| ---- | ---- | ---- | ---- |\n|AI 身形塑形|长边 <= 2048，短边 >= 320|< 10MB|jpg/jpeg/png|\n\n* 错误码\n\n| 错误码 | 说明 |\n| ---- | ---- |\n| RUNTIME_ERROR | 运行时发生未知错误 |\n| PHOTO_DETECTION_FAIL | 用户图片无法正确处理，例如未检测到手 |\n| PHOTO_CHECK_INVALID | 用户图片的姿态或尺寸不符合要求 |\n| INPUT_ERROR | 输入文件格式有误 |\n| INPUT_MAIN_IMAGE_EMPTY | 必须提供用户图片 |\n\n\n* 运行环境与依赖\n\n| 示例代码语言 / 工具 | 建议运行时版本 |\n|---|---|\n| cURL | - bash >= 3.2</br>- curl >= 7.58 (modern TLS/HTTP support)</br>- jq >= 1.6 (robust JSON parsing) |\n| Node.js (JavaScript) | Node >= 18 (for global fetch) |\n| JavaScript | - Chrome / Edge >= 80</br>- Firefox >= 74</br>- Safari >= 13.1 |\n| PHP | PHP >= 7.4 (for modern TLS/compat), ext-curl (recommended) or allow_url_fopen=On + ext-openssl, ext-json |\n| Python | Python >= 3.10 (for f-strings), requests >= 2.20.0 |\n| Java | Java 11+ (for HttpClient), Jackson Databind >= 2.12.0 |\n\n---\n\n## 点数消耗\n\n| AI 功能 | 消耗点数 |\n|---|---|\n| AI 身形塑形 V1.0 | 1 |\n\n---\n",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/body-reshape/pre-process": {
      "post": {
        "summary": "执行 AI 身形塑形 检测任务。",
        "description": "当源图中可能存在多个有效目标，或您的接入需要显式指定特效作用在哪个已检测目标上时，请使用预处理任务。若图片只有一个目标，且功能支持默认的 `index` 取值、您的应用也不需要手动挑选目标，这一步可以省略。\n\n预处理任务会在源图中检测候选目标，并把它们的坐标返回在 `data.results.result` 中。结果数组里的每一项对应一个检测到的目标。请查看返回的坐标，与源图中您要处理的脸部或区域对应起来，然后在创建特效任务时，把该项的下标（从 0 开始）作为 `index` 传入。\n\n图中检测到多张脸或多个区域时，请不要不看预处理结果就直接使用默认的 `index` 取值。特效只会作用在 `index` 选中的那个目标上，因此在运行特效任务之前，接入方必须先确认结果中哪一项才是您要处理的目标。\n\n本任务为异步任务。创建任务后，若功能支持 Webhook，请用 Webhook 接收完成通知；否则轮询对应的预处理状态接口，直到 `data.task_status` 变为 `success` 或 `error`。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务执行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任务执行失败",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/body-reshape/pre-process/{task_id}": {
      "get": {
        "summary": "查询 AI 身形塑形 检测任务的状态。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查询的任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TaskStatusResponsePreProcessNoUrlBase"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "timed": {
                                  "type": "number"
                                },
                                "result": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "left": {
                                        "type": "number"
                                      },
                                      "top": {
                                        "type": "number"
                                      },
                                      "width": {
                                        "type": "number"
                                      },
                                      "height": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/body-reshape": {
      "post": {
        "summary": "执行 AI 身形塑形 任务。",
        "description": "AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 `success` 或 `error` 通知后，用收到的 `task_id` 查询任务结果。配置与校验的细节请见 [Webhook 接入指南](/develop/webhook.md)。\n\n若功能不支持 Webhook，或您的接入方式用不了 Webhook，就请实现轮询。提交 AI 任务后，按固定间隔（例如每 10 秒）轮询状态接口，直到任务状态变为 `success` 或 `error`。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  },
                  {
                    "type": "object",
                    "required": [
                      "version",
                      "features"
                    ],
                    "properties": {
                      "version": {
                        "type": "string",
                        "description": "功能规格的版本号。 未特别指定时默认为 `\"1.0\"`。\n",
                        "default": "1.0",
                        "example": "1.0"
                      },
                      "index": {
                        "type": "integer",
                        "example": 0,
                        "description": "检测结果中人物的编号"
                      },
                      "features": {
                        "type": "object",
                        "description": "不能全为 0",
                        "minProperties": 1,
                        "properties": {
                          "arm": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "breast": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "作用于两侧。可用分侧键 （`breast_left` / `breast_right`）覆盖该侧的取值； 分侧取 `0` 表示该侧保持不变。"
                          },
                          "breast_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "breast_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "hip": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "hip_lift": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "leg": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "neck": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0,
                            "description": "作用于两侧。可用分侧键 （`neck_left` / `neck_right`）覆盖该侧的取值； 分侧取 `0` 表示该侧保持不变。"
                          },
                          "neck_left": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "neck_right": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "shoulder": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "作用于两侧。可用分侧键 （`shoulder_left` / `shoulder_right`）覆盖该侧的取值； 分侧取 `0` 表示该侧保持不变。"
                          },
                          "shoulder_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "shoulder_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "squared_shoulder": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "作用于两侧。可用分侧键 （`squared_shoulder_left` / `squared_shoulder_right`） 覆盖该侧的取值；分侧取 `0` 表示该侧保持不变。"
                          },
                          "squared_shoulder_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "squared_shoulder_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "slim": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "taller": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "waist": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "belly": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务执行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任务执行失败",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/body-reshape/{task_id}": {
      "get": {
        "summary": "查询 AI 身形塑形 任务的状态。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查询的任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TaskStatusResponseV2"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "timed": {
                                  "type": "number"
                                },
                                "timed_apply": {
                                  "type": "number"
                                },
                                "arm": {
                                  "type": "boolean"
                                },
                                "breast_left": {
                                  "type": "boolean"
                                },
                                "breast_right": {
                                  "type": "boolean"
                                },
                                "hip": {
                                  "type": "boolean"
                                },
                                "hip_lift": {
                                  "type": "boolean"
                                },
                                "leg": {
                                  "type": "boolean"
                                },
                                "neck_left": {
                                  "type": "boolean"
                                },
                                "neck_right": {
                                  "type": "boolean"
                                },
                                "shoulder_left": {
                                  "type": "boolean"
                                },
                                "shoulder_right": {
                                  "type": "boolean"
                                },
                                "squared_shoulder_left": {
                                  "type": "boolean"
                                },
                                "squared_shoulder_right": {
                                  "type": "boolean"
                                },
                                "slim": {
                                  "type": "boolean"
                                },
                                "taller": {
                                  "type": "boolean"
                                },
                                "waist": {
                                  "type": "boolean"
                                },
                                "belly": {
                                  "type": "boolean"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用标准的 Bearer 鉴权。把您的 API 密钥放进请求头： `Authorization:Bearer YOUR_API_KEY`。请注意 'Bearer' 与 'YOUR_API_KEY' 之间有一个空格。"
      }
    },
    "schemas": {
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "用于运行任务的文件 URL，该 URL 需可公开访问。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "用于运行任务的文件 ID，取自上传文件接口返回的 file_id。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2": {
        "title": "BasicRunTaskV2",
        "anyOf": [
          {
            "title": "用源文件 URL 运行任务",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              }
            ]
          },
          {
            "title": "用源文件 ID 运行任务",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
              }
            ]
          }
        ]
      },
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "该任务的 ID。凭这个 ID 可在 24 小时内查询任务结果。",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "RunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "错误信息",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters",
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest"
            ],
            "description": "错误码：\n  * InvalidParameters - 请求参数无效\n  * CreditInsufficiency - 点数不足，无法运行\n  * BadRequest - 请求参数不符合预期\n  * InvalidStyleGroup - 风格分组 ID 无效\n  * InvalidStyle - 风格 ID 无效\n"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "error_exceed_max_image_size",
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "错误码：\n- \\`error_exceed_max_image_size\\`  - 输入图片尺寸超出上限\n- \\`exceed_max_filesize\\` - 输入文件大小超出上限\n- \\`invalid_parameter\\` - 参数取值无效\n- \\`error_download_image\\` - 下载原图出错\n- \\`error_download_mask\\` - 下载蒙版图片出错\n- \\`error_decode_image\\` - 解码原图出错\n- \\`error_decode_mask\\` - 解码蒙版图片出错\n- \\`error_nsfw_content_detected\\` - 在原图中检测到不适宜内容（NSFW）\n- \\`error_no_face\\` - 原图中没有检测到人脸\n- \\`error_pose\\` - 原图的姿态检测失败\n- \\`error_face_parsing\\` - 原图的人脸分割失败\n- \\`error_inference\\` - 推理流程中出现错误\n- \\`exceed_nsfw_retry_limits\\` - 为避免生成不适宜内容， 重试次数已用尽\n- \\`error_upload\\` - 上传结果图片出错\n- \\`unknown_internal_error\\` - 其他错误\n"
      },
      "TaskStatusResponsePreProcessNoUrlBase": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "任务状态"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "错误的详细说明"
              }
            }
          }
        }
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "下载该结果的 URL，有效期 2 小时",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "任务状态"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "错误的详细说明"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "InvalidApiKey": {
        "description": "API 密钥无效或缺失",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "请求过多",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "任务 ID 无效",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "任务执行超时",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}