{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 豐胸模擬",
    "description": "# 概述\nAI 豐胸模擬提供強大且非侵入式的身材重塑解決方案，無需手術，也不需要恢復時間。透過先進的 AI 技術，您可以即刻呈現並探索理想的外觀，預覽前後結果，並輕鬆簡易地達成專業品質的增強。\n\n透過精修輪廓或校正視角問題，自然地增強您的照片。例如，若您尋求更平衡或更勻稱的上半身外觀，AI 豐胸模擬提供 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 豐胸模擬任務，並逐步調整強度以達成您想要的外觀。接著調整增強強度等參數，以符合您的審美偏好，全部都在一個易用的 API 中完成，適合初學者與經驗豐富的使用者。\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 豐胸模擬 API 的工作流程：\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 任務並取得任務 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   - 狀態轉為成功後，相應更新工作流程。\n\n這個結構化的工作流程確保與使用者輸入的高效整合、任務的自動化監控，以及無縫取得結果。\n\n---\n\n* 認證\n- 使用 **Bearer Token** 將您的 API key 納入請求標頭：\n    ```\n    Authorization: Bearer YOUR_API_KEY\n    ```\n您可以在 https://yce.makeupar.com/api-console/en/api-keys/ 找到您的 API Key。\n\n---\n\n* 上傳圖片\n\n您可以直接上傳檔案到伺服器，或在 AI 任務內容中提供有效的圖片網址。\n\n   * 上傳端點\n\n```\nPOST /s2s/v2.0/file\n```\n\n或者，若您已有公開的圖片網址，可跳過此步驟。\n\n---\n\n* 調整 AI 豐胸模擬強度\n**AI 豐胸模擬設定**\n\n對於 AI 豐胸模擬，透過將強度等級設在 **1 到 3** 之間來控制修改程度：\n- **等級 1** 提供細微、自然的外觀調整，最適合輕微精修。\n- **等級 2** 提供適度增強，在真實感與明顯改善之間取得平衡。\n- **等級 3** 帶來最明顯的效果，適合顯著重塑，同時維持解剖學的合理性。\n\n選擇最符合您審美目標與理想外觀的強度等級。\n\n---\n\n* 建立 AI 豐胸模擬任務並輪詢結果\n\n上傳圖片並選擇您偏好的強度等級後，即可開始增強任務。API 以非同步方式處理請求。您必須輪詢任務狀態，直到達到 `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  - 胸部區域必須可見。這包括穿著與未穿著的情況，只要主體主要面向前方（即 yaw 角度介於 −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`          | 系統下載來源圖片失敗，可能因網路問題、網址無效，或資源權限無法存取。 |\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（現代 TLS/HTTP 支援）</br>   - jq >= 1.6（穩健的 JSON 解析） |\n| Node.js（JavaScript） | Node >= 18（支援全域 fetch） |\n| JavaScript | - Chrome / Edge >= 80</br>   - Firefox >= 74</br>   - Safari >= 13.1 |\n| PHP | PHP >= 7.4（現代 TLS/相容性），ext-curl（建議）或 allow_url_fopen=On + ext-openssl、ext-json |\n| Python | Python >= 3.10（支援 f-strings），requests >= 2.20.0 |\n| Java | Java 11+（支援 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": "這個端點啟動豐胸模擬流程。您必須提供來源檔案（透過網址或檔案 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 authentication'。請在標頭中放入您的 'API Key'：`Authorization:Bearer YOUR_API_KEY`。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。"
      }
    },
    "schemas": {
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "要執行任務的檔案網址。該網址應可公開存取。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "要執行任務的檔案 ID。檔案 ID 來自上傳檔案 API。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2": {
        "title": "BasicRunTaskV2",
        "anyOf": [
          {
            "title": "Run task with src file url",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              }
            ]
          },
          {
            "title": "Run task with src file 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\\` - 超過重試上限以避免產生 NSFW 圖片\n- \\`error_upload\\` - 上傳結果圖片錯誤\n- \\`unknown_internal_error\\` - 其他"
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "下載這個結果的網址。有效期限 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"
                }
              }
            }
          }
        }
      }
    }
  }
}