{
  "openapi": "3.0.0",
  "info": {
    "title": "指輪バーチャル試着",
    "description": "# 概要\nAR リングやエンゲージメントリングのバーチャル試着を作成します。2D 画像でリングの試着プレビューを生成します。\n\n## 統合ガイド\n本ガイドでは以下内容を説明します:\n\n*   **エンドポイント:** `/s2s/v2.0/task/2d-vto/ring`\n*   **認証:** すべてのリクエストに `Authorization: Bearer YOUR_API_KEY` が必要です\n*   **ワークフロー:**\n    1.  **手の画像を準備する:** 画像をアップロードするか、手の有効な画像 URL を提供します\n    1.  **リングの画像を準備する:** 画像をアップロードするか、リング製品の有効な画像 URL を提供します\n    1.  **AI タスクを発行しタスク ID を取得する:** レスポンスから `task_id` を取得します。\n    1.  **ステータスをポーリングする（`GET`）:** `task_id` を使用してタスクのステータスを確認します。`task_status` が `\"success\"` または `\"error\"` になるまでポーリングを続行してください。\n\n---\n\n* API プレイグラウンド\n\nAPI プレイグラウンドで API を対話的にテストします:\n\n**API プレイグラウンド:**\n[http://yce.makeupar.com/api-console/en/api-playground/ai-ring-virtual-try-on/](http://yce.makeupar.com/api-console/en/api-playground/ai-ring-virtual-try-on/)\n\n---\n\n* 認証\n- リクエストヘッダーに **Bearer Token** を使用して API キーを含めます:\n    ```\n    Authorization: Bearer YOUR_API_KEY\n    ```\nAPI キーの確認場所: https://yce.makeupar.com/api-console/en/api-keys/.\n\n\n* 1. 画像のアップロード\n\nファイルをサーバーに直接アップロードするか、VTO タスクペイロードに有効な画像 URL を提供できます。\n\n   * アップロードエンドポイント\n\n```\nPOST /s2s/v2.0/file\n```\n\nすでにパブリックな画像 URL を持っている場合は、このステップをスキップできます。\n\nFile API のレスポンスで提供された URL にファイルを直接アップロードし、その後 File API が返した対応する `src_file_id` を使用して AI タスクを呼び出すことができます。または VTO タスクペイロードに有効な画像 URL を `src_file_url` として提供します。`src_file_id` または `src_file_url` がバーチャル試着の対象となります。\n\nまた、`src_file_id` または `src_file_url` に適用するリング製品画像を参照として `ref_file_ids` または `ref_file_urls` で提供する必要があります。\n\nAI エンジンでは、リング製品画像の自動背景透過に対応しています。ただし、手（`srcmsk_file_id` または `srcmsk_file_url`）またはリング製品（`refmsk_file_ids` または `refmsk_file_urls`）のオクルージョンマスク画像ファイルを提供してセグメンテーションを微調整できます。\n\n---\n\n* 2. リング VTO タスクの作成と結果のポーリング\n\n画像とテンプレート ID が揃ったら、タスクを作成します。API はリクエストを非同期で処理します。ステータスが `success` または `error` に達するまでタスクステータスをポーリングする必要があります。\n\n   * タスク作成エンドポイント\n\n```\nPOST /s2s/v2.0/task/2d-vto/ring\n```\n\n   * ポーリングエンドポイント\n\n```\nGET /s2s/v2.0/task/2d-vto/ring/{task_id}\n```\n\n---\n\n## ファイル仕様とエラー\n\n* 指輪バーチャル試着の仕様\n\n**サポートされるリングビュー**\nリング画像は四分之三前面ビュー（約 45 度）で提供する必要があります。\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/ring_product_01_9a4d0680f2_b46afe9a53.jpg)\n\n**サポートされる手のビュー**\n手の甲が完全に、5 つの指がすべて明確に見え、オクルージョン（遮蔽）がない状態である必要があります。\n\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/ring_user_01_6d9893abd0_c7427cdb78.jpg)\n\n**ring\\_wearing\\_finger: integer (0–4)**\nリングを着用する指を指定します:\n0 = 親指\n1 = 人差し指\n2 = 中指\n3 = 薬指\n4 = 小指\n\n**ring\\_wearing\\_location: float (0.0–1.0)**\n指に沿った位置を示します:\n0.0 = MCP 関節（大きな関節）に近い\n1.0 = PIP 関節（中央の関節）に近い\n\n![ring_wearing_location](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/ring_wearing_location_59567be4af.jpg)\n\n**ring\\_shadow\\_intensity: float (0.0–1.0)**\n影の強さを制御します:\n0.0 = 影なし\n1.0 = 最大限の影\nデフォルト: 0.15\n\n**ring\\_ambient\\_light\\_intensity: float (0.0–1.0)**\nライティングがターゲットの手画像を参照する度合いを定義します:\n0.0 = 手画像のライティングを無視\n1.0 = 手画像のライティングと影のレンダリングに完全に一致\nデフォルト: 1.0\n\n**リングアンカーポイント: ピクセル座標の 2 点の配列（任意）**\nリングが指に接する内側のエッジをマークし、左と右の点を指定します。幅広または厚みのあるリングには特に役立ちます。\nこのパラメータを提供しない場合、AI エンジンがアンカーポイントを自動的に検出します。\n\n![ring_anchor_point](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/ring_anchor_point_e6eb241ef8.jpg)\n\n\n---\n\n* サポートされる形式と寸法\n\n|AI 機能|サポートされる寸法|サポートされるファイルサイズ|サポートされる形式|\n|  ----  | ----  | ----  | ----  |\n|指輪バーチャル試着|長辺 <= 4096 |< 10MB|jpg/jpeg/png|\n\n* エラーコード\n\n|エラーコード|説明|\n|  ----  | ----  |\n| RUNTIME_ERROR | ランタイムで予期しないエラーが発生しました |\n| PHOTO_DETECTION_FAIL | ユーザー写真が正しく処理できませんでした（例: 手が検出されなかった） |\n| OBJECT_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## JS Camera Kit\n{% partial file=\"/_partials/js-camera-kit.md\" /%}\n\n---\n\n## ユニット消費\n\n| AI 機能 | 消費ユニット |\n|---|---|\n| 指輪バーチャル試着 V1.0 | シングルアイテム着用で 1 ユニット<br> スタック着用で 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"
    }
  ],
  "paths": {
    "/s2s/v2.0/file/2d-vto/ring": {
      "post": {
        "summary": "新しいファイルを作成します。",
        "description": "新しいファイルをアップロードするには、まず File API を使用する必要があります。URL が発行されるので、その URL を使用してファイルをアップロードします。アップロードが完了したら、同じレスポンス内の file_id を使用して AI 機能を利用できます。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/FileV1.1"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ファイルアップロード情報の取得に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/FileResponseV2"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameters"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          }
        }
      }
    },
    "/s2s/v2.0/task/2d-vto/ring": {
      "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": {
                "$ref": "#/components/schemas/RingRunTaskV2"
              }
            }
          }
        },
        "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/2d-vto/ring/{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": {
                  "$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": {
      "RingRunTaskV2": {
        "allOf": [
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2"
          },
          {
            "type": "object",
            "properties": {
              "object_infos": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "parameter": {
                      "type": "object",
                      "properties": {
                        "ring_need_remove_background": {
                          "type": "boolean",
                          "description": "指輪画像の背景を透過するかどうか。",
                          "default": true,
                          "example": true
                        },
                        "ring_anchor_point": {
                          "type": "array",
                          "description": "指輪画像のアンカーポイント。指輪の内側の縁に沿って最も離れた 2 点を示します。<br>型: 整数の 2x2 リスト<br>範囲: 2 つの (x, y) ピクセル座標<br>初期値: null (エンジンデフォルトを使用)",
                          "default": null,
                          "example": null,
                          "minItems": 2,
                          "maxItems": 2,
                          "items": {
                            "type": "array",
                            "minItems": 2,
                            "maxItems": 2,
                            "items": {
                              "type": "integer"
                            }
                          }
                        },
                        "ring_wearing_finger": {
                          "type": "integer",
                          "description": "指輪を着用する指を指定します。<br>初期値: null (エンジンデフォルトを使用)<br>範囲: 0 ~ 4 [親指から小指]",
                          "enum": [
                            0,
                            1,
                            2,
                            3,
                            4
                          ],
                          "default": null,
                          "example": null
                        },
                        "ring_wearing_location": {
                          "type": "number",
                          "description": "ユーザー写真内の選択した指に対する指輪の配置位置を指定します。<br>範囲: 0.0 ~ 1.0 (0 = 指の付け根, 1 = 第 1 関節)",
                          "minimum": 0,
                          "maximum": 1,
                          "default": null,
                          "example": null
                        },
                        "ring_shadow_intensity": {
                          "type": "number",
                          "description": "指輪に適用される影の強度 (値が大きいほど影が濃くなります)。",
                          "minimum": 0,
                          "maximum": 1,
                          "default": 0.15,
                          "example": 0.15
                        },
                        "ring_ambient_light_intensity": {
                          "type": "number",
                          "description": "指輪の環境光調整強度。",
                          "minimum": 0,
                          "maximum": 1,
                          "default": 1,
                          "example": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "FileV1.1": {
        "title": "File V1.1",
        "description": "このオブジェクトはファイルを表します。",
        "type": "object",
        "required": [
          "files"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "content_type",
                "file_name",
                "file_size"
              ],
              "properties": {
                "content_type": {
                  "type": "string",
                  "example": "image/jpg",
                  "description": "ファイルのコンテンツ MIME タイプを指定します。現在サポートされている値には、image/jpg や video/mp4 などの画像および動画形式が含まれます。"
                },
                "file_name": {
                  "type": "string",
                  "example": "my-selfie.jpg",
                  "description": "このファイルの名前"
                },
                "file_size": {
                  "type": "integer",
                  "example": 50000,
                  "description": "バイト単位のファイルサイズ。サポートされている制限は、画像ファイルで 10 MB、動画ファイルで 100 MB です。"
                }
              }
            }
          }
        }
      },
      "BasicFileResponse": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content_type": {
                  "type": "string",
                  "example": "image/jpg",
                  "description": "このファイルのコンテンツ MIME タイプ。"
                },
                "file_name": {
                  "type": "string",
                  "example": "my-selfie.jpg",
                  "description": "このファイルの名前"
                },
                "file_id": {
                  "type": "string",
                  "example": "U8aqJbsXGT537jtGnEDFHqxdDXqh8+oTF/cSkLimzuvVwMP+Jb1XbjPsf7ZgUgLY",
                  "description": "このファイルの ID。他のタスク実行 API でこの \\`file_id\\` が必要になります。"
                },
                "requests": {
                  "type": "array",
                  "description": "以下の \\`url\\`、\\`headers\\`、\\`method\\` を使用してファイルをアップロードします。完了後、\\`file_id\\` を使用してタスク実行 API の呼び出しを進めます。",
                  "items": {
                    "type": "object",
                    "properties": {
                      "headers": {
                        "type": "object",
                        "example": {
                          "Content-Type": "image/jpg",
                          "Content-Length": 50000
                        },
                        "description": "ファイルのアップロード時に含めるヘッダー"
                      },
                      "url": {
                        "type": "string",
                        "example": "https://example.com/presigned-upload-url",
                        "description": "このファイルをアップロードする URL"
                      },
                      "method": {
                        "type": "string",
                        "example": "PUT",
                        "description": "このファイルをアップロードするための HTTP メソッド"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "FileResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "example": 200,
            "description": "レスポンスステータス"
          },
          "data": null
        },
        "$ref": "#/components/schemas/BasicFileResponse"
      },
      "BasicRunTaskV2SrcFileUrl": {
        "type": "object",
        "required": [
          "src_file_url"
        ],
        "properties": {
          "src_file_url": {
            "type": "string",
            "description": "タスクを実行するファイルの URL。この URL は公開されている必要があります。",
            "example": "https://example.com/selfie.jpg"
          }
        }
      },
      "2dVtoRunTaskV2SrcmskFileUrl": {
        "type": "object",
        "properties": {
          "srcmsk_file_url": {
            "type": "string",
            "description": "タスクを実行するソースマスクファイルの URL。URL は公開されている必要があります。",
            "example": "https://example.com/src_mask.jpg"
          }
        }
      },
      "2dVtoRunTaskV2RefFileUrls": {
        "type": "object",
        "required": [
          "ref_file_urls"
        ],
        "properties": {
          "ref_file_urls": {
            "type": "array",
            "description": "タスク実行用の参照ファイルの URL です。URL は公開されている必要があります。",
            "example": [
              "https://example.com/vto_sku.jpg"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefmskFileUrls": {
        "type": "object",
        "properties": {
          "refmsk_file_urls": {
            "type": "array",
            "description": "タスク実行用の参照マスクファイルの URL です。URL は公開されている必要があります。",
            "example": [
              "https://example.com/vto_sku_mask.jpg"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefFileIds": {
        "type": "object",
        "required": [
          "ref_file_ids"
        ],
        "properties": {
          "ref_file_ids": {
            "type": "array",
            "description": "タスク実行用の参照ファイルの ID です。ファイルアップロード API で取得したファイル ID です。",
            "example": [
              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "2dVtoRunTaskV2RefmskFileIds": {
        "type": "object",
        "properties": {
          "refmsk_file_ids": {
            "type": "array",
            "description": "タスク実行用の参照マスクファイルの ID です。ファイルアップロード API で取得したファイル ID です。",
            "example": [
              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BasicRunTaskV2SrcFileId": {
        "type": "object",
        "required": [
          "src_file_id"
        ],
        "properties": {
          "src_file_id": {
            "type": "string",
            "description": "タスクを実行するファイルの ID。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "2dVtoRunTaskV2SrcmskFileId": {
        "type": "object",
        "properties": {
          "srcmsk_file_id": {
            "type": "string",
            "description": "タスクを実行するソースマスクファイルの ID。ファイルアップロード API から取得したファイル ID です。",
            "example": "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE="
          }
        }
      },
      "2dVtoRunTaskV2SrcInfo": {
        "type": "object",
        "required": [
          "source_info"
        ],
        "properties": {
          "source_info": {
            "type": "object",
            "description": "ソース画像の情報を含みます。",
            "properties": {
              "name": {
                "type": "string",
                "description": "ソース URL またはファイル ID です。",
                "example": "https://example.com/selfie.jpg"
              },
              "mask_name": {
                "type": "string",
                "description": "ソースマスク URL またはファイル ID です。",
                "example": "https://example.com/src_mask.jpg"
              }
            },
            "required": [
              "name"
            ]
          }
        }
      },
      "2dVtoRunTaskV2ObjInfos": {
        "type": "object",
        "required": [
          "object_infos"
        ],
        "properties": {
          "object_infos": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "このリストに複数のオブジェクト情報を含みます。",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "参照 URL またはファイル ID です。どの参照製品画像とマッチさせるかを示します。",
                  "example": "https://example.com/vto_sku.jpg"
                },
                "mask_name": {
                  "type": "string",
                  "description": "参照マスク URL またはファイル ID です。どの参照製品画像とマッチさせるかを示します。",
                  "example": "https://example.com/vto_sku_mask.jpg"
                }
              },
              "required": [
                "name"
              ]
            }
          }
        }
      },
      "2dVtoRunTaskV2": {
        "allOf": [
          {
            "anyOf": [
              {
                "allOf": [
                  {
                    "title": "src file url & srcmsk file url & ref file urls & refmsk file urls でタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileUrls"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileUrls"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src file url & srcmsk file url & ref file IDs & refmsk file IDs でタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileUrl"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileIds"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileIds"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src file ID & srcmsk file ID & ref file urls & refmsk file urls でタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileUrls"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileUrls"
                  }
                ]
              },
              {
                "allOf": [
                  {
                    "title": "src file ID & srcmsk file ID & ref file IDs & refmsk file IDs でタスクを実行"
                  },
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2SrcFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2SrcmskFileId"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefFileIds"
                  },
                  {
                    "$ref": "#/components/schemas/2dVtoRunTaskV2RefmskFileIds"
                  }
                ]
              }
            ]
          },
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2SrcInfo"
          },
          {
            "$ref": "#/components/schemas/2dVtoRunTaskV2ObjInfos"
          }
        ]
      },
      "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": {
      "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"
                }
              }
            }
          }
        }
      }
    }
  }
}