{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 画像生成",
    "description": "# 概要\nAI 画像生成では、テキストプロンプトから画像を生成します。カートゥーン、油絵、スケッチなどのスタイルを試せます。画像を参照として追加することもできます。\n\nその他のスタイルについては、https://yce.makeupar.com/ai-art-generator. を参照してください。\n\nユースケース:\n![AI 画像生成](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v3_video_02f161f909.jpg \"AI 画像生成\")\n\n![AI 画像生成](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v4_poster_092d2fbb9f.jpg \"AI 画像生成\")\n\n出力例:\n![AI 画像生成](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_2_e325681588.jpg \"AI 画像生成\")\n\n![AI 画像生成](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_5_8b4fa13c6a.jpg \"AI 画像生成\")\n\n## ファイル仕様とエラー\n\n* 対応フォーマットと寸法\n\n|AI 機能|対応寸法|対応ファイルサイズ|対応フォーマット|\n| ---- | ---- | ---- | ---- |\n| V1.0 Text to Image | 出力: 長辺 1024 ピクセル。 | プロンプトは 500 文字以内 | N/A |\n| V2.0 Text to Image | 出力: 初期解像度は 1664 × 928 で、対応解像度は 1664 × 928 (16:9)、1472 × 1104 (4:3)、1328 × 1328 (1:1)、1104 × 1472 (3:4)、928 × 1664 (9:16) です。 | プロンプトは 800 文字以内 | N/A |\n| V2.0 Image to Image | 入力: 幅と高さの両方が 384 から 3072 ピクセルの範囲内である必要があります。 <br>出力: 幅と高さのカスタマイズ可能な範囲は 512 から 2,048 ピクセルで、初期設定では入力画像のアスペクト比に基づき、総ピクセル数が約 1,024 × 1,024 となるように維持されます。 | <10MB<br> プロンプトは 800 文字以内 | JPG、JPEG、PNG、BMP、TIFF、WEBP、GIF。 <br>アニメーション GIF の場合、最初のフレームのみが処理されます。 |\n\n* エラーコード\n\n| エラーコード | 説明 |\n| ---------- | ----------- |\n| exceed_max_filesize | アップロードされたファイルサイズが最大制限を超えています。 |\n| invalid_parameter | 1 つ以上のパラメータが不足しているか、無効です |\n| error_download_image | ソース画像のダウンロードに失敗しました。 |\n| error_decode_image | ソース画像のデコードまたは解析に失敗しました。 |\n| error_nsfw_content_detected | ソース画像に NSFW（職場不適切）コンテンツが検出されました。 |\n| error_unsupport_ratio | 入力画像のアスペクト比はサポートされていません。 |\n| unknown_internal_error | 不明な内部エラーが発生しました。 |\n\n---\n\n## ユニット消費量\n\n| AI 機能 | 消費ユニット |\n|---|---|\n| AI 画像生成 V1.0 | 2 |\n| AI 画像生成 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 画像生成 V2.0 API で、テキストプロンプトまたは既存の画像から画像を生成します。"
    },
    {
      "name": "V1.0",
      "description": "AI 画像生成 API を使用すると、事前定義されたテンプレートを使用してテキストプロンプトから画像を生成できます。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/text-to-image": {
      "get": {
        "summary": "事前定義されたテンプレートを一覧表示します。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "example": 20
            },
            "description": "このページで返される結果の数。有効な値は 1 から 20 の間です。初期値は 20 です。"
          },
          {
            "name": "starting_token",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "73a3c9e69b89"
            },
            "description": "現在のページのトークン。最初のページは `null` で開始し、次のページを開始するには前のレスポンスの `next_token` を使用します"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TemplateResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameters"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image": {
      "post": {
        "summary": "AI 画像生成タスクを実行します。",
        "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": [
                  {
                    "type": "object",
                    "required": [
                      "prompt",
                      "template_id"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "description": "画像を生成するためのプロンプト",
                        "example": "A little cat"
                      },
                      "negative_prompt": {
                        "type": "string",
                        "description": "望ましくない内容のプロンプト",
                        "example": "dog"
                      },
                      "template_id": {
                        "type": "string",
                        "description": "テンプレートの ID。まず事前定義されたテンプレートを一覧表示し、テンプレートの ID を使用します。",
                        "example": "good_template_001"
                      },
                      "steps": {
                        "type": "integer",
                        "description": "ステップ数は画像の品質と処理時間に影響します。<br>推奨ステップ数<br>10-15 ステップ: 迅速なプロンプトテストや大まかな調整に最適です。<br>15–20 ステップ: 多くのモデルが理想的な品質と時間のバランスを達成する範囲です。<br>20–30 ステップ: 顔、毛皮、建築要素など、非常に詳細な被写体を生成するのに最適です。",
                        "example": 10
                      },
                      "cfg_scale": {
                        "type": "number",
                        "description": "CFG (Classifier-Free Guidance) スケールは、AI モデルがテキストプロンプトにどの程度厳密に従うかを決定する数学的な設定です。<br>低い CFG (1 – 4): AI に高い創造的自由度があります。プロンプトを緩く解釈するため、抽象的または絵画的な結果になったり、テーマから逸脱した画像になる可能性があります。<br>中程度の CFG (5 – 10): 理想的なバランスです。ジェネレーターはテキストに厳密に従いながら、自然で高品質なビジュアルを維持します。<br>高い CFG (11+): AI はプロンプトのすべての単語に固執します。詳細はより鮮明で文字通りになりますが、スケールが高すぎると、色が過度に飽和したり、ノイズや不自然なアーティファクトが発生することがよくあります。",
                        "example": 4
                      },
                      "seed": {
                        "type": "array",
                        "description": "各画像は一意のシードで生成されます。同じシードを使用すると同じ画像を再現できます。シードは 1 つのみ受け付けます。",
                        "items": {
                          "type": "integer",
                          "example": 3843718472198472
                        }
                      },
                      "width_ratio": {
                        "type": "integer",
                        "description": "画像の比率の幅。",
                        "example": 3
                      },
                      "height_ratio": {
                        "type": "integer",
                        "description": "画像の比率の高さ。",
                        "example": 4
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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/text-to-image/{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": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/youcam": {
      "post": {
        "summary": "テキストから画像への AI 画像生成タスク V2 を実行します。",
        "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": [
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "モデル名。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "望ましい画像の内容、スタイル、構成を記述するポジティブプロンプト。<br>中国語と英語をサポートします。最大長は 800 文字です。中国語の文字、英数字、記号はそれぞれ 1 文字としてカウントされます。",
                        "example": "A sitting orange cat with a joyful expression, lively and adorable, highly realistic."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "画像に含めたくない内容を記述するネガティブプロンプト。<br>中国語と英語をサポートします。最大長は 500 文字です。",
                        "example": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text."
                      },
                      "size": {
                        "type": "string",
                        "description": "出力画像の解像度。width\\*height 形式で指定します。<br>サポートされている解像度とアスペクト比:<br>- 1664\\*928 (初期値): 16:9<br>- 1472\\*1104: 4:3<br>- 1328\\*1328: 1:1<br>- 1104\\*1472: 3:4<br>- 928\\*1664: 9:16",
                        "enum": [
                          "1664*928",
                          "1472*1104",
                          "1328*1328",
                          "1104*1472",
                          "928*1664"
                        ],
                        "example": "1664*928",
                        "default": "1664*928"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "スマートプロンプト書き換えを有効にします。モデルがポジティブプロンプトを最適化します。ネガティブプロンプトには影響しません。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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/text-to-image/youcam/{task_id}": {
      "get": {
        "summary": "テキストから画像への AI 画像生成タスク V2 のステータスを確認します。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "確認するタスクの ID"
          }
        ],
        "responses": {
          "200": {
            "description": "タスクステータスの確認に成功しました",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-image/youcam": {
      "post": {
        "summary": "画像から画像への AI 画像生成タスク V2 を実行します。",
        "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": [
                  {
                    "anyOf": [
                      {
                        "title": "src_file_urls を使用してタスクを実行",
                        "type": "object",
                        "required": [
                          "src_file_urls"
                        ],
                        "properties": {
                          "src_file_urls": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "ファイルアップロード API から取得したファイル URL です。`src_file_urls` または `src_file_ids` のいずれかを指定してください。",
                            "example": [
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "title": "3 つの角度のソースファイル ID を使用してタスクを実行",
                        "type": "object",
                        "required": [
                          "src_file_ids"
                        ],
                        "properties": {
                          "src_file_ids": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "ファイルアップロード API から取得したファイル ID です。`src_file_urls` または `src_file_ids` のいずれかを指定してください。",
                            "example": [
                              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=",
                              "pkVzplMv8Y1QPgHbqtKfyJmg+xJDUbTP16YijZ3qARNf",
                              "B5LNohvvO+7d/78Ymuhp6vMiSooN/5DX9oVuupzkKctf"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "モデル名。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "生成画像に含めたい要素や視覚的特徴を記述する画像編集指示（ポジティブプロンプト）です。<br>このパラメータは中国語と英語に対応しており、最大長は 800 文字です。中国語 1 文字または英語 1 文字につき 1 文字としてカウントされます。",
                        "example": "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged, and ensure the action is natural and smooth."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "生成画像に含めたくないコンテンツを記述するネガティブプロンプトです。<br>このパラメータは中国語と英語に対応しており、最大長は 500 文字です。中国語 1 文字または英語 1 文字につき 1 文字としてカウントされます。",
                        "example": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions."
                      },
                      "size": {
                        "type": "string",
                        "description": "出力画像の解像度を幅*高さの形式（例：\"1024\\*1536\"）で指定します。<br>- 幅と高さはそれぞれ [512, 2048] ピクセルの範囲内である必要があります。<br>- デフォルトでは、総ピクセル数は約 1024\\*1024 で、入力画像（または複数画像リクエストの場合は最後の画像）と類似のアスペクト比になります。<br>size パラメータを指定する場合、システムは size で指定された幅と高さをターゲットとして使用し、実際の出力画像の幅と高さを 16 の倍数に最も近い値に調整します。例えば、1033\\*1032 を指定した場合、出力画像の寸法は 1040\\*1024 になります。<br>一般的なアスペクト比の推奨解像度：<br>- 1:1: 1024\\*1024, 1536\\*1536 <br>- 2:3: 768\\*1152, 1024\\*1536 <br>- 3:2: 1152\\*768, 1536\\*1024 <br>- 3:4: 960\\*1280, 1080\\*1440 <br>- 4:3: 1280\\*960, 1440\\*1080 <br>- 9:16: 720\\*1280, 1080\\*1920 <br>- 16:9: 1280\\*720, 1920\\*1080 <br>- 21:9: 1344\\*576, 2048\\*872",
                        "example": "1024*1024"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "スマートプロンプト書き換えを有効にします。モデルがポジティブプロンプトを最適化します。ネガティブプロンプトには影響しません。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "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/image-to-image/youcam/{task_id}": {
      "get": {
        "summary": "画像から画像への AI 画像生成タスク V2 のステータスを確認します。",
        "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' の間にスペースがあることに注意してください。"
      }
    },
    "schemas": {
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "テンプレートの ID。タスク実行時に `template_id` として使用します。",
            "example": "good_template_001"
          },
          "thumb": {
            "type": "string",
            "description": "スタイルのサムネイル。"
          },
          "title": {
            "type": "string",
            "description": "テンプレートのタイトル。"
          },
          "category_name": {
            "type": "string",
            "description": "テンプレートのカテゴリー名。"
          }
        }
      },
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "このタスクの ID。タスクの結果は、この ID を使用して 24 時間以内にクエリできます。",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "RunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "エラーメッセージ",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters",
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest"
            ],
            "description": "エラーコード:\n  * InvalidParameters - 無効なリクエストパラメータ\n  * CreditInsufficiency - 実行に必要なユニットが不足しています\n  * BadRequest - 予期しないリクエストパラメータ\n  * InvalidStyleGroup - 無効なスタイルグループ ID\n  * InvalidStyle - 無効なスタイル ID"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "error_exceed_max_image_size",
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "エラー：\n- `error_exceed_max_image_size`  - 入力画像サイズが最大制限を超えています\n- `exceed_max_filesize` - 入力ファイルサイズが最大制限を超えています\n- `invalid_parameter` - 無効なパラメータ値\n- `error_download_image` - ソース画像のダウンロードエラー\n- `error_download_mask` - マスク画像のダウンロードエラー\n- `error_decode_image` - ソース画像のデコードエラー\n- `error_decode_mask` - マスク画像のデコードエラー\n- `error_nsfw_content_detected` - ソース画像で NSFW コンテンツが検出されました\n- `error_no_face` - ソース画像で顔が検出されませんでした\n- `error_pose` - ソース画像でポーズの検出に失敗しました\n- `error_face_parsing` - ソース画像での顔セグメンテーションに失敗しました\n- `error_inference` - 推論パイプラインエラー\n- `exceed_nsfw_retry_limits` - NSFW 画像の生成を避けるための再試行制限を超えました\n- `error_upload` - 結果画像のアップロードエラー\n- `unknown_internal_error` - その他\n"
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "この結果をダウンロードする URL。有効期間は 2 時間です",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "レスポンスステータス",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "このタスクのステータス"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "エラーの詳細な説明"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "TemplateResponse": {
        "description": "スタイルの正常な取得",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "description": "レスポンスステータス",
                  "example": 200
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "next_token": {
                      "type": "string",
                      "example": "73a3c9e69b89",
                      "description": "次のページをクエリするためのトークン。"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InvalidParameters": {
        "description": "無効なリクエストパラメータ",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid parameter value"
                },
                "error_code": {
                  "type": "string",
                  "example": "InvalidParameters"
                }
              }
            }
          }
        }
      },
      "InvalidApiKey": {
        "description": "無効または欠落している API キー",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "リクエストが多すぎます",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "無効なタスク ID",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "タスク実行タイムアウト",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "レスポンスステータス"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}