{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 隆胸模拟器",
    "description": "# 概览\nAI 隆胸模拟器提供一套强有力的非侵入式身体塑形方案：不用手术，也不用恢复期。借助先进 AI 技术，您可以即刻看到、试出自己的理想外形，预览调整前后的对比，轻轻松松做出专业级的改善。\n\n自然地改善照片：修饰身形轮廓，校正透视问题。想要更均衡、更协调的上半身观感，AI 隆胸模拟器能做强化的胸部轮廓增强。该功能用智能算法在您希望的位置适度增加立体感与体积，做出含蓄真实的改善，同时保住您原有的特征与比例。最终效果是自信、精致的样子，毫无假感变形。\n\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-06-18/e41b8942-22e1-4846-8f81-f41171b74558.jpg)\n\n传统滤镜常做出夸张、失真的效果，这款工具不一样：它给出干净真实的修改，贴合您个人的身体条件。不论是为社交媒体、个人使用还是创作项目准备图片，改善效果都保持真实，同时把您最好的一面凸现出来。\n\n想开始体验虚拟身形修饰，只要创建一个 AI 隆胸模拟器任务，把强度一点点调到您满意的样子。随后还能调整增强强度等参数，贴合您的审美偏好；整套接口好用易上手，新手老手都合适。\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-06-18/733cedfd-2e8e-4cfc-8758-6854d923664b.jpg)\n\n---\n\n## 接入指南\n本指南将带您走完全流程：\n\nAI 隆胸模拟器接口的流程：\n\n**接口地址：** `/s2s/v2.0/task/breast-shape`\n\n**需要鉴权：** `Authorization: Bearer YOUR_API_KEY`\n\n**流程步骤：**\n\n1. **准备图片上传：**\n   - 第一步是准备一张上半身自拍照。\n\n2. **AI 隆胸模拟器设置**\n    AI 隆胸模拟器用强度档位控制变化程度，范围从 1（细微）到 3（明显）。建议从低档位开始逐步调高，做出符合您审美的自然效果。一点点调，结果更真实、比例更协调。\n\n3. **发起 AI 任务并取得 Task ID：**\n   - 把上传好的图片连同参数配置，通过 HTTP POST 请求送到 `/s2s/v2.0/file`。\n   - 响应会返回一个唯一的任务 ID，用于标识本次调用。\n\n4. **轮询任务状态（持续检查）：**\n   - 用取得的 `task_id` 通过 HTTP GET 请求定期轮询任务状态（例如 `GET /task/${task_id}`）。\n   - 持续留意：\n     - `Task_status = \"success\"`（处理完成）。\n     - `Task_status = \"error\"`（视情况排查或重试）。\n   - 状态转为 success 后，按流程继续往下走。\n\n这套规整的流程能顺畅对接用户输入、自动监控任务，并顺利取回结果。\n\n---\n\n* 鉴权\n- 请在请求头中以 **Bearer Token** 方式带上您的 API 密钥：\n    ```\n    Authorization: Bearer YOUR_API_KEY\n    ```\nAPI Key 可在 https://yce.makeupar.com/api-console/en/api-keys/ 获取。\n\n---\n\n* 上传图片\n\n您可以把文件直接上传到服务器，也可以在 AI 任务参数中提供有效的图片 URL。\n\n   * 上传接口\n\n```\nPOST /s2s/v2.0/file\n```\n\n如果您已有公开可访问的图片 URL，这一步可以跳过。\n\n---\n\n* 调整 AI 隆胸模拟器强度\n**AI 隆胸模拟器设置**\n\nAI 隆胸模拟器的修改程度由强度档位控制，范围 **1 到 3**：\n- **1 档** 是含蓄自然的微调，适合小修小补。\n- **2 档** 为中等增强，真实感与明显改善之间取得平衡。\n- **3 档** 效果最明显，适合大幅度塑形，同时仍符合人体合理性。\n\n按您的审美目标与想要的样子，选择合适的强度档位。\n\n---\n\n* 创建 AI 隆胸模拟器任务并轮询结果\n\n上传图片、选好强度档位后，就可以启动增强任务。接口异步处理请求，您需要轮询任务状态，直到状态变为 `success` 或 `error`。\n\n   * 创建任务接口\n\n```\nPOST /s2s/v2.0/task/breast-shape\n```\n\n   * 轮询接口\n\n```\nGET /s2s/v2.0/task/breast-shape/{task_id}\n```\n\n---\n\n## 文件规格与错误码\n\n* AI 隆胸模拟器规格\n**图片要求与建议，帮您拿到最佳效果**\n\n- **分辨率要求**：\n  输入图片最长边不得超过 4096 像素。为获得最佳表现，请确保上半身区域——从头顶到胸口（含胸口）——的分辨率不低于 1024 × 768 像素。\n\n- **人物要求**：\n  - 图片中至少要有一位可完整检测的人物，两侧肩膀都要在画面内清楚可见。\n  - 胸部区域必须可见。穿衣、不穿衣都可以，前提是人物基本正对镜头（即偏航角在 −90° 到 +90° 之间）。强烈建议采用正脸视角，不要斜侧或侧面。\n\n- **提升效果的建议做法**：\n  - 构图以上半身为主：图片最好专注上半身；若收录全身，上半身应占据画面相当大的比例，最长边超过 1024 像素。\n  - 只用正面姿态；避免侧身或明显转体，这些姿态会降低检测准确率与成品质量。\n  - 想让胸部轮廓增强得最自然，请选胸前露一些皮肤的服装——例如泳装、低领上衣、V 领服饰。这类款式能让 AI 更好地推断底层结构，做出含蓄真实的乳沟效果。\n  - 系统只支持单人图片。画面中有多人时，处理会自动锁定肩部可见跨度最大的那位（即离镜头最近、或最居中的人）。\n  - 避免胸前区域有遮挡。包、背包带、围巾、项链等配饰可能被误移除，或在编辑过程中产生瑕疵。\n  - 服装外观可能与原图不同。改变程度取决于强度档位：档位越高，变化越明显，胸前衣物的形状、版型与垂坠都可能出现可见改变。\n\n遵循以上要求，可保证输入质量最佳，让 AI 生成的增强效果最大程度还原真实、保持一致。\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_02-1_2dfe3418c2.jpg)\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webp_02-2_a88356deeb.jpg)\n\n---\n\n* 支持的格式与尺寸\n\n|AI 功能|支持尺寸|支持文件大小|支持格式|\n|  ----  | ----  | ----  | ----  |\n|AI 隆胸模拟器|最小：512x384 <BR>最大：长边 < 4096|< 10MB|jpg/jpeg/png/heic |\n\n* 错误码\n\n| 错误码                      | 说明 |\n|----------------------------------|-------------|\n| `invalid_parameter`             | 参数无效——具体是必填字段（`src_keys`、`dst_keys` 或 `acts`）中有一个或多个缺失、格式有误，或包含不支持的取值。 |\n| `exceed_max_filesize`           | 输入图片超出允许的文件大小上限（10 MB）。请先压缩或缩放图片再提交。 |\n| `error_download_image`          | 系统下载源图片失败，通常是网络问题、URL 无效，或资源权限不可访问。 |\n| `error_decode_image`            | 下载下来的图片无法解码——可能是文件损坏、格式不受支持，或二进制数据有误。 |\n| `error_nsfw_content_detected`   | 在源图或生成的输出图中检测到疑似不适宜内容（NSFW）。出于合规与安全考虑，处理已中止。 |\n| `error_pose`                    | 人体姿态估计失败：无法可靠检测出全身或上半身骨架，后续的形体分析因此无法进行。 |\n| `error_breast_region_detection` | 系统已依据姿态与分割线索尝试检测胸部区域，但未能找到有效、可辨识的胸部区域（例如因遮挡、角度过于偏斜，或可见度不足）。 |\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"
    }
  ],
  "tags": [
    {
      "name": "V1.0",
      "description": "用 AI 处理上传的图片，模拟隆胸效果。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/breast-shape": {
      "post": {
        "summary": "执行 AI 隆胸模拟器 任务。",
        "description": "本接口用于发起 AI 隆胸模拟器流程。您需要提供源文件（URL 或文件 ID），并指定强度等级。任务会异步处理，您可以使用本响应返回的 task_id 查询其状态。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "intensity": {
                        "type": "integer",
                        "description": "胸部调整强度，3 为最强。",
                        "default": 2,
                        "example": 2,
                        "enum": [
                          1,
                          2,
                          3
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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/breast-shape/{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": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "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"
      },
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}