{
  "openapi": "3.0.0",
  "info": {
    "title": "服バーチャル試着 Mix & Match",
    "description": "# 概要 (Overview)\n1 回のリクエストで全身のコーデを試着。人物写真 1 枚とアイテム参考画像 1〜9 枚を送ると、AI Outfit Virtual Try-On Mix & Match API がすべてのアイテムを同時に着用させ、スタイル写真 1 枚を返します。\n\n* 1 リクエスト 1 コーデ：1 タスクで参考アイテムをすべて着用させ、結果写真は正確に 1 枚。\n* 8 つのアイテムカテゴリ：`upper_body`、`lower_body`、`full_body`、`outer`、`shoes`、`bag`、`headwear`、`accessory`。\n* スタイリングリクエスト：「ジャケットは開けて着る」「トップスをインする」などの希望を伝えられます。変更されるのは着こなしだけで、アイテム自体、人物、ポージングは変わりません。\n\n活用例：\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2026-10-22/webp_23606d07-1943-449d-93d5-9ee8fa69dc38.webp)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2026-10-16/webp_972912f5-866d-4134-9347-45bde4991724.webp)\n\n---\n\n## 統合ガイド (Integration Guide)\n\n* AI Outfit Virtual Try-On Mix & Match 利用ガイド\n\nこのガイドでは、人物写真と参考アイテム画像のアップロード、試着タスクの作成、結果の読み方を説明します。タスクは非同期で実行されます。実行レスポンスにタスク ID が返るので、ステータスエンドポイントをポーリングして結果を取得します。\n\n***\n\n   * ステップ 1. File API で写真をアップロードする\n\n**File API**（`/s2s/v2.0/file`）で、人物写真 1 枚と参考画像 1〜9 枚（画像 1 枚につきアイテム 1 点）をアップロードします。レスポンスにはファイルごとの `file_id` と `requests.url` が返るので、その URL にファイル本体をアップロードします。写真を公開 URL でホストし、URL を直接渡すこともできます。\n\n参考画像とアイテムカテゴリは同じ順序で保ってください。n 枚目の参考画像が、`garment_categories` の n 番目のカテゴリに対応します。\n\n***\n\n   * ステップ 2. 試着タスクを作成する\n\n**AI タスク API**（`/s2s/v2.0/task/cloth-mix-v2`）に、人物写真、参考画像、画像ごとのカテゴリ、任意でスタイリングリクエストを渡します：\n\n```bash\ncurl --request POST \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/cloth-mix-v2 \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json' \\\n  --data '{\n    \"src_file_url\": \"https://example.com/selfie.jpg\",\n    \"ref_file_urls\": [\n      \"https://example.com/1.jpg\",\n      \"https://example.com/2.jpg\",\n      \"https://example.com/3.jpg\"\n    ],\n    \"garment_categories\": [\"upper_body\", \"lower_body\", \"shoes\"],\n    \"styling_note\": \"tuck the top in\"\n  }'\n```\n\n    > `garment_categories` は必須で、参考画像配列と同じ長さである必要があります。長さが違うと `invalid_parameter` が返ります。タスクの処理時間はおよそ 40〜50 秒、スタイリングリクエストを付けると 3〜4 秒プラスされます。400 秒以内に完了しなかったタスクは `unknown_internal_error` で失敗し、再実行できます。\n\n***\n\n   * ステップ 3. タスク結果をポーリングする\n\n実行レスポンスの `task_id` でステータスを確認します。`task_status` が `success` または `error` になるまで続けます：\n\n```bash\ncurl --request GET \\\n  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/cloth-mix-v2/YOUR_TASK_ID \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'content-type: application/json'\n```\n\n***\n\n   * ステップ 4. 結果を取得する\n\n成功時のレスポンスにはスタイル写真が 1 枚返ります。スタイリングリクエストを付けた場合、`not_applied` に「反映されなかった部分とその理由」が記載され、それ以外は通常どおり反映されています。\n\n```json\n{\n  \"status\": 200,\n  \"data\": {\n    \"error\": null,\n    \"results\": {\n      \"url\": \"https://example.com/sample-result-url\",\n      \"not_applied\": \"bottom high-waisted: the trousers are already high-waisted\"\n    },\n    \"task_status\": \"success\"\n  }\n}\n```\n\n    > ユニットは結果写真が返ったときのみ消費されます。エラーで終わったタスクは課金対象外です。\n\n---\n\n## 入力と出力 (Inputs & Outputs)\n\n* リクエストボディ\n\n`src_file_url` / `src_file_id`：いずれか一方を指定。`ref_file_urls` / `ref_file_ids`：いずれか一方を指定。\n\n| フィールド | 型 | 必須 | デフォルト | 説明 |\n|---|---|---|---|---|\n| src_file_url / src_file_id | string | はい* | - | 人物写真。公開可能な URL、または File API のファイル ID |\n| ref_file_urls / ref_file_ids | string 配列 | はい* | - | 参考画像 1〜9 枚。画像 1 枚につきアイテム 1 点、`garment_categories` と同じ順序 |\n| garment_categories | string 配列（enum） | はい | - | 参考画像 1 枚ごとのカテゴリ。参考画像配列と同じ順序・同じ長さ：`upper_body`、`lower_body`、`full_body`、`outer`、`shoes`、`bag`、`headwear`、`accessory` |\n| styling_note | string | いいえ | `\"\"` | 着こなしの希望。最大 300 文字の自由文。例：\"tuck the top in\"、\"wear the jacket open\"、\"carry the bag crossbody\" |\n\n* アイテムカテゴリ\n\n| garment_category | 内容 | 上限 |\n|---|---|---|\n| upper_body | トップス | 1 |\n| lower_body | ボトムス | 1 |\n| full_body | ワンピース類（例：ドレス） | 1。`upper_body`・`lower_body` との併用不可 |\n| outer | アウター、ベスト | 1 |\n| shoes | 靴 | 1 |\n| bag | バッグ | 1 |\n| headwear | ハット、ヘッドバンド | 1 |\n| accessory | 眼鏡、ネックレス、ピアス、時計、ベルト、マフラー | 3 |\n\n    > 送信されたカテゴリはそのまま使われ、エンジンが再分類することはありません。アクセサリーの配置はエンジンが決定し、新しいアクセサリーは人物が同じ位置に着けているアイテムと置き換わります。\n\n* 結果（`data.results`）\n\n| フィールド | 型 | 説明 |\n|---|---|---|\n| url | string | 結果写真のダウンロード URL。有効期限は 2 時間 |\n| not_applied | string | `styling_note` のうち反映されなかった部分と、その理由。`styling_note` を付けたときのみ返ります |\n\n---\n\n## ファイル仕様とエラー (File Specs & Errors)\n\n* サポートされる形式と寸法\n\n| 項目 | サポートされる寸法 | サポートされるファイルサイズ | サポートされる形式 |\n|---|---|---|---|\n| 人物写真 | 正面を向いた写真。最小 512 x 384、長辺 4096 px。アスペクト比は最大 3:1、超える分は中央からトリミング | < 10MB | JPEG, PNG, HEIC |\n| 参考画像 | 最小 512 x 384、長辺 4096 px。トリミングなし（ベルトやネックレス類は 3:1 を超えても可） | < 10MB | JPEG, PNG, HEIC |\n| 結果写真 | 人物写真のアスペクト比を維持、約 1.5 MP（1024 x 1536）内。長辺が 1024 未満は 1024 に拡大。例：3000 x 4000 -> 1072 x 1440、4000 x 1000 -> 2160 x 720 | - | JPEG |\n\n    > 背景が透明な写真は白背景で合成されます。結果写真には C2PA 署名が付与されます。\n\n* エラーコード\n\n| エラーコード | 説明 |\n|---|---|\n| invalid_parameter | パラメータの欠落または不正。メッセージに該当パラメータ名が記載されます |\n| error_download_image | 人物写真または参考画像のダウンロードに失敗しました |\n| error_invalid_src | 人物写真を読み込めませんでした |\n| error_invalid_ref | 参考画像を読み込めませんでした |\n| error_analyze_failed | アイテム解析に失敗、またはタイムアウトしました |\n| error_ref_categories | アイテムを組み合わせて着用できません：カテゴリの重複、`full_body` と `upper_body`/`lower_body` の併用、`bag`・`headwear` が 1 超、`accessory` が 3 超 |\n| error_nsfw_content_detected | 不適切なコンテンツが検出され、生成を拒否しました |\n| unknown_internal_error | その他のエラー（400 秒以内に完了しなかったタスクを含む） |\n\n---\n\n## ユニット消費 (Unit Consumption)\n\n| 参考アイテム数 | 消費ユニット |\n|---|---|\n| 1 点試着 | 3 ユニット |\n| 2 点試着 | 4 ユニット |\n| 3 点試着 | 5 ユニット |\n| 4 点試着 | 6 ユニット |\n| 5 点試着 | 7 ユニット |\n| 6 点試着 | 8 ユニット |\n| 7 点試着 | 9 ユニット |\n| 8 点試着 | 10 ユニット |\n| 9 点試着 | 11 ユニット |\n\n    > ユニットは結果写真が返ったときのみ消費されます。エラーで終わったタスクは課金対象外です。\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": "服バーチャル試着 Mix & Match API は、人物写真 1 枚に 1〜9 枚のアイテム参考画像を 1 タスクで着用させます。参考画像ごとにアイテムカテゴリを指定し、スタイリングリクエストで着こなしを伝えれば、スタイル写真が 1 枚返ります。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/cloth-mix-v2": {
      "post": {
        "summary": "服バーチャル試着 Mix & Match タスクを実行します。",
        "description": "AI タスクは非同期です。機能ごとに Webhook がサポートされている場合は、Webhook による完了処理を優先します。Webhook エンドポイントを設定し、Webhook 署名を検証したうえで、`success` または `error` の通知が来たら、受け取った `task_id` を使ってタスクの結果を照会します。設定と検証の詳細は [Webhook 統合ガイド](/develop/webhook.md) を参照してください。\n\nWebhook がサポートされていない場合、または統合に使えない場合は、ポーリングを実装します。AI タスクを送信した後、一定の間隔（例：10 秒ごと）でステータスエンドポイントをポーリングし、`success` または `error` になるまで待ちます。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "allOf": [
                      {
                        "title": "src file url と ref file urls でタスクを実行",
                        "required": [
                          "ref_file_urls"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixRefFileUrls"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixTaskParams"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "title": "src file url と ref file IDs でタスクを実行",
                        "required": [
                          "ref_file_ids"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixRefFileIds"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixTaskParams"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "title": "src file ID と ref file urls でタスクを実行",
                        "required": [
                          "ref_file_urls"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixRefFileUrls"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixTaskParams"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "title": "src file ID と ref file IDs でタスクを実行",
                        "required": [
                          "ref_file_ids"
                        ]
                      },
                      {
                        "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixRefFileIds"
                      },
                      {
                        "$ref": "#/components/schemas/ClothMixTaskParams"
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "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-mix-v2/{task_id}": {
      "get": {
        "summary": "服バーチャル試着 Mix & Match タスクのステータスを確認します。",
        "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": {
                                "not_applied": {
                                  "type": "string",
                                  "description": "styling_note のうち反映されなかった部分と、その理由。styling_note を付けたときのみ返されます"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClothMixRefFileUrls": {
        "type": "object",
        "properties": {
          "ref_file_urls": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "description": "1〜9 枚の参考画像の URL。画像 1 枚につきアイテム 1 点。n 枚目の画像が、garment_categories の n 番目のカテゴリに対応します。URL は公開アクセス可能なものである必要があります。",
            "example": [
              "https://example.com/full_body.jpg",
              "https://example.com/shoes.jpg"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ClothMixRefFileIds": {
        "type": "object",
        "properties": {
          "ref_file_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "description": "1〜9 枚の参考画像の ID。画像 1 枚につきアイテム 1 点。n 枚目の画像が、garment_categories の n 番目のカテゴリに対応します。ファイルアップロード API で取得したファイル ID を指定します。",
            "example": [
              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ClothMixTaskParams": {
        "type": "object",
        "required": [
          "garment_categories"
        ],
        "properties": {
          "garment_categories": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "description": "参考画像 1 枚ごとのカテゴリ。ref_file_urls（または ref_file_ids）と同じ順序・同じ長さで指定します。 アクセサリーは最大 3 点までで、ほかのカテゴリは各 1 点まで。full_body は upper_body・lower_body との併用ができません。",
            "example": [
              "full_body",
              "shoes"
            ],
            "items": {
              "type": "string",
              "enum": [
                "upper_body",
                "lower_body",
                "full_body",
                "outer",
                "shoes",
                "bag",
                "headwear",
                "accessory"
              ]
            }
          },
          "styling_note": {
            "type": "string",
            "maxLength": 300,
            "default": "",
            "description": "着こなしの指定。例：\"jacket open\"（ジャケットを開けて着る）、\"top tucked in\"（トップスをインする）、 \"bag cross body\"（バッグを斜めがけ）。変更されるのは着こなしだけで、アイテム自体、人物、ポージングは変わりません。 反映できない部分はスキップされ、結果の not_applied に記載されます。",
            "example": "top tucked in"
          }
        }
      },
      "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。ファイルアップロード 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 を使用して 30 日間以内にクエリできます。",
                "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"
      }
    },
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "標準の 'Bearer authentication' を使用します。ヘッダーに 'API Key' を設定します: `Authorization:Bearer YOUR_API_KEY`。'Bearer' と 'YOUR_API_KEY' の間にスペースが 1 つあることに注意してください。"
      }
    },
    "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"
                }
              }
            }
          }
        }
      }
    }
  }
}