{
  "openapi": "3.0.0",
  "info": {
    "title": "顔の比率分析",
    "description": "# 概要\n顔の比率分析では、顔の構造を解析し、顔、目、眉、唇、鼻、頬骨などの形状を特定します。\n\n## 統合ガイド\n* 顔の比率分析 用に写真を撮る方法\n\n* 正面を向いた自撮り写真を撮る\n  - 鮮明な写真 1 枚で、カメラにまっすぐ向き合ってください。髪は自然な状態にし、顔全体が隠れることなく見える状態がベストです。おでこを出すために髪を流し、まっすぐ正面を見つめることで、適切な正面からのアングルを撮影してください。\n  - または、JS Camera Kit を使用して写真を撮影してください。自動的な顔アラインメント、ライティングのガイド、顔サイズ検出に従い、写真が処理に必要な基準を満たすことを確認してください。\n\n* AI による肌の悩みの検出方法\n\n1. **ソース画像のサイズを変更する**</br>\n   写真のサイズをサポートされている寸法に合わせてください。詳細は **[ファイル仕様とエラー](#section/overview/File-Specs-and-Errors)**\n\n2. **File API を使用してファイルをアップロードする**</br>\n   ***/s2s/v2.0/file*** API を使用して、対象のユーザー画像をアップロードします。\n     - 画像の要件\n       - 詳細は **[ファイル仕様とエラー](#section/overview/File-Specs-and-Errors)** をご覧ください。\n     ***重要***: File API を呼び出すだけでは、ファイルはアップロードされません。File API レスポンスで提供された **URL** へファイルを **手動でアップロード** する必要があります。その URL がアップロード先です。続行する前に、ファイルがそこに正常に転送されたことを確認してください。<br>\n     AI API を呼び出す前に、ファイルが正常にアップロード済みであることを確認してください。File API を使用してアップロード用 URL を取得し、その場所にファイルをアップロードします。アップロードが完了すると、レスポンスで ***file_id*** を受け取ります。この ID を使用して、そのファイルに関連する AI 機能にアクセスします。\n\n      > **警告:** File API レスポンスで提供された URL へファイルをアップロードせずに AI API を使用すると、500 Server Error / unknown_internal_error または 404 Not Found のエラーが発生する点にご注意ください。\n\n3. **顔の比率分析 タスクを実行する**</br>\n   アップロードが完了すると、ファイル ID を使用して分析する複数の顔属性を選択できます。 **[入力と出力](#section/overview/Inputs-and-Outputs)** を参照してください。</br>\n   その後、File ID を用いて POST 'task/face-attr-analysis' を呼び出すと、\n   enhance タスクが実行され、***task_id*** が取得されます。\n\n4. **タスクが成功またはエラーになるまでポーリングでステータスを確認する**</BR>\nこの ***task_id*** を使用して、GET 'task/face-attr-analysis' をポーリングし、現在のエンジンステータスを取得してタスクのステータスを監視します。エンジンがタスクを完了するまで、ステータスは 'running' のままで、この段階ではユニットは消費されません。\n\n    **警告:** タスクの保持期間に基づいて **ポーリング** でタスクのステータスを確認することは必須です。保持期間内にポーリングリクエストがなければ、タスクが正常に処理されていても、タスクはタイムアウトします（ユニットは消費されます）。\n\n    > **警告:** タイムアウトしたタスクのステータスを確認すると、***InvalidTaskId*** エラーが発生します。そのため、AI タスクを実行したら、保持期間内に **ポーリング** でステータスを確認し、ステータスが *success* または *error* になるまで続行する必要があります。\n\n5. **AI タスクが成功したら結果を取得する**</BR>\nエンジンが入力ファイルを正常に処理し、結果画像を生成すると、タスクは 'success' ステータスに変更されます。処理された画像の URL と、結果画像を再アップロードせずに別の AI タスクを連続実行できる dst_id を受け取ります。\nユニットは、この場合にのみ消費されます。エンジンがタスクの処理に失敗すると、タスクのステータスは 'error' に変更され、ユニットは消費されません。</BR>\nユニットを控除する際、システムは期限の近づいているものを優先します。期限が同じ場合は、最も早く取得したユニットを控除します。\n\n* 実際の使用例:\n![](https://plugins-media.makeupar.com/smb/blog/post/2025-01-15/10a4b980-f571-4d08-8f5d-e3ed48db77aa.jpg)\n## 入力と出力\n* 顔属性:\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/img_Face_Ratio_sec_01_01_enu_79380baa14.jpg)\n\n| **カテゴリ**     | **サブカテゴリ**   | **リクエストパラメータ** | **結果パラメータ** | **結果タイプ** |\n| --- | --- | --- |  --- | --- |\n| **顔** | 顔の形 | `faceShape` | `faceshape` | Triangle, Diamond, Heart, InvTriangle, Oblong, Oval, Round, Square, Unknown |\n| **年齢と性別** | 年齢 | `age` | `agegender.age` | integer |\n| | 性別 | `gender` | `agegender.gender` | female, male, unknown |\n| **目** | 目の形 | `eyeShape` | `eyelid.left_shape`, `eyelid.right_shape` | Narrow, Round, Almond |\n| | 目の大きさ | `eyeSize` | `eyelid.size` | Big, Small, Average |\n| | 目の角度 | `eyeAngle` | `eyelid.left_angle`, `eyelid.right_angle` | Downturned, Upturned, Average |\n| | 目の間隔 | `eyeDistance` | `eyelid.setting` | Close-set, Wide-Set, Average |\n| | まぶた | `eyelid` | `eyelid.left_eyelid`, `eyelid.right_eyelid` | Hooded-lid, Single-lid, Double-lid, Deep-Set |\n| **眉** | 眉の形 | `eyebrowShape` | `eyebrow.left_shape`, `eyebrow.right_shape` | Hard Angled, Soft Angled, Straight, Rounded, Obscured |\n| | 眉の太さ | `eyebrowThickness` | `eyebrow.left_body_thickness`, `eyebrow.right_body_thickness` | Dense, Sparse, Average, Unknown |\n| | 眉間 | `eyebrowDistance` | `eyebrow.gap` | Far-Apart, Close, Average |\n| | 眉の短さ | `eyebrowShortness` | `eyebrow.left_shortness`, `eyebrow.right_shortness` | Short, Normal |\n| **唇** | 唇の形 | `lipShape` | `lipshape[]` | Bow, Downturned, Full, Heavy Lower Lip, Heavy Upper Lip, Narrow, Round, Thin, Wide, Average |\n| **鼻** | 鼻の幅 | `noseWidth` | `nose.width` | Narrow, Broad, Average |\n| | 鼻の長さ | `noseLength` | `nose.length` | Long, Short, Average |\n| **頬骨**   | 頬骨 | `cheekbones` | `cheekbone.left`, `cheekbone.right`, `cheekbone.overall` | Flat Cheekbone, High Cheekbone, Low Cheekbone, Round Cheeks |\n\n\n---\n\n* 顔比率:\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/img_Face_Ratio_sec_01_03_2fe8f06b92.jpg)\n\n| **サブカテゴリ** | **リクエストパラメータ** | **結果パラメータ** | **結果タイプ** | **説明** |\n| --- | --- | --- | --- | --- |\n| 水平 3 分割比率 | `horizontalThird` | `horizontal_third` | 3 分割のパーセンテージ; 解釈: Short / Balanced / Long; ゴールデンRatio: 33% : 33% : 33% | 顔の水平比率は、顔を 3 つの等しい区間に分割することに基づいています：生え際から眉の下端まで、眉の下端から鼻の下端まで、そして鼻の下端から顎先まで。3 つの区間のゴールデンRatio、つまり理想の比率は 1:1:1 です。|\n| 垂直 5 分割比率 | `verticalFifth` | `vertical_fifth` | 5 分割のパーセンテージ; 解釈 (目の間隔と目の幅): Narrow / Balanced / Wide; ゴールデンRatio: 20% : 20% : 20% : 20% : 20% | 顔の垂直比率は、顔を 5 つの区間に分割して決定されます：1 つの目の幅、2 つの目の間隔、そして目の外側から顔の縁までの空間。これらの比率のゴールデンRatioは 1:1:1:1:1 です。 |\n| 顔のアスペクト比 | `faceAspectRatio` | `face_aspect_ratio` | `[1, r]`; 解釈: Short / Balanced / Long; ゴールデンRatio: 1 : 1.46 | 顔のアスペクト比は、顔の幅と高さの関係であり、ゴールデンRatio 1:1.46 に従うことが理想です。 |\n| 目のアスペクト比 | `eyeAspectRatio` | `left_eye_aspect_ratio` `right_eye_aspect_ratio` | `[1, r]`; 解釈: Round / Balanced / Flat; ゴールデンRatio: 1 : 3 | 目のアスペクト比は、目の高さとその幅の関係であり、ゴールデンRatio 1:3 に合うことが理想です。\n |\n| 眉山アーチ比率 | `eyebrowArch` | `left_eyebrow_arch_to_eyebrow_width` `right_eyebrow_arch_to_eyebrow_width` | `[1, r]`; 解釈: Short Arch / Balanced / Long Arch; ゴールデンRatio: 1 : 1.618 | 眉山アーチの理想の比率は、眉自体の形によって決まり、最高点（アーチ）がゴールデンRatio に合致することで、美しい外観が得られます。 |\n| 目の高さから眉までの距離 | `eyeHeightToEyebrowDistance` | `left_eye_height_to_eyebrow_distance` `right_eye_height_to_eyebrow_distance` `overall_eye_height_to_eyebrow_distance` | `[1, r]`; 解釈: Short / Balanced / Long; ゴールデンRatio: 1 : 1.618 | 眉までの距離は、上まぶたの上端から眉の最高点までの垂直距離です。理想としては、目の高さを基準にゴールデンRatio 1.618:1 となることで、目と眉の間に最も調和のとれたバランスが得られます。 |\n| 鼻のアスペクト比 | `noseAspectRatio` | `nose_aspect_ratio` | `[1, r]`; 解釈: Wide / Balanced / Narrow; ゴールデンRatio: 1 : 1.618 | 鼻のアスペクト比は、鼻の幅と高さの関係であり、ゴールデンRatio 1:1.618 に従うことが理想です。 |\n| 鼻幅に対する口幅 | `noseWidthToMouthWidth` | `nose_width_to_mouth_width` | `[1, r]`; 解釈: Small / Balanced / Large; ゴールデンRatio: 1 : 1.618 | 鼻幅と口幅の比率は、鼻の幅と口の幅の関係であり、ゴールデンRatio 1:1.618 に従うことが理想です。 |\n| 鼻から唇、顎まで | `noseToLipToChin` | `nose_to_lip_to_chin` | `[1, r]`; 解釈: Short / Balanced / Long (顔の下半分の長さ); ゴールデンRatio: 1 : 1.618 | 鼻から唇、顎までの比率は、鼻の基部から唇の中心までの距離を 1 としたとき、唇の中心から顎までの理想の距離が 1.618 となる比率です。このゴールデンRatioにより、顔の対称性の原理に従い、調和のとれた下半顔が得られます。 |\n| 上唇に対する下唇 | `upperLipToLowerLip` | `upper_lip_to_lower_lip` | `[1, r]`; 解釈: Full Upper / Balanced / Full Lower; ゴールデンRatio: 1 : 1.618 | 上唇と下唇のゴールデンRatioでは、下唇の厚さは上唇の 1.618 倍であるべきとされています。この比率により、下唇が上唇よりややふっくらします。 |\n\n----\n\n* 撮影方法の提案:\n![](https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/AI_Face_Analysis_how_to_shoot_35ca9af08e.png)\n\n> **警告:** 顔の幅は、画像の幅の 60% を超える必要があります。\n\n## ファイル仕様とエラー\n* 対応形式と解像度\n\n|AI 機能|対応解像度|対応ファイルサイズ|対応形式|\n|  ----  | ----  | ----  | ----  |\n|顔の比率分析|長辺 <= 4096、1 人のみ。1 辺が 1080px 超の画像は自動的にリサイズされて分析されます。|< 10MB|jpg/jpeg|\n\n* エラーコード\n\n|エラーコード|説明|\n|  ----  | ----  |\n| error_below_min_image_size | ソース画像の解像度は 320 ピクセル以上である必要があります。 |\n| error_face_position_invalid | 顔は完全に露出しており、正面を向いて、画像内で中央に位置している必要があります。 |\n| error_face_position_too_small | 検出された顔は分析に小さすぎます。 |\n| error_face_position_out_of_boundary | 顔が画像の境界を超えています。 |\n| error_face_not_forward_facing | 顔はカメラに正面を向いている必要があります。 |\n| error_face_angle_upward | 顔が上向きに角度が大きすぎます—頭を少し下へ傾けてください。 |\n| error_face_angle_downward | 顔が下向きに角度が大きすぎます — 頭を少し上へ傾けてください。 |\n| error_face_angle_leftward | 顔が左に回りすぎです — 頭を少し右へ回してください。 |\n| error_face_angle_rightward | 顔が右に回りすぎです — 頭を少し左へ回してください。 |\n| error_face_angle_left_tilt | 顔が左に傾きすぎです — 頭を軽く右へ傾けてください。 |\n| error_face_angle_right_tilt | 顔が右に傾きすぎです — 頭を軽く左へ傾けてください。 |\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 カメラキット\n{% partial file=\"/_partials/js-camera-kit.md\" /%}\n\n---\n\n## ユニット消費\n\n* 顔属性・比率分析\n\n| AI 機能 | 消費ユニット数 |\n|---|---|\n| 顔構造機能 1~5 個 | 10 |\n| 顔構造機能 6~14 個 | 20 |\n| 顔構造機能 15~28 個 | 30 |\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/face-attr-analysis": {
      "post": {
        "summary": "顔属性分析タスクを実行します。",
        "description": "このエンドポイントは、顔属性分析プロセスを開始します。ソースファイル（URL またはファイル ID 経由）を提供し、分析する機能を指定する必要があります。タスクは非同期で処理され、このレスポンスで返される task_id を使用してステータスを確認できます。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BasicRunTaskV2"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "face_angle_strictness_level": {
                        "$ref": "#/components/schemas/BasicFaceAttrReqFaceAngleStrictnessLevel"
                      },
                      "features": {
                        "$ref": "#/components/schemas/BasicFaceAttrReqFeatures"
                      }
                    },
                    "required": [
                      "features"
                    ]
                  }
                ]
              }
            }
          }
        },
        "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/face-attr-analysis/{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": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "description": "レスポンスステータス",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "task_status": {
                          "type": "string",
                          "enum": [
                            "running",
                            "success",
                            "error"
                          ],
                          "description": "このタスクのステータス"
                        },
                        "error": {
                          "$ref": "#/components/schemas/EngineErrorCode"
                        },
                        "error_message": {
                          "type": "string",
                          "description": "エラーの詳細説明"
                        },
                        "results": {
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "face_quality": {
                                  "$ref": "#/components/schemas/BasicFaceAttrRespFaceQuality"
                                },
                                "facialratio": {
                                  "$ref": "#/components/schemas/BasicFaceAttrRespFacialRatio"
                                },
                                "cheekbone": {
                                  "type": "object",
                                  "properties": {
                                    "left": {
                                      "type": "string",
                                      "enum": [
                                        "Flat Cheekbone",
                                        "High Cheekbone",
                                        "Low Cheekbone",
                                        "Round Cheeks"
                                      ]
                                    },
                                    "right": {
                                      "type": "string",
                                      "enum": [
                                        "Flat Cheekbone",
                                        "High Cheekbone",
                                        "Low Cheekbone",
                                        "Round Cheeks"
                                      ]
                                    },
                                    "overall": {
                                      "type": "string",
                                      "enum": [
                                        "Flat Cheekbone",
                                        "High Cheekbone",
                                        "Low Cheekbone",
                                        "Round Cheeks"
                                      ]
                                    }
                                  }
                                },
                                "eyelid": {
                                  "type": "object",
                                  "properties": {
                                    "left_eyelid": {
                                      "type": "string",
                                      "enum": [
                                        "Hooded-lid",
                                        "Single-lid",
                                        "Double-lid",
                                        "Deep-Set"
                                      ]
                                    },
                                    "left_angle": {
                                      "type": "string",
                                      "enum": [
                                        "Downturned",
                                        "Upturned",
                                        "Average"
                                      ]
                                    },
                                    "left_shape": {
                                      "type": "string",
                                      "enum": [
                                        "Narrow",
                                        "Round",
                                        "Almond"
                                      ]
                                    },
                                    "right_eyelid": {
                                      "type": "string",
                                      "enum": [
                                        "Hooded-lid",
                                        "Single-lid",
                                        "Double-lid",
                                        "Deep-Set"
                                      ]
                                    },
                                    "right_angle": {
                                      "type": "string",
                                      "enum": [
                                        "Downturned",
                                        "Upturned",
                                        "Average"
                                      ]
                                    },
                                    "right_shape": {
                                      "type": "string",
                                      "enum": [
                                        "Narrow",
                                        "Round",
                                        "Almond"
                                      ]
                                    },
                                    "setting": {
                                      "type": "string",
                                      "enum": [
                                        "Close-set",
                                        "Wide-Set",
                                        "Average"
                                      ]
                                    },
                                    "size": {
                                      "type": "string",
                                      "description": "選択肢: [Big, Small, Average]",
                                      "enum": [
                                        "Big",
                                        "Small",
                                        "Average"
                                      ]
                                    }
                                  }
                                },
                                "eyebrow": {
                                  "type": "object",
                                  "properties": {
                                    "gap": {
                                      "type": "string",
                                      "enum": [
                                        "Far-Apart",
                                        "Close",
                                        "Average"
                                      ]
                                    },
                                    "left_shape": {
                                      "type": "string",
                                      "enum": [
                                        "Hard Angled",
                                        "Soft Angled",
                                        "Straight",
                                        "Rounded",
                                        "Obscured"
                                      ]
                                    },
                                    "left_body_thickness": {
                                      "type": "string",
                                      "enum": [
                                        "Dense",
                                        "Sparse",
                                        "Average",
                                        "Unknown"
                                      ]
                                    },
                                    "left_tail_thickness": {
                                      "type": "string",
                                      "enum": [
                                        "Dense",
                                        "Sparse",
                                        "Average",
                                        "Unknown"
                                      ]
                                    },
                                    "left_thinness": {
                                      "type": "string",
                                      "enum": [
                                        "Thin",
                                        "Normal"
                                      ]
                                    },
                                    "left_shortness": {
                                      "type": "string",
                                      "enum": [
                                        "Short",
                                        "Normal"
                                      ]
                                    },
                                    "right_shape": {
                                      "type": "string",
                                      "enum": [
                                        "Hard Angled",
                                        "Soft Angled",
                                        "Straight",
                                        "Rounded",
                                        "Obscured"
                                      ]
                                    },
                                    "right_body_thickness": {
                                      "type": "string",
                                      "enum": [
                                        "Dense",
                                        "Sparse",
                                        "Average",
                                        "Unknown"
                                      ]
                                    },
                                    "right_tail_thickness": {
                                      "type": "string",
                                      "enum": [
                                        "Dense",
                                        "Sparse",
                                        "Average",
                                        "Unknown"
                                      ]
                                    },
                                    "right_thinness": {
                                      "type": "string",
                                      "enum": [
                                        "Thin",
                                        "Normal"
                                      ]
                                    },
                                    "right_shortness": {
                                      "type": "string",
                                      "enum": [
                                        "Short",
                                        "Normal"
                                      ]
                                    }
                                  }
                                },
                                "faceshape": {
                                  "type": "string",
                                  "enum": [
                                    "Triangle",
                                    "Diamond",
                                    "Heart",
                                    "InvTriangle",
                                    "Oblong",
                                    "Oval",
                                    "Round",
                                    "Square",
                                    "Unknown"
                                  ]
                                },
                                "lipshape": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "Bow",
                                      "Downturned",
                                      "Full",
                                      "Heavy Lower Lip",
                                      "Heavy Upper Lip",
                                      "Narrow",
                                      "Round",
                                      "Thin",
                                      "Wide",
                                      "Average"
                                    ]
                                  }
                                },
                                "nose": {
                                  "type": "object",
                                  "properties": {
                                    "width": {
                                      "type": "string",
                                      "enum": [
                                        "Narrow",
                                        "Broad",
                                        "Average"
                                      ]
                                    },
                                    "length": {
                                      "type": "string",
                                      "enum": [
                                        "Long",
                                        "Short",
                                        "Average"
                                      ]
                                    }
                                  }
                                },
                                "color": {
                                  "type": "object",
                                  "properties": {
                                    "eye_color": {
                                      "type": "string",
                                      "description": "目の色の 16 進数値"
                                    },
                                    "eye_color_name": {
                                      "type": "string",
                                      "enum": [
                                        "Amber",
                                        "Brown",
                                        "Green",
                                        "Blue",
                                        "Gray",
                                        "Other"
                                      ]
                                    },
                                    "lip_color": {
                                      "type": "string",
                                      "description": "唇の色の 16 進数値"
                                    },
                                    "eyebrow_color": {
                                      "type": "string",
                                      "description": "眉毛の色の 16 進数値"
                                    },
                                    "hair_color": {
                                      "type": "string",
                                      "format": "color",
                                      "enum": [
                                        "#a0a0a0",
                                        "#722626",
                                        "#000000",
                                        "#FAF0BE",
                                        "#42280E",
                                        "#808080",
                                        "#B56637"
                                      ]
                                    },
                                    "hair_color_name": {
                                      "type": "string",
                                      "enum": [
                                        "Auburn",
                                        "Black",
                                        "Blonde",
                                        "Brown",
                                        "Grey/White",
                                        "Red"
                                      ]
                                    }
                                  }
                                },
                                "agegender": {
                                  "type": "object",
                                  "properties": {
                                    "age": {
                                      "type": "integer"
                                    },
                                    "gender": {
                                      "type": "string",
                                      "enum": [
                                        "female",
                                        "male",
                                        "unknown"
                                      ]
                                    }
                                  }
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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": {
      "BasicFaceAttrReqFaceAngleStrictnessLevel": {
        "type": "string",
        "description": "顔角度検出（ピッチ、ヨー、ロール）の厳密さレベルです。\nより厳しいレベルでは、顔属性の結果がより正確になります。\n初期値は 'high' です。\noptoins:\n  - strict: pitch <= 4 degrees, yaw <= 6 degrees, roll <= 4 degrees\n  - high: pitch, yaw, roll <= 10 degrees\n  - medium: pitch, yaw, roll <= 15 degrees\n  - low: pitch, yaw, roll <= 20 degrees\n  - flexible: pitch, yaw, roll <= 30 degrees\n",
        "enum": [
          "strict",
          "high",
          "medium",
          "low",
          "flexible"
        ],
        "example": "high"
      },
      "BasicFaceAttrReqFeatures": {
        "description": "AI 肌分析カテゴリ\n\n* 顔分析\n  - FACE: faceShape\n  - EYES: eyeShape eyeSize eyeAngle eyeDistance eyelid\n  - BROWS: eyebrowShape eyebrowThickness eyebrowDistance eyebrowShortness\n  - LIPS: lipShape\n  - NOSE: noseWidth noseLength\n  - CHEEKBONES: cheekbones\n  - AGE & GENDER: age gender\n  - COLORS: eyeColor hairColor eyebrowColor lipColor\n\n* 顔の比率\n  - horizontalThird\n  - verticalFifth\n  - faceAspectRatio\n  - eyeAspectRatio\n  - eyebrowPosition\n  - eyebrowArch\n  - eyeHeightToEyebrowDistance\n  - noseAspectRatio\n  - noseWidthToMouthWidth\n  - noseToLipToChin\n  - upperLipToLowerLip\n",
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "eyeShape",
            "eyeSize",
            "eyeAngle",
            "eyeDistance",
            "eyelid",
            "eyebrowShape",
            "eyebrowThickness",
            "eyebrowDistance",
            "eyebrowShortness",
            "cheekbones",
            "faceShape",
            "lipShape",
            "noseWidth",
            "noseLength",
            "age",
            "gender",
            "eyeColor",
            "lipColor",
            "eyebrowColor",
            "hairColor",
            "horizontalThird",
            "verticalFifth",
            "faceAspectRatio",
            "eyeAspectRatio",
            "eyebrowPosition",
            "eyebrowArch",
            "eyeHeightToEyebrowDistance",
            "noseAspectRatio",
            "noseWidthToMouthWidth",
            "noseToLipToChin",
            "upperLipToLowerLip"
          ]
        }
      },
      "BasicFaceAttrRespFaceQuality": {
        "type": "object",
        "properties": {
          "has_face": {
            "type": "boolean",
            "example": true
          },
          "area": {
            "type": "string",
            "example": "good"
          },
          "frontal": {
            "type": "string",
            "example": "good"
          },
          "lighting": {
            "type": "string",
            "example": "good"
          },
          "faceangle": {
            "type": "string",
            "example": "good"
          }
        }
      },
      "BasicFaceAttrRespFacialRatio": {
        "type": "object",
        "properties": {
          "horizontal_third": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "example": [
              33,
              33,
              33
            ]
          },
          "vertical_fifth": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "example": [
              20,
              20,
              20,
              20,
              20
            ]
          },
          "face_aspect_ratio": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "顔の幅と高さの比率",
            "example": [
              1,
              1.46
            ]
          },
          "left_eye_aspect_ratio": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "目の高さと幅の比率",
            "example": [
              1,
              3
            ]
          },
          "right_eye_aspect_ratio": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "目の高さと幅の比率",
            "example": [
              1,
              3
            ]
          },
          "left_eyebrow_arch_to_eyebrow_width": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "眉毛の前部（眉毛の開始点からアーチまで）の幅と、眉毛全体の幅（開始点から終点まで）の比率",
            "example": [
              1,
              1.476
            ]
          },
          "right_eyebrow_arch_to_eyebrow_width": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "眉の前部（眉の開始点からアーチまで）の幅と、眉全体の幅（開始点から終点まで）の比率",
            "example": [
              1,
              1.523
            ]
          },
          "left_eye_height_to_eyebrow_distance": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "目の高さと、眉の上端から目の下端までの垂直距離の比率",
            "example": [
              1,
              2.69
            ]
          },
          "right_eye_height_to_eyebrow_distance": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "目の高さと、眉の上端から目の下端までの垂直距離の比率",
            "example": [
              1,
              2.775
            ]
          },
          "overall_eye_height_to_eyebrow_distance": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "example": [
              1,
              2.733
            ]
          },
          "nose_aspect_ratio": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "鼻の幅と高さの比率",
            "example": [
              1,
              1.172
            ]
          },
          "nose_width_to_mouth_width": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "鼻の幅と口の幅の比率",
            "example": [
              1,
              1.475
            ]
          },
          "nose_to_lip_to_chin": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "鼻尖から唇の中央までの垂直距離と、唇の中央から顎までの垂直距離の比率",
            "example": [
              1,
              2.098
            ]
          },
          "upper_lip_to_lower_lip": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "上唇の高さと下唇の高さの比率",
            "example": [
              1,
              1.099
            ]
          }
        }
      },
      "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"
      }
    },
    "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"
                }
              }
            }
          }
        }
      }
    }
  }
}