{
  "openapi": "3.0.0",
  "info": {
    "title": "AI リテイク",
    "description": "# 概要\nシーンはそのままに、顔だけを作り替える。AI Retake なら、集合写真を 1 人ずつ作り替えることができます。面白い顔の写真を作る場合も、プロ仕様のツールが必要な場合も、本 API が対応します。\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/3d504686-8057-418e-a0cb-eba3d47ea42c.jpg)\n\n## 統合ガイド\n* AI Retake の実装方法\n\n   * ステップ 1: 元画像と参照画像をアップロードする\n\n      1. API にアップロード URL をリクエストします：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/file\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        Body:\n\n        ```json\n        {\n            \"files\": [\n            {\n                \"file_name\": \"target.jpg\",\n                \"file_size\": 123456,\n                \"content_type\": \"image/jpeg\"\n            }\n            ]\n        }\n        ```\n        1. レスポンスには、署名付きの **アップロード URL** と `file_id` が含まれます。\n        2. 指定された URL に対して HTTP PUT リクエストでファイルをアップロードします。\n        3. あとで使うため `file_id` を保存します。**対象** 画像と **参照** 画像の両方についてこの手順を繰り返します。\n\n      2. **アップロード URL** に実際のファイルをアップロードします。\n\n---\n\n   * ステップ 2: 元画像と参照画像を前処理する（顔検出）\n\n        1. 前処理タスクを作成します：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/retake/pre-process\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        Body:\n\n        ```json\n        {\n            \"request_id\": 1,\n            \"payload\": {\n            \"file_sets\": {\n                \"src_ids\": [\"TARGET_FILE_ID\"]\n            },\n            \"actions\": [\n                { \"id\": 0 }\n            ]\n            }\n        }\n        ```\n        1. API が `task_id` を返します。\n        2. 次の URL でタスクステータスをポーリングします：\n\n        ```\n        GET https://yce-api-01.makeupar.com/s2s/v2.0/task/retake/pre-process?task_id=TASK_ID\n        ```\n        1. 完了すると、検出された顔のリストと、それぞれのバウンディングボックスが返されます。\n\n---\n\n   * ステップ 3: AI Retake タスクを実行する\n        1. どの参照画像で元画像の顔を置き換えるかを定義する\n        `face_mapping` 配列は、**元画像**（Source Image）の顔を **参照画像**（Reference Images）の顔でどのように置き換えるかを定義します。元画像で検出された顔と、特定の参照画像とを結ぶリンクリストとして機能します。\n\n        * 構造\n\n            配列の各要素は、次の 2 つのプロパティを含むオブジェクトです：\n\n            | パラメータ | 型 | 説明 |\n            | :--- | :--- | :--- |\n            | `position` | `integer` | **元画像** で検出された顔のインデックス（例: 0, 1, 2）。 |\n            | `index` | `integer` | 置き換えに使う **参照画像リスト** 内の顔画像のインデックス。 |\n\n                * ロジックのルール\n            1.  **インデックスの対応:** `index` は、参照リストに指定した画像の並び順に直接対応します。\n                *   `0`: 1 番目の参照画像。\n                *   `1`: 2 番目の参照画像。\n            2.  **置き換えをスキップする:** 元画像で検出された特定の顔の置き換えをスキップするには、`index` と `position` の両方を `-1` に設定します。\n            3.  **配列の並び順:** 配列内のオブジェクトの並び順は、`position` に応じた順にします。\n\n                * 利用例\n\n            **シナリオ:**\n            *   **参照リスト:** 画像を 2 枚指定（画像 A、画像 B）。\n            *   **元画像:** 顔が 3 つ検出される（顔 0、顔 1、顔 2）。\n\n            **目的:**\n            *   **元画像の顔 0** を **参照画像 1** で置き換える。\n            *   **元画像の顔 1** は置き換えをスキップする。\n            *   **元画像の顔 2** を **参照画像 0** で置き換える。\n\n            **設定:**\n\n            ```json\n            \"face_mapping\": [\n                {\n                    \"index\": 1,  // Use the second reference image\n                    \"position\": 0 // Apply to the first detected face in source\n                },\n                {\n                    \"index\": -1, // Skip replacing\n                    \"position\": -1 // Skip replacing\n                },\n                {\n                    \"index\": 0,  // Use the first reference image\n                    \"position\": 2 // Apply to the third detected face in source\n                }\n            ]\n            ```\n\n        1. メインタスクのリクエストを送信します：\n\n        ```\n        POST https://yce-api-01.makeupar.com/s2s/v2.0/task/retake\n        Authorization: Bearer YOUR_API_KEY\n        Content-Type: application/json\n        ```\n\n        Body:\n\n        ```json\n        {\n            \"request_id\": 2,\n            \"payload\": {\n            \"file_sets\": {\n                \"src_ids\": [\"TARGET_FILE_ID\"],\n                \"ref_ids\": [\"REFERENCE_FILE_ID\"]\n            },\n            \"actions\": [\n                {\n                \"id\": 0,\n                \"params\": {\n                    \"face_mapping\": [\n                    { \"index\": 0, \"position\": 0 },\n                    { \"index\": -1, \"position\": -1 }\n                    ]\n                }\n                }\n            ]\n            }\n        }\n        ```\n        1. レスポンスには `task_id` が返されます。\n\n---\n\n   * ステップ 4: タスクステータスをポーリングして結果を取得する\n         ポーリングが許可された時間枠内で、一定間隔ごとにタスクステータスを問い合わせるタイムドループを実装する必要があります。\n         1. 次の URL でポーリングします：\n\n        ```\n        GET https://yce-api-01.makeupar.com/s2s/v2.0/task/retake?task_id=TASK_ID\n        ```\n        2. `status` が `success` になると、レスポンスに生成画像の URL が含まれます。\n        3. その URL から画像をダウンロード、または表示します。\n\n---\n\n   * ステップ 5: ご自身のプラットフォームに統合する\n\n        * **Web フロントエンド** では、fetch や Axios を使って JavaScript で直接実装できます。\n        * **バックエンド**（Node.js、Python、Java、PHP など）では、同じエンドポイントを標準の HTTP ライブラリで利用できます。\n        * タスクは非同期で実行されるため、リトライとエラーハンドリングを実装してください。\n\n---\n\n     * デバッグガイド\n\n         1. **元画像の一部の顔が検出されないのはなぜですか**\n             </br>**理由:** 顔がはっきり写っており、覆われたり遮られたりしておらず、画像内で十分に大きいサイズである必要があります\n             </br>**解決方法:** 顔を大きく写し、覆いや遮るものなくはっきり確認できる写真で撮り直してください\n\n---\n\n## 入力と出力\n\n* 実際の例：\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-01-14/9aeab2bb-28aa-48f5-ab86-2edd897ad908.jpg)\n\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-07-02/webp_0196a9d4-1430-4121-9680-5e81b58b66ac.webp)\n\n\n## 対応ファイル仕様とエラー\n* サポートされている形式と寸法\n\n| AI 機能 | サポートされている寸法 | サポートされているファイルサイズ | サポートされている形式 |\n| ---- | ---- | ---- | ---- |\n| AI Retake | 入力・出力ともに長辺 4096 ピクセル以下 | < 10MB | jpg/jpeg/png |\n\n\n* エラーコード\n\n| エラーコード | 説明 |\n| ------------------ | ----------- |\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_download_video | 元動画のダウンロード中にエラーが発生しました |\n| error_decode_video | 元動画のデコード中にエラーが発生しました |\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| error_multiple_people | 人物の数が上限を越えています |\n| error_no_shoulder | 元画像に肩が写っていません |\n| error_large_face_angle | アップロードされた画像の顔の角度が大きすぎます |\n| error_unsupport_ratio | 入力画像のアスペクト比はサポートされていません |\n| unknown_internal_error | その他の内部エラー |\n\n---\n\n## ユニット消費量\n\n| AI 機能 | 消費ユニット |\n|---|---|\n| AI Retake V2.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": "V2.0",
      "description": "シーンはそのままに、顔だけを作り替える。AI Retake なら、集合写真を 1 人ずつ作り替えることができます。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/retake/pre-process": {
      "post": {
        "summary": "AI Retake の顔検出タスクを実行します。",
        "x-display-name": "AI Retake",
        "x-engine-version": "V2.0",
        "description": "AI タスクは非同期です。機能ごとに Webhook がサポートされている場合は、Webhook による完了処理を優先します。Webhook エンドポイントを設定し、Webhook 署名を検証したうえで、`success` または `error` の通知が来たら、受け取った `task_id` を使ってタスクの結果を照会します。設定と検証の詳細は [Webhook 統合ガイド](../develop/webhook.md) を参照してください。\n\nWebhook がサポートされていない場合、または統合に使えない場合は、ポーリングを実装します。AI タスクを送信した後、一定の間隔（例：10 秒ごと）でステータスエンドポイントをポーリングし、`success` または `error` になるまで待ちます。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "タスクの実行に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "タスクの実行に失敗しました",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/retake/pre-process/{task_id}": {
      "get": {
        "summary": "AI Retake の顔検出タスクのステータスを確認します。",
        "x-display-name": "AI Retake",
        "x-engine-version": "V2.0",
        "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": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TaskStatusResponsePreProcessBase"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "url": {
                                  "type": "string",
                                  "description": "この結果をダウンロードする URL。2 時間有効です",
                                  "example": "https://example.com/sample-result-url"
                                },
                                "faces": {
                                  "type": "array",
                                  "description": "写真で検出された顔。左から右へ並んでいます。配列の位置が顔の インデックスで、0 から始まります。",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "bbox": {
                                        "type": "array",
                                        "description": "顔の位置。4 つの数値で構成され、形式は [x1, y1, x2, y2] です。(x1, y1) は左上の点、(x2, y2) は右下の点です。",
                                        "items": {
                                          "type": "integer",
                                          "example": [
                                            0,
                                            0,
                                            100,
                                            100
                                          ]
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/retake": {
      "post": {
        "summary": "AI Retake タスクを実行します。",
        "x-display-name": "AI Retake",
        "x-engine-version": "V2.0",
        "description": "AI タスクは非同期です。機能ごとに Webhook がサポートされている場合は、Webhook による完了処理を優先します。Webhook エンドポイントを設定し、Webhook 署名を検証したうえで、`success` または `error` の通知が来たら、受け取った `task_id` を使ってタスクの結果を照会します。設定と検証の詳細は [Webhook 統合ガイド](../develop/webhook.md) を参照してください。\n\nWebhook がサポートされていない場合、または統合に使えない場合は、ポーリングを実装します。AI タスクを送信した後、一定の間隔（例：10 秒ごと）でステータスエンドポイントをポーリングし、`success` または `error` になるまで待ちます。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2WithMultiRequiredRef"
                  },
                  {
                    "type": "object",
                    "required": [
                      "face_mapping"
                    ],
                    "properties": {
                      "face_mapping": {
                        "type": "array",
                        "description": "ユーザー写真で検出された各顔を、どの参照画像の顔で置き換えるか指定します。n 番目の要素は、左から数えて n 番目の顔に適用されます。写真に 1 人しか写っていない場合も必須です。各写真に 1 人ずつ写っている場合は [{\"index\": 0, \"position\": 0}] を使用してください。",
                        "example": [
                          {
                            "index": 0,
                            "position": 0
                          }
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "index",
                            "position"
                          ],
                          "properties": {
                            "index": {
                              "type": "integer",
                              "description": "参照リスト内の参照写真のインデックス。0 から始まります。この顔を変更せずに残す場合は -1 を設定します。",
                              "example": 0
                            },
                            "position": {
                              "type": "integer",
                              "description": "参照リスト内の参照写真の位置のインデックス。0 から始まり、顔検出タスクが返した順（左から右）と対応します。この顔を変更せずに残す場合は -1 を設定します。",
                              "example": 0
                            }
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "タスクの実行に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "タスクの実行に失敗しました",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/retake/{task_id}": {
      "get": {
        "summary": "AI Retake タスクのステータスを確認します。",
        "x-display-name": "AI Retake",
        "x-engine-version": "V2.0",
        "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"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "標準の 'Bearer authentication' を使用します。ヘッダーに 'API Key' を設定してください：`Authorization:Bearer YOUR_API_KEY`。'Bearer' と 'YOUR_API_KEY' の間にスペースが 1 つ必要です。"
      }
    },
    "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。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "BasicRunTaskV2": {
        "title": "BasicRunTaskV2",
        "anyOf": [
          {
            "title": "src ファイル URL でタスクを実行",
            "allOf": [
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              }
            ]
          },
          {
            "title": "src ファイル 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"
          }
        }
      },
      "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"
          }
        }
      },
      "TaskStatusResponsePreProcessBase": {
        "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": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
                  }
                ]
              }
            }
          }
        }
      },
      "BasicRunTaskV2RefFileUrls": {
        "type": "object",
        "properties": {
          "ref_file_urls": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "description": "タスクを実行するための参照ファイルの URL。この URL は公開されている必要があります。",
              "example": "https://example.com/accessory.jpg"
            }
          }
        }
      },
      "BasicRunTaskV2RefFileIds": {
        "type": "object",
        "properties": {
          "ref_file_ids": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "description": "タスクを実行するための参照ファイルの ID。ファイルアップロード API から取得したファイル ID です。",
              "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            }
          }
        }
      },
      "BasicRunTaskV2WithMultiRequiredRef": {
        "title": "BasicRunTaskV2WithRef",
        "anyOf": [
          {
            "allOf": [
              {
                "title": "src ファイル URL と参照ファイル URL でタスクを実行",
                "required": [
                  "ref_file_urls"
                ]
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrls"
              }
            ]
          },
          {
            "allOf": [
              {
                "title": "src ファイル URL と参照ファイル ID でタスクを実行",
                "required": [
                  "ref_file_ids"
                ]
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2RefFileIds"
              }
            ]
          },
          {
            "allOf": [
              {
                "title": "src ファイル ID と参照ファイル URL でタスクを実行",
                "required": [
                  "ref_file_urls"
                ]
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2RefFileUrls"
              }
            ]
          },
          {
            "allOf": [
              {
                "title": "src ファイル ID と参照ファイル ID でタスクを実行",
                "required": [
                  "ref_file_ids"
                ]
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
              },
              {
                "$ref": "#/components/schemas/BasicRunTaskV2RefFileIds"
              }
            ]
          }
        ]
      },
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}