{
  "openapi": "3.0.0",
  "info": {
    "title": "体型補正",
    "description": "# 概要\n体型補正 API による体型補正＆スリミング\nAI 体型補正 API で、写真のスリミングと体型補正を行います。\n\n\n## 統合ガイド\nこのガイドでは、AI 体型補正 API のワークフローについて説明します。\n\n**エンドポイント:** `/s2s/v2.0/task/body-reshape`\n\n**認証必須:** `Authorization: Bearer YOUR_API_KEY`\n\n**ワークフロー手順:**\n\n1. **画像アップロードの準備:**\n    - アップロード用のセルフィー画像を準備します。\n    - ファイル API `/s2s/v2.0/file` を呼び出し、アップロード URL と関連する `file_id` を取得します。\n    - 提供されたアップロード URL を使用してセルフィー画像をアップロードします。\n\n2. **グループ写真の場合のオプション前処理:**\n    - 画像内に複数の人物がいる場合は、セルフィー画像を前処理します。\n\n3. **体型補正効果の設定:**\n    - まず、適切な体型補正パラメータを選択します。\n\n4. **AI タスクの開始とタスク ID の取得:**\n    - `file_id` と選択した効果設定を HTTP POST リクエストで `/s2s/v2.0/task/body-reshape` に送信します。\n    - この操作を識別するための一意なタスク ID をレスポンスで待ちます。\n\n5. **タスクステータスのポーリング（継続的な確認）:**\n    - 取得した `task_id` を使用し、HTTP GET リクエスト（例: `GET /s2s/v2.0/task/body-reshape/${task_id}`）で定期的にタスクステータスをポーリングします。\n    - 以下を継続的に監視します。\n    - `Task_status = \"success\"`（処理完了）。\n    - `Task_status = \"error\"`（該当する場合、解決または再試行）。\n    - ステータスが success に遷移したら、ワークフローを適切に更新します。\n\n---\n\n* API プレイグラウンド\n\nAPI プレイグラウンドで API を対話的にテストします。\n\n**API プレイグラウンド:**\n[http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/](http://yce.makeupar.com/api-console/en/api-playground/ai-body-reshape/)\n\n---\n\n* 認証\n- リクエストヘッダーに **Bearer トークン** を使用して API キーを含めます。\n```\nAuthorization: Bearer YOUR_API_KEY\n```\nAPI キーの確認場所: https://yce.makeupar.com/api-console/en/api-keys/.\n\n\n* 1. 画像のアップロード\n\nファイルをサーバーに直接アップロードするか、AI タスクペイロードに有効な画像 URL を指定します。\n\n* アップロードエンドポイント\n\n```\nPOST /s2s/v2.0/file\n```\n\nすでに公開画像 URL がある場合は、この手順をスキップできます。\n\n---\n\n* 2. 効果テンプレートの準備\n\n* 前処理\nピクセル座標で検出されたバウンディングボックスを出力します。後で体型補正 AI タスクを作成するために、結果のインデックスを使用します。\n```\n{\n\"timed\": number,\n\"result\": [\n{\n \"left\": number,\n \"top\": number,\n \"width\": number,\n \"height\": number\n}\n]\n}\n```\n\n* 効果テンプレート JSON スキーマ\n```\n{\n\"version\": \"1.0\",\n\"index\": 0,\n\"features\": {\n\"arm\": 0, // -100~100\n\"breast_left\": 0, // -100~100\n\"breast_right\": 0, // -100~100\n\"hip\": 0, // -100~100\n\"hip_lift\": 0, // -100~100\n\"leg\": 0, // -100~100\n\"neck_left\": 0, // 0~100\n\"neck_right\": 0, // 0~100\n\"shoulder_left\": 0, // -100~100\n\"shoulder_right\": 0, // -100~100\n\"squared_shoulder_left\": 0, // -100~100\n\"squared_shoulder_right\": 0, // -100~100\n\"slim\": 0, // -100~100\n\"taller\": 0, // 0~100\n\"waist\": 0, // -100~100\n\"belly\": 0 // -100~100\n}\n}\n```\nindex: 前処理で検出された体のインデックス。省略可、初期値 0。\nfeatures: 少なくとも 1 つの非ゼロの体型補正パラメータが必須です。すべてゼロにはできません。\n\n\n* ペイロードの例（送信可能）\n```\n{\n \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/body_reshape_02_7777218379.jpg\",\n \"version\": \"1.0\",\n \"index\": 0,\n \"features\": {\n\"arm\": 0,\n\"waist\": -20,\n\"taller\": 80,\n\"squared_shoulder_left\": 10,\n\"squared_shoulder_right\": 10,\n\"neck_left\": 0,\n\"neck_right\": 0,\n\"hip\": 10,\n\"breast_left\": 30,\n\"breast_right\": 30,\n\"slim\": -70,\n\"shoulder_left\": 30,\n\"shoulder_right\": 30,\n\"leg\": -30,\n\"hip_lift\": 0,\n\"belly\": -50\n }\n}\n```\n\n\n* 3. 体型補正 AI タスクの作成と結果のポーリング\n\n画像と完全な効果ペイロードが準備できたら、タスクを作成します。API はリクエストを非同期で処理します。ステータスが `success` または `error` になるまで、タスクステータスをポーリングする必要があります。\n\n* タスク作成エンドポイント\n\n```\nPOST /s2s/v2.0/task/body-reshape\n```\n\n* ポーリングエンドポイント\n\n```\nGET /s2s/v2.0/task/body-reshape/{task_id}\n```\n\n---\n\n## ファイル仕様とエラー\n\n* AI 体型補正仕様\n\n**対応セルフィービュー**\n顔の表情と体の姿勢がはっきりと見える全身写真。\n\n![](https://plugins-media.makeupar.com/strapi/assets/thumbnail_body_reshape_02_7777218379.jpg)\n\n**可視性とポーズの要件**\n\n| **領域** | **ソース画像で満たすべき条件** |\n|------------|---------------------------------------------------|\n| **首** | ソース画像内で首が見えている必要があります。 |\n| **腕** | 両腕（上腕、前腕、手）が完全に写っている必要があります。 |\n| **脚** | 脚全体が画像内に写っている必要があります。 |\n| **ヒップ** | ヒップが視界に入っている必要があります。 |\n| **ヒップリフト** | ヒップが視界に入っている必要があります。 |\n| **肩** | • 肩が見えている必要があります。<br>• 手を上げるポーズは許可されていません。<br>• 90° の横向きポーズは許可されていません。 |\n| **腹部** | 腹部が見えている必要があります。 |\n| **ウエスト** | ウエストが見えている必要があります。 |\n| **胸** | • 胸の領域が画像内に写っている必要があります。<br>• ヒップを含むショットである必要があります（「ヒップなしのハーフボディ」は不可）。<br>• 胸の中央が見えている必要があります。 |\n| **スリム** | 肩がフレーム内に入っている必要があります。 |\n| **身長** | • ヒップが写っている必要があります。<br>• ハーフボディビューの場合、脚が含まれている必要があります（脚が見えていること）。 |\n\n\n\n**体型補正カスタマイズパラメータガイド**\n\n| カテゴリ | パラメータ | 機能 | 最小値 (-100 / 0) | 最大値 (100) |\n| -------- | --------- | -------- | -------------------- | --------------- |\n| 腕| 強度 | 腕の太さを調整します | 細い | 太い |\n| 腹部| 強度 | 腹部の突出を調整します | 平坦 | 突出 |\n| 胸| 強度（左 / 右） | 各側の胸のボリュームを調整します | 平坦 | 豊か |\n| ヒップリフト | 強度 | ヒップの曲率とリフトを調整します（ヒップアップ効果を追加） | 引き締まった（リフトアップ＆引き締め） | 丸みのある（リフトアップ＆ボリュームアップ） |\n| ヒップサイズ | 強度 | ヒップ全体の幅を調整します | 狭い | 広い |\n| 脚| 強度 | 脚の太さを調整します | 細い | 太い|\n| 首| 強度（左 / 右） | 各側の首の輪郭とスリミングを調整します| 元通り (0)| 引き締まった |\n| 肩幅 | 強度（左 / 右） | 各肩の幅を調整します | 狭い | 広い |\n| 肩の形 | 強度（左 / 右） | 各肩の角度と傾きを調整します | 傾斜 | 四角い |\n| スリム| 強度 | 全身の曲線を調整します | スリム | 曲線的 |\n| 身長| 強度 | 人物全体の身長を調整します | 元通り (0) | 高い |\n| ウエスト| 強度 | ウエストラインの幅を調整します | 狭い | 広い |\n\n**注意:** *“左”と“右”は、視聴者の画面の左右ではなく、人物本人の視点に基づいています。*\n\n\n---\n\n* 対応フォーマットと寸法\n\n|AI 機能|対応寸法|対応ファイルサイズ|対応フォーマット|\n| ---- | ---- | ---- | ---- |\n|AI 体型補正|長辺 <= 2048、短辺 >= 320|< 10MB|jpg/jpeg/png|\n\n* エラーコード\n\n| エラーコード | 説明 |\n| ---- | ---- |\n| RUNTIME_ERROR | 体型補正の実行中に予期しないエラーが発生しました |\n| PHOTO_DETECTION_FAIL | ユーザー写真を正しく処理できませんでした。例えば、手が検出されませんでした |\n| PHOTO_CHECK_INVALID | ユーザー写真のポーズまたはサイズが無効です |\n| INPUT_ERROR | 入力ファイルフォーマットが正しくありません |\n| INPUT_MAIN_IMAGE_EMPTY | ユーザー画像が必要です |\n\n\n* 環境と依存関係\n\n| サンプルコード言語 / ツール | 推奨ランタイムバージョン |\n|---|---|\n| cURL | - bash >= 3.2</br>- curl >= 7.58 (モダンな TLS/HTTP サポート)</br>- jq >= 1.6 (堅牢な JSON パーシング) |\n| Node.js (JavaScript) | Node >= 18 (グローバル fetch のため) |\n| JavaScript | - Chrome / Edge >= 80</br>- Firefox >= 74</br>- Safari >= 13.1 |\n| PHP | PHP >= 7.4 (モダンな TLS/互換性のため), ext-curl (推奨) または allow_url_fopen=On + ext-openssl, ext-json |\n| Python | Python >= 3.10 (f-strings のため), requests >= 2.20.0 |\n| Java | Java 11+ (HttpClient のため), Jackson Databind >= 2.12.0 |\n\n---\n\n## ユニット消費\n\n| AI 機能 | 消費ユニット |\n|---|---|\n| AI 体型補正 V1.0 | 1 |\n\n---\n",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/body-reshape/pre-process": {
      "post": {
        "summary": "体型補正検出タスクを実行します。",
        "description": "ソース画像に複数の有効なターゲットが含まれる可能性がある場合、またはエフェクトを適用する検出ターゲットを明示的に選びたい場合は、前処理タスクを使います。単一ターゲットの画像では、機能がデフォルトの `index` 値をサポートしているため、手動でのターゲット選択が不要な場合は前処理をスキップできます。\n\n前処理タスクは、ソース画像内の候補ターゲットを検出し、その座標を `data.results.result` に返します。結果配列の各項目は、検出された 1 つのターゲットを表します。返された座標を確認し、ソース画像内の意図した顔や領域に対応づけたうえで、エフェクトタスクを作成する際にその項目のゼロベース配列インデックスを `index` 値として使います。\n\n複数の顔や領域が検出された画像では、前処理の結果を確認せずにデフォルトの `index` 値に頼らないでください。エフェクトは `index` で選択されたターゲットにしか適用されないため、エフェクトタスクを実行する前に、意図したターゲットに対応する結果項目を確認する必要があります。\n\nこのタスクは非同期です。タスクを作成した後、機能がサポートしている場合は Webhook で完了を処理するか、対応する前処理ステータスエンドポイントをポーリングして `data.task_status` が `success` または `error` になるまで待ちます。\n",
        "tags": [
          "V1.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/body-reshape/pre-process/{task_id}": {
      "get": {
        "summary": "体型補正検出タスクのステータスを確認します。",
        "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/TaskStatusResponsePreProcessNoUrlBase"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "timed": {
                                  "type": "number"
                                },
                                "result": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "left": {
                                        "type": "number"
                                      },
                                      "top": {
                                        "type": "number"
                                      },
                                      "width": {
                                        "type": "number"
                                      },
                                      "height": {
                                        "type": "number"
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/body-reshape": {
      "post": {
        "summary": "体型補正タスクを実行します。",
        "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": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  },
                  {
                    "type": "object",
                    "required": [
                      "version",
                      "features"
                    ],
                    "properties": {
                      "version": {
                        "type": "string",
                        "description": "機能仕様のバージョン。特に指定がない限り、初期値は `\"1.0\"` です。\n",
                        "default": "1.0",
                        "example": "1.0"
                      },
                      "index": {
                        "type": "integer",
                        "example": 0,
                        "description": "検出タスクの結果からの人物のインデックス。"
                      },
                      "features": {
                        "type": "object",
                        "description": "すべて 0 にすることはできません",
                        "minProperties": 1,
                        "properties": {
                          "arm": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "breast": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "両側に適用されます。片側ごとのキー (`breast_left` / `breast_right`) は、その側のこの値を上書きします。片側ごとの `0` は、その側が変更されないことを意味します。"
                          },
                          "breast_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "breast_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "hip": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "hip_lift": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "leg": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "neck": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0,
                            "description": "両側に適用されます。片側ごとのキー（`neck_left` / `neck_right`）を使用すると、その側の値を上書きできます。片側ごとに `0` を指定すると、その側は変更されません。"
                          },
                          "neck_left": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "neck_right": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "shoulder": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "両側に適用されます。片側ごとのキー（`shoulder_left` / `shoulder_right`）を使用すると、その側の値を上書きできます。片側ごとに `0` を指定すると、その側は変更されません。"
                          },
                          "shoulder_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "shoulder_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "squared_shoulder": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0,
                            "description": "両側に適用されます。片側ごとのキー（`squared_shoulder_left` / `squared_shoulder_right`）を使用すると、その側の値を上書きできます。片側ごとに `0` を指定すると、その側は変更されません。"
                          },
                          "squared_shoulder_left": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "squared_shoulder_right": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "slim": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "taller": {
                            "type": "number",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 0
                          },
                          "waist": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "example": 0
                          },
                          "belly": {
                            "type": "number",
                            "minimum": -100,
                            "maximum": 100,
                            "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/body-reshape/{task_id}": {
      "get": {
        "summary": "AI 体型補正タスクのステータスを確認します。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "確認するタスクの ID"
          }
        ],
        "responses": {
          "200": {
            "description": "タスクステータスの確認に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/TaskStatusResponseV2"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "results": {
                              "type": "object",
                              "properties": {
                                "timed": {
                                  "type": "number"
                                },
                                "timed_apply": {
                                  "type": "number"
                                },
                                "arm": {
                                  "type": "boolean"
                                },
                                "breast_left": {
                                  "type": "boolean"
                                },
                                "breast_right": {
                                  "type": "boolean"
                                },
                                "hip": {
                                  "type": "boolean"
                                },
                                "hip_lift": {
                                  "type": "boolean"
                                },
                                "leg": {
                                  "type": "boolean"
                                },
                                "neck_left": {
                                  "type": "boolean"
                                },
                                "neck_right": {
                                  "type": "boolean"
                                },
                                "shoulder_left": {
                                  "type": "boolean"
                                },
                                "shoulder_right": {
                                  "type": "boolean"
                                },
                                "squared_shoulder_left": {
                                  "type": "boolean"
                                },
                                "squared_shoulder_right": {
                                  "type": "boolean"
                                },
                                "slim": {
                                  "type": "boolean"
                                },
                                "taller": {
                                  "type": "boolean"
                                },
                                "waist": {
                                  "type": "boolean"
                                },
                                "belly": {
                                  "type": "boolean"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "標準の 'Bearer authentication' を使用します。ヘッダーに 'API Key' を設定してください：`Authorization:Bearer YOUR_API_KEY`。'Bearer' と 'YOUR_API_KEY' の間にスペースがある点にご注意ください。"
      }
    },
    "schemas": {
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "タスクを実行するファイルの 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"
      },
      "TaskStatusResponsePreProcessNoUrlBase": {
        "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": "エラーの詳細な説明"
              }
            }
          }
        }
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "この結果をダウンロードする URL。有効期間は 2 時間です",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "このタスクのステータス"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "エラーの詳細な説明"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "InvalidApiKey": {
        "description": "無効または欠落している API キー",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "リクエストが多すぎます",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "無効なタスク ID",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "タスク実行タイムアウト",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}