{
  "openapi": "3.0.0",
  "info": {
    "title": "服バーチャル試着",
    "description": "# 概要\nAI Clothes で、服のバーチャル試着を作成します。\n画像に衣装を重ね合わせて試着プレビューを生成します。\n\n---\n\n## 統合ガイド\n\n* API プレイグラウンド\nAPI プレイグラウンドで AI Clothes のバーチャル試着機能をテストします。\n\nAPI プレイグラウンドにアクセスするには:\n<https://yce.makeupar.com/api-console/en/api-playground/ai-clothes/>\n\n---\n\n* AI Clothes API 使用ガイド\n\nこのガイドでは、画像のアップロード、参照衣装の準備、および AI Clothes API を使用したバーチャル試着タスクの作成方法について説明します。\n\n***\n\n   * ステップ 1. File API を使用してファイルをアップロードする\n\n**File API** (`/s2s/v2.0/file`) を使用して、対象ユーザーの画像をアップロードします。\n\n**画像要件:**\n\n*   高解像度の全身写真をアップロードしてください。\n*   写真に全身がはっきりと映っていることを確認してください。\n*   複数の人物や気が散るオブジェクトがある背景は避けてください。\n\n**リクエスト例:**\n\n```bash\ncurl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/file \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"files\": [\n {\n   \"content_type\": \"image/jpg\",\n   \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n   \"file_size\": 547541\n }\n    ]\n  }'\n```\n\n***\n\n   * ステップ 2. File API レスポンスを取得する\n\nレスポンスには以下が含まれます:\n\n*   AI タスク作成用の `file_id`。\n*   実際の画像ファイルをアップロードするための `requests.url`。\n\n**レスポンス例:**\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"files\": [\n {\n   \"content_type\": \"image/jpg\",\n   \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n   \"file_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\",\n   \"requests\": [\n {\n  \"method\": \"PUT\",\n  \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\",\n  \"headers\": {\n    \"Content-Length\": \"547541\",\n    \"Content-Type\": \"image/jpg\"\n  }\n }\n   ]\n }\n    ]\n  }\n}\n```\n\n***\n\n   * ステップ 3. 提供された URL に画像をアップロードする\n\nFile API レスポンスの `requests.url` を使用して画像をアップロードします:\n\n```bash\ncurl --location --request PUT 'https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...' \\\n  --header 'Content-Type: image/jpg' \\\n  --header 'Content-Length: 547541' \\\n  --data-binary @'./full_body_photo_01_3dbd1b6683.jpg'\n```\n\n***\n\n   * ステップ 4. 参照衣装を準備する\n\n * 4.1 参照衣装画像をアップロードする\n\n以下のいずれかの方法が可能です:\n\n*   File API (`/s2s/v2.0/file`) を使用して衣装画像をアップロードする、または\n*   有効な画像 URL を提供する。\n\n**サポートされる衣装画像:**\n\n*   服の商品画像。\n*   衣装参照としての全身写真。\n\n詳細な仕様については、**[ファイル仕様とエラー](#section/overview/File-Specs-and-Errors)** を参照してください。\n\n***\n\n   * ステップ 5. AI タスクを作成する\n\n**AI Task API** (`/s2s/v2.0/task/cloth-v4`) を使用して、バーチャル試着タスクを作成します。\n\n**パラメータ:**\n\n*   ユーザー画像用: `src_file_id` または `src_file_url`。\n*   衣装画像用: `ref_file_id`、`ref_file_url`、または `template_id`。\n\n**リクエスト例:**\n\n```bash\ncurl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/cloth-v4 \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/clothes_03_cccd5d4803.jpeg\",\n    \"ref_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/clothes_reference_full_body_01_5a000d999f.png\",\n    \"garment_category\": \"full_body\"\n  }'\n```\n\n**レスポンス例:**\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"task_id\": \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9_13W5TOD8_u_GPi6NqQ3dhlmN-6ntFwhzT\"\n  }\n}\n```\n\n***\n\n   * ステップ 6. タスク結果をポーリングする\n\nタスク ID を使用してステータスを確認します:\n\n```bash\ncurl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/cloth-v4/<YOUR_TASK_ID> \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n```\n\n***\n\n   * ステップ 7. 結果を取得する\n\n成功したレスポンスには、結果画像のダウンロード URL が含まれます:\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n```\n\n無効な API キー エラー レスポンス:\n\n```json\n{\n  \"status\": 401,\n  \"error\": \"Unauthorized\",\n  \"error_code\": \"InvalidAccessToken\"\n}\n```\n\n---\n\nユースケース:\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-05-08/b80f4ae1-c905-4ec0-b491-e42c15e65575.gif)\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/01%20ai%20clothes%20changer.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2023-12-01/45f451aa-4b4f-466d-9da7-4538573c92af.jpg)\n\n撮影方法のヒント:\n![撮影方法のヒント](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/AI-Cloth-Guideline.png \"撮影方法のヒント\")\n\n\n## ファイル仕様とエラー\n* サポートされる形式と寸法\n\n|タイプ|サポートされる寸法|サポートされるファイルサイズ|サポートされる形式|\n|  ---- | ---- | ---- | ---- |\n|対象ユーザー画像|推奨: 1024×768、最小: 512×384、最大辺: 4096 px。</br></br> - 1 人のみ。</br> - 最適な結果を得るには、人物がフレームの少なくとも 80% を占めている必要があります。</br> - 画像には上半身のみを含め、胸から上を映してください。腹部は映す必要はありませんが、肩は見える必要があります。</br> - 顔全体がはっきりと見え、遮るものがない必要があります。</br> - 体は正面を向いて立っている状態である必要があります（座ったりしゃがんだりしていないこと）。 |< 10MB|jpg/png|\n|服の参照画像 |推奨: 1024×768、最小: 512×384、最大辺: 4096 px。</br></br> - 実写の服写真を参照として使用する場合</br>&nbsp;&nbsp;&nbsp;- 1 人のみである必要があります。</br>&nbsp;&nbsp;&nbsp;- 見える服の領域が、試着対象領域を完全にカバーしている必要があります。</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- 例: 全身試着の場合、上半身のみの服画像は受け入れられません。</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- 例: 下半身試着の場合、部分的なパンツ画像は受け入れられません。</br>&nbsp;&nbsp;&nbsp;- 服が激しく遮られていてはいけません（例: 長い髪や腕で覆われているなど）。</br>&nbsp;&nbsp;&nbsp;- 顔全体がはっきりと見え、遮るものがない必要があります。</br>&nbsp;&nbsp;&nbsp;- 体は正面を向いて立っている状態である必要があります（座ったりしゃがんだりしていないこと）。 </br></br> - 商品画像を参照として使用する場合</br>&nbsp;&nbsp;&nbsp;- 単一の衣類の正面からの商品ショットである必要があります。</br>&nbsp;&nbsp;&nbsp;- 合成画像（例: 1 枚の写真にトップスとボトムスが含まれているなど）は使用しないでください。</br>&nbsp;&nbsp;&nbsp;- 下半身の場合、実際に着用された衣装のみがサポートされ、単独の商品画像はサポートされません。|< 10MB|jpg/png|\n\n* エラーコード\n\n* エラーコード（前処理）\n\n| エラーコード | 説明 |\n| ---------- | ----------- |\n| exceed_max_filesize | SRC または REF 画像が大きすぎます。長辺は 4096 ピクセルを超えてはいけません。 |\n| error_below_min_image_size | SRC または REF 画像が小さすぎます。長辺は少なくとも 128 ピクセルである必要があります。 |\n| error_pose | アップロードされた人間の SRC 画像からポーズを検出できませんでした。 |\n| error_invalid_ref | REF 画像が無効です。例えば、空であるか、被写体が完全に見えていません。 |\n| error_apply_region_mismatch | SRC 画像内の適用領域が REF 画像と一致しないため、編集を適用できません。 |\n| error_invalid_src | ソース画像に下半身のみ、または足のみが映っている場合。 |\n\n* エラーコード（エンジン）\n\n| エラーコード | 説明 |\n| ---------- | ----------- |\n| invalid_parameter | - 無効な衣類カテゴリー。 <br> - Style_id が inference_style_list に含まれていません。 <br> - 無効な src_keys、dst_keys、または acts。 <br> - 無効な ref_keys または template_ref_image。 <br> - 必ずそのうち 1 つのみを提供してください。 |\n| error_download_image | SRC または REF 画像をダウンロードできませんでした。 |\n| exceed_max_filesize | SRC または REF 画像が大きすぎます。ファイルサイズは 10 MB を超えてはいけません。 |\n| error_nsfw_content_detected | 結果画像に潜在的な NSFW コンテンツが検出されました。 |\n| error_editing_failed | 結果画像がソース画像と類似しすぎているため、編集プロセスが失敗しました。 |\n| unknown_internal_error | - モデルの読み込みに失敗しました。 <br> - 無効なスケジューラーアルゴリズムタイプ。 <br> - エンジンが読み込まれていません。 <br> - ファイルがアップロード結果に含まれていません。 |\n| error_multi_person | 「normal」または「strict」のマルチパーソンフィルター設定下で、ソース画像または参照画像に複数の人物が検出されました。 |\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| 服バーチャル試着 V2.0 | 2 |\n| 服バーチャル試着 V3.0 | 2 |\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": "V4.0",
      "description": "ジャケットやベストなどのアウターウェアを含むバーチャル試着に対応する機能が強化されました。バーチャル試着では、全身、上半身、下半身、靴、またはアウターウェアから選択するか、単に Auto を選択して AI エンジンにコーディネートを作成させることができます。"
    },
    {
      "name": "V3.0",
      "description": "AI Clothes v3 エンジンをアップグレードしました。革、ニット、サテンなどの素材のレンダリングと、複雑な衣類の詳細の再現を改善しました。"
    },
    {
      "name": "V2.0",
      "description": "AI 技術を使用して衣類のバーチャル試着を作成し、テンプレートベースおよび参照画像の方法をサポートします。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/cloth": {
      "get": {
        "summary": "事前定義されたテンプレートを一覧表示します。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "example": 20
            },
            "description": "このページで返される結果の数。有効な値は 1 から 20 の間です。初期値は 20 です。"
          },
          {
            "name": "starting_token",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "73a3c9e69b89"
            },
            "description": "現在のページのトークン。最初のページでは `null` で開始し、次のページを開始するには前回のレスポンスの `next_token` を使用します。"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TemplateResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameters"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          }
        }
      }
    },
    "/s2s/v2.0/task/cloth": {
      "post": {
        "summary": "服バーチャル試着タスクを実行します。",
        "description": "このエンドポイントは、服バーチャル試着プロセスを開始します。テンプレート ID を使用するか、参照画像（ソースファイルと参照ファイル）を提供できます。タスクは非同期で処理され、このレスポンスで返される task_id を使用してステータスを確認できます。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunClothsTaskV2"
              }
            }
          }
        },
        "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/cloth/{task_id}": {
      "get": {
        "summary": "服バーチャル試着タスクのステータスを確認します。",
        "tags": [
          "V2.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"
          }
        }
      }
    },
    "/s2s/v2.0/task/cloth-v3": {
      "post": {
        "summary": "服バーチャル試着 V3 タスクを実行します。",
        "description": "AI タスクは非同期です。機能ごとに Webhook がサポートされている場合は、Webhook による完了処理を優先します。Webhook エンドポイントを設定し、Webhook 署名を検証したうえで、`success` または `error` の通知が来たら、受け取った `task_id` を使ってタスクの結果を照会します。設定と検証の詳細は [Webhook 統合ガイド](/develop/webhook.md) を参照してください。\n\nWebhook がサポートされていない場合、または統合に使えない場合は、ポーリングを実装します。AI タスクを送信した後、一定の間隔（例：10 秒ごと）でステータスエンドポイントをポーリングし、`success` または `error` になるまで待ちます。\n",
        "tags": [
          "V3.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RunClothV3Task"
                  }
                ]
              }
            }
          }
        },
        "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/cloth-v3/{task_id}": {
      "get": {
        "summary": "服バーチャル試着 V3 タスクのステータスを確認します。",
        "tags": [
          "V3.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"
          }
        }
      }
    },
    "/s2s/v2.0/task/cloth-v4": {
      "post": {
        "summary": "服バーチャル試着 V4 タスクを実行します。",
        "x-display-name": "AI Clothes Virtual Try-On",
        "x-engine-version": "V4.0",
        "description": "AI タスクは非同期です。機能ごとに Webhook がサポートされている場合は、Webhook による完了処理を優先します。Webhook エンドポイントを設定し、Webhook 署名を検証したうえで、`success` または `error` の通知が来たら、受け取った `task_id` を使ってタスクの結果を照会します。設定と検証の詳細は [Webhook 統合ガイド](/develop/webhook.md) を参照してください。\n\nWebhook がサポートされていない場合、または統合に使えない場合は、ポーリングを実装します。AI タスクを送信した後、一定の間隔（例：10 秒ごと）でステータスエンドポイントをポーリングし、`success` または `error` になるまで待ちます。\n",
        "tags": [
          "V4.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RunClothV4Task"
                  }
                ]
              }
            }
          }
        },
        "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/cloth-v4/{task_id}": {
      "get": {
        "summary": "服バーチャル試着 V4 タスクのステータスを確認します。",
        "x-display-name": "AI Clothes Virtual Try-On",
        "x-engine-version": "V4.0",
        "tags": [
          "V4.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": {
      "RunClothsTaskV2Template": {
        "required": [
          "template_id"
        ],
        "properties": {
          "template_id": {
            "type": "string",
            "description": "テンプレートの ID。まず事前定義されたテンプレートを一覧表示し、テンプレートの id を使用します。",
            "example": "good_template_001"
          }
        }
      },
      "RunClothsTaskV2GarmentCategory": {
        "required": [
          "garment_category"
        ],
        "properties": {
          "garment_category": {
            "type": "string",
            "enum": [
              "full_body",
              "lower_body",
              "upper_body",
              "shoes",
              "auto"
            ],
            "description": "参照画像の衣類のカテゴリ。参照画像を提供する場合は必須です。AI エンジンが衣類のカテゴリを自動的に識別・分類できるようにするには、\"auto\" パラメータを使用します。"
          }
        }
      },
      "RunClothsTaskV2": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル URL とテンプレートでタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2Template"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID とテンプレートでタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2Template"
                  }
                ]
              }
            ]
          },
          {
            "properties": {
              "change_shoes": {
                "type": "boolean",
                "default": true,
                "description": "靴を含む全身参照画像が処理可能な場合に、靴を交換するかどうかを制御します。"
              }
            }
          }
        ]
      },
      "RunClothV3Task": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV2GarmentCategory"
                  }
                ]
              }
            ]
          },
          {
            "properties": {
              "change_shoes": {
                "type": "boolean",
                "default": true,
                "description": "靴を含む全身参照画像が処理可能な場合に、靴を交換するかどうかを制御します。\n<br> `garment_category` が `full_body` または `lower_body` の場合に有効です\n"
              }
            }
          }
        ]
      },
      "RunClothsTaskV4GarmentCategory": {
        "required": [
          "garment_category"
        ],
        "properties": {
          "garment_category": {
            "type": "string",
            "enum": [
              "full_body",
              "lower_body",
              "upper_body",
              "shoes",
              "auto",
              "outer"
            ],
            "description": "参照画像の衣類のカテゴリ。参照画像を提供する場合は必須です。AI エンジンが衣類のカテゴリを自動的に識別・分類できるようにするには、\"auto\" パラメータを使用します。"
          }
        }
      },
      "RunClothV4Task": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV4GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル URL と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV4GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル URL でタスクを実行",
                    "required": [
                      "ref_file_url"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV4GarmentCategory"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src ファイル ID と ref ファイル ID でタスクを実行",
                    "required": [
                      "ref_file_id"
                    ]
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2RefFileId"
                  },
                  {
                    "$ref": "#/components/schemas/RunClothsTaskV4GarmentCategory"
                  }
                ]
              }
            ]
          },
          {
            "properties": {
              "change_shoes": {
                "type": "boolean",
                "default": true,
                "description": "靴を含む全身参照画像が処理に利用可能な場合、靴を交換するかどうかを制御します。\n<br> `garment_category` が `full_body` または `lower_body` の場合に有効です。\n"
              },
              "filter_multi_person": {
                "type": "string",
                "enum": [
                  "off",
                  "normal",
                  "strict"
                ],
                "default": "off",
                "description": "ソース画像および人物参照画像内の複数人のケースを除外します。\n<br> `off` - フィルタリングなし。エンジンが画像内の最も大きい人物を使用します。\n<br> `normal` - 別の人物が被写体と同等のサイズである場合、または同じ平面で明確に視認できる場合（例：鮮明で認識可能な顔で近くに立っている場合）は拒否します。典型的なグループ写真や 2 人写真です。遠い、またはぼやけた背景の人物は無視されます。\n<br> `strict` - 小さい、遠い、背景、またはぼやけた/ピントが合っていない人物を含め、追加の人物が視認される場合はすべて拒否します。\n"
              }
            }
          }
        ]
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "テンプレートの ID。タスク実行時に `template_id` として使用します。",
            "example": "good_template_001"
          },
          "thumb": {
            "type": "string",
            "description": "スタイルのサムネイル。"
          },
          "title": {
            "type": "string",
            "description": "テンプレートのタイトル。"
          },
          "category_name": {
            "type": "string",
            "description": "テンプレートのカテゴリー名。"
          }
        }
      },
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "タスクを実行するファイルの URL。この URL は公開されている必要があります。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "BasicRunTaskV2RefFileUrl": {
        "type": "object",
        "properties": {
          "ref_file_url": {
            "type": "string",
            "description": "タスクを実行するための参照ファイルの URL。この URL は公開されている必要があります。",
            "example": "https://example.com/accessory.jpg"
          }
        }
      },
      "BasicRunTaskV2RefFileId": {
        "type": "object",
        "properties": {
          "ref_file_id": {
            "type": "string",
            "description": "タスクを実行するための参照ファイルの ID。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "タスクを実行するファイルの ID。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "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"
          }
        }
      },
      "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` - その他\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": {
      "TemplateResponse": {
        "description": "スタイルの正常な取得",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "description": "レスポンスステータス",
                  "example": 200
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "next_token": {
                      "type": "string",
                      "example": "73a3c9e69b89",
                      "description": "次のページをクエリするためのトークン。"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InvalidParameters": {
        "description": "無効なリクエストパラメータ",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid parameter value"
                },
                "error_code": {
                  "type": "string",
                  "example": "InvalidParameters"
                }
              }
            }
          }
        }
      },
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}