# バーチャルメイク

# 概要 (Overview)
AI Makeup API (バーチャルメイク) で、セルフィー画像にバーチャルメイクを適用します。
ファンデーション、チーク、アイシャドウ、リップなどのメイクをサポートしています。

**主な特徴：**
*   **3D 顔レンダリング：** 3D 顔 AI 技術でメイクをレンダリングします。
*   **特許技術：** ディープラーニングアルゴリズムにより実現しています。
*   **リアルタイムの精度：** さまざまな照明条件に適応する顔トラッキング。
*   **製品色の再現：** 実在の製品の色、質感（マットからメタリックまで）、仕上げを再現します。

* 基本概念

   * 色のブレンド
ディープラーニングを用いて、実在のメイク製品の色を再現します。

   * 質感と仕上げの再現
マットからメタリック、シマーからサテンまで、質感と仕上げをシミュレーションします。

   * 光のバランス調整
画像の照明条件を検出します。画像を補正してメイクを適用します。

---

## 統合ガイド (Integration Guide)

Makeup Virtual Try-On サービスは非同期タスクとして動作します。まず、画像 URL と適用したいエフェクトのリストを指定して、メイク処理タスクを開始する必要があります。サーバーは `task_id` を返します。その後、ステータスを確認するエンドポイントを定期的にポーリングして、最終結果またはエラーを取得します。

*   **エンドポイント：** `/v2.0/task/makeup-vto`
*   **認証：** すべてのリクエストには `Authorization: Bearer <TOKEN>` が必要です。
*   **ワークフロー：**
    1.  **自撮り画像の準備：** 画像をアップロードするか、顔画像の既存のファイル URL を使用します。
    1.  **タスクの開始 (`POST`)：** 画像 ID/URL とメイク設定を送信します。
    1.  **タスク ID の取得：** レスポンスから `task_id` を取得します。
    1.  **ステータスのポーリング (`GET`)：** `task_id` を使用してタスクのステータスを確認します。`task_status` が `"success"` または `"error"` になるまでポーリングを継続します。


* API プレイグラウンド

API プレイグラウンドで API を対話的にテストします：

**API プレイグラウンド：**
[http://yce.makeupar.com/api-console/en/api-playground/ai-makeup-virtual-try-on/](http://yce.makeupar.com/api-console/en/api-playground/ai-makeup-virtual-try-on/)

---

* 認証
- **Bearer Token** を使用して、リクエストヘッダーに API キーを含めます：
    ```
    Authorization: Bearer <API Key>
    ```
API キーの確認場所: https://yce.makeupar.com/api-console/en/api-keys/.

* 1. 自撮り画像のアップロード
  元画像は次の 2 つの方法で提供できます：

  - **既存の公開画像 URL を使用する**
    アップロードの代わりに、AI タスクの開始時に公開アクセス可能な画像 URL を直接指定できます。

  - **File API 経由でアップロードする**
    次のエンドポイントを使用します：
    ```
    POST /s2s/v2.0/file
    ```
    これにより、後続のタスク実行に使用する `file_id` が返されます。

    - ***重要***：File API を呼び出すだけではファイルはアップロードされません。**File API のレスポンスで提供される URL** に対して、**手動で**ファイルをアップロードする必要があります。その URL がアップロード先であるため、次に進む前にファイルが正常に転送されたことを確認してください。<br></br>
    AI API を呼び出す前に、ファイルが正常にアップロードされていることを確認してください。File API を使用してアップロード URL を取得し、その場所にファイルをアップロードします。アップロードが完了すると、レスポンスに ***file_id*** が返されます。この ID を使用して、そのファイルに関連する AI 機能にアクセスします。

      > **警告：** File API のレスポンスで提供された URL にファイルをアップロードせずに AI API を使用すると、500 Server Error / unknown_internal_error または 404 Not Found エラーが発生します。


* 2. メイクタスクの開始

`POST /s2s/v2.0/task/makeup-vto`

指定された画像に対して新しいバーチャルメイクタスクを開始します。このエンドポイントは非同期であり、`task_id` を返します。

   * リクエストヘッダー

| ヘッダー | 値 |
|--------|-------|
| Content-Type | `application/json` |
| Authorization | `Bearer YOUR_API_KEY` |

   * リクエストボディの例
```json
{
  "src_file_url": "https://plugins-media.makeupar.com/strapi/assets/sample_Image_1_202b6bf6e6.jpg",
  "effects": [
    {
      "category": "blush",
      "pattern": { "name": "2colors6" },
      "palettes": [
        { "color": "#FF0000", "texture": "matte", "colorIntensity": 50 },
        { "color": "#F2A53E", "texture": "matte", "colorIntensity": 50 }
      ]
    },
    {
      "category": "eye_liner",
      "pattern": { "name": "3colors5" },
      "palettes": [
        { "color": "#000000", "texture": "matte", "colorIntensity": 50 },
        { "color": "#BA0656", "texture": "matte", "colorIntensity": 50 },
        { "color": "#089085", "texture": "matte", "colorIntensity": 50 }
      ]
    }
  ],
  "version": "1.0"
}
```

   * リクエストボディのスキーマ

| フィールド | 型 | 説明 |
|-------|------|---------|
| `src_file_url` | string (URL) | 処理対象の自撮り画像への、公開アクセス可能な URL。 |
| `effects` | array of Effect | 適用するメイクエフェクトオブジェクトの配列。詳細は [メークエフェクトのスキーマ](#makeup-effect-schemas) をご覧ください。 |
| `version` | string | エフェクトペイロード構造の API バージョン。`"1.0"` を使用します。 |

   * 成功時のレスポンス (`200 OK`)
タスク識別子を含む JSON オブジェクトを返します。

**レスポンスボディのスキーマ：**
```json
{
  "status": 200,
  "data": {
    "task_id": "<string>"
  }
}
```

**レスポンスの例：**
```json
{
  "status": 200,
  "data": {
    "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
  }
}
```

   * エラーレスポンス (`400 Bad Request`、`401 InvalidApiKey` など)
失敗を説明するメッセージを含む標準のエラーオブジェクトが返されます。

**エラーレスポンスの例：**
```json
{
  "status": 400,
  "error": "The operation could not be completed",
  "error_code": "CreditInsufficiency"
}
```

---

* 3. タスクのステータスと結果の取得

`GET /s2s/v2.0/task/makeup-vto/<task_id>`

進行中または完了したタスクの現在のステータスと結果を取得します。

   * リクエストヘッダー

| ヘッダー | 値 |
|--------|-------|
| Authorization | `Bearer YOUR_API_KEY` |

   * パスパラメータ

| パラメータ | 型 | 説明 |
|-----------|------|---------|
| task_id | string | タスク開始エンドポイントから返される識別子。 |

   * 成功時のレスポンス (`200 OK`)
ステータスと、完了している場合は結果を含む JSON オブジェクト。

**レスポンスボディのスキーマ：**
```json
{
  "data": {
    "task_status": "<string>", // 'success', 'error', or a processing state (e.g., 'queued', 'processing')
    "results": [ // present only when task_status is 'success'
      {
        "download_url": "<string>" // URL to download the processed image
      }
    ],
    "failure_reason": "<string>" // present only when task_status is 'error'
  }
}
```

**成功レスポンスの例：**
```json
{
  "status": 200,
  "data": {
    "task_status": "success",
    "results": {
      "url": "https://s3.storage.prod/processed/image_123.jpg?token=..."
    }
  }
}
```

**エンジンエラーレスポンスの例：**
API クエリは正常に送信されましたが、AI タスクの実行中にエラーが発生しました。
```json
{
  "status": 200,
  "data": {
    "task_status": "error",
    "error": "exceed_max_filesize",
    "error_message": "string",
  }
}
```
  > 注意：クエリエラーでもエンジンエラーでも、エラーが発生した場合はユニットは消費されません。

**処理中レスポンスの例：**
```json
{
  "status": 200,
  "data": {
    "task_status": "running"
  }
}
```

   * エラーレスポンス
*   `404 InvalidTaskId`：`task_id` が存在しないか、無効です。
*   `401 InvalidApiKey`：API キーが無効か、指定されていません。
*   `500 TaskTimeout`：タスクは正常に完了したか失敗したかのいずれかですが、保持期間を超過しています。

**クエリエラーレスポンスの例：**
```json
{
  "status": 401,
  "error_code": "InvalidApiKey"
}
```
  > 注意：クエリエラーでもエンジンエラーでも、エラーが発生した場合はユニットは消費されません。

---
## 入力と出力
* メイクアップエフェクトスキーマ

このセクションでは、AI Makeup タスクのリクエストボディの完全な構造と制約について定義します。各エフェクトは、トップレベルの `effects` 配列内のオブジェクトです。

* エフェクトコンテナ（トップレベル）

```json
{
  "version": "1.0",
  "effects": []                    // array<Effect> — Contains makeup effect objects
}
```

* メイクアップエフェクトカテゴリ

   * `skin_smooth`
```json
{
  "category": "skin_smooth",           // string, const "skin_smooth"
  "skinSmoothStrength": 50,            // integer, range: 0..100
  "skinSmoothColorIntensity": 50       // integer, range: 0..100
}
```
  > **注意!** ``skin_smooth`` エフェクトがリクエストに含まれていない場合、AI Makeup Engine は自動的に Skin Smooth の初期値 50 を適用します。
  肌補正なしでメイクアップを適用したい場合は、``skinSmoothStrength`` と ``skinSmoothColorIntensity`` のすべてのパラメータを 0 に設定してください。ただし、最良の結果と最高品質のブレンドを得るには、初期値の肌補正を有効のままにすることをお勧めします。

   * `blush`
```json
{
  "category": "blush",                 // string, const "blush"
  "pattern": {                         // object
    "name": ""                         // string — MUST equal a `label` from blush.json
  },
  "palettes": [                        // array<BlushPalette>, minItems: (see colorNum in pattern)
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "texture": "matte",              // string, enum ["matte","satin","shimmer"]
      "glowStrength": 50,              // integer, range: 0..100 — REQUIRED if texture="satin"
      "shimmerColor": "#fc288f",       // string, hex color "#RRGGBB" — REQUIRED if texture="shimmer"
      "shimmerDensity": 50,            // integer, range: 0..100 — REQUIRED if texture="shimmer"
      "colorIntensity": 50             // integer, range: 0..100
    }
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/blush.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "1 color",
    "label": "1color1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/483/a53cd4f4-43b6-4e19-b85a-ec7a95c6a47f.jpg",
    "tags": [
      { "id": 100, "name": "Blush 3D" },
      { "id": 103, "name": "Oblong" }
    ],
    "colorNum": 1
  },
  {
    "category": "2 colors",
    "label": "2colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/147/a8d86a4b-8aa0-48d7-a716-63ec78dfb30b.jpg",
    "tags": [
      { "id": 100, "name": "Blush 3D" }
    ],
    "colorNum": 2
  },
  {
    "category": "3 colors",
    "label": "3colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/734/af8b625b-ae3a-4211-9413-f22c16a5f174.jpg",
    "tags": [
      { "id": 100, "name": "Blush 3D" },
      { "id": 104, "name": "Round" }
    ],
    "colorNum": 3
  }
]
```


   * `bronzer`
```json
{
  "category": "bronzer",               // string, const "bronzer"
  "pattern": { "name": "" },           // object — name MUST equal a `label` from bronzer.json
  "palettes": [
    { "color": "#ff0000", "colorIntensity": 50 }  // hex color, int range: 0..100
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/bronzer.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "Bronzer",
    "label": "Bronzer1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/973/22ff2c07-d584-4ae6-8281-c095cd121a52.jpg",
    "tags": [],
    "colorNum": 1
  }
]
```

   * `concealer`
```json
{
  "category": "concealer",             // string, const "concealer"
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "colorIntensity": 50,            // integer, range: 0..100
      "colorUnderEyeIntensity": 50,    // integer, range: 0..100
      "coverageLevel": 50              // integer, range: 0..100
    }
  ]
}
```

   * `contour`
```json
{
  "category": "contour",               // string, const "contour"
  "pattern": { "name": "" },           // object — name MUST equal a `label` from contour.json
  "palettes": [
    { "color": "#ff0000", "colorIntensity": 50 }  // hex color, int range: 0..100
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/contour.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "Heart face",
    "label": "HeartFace2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/731/49a1b3b9-b393-4bf4-b486-1493fe468436.jpg",
    "tags": []
  },
  {
    "category": "Invtriangle",
    "label": "Invtriangle1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/858/a94c8cca-5f8c-4b8b-a02d-94edb6a4ad7f.jpg",
    "tags": []
  },
  {
    "category": "Oval face",
    "label": "OvalFace6",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/906/644368a3-7eee-4ad9-829e-e2b3d4320fec.jpg",
    "tags": []
  },
  {
    "category": "Round face",
    "label": "RoundFace4",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/106/3e455b5f-7e2d-46f7-8627-dc137051c144.jpg",
    "tags": []
  },
  {
    "category": "Triangle face",
    "label": "TriangleFace2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/528/18765180-c254-4411-a25c-c1d78f5c3d77.jpg",
    "tags": []
  }
]
```

   * `eyebrows`
```json
{
  "category": "eyebrows",              // string, const "eyebrows"
  "pattern": {
    "type": "shape",                   // string, enum ["shape","color"], default: "shape"
    "name": "",                        // string, required when type="shape" — label from eyebrows.json
    "curvature": 0,                    // integer, range: -100..100 (shape only)
    "thickness": 0,                    // integer, range: -100..100 (shape only)
    "definition": 0                    // integer, range: 0..100 (shape only)
  },
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "colorIntensity": 50,            // integer, range: 0..100
      "texture": "matte",              // string, enum ["matte","shimmer"]
      "shimmerColor": "#fc288f",       // string, hex color "#RRGGBB" — REQUIRED if texture="shimmer"
      "shimmerIntensity": 50,          // integer, range: 0..100 — REQUIRED if texture="shimmer"
      "shimmerSize": 50,               // integer, range: 0..100 — REQUIRED if texture="shimmer"
      "shimmerDensity": 50             // integer, range: 0..100 — REQUIRED if texture="shimmer"
    }
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/eyebrows.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "Arrow",
    "label": "Arrow1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/490/1fb96bf9-979e-4327-a8c4-8c503f541f1a.jpg",
    "tags": []
  },
  {
    "category": "Curved",
    "label": "Curved1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/389/1ccb300e-c7ed-4995-920e-7d1bf8da1fad.jpg",
    "tags": []
  },
  {
    "category": "Drama",
    "label": "Drama2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/196/5fb14bec-553d-4841-bba7-ca7e5e27c12e.jpg",
    "tags": []
  },
  {
    "category": "High Arch",
    "label": "HighArch1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/609/7a8676dc-6f6a-4b12-aab0-c50328e448c5.jpg",
    "tags": []
  },
  {
    "category": "Original",
    "label": "Original2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/300/123551e9-ca94-4732-89ed-5b3866678555.jpg",
    "tags": []
  },
  {
    "category": "Soft Arch",
    "label": "SoftArch1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/121/2552ebf0-2705-43f7-b295-4fac21e18009.jpg",
    "tags": []
  },
  {
    "category": "Straight",
    "label": "Straight1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/1/7734e777-8e51-41f1-abaf-205f0ed5e3b4.jpg",
    "tags": []
  },
  {
    "category": "Thin",
    "label": "Thin1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/734/6ee10843-a251-4aa0-9183-db7f981d714d.jpg",
    "tags": []
  },
  {
    "category": "Upward",
    "label": "Upward4",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/751/76578317-f475-49c7-bd96-910ccad617ef.jpg",
    "tags": []
  }
]
```

   * `eye_liner`
```json
{
  "category": "eye_liner",             // string, const "eye_liner"
  "pattern": { "name": "" },           // object — name MUST equal a label from eyeliner.json
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "texture": "matte",              // string, enum ["matte","shimmer","metallic"]
      "shimmerColor": "#fc288f",       // string, hex color "#RRGGBB" — REQUIRED if texture in ["shimmer","metallic"]
      "shimmerIntensity": 50,          // integer, range: 0..100 — REQUIRED if texture in ["shimmer","metallic"]
      "metallicIntensity": 50,         // integer, range: 0..100 — REQUIRED if texture="metallic"
      "colorIntensity": 50             // integer, range: 0..100
    }
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/eyeliner.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "2 colors",
    "label": "2colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/419/71d9429a-dc08-4e80-9c46-6e55631ef766.jpg",
    "tags": [
      {
        "id": 28,
        "name": "Drama"
      }
    ],
    "colorNum": 2
  },
  {
    "category": "3 colors",
    "label": "3colors2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/208/056aa6cd-8678-470c-b111-b7653d7ddf93.jpg",
    "tags": [
      {
        "id": 28,
        "name": "Drama"
      }
    ],
    "colorNum": 3
  },
  {
    "category": "1 color",
    "label": "Arabic3",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/726/1919aad4-21a2-493a-a5f8-48bc99a61ba5.jpg",
    "tags": [
      {
        "id": 26,
        "name": "Arabic"
      }
    ],
    "colorNum": 1
  }
]
```

   * `eye_shadow`
```json
{
  "category": "eye_shadow",            // string, const "eye_shadow"
  "pattern": { "name": "" },           // object — name MUST equal a label from eyeshadow.json
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "texture": "matte",              // string, enum ["matte","shimmer","metallic"]
      "shimmerColor": "#fc288f",       // string, hex color "#RRGGBB" — REQUIRED if texture in ["shimmer","metallic"]
      "shimmerIntensity": 50,          // integer, range: 0..100 — REQUIRED if texture in ["shimmer","metallic"]
      "metallicIntensity": 50,         // integer, range: 0..100 — REQUIRED if texture="metallic"
      "colorIntensity": 50             // integer, range: 0..100
    }
  ]                                    // minItems: (see colorNum in pattern)
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/eyeshadow.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "1 color",
    "label": "1color1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/188/0322c4f9-e54d-4a6b-8072-6bb76560121a.jpg",
    "tags": [
      {
        "id": 12,
        "name": "Artistic"
      },
      {
        "id": 14,
        "name": "Dream"
      },
      {
        "id": 15,
        "name": "Trend"
      }
    ],
    "colorNum": 1
  },
  {
    "category": "2 colors",
    "label": "2colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/938/3348211c-1b83-4ab2-9c6a-ce06e4aa3528.jpg",
    "tags": [
      {
        "id": 1,
        "name": "Fan shape"
      },
      {
        "id": 8,
        "name": "Only upper lid"
      }
    ],
    "colorNum": 2
  },
  {
    "category": "3 colors",
    "label": "3colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/542/55e1b0fd-b888-47ff-bd3a-3dc1af2a7b69.jpg",
    "tags": [
      {
        "id": 1,
        "name": "Fan shape"
      },
      {
        "id": 8,
        "name": "Only upper lid"
      }
    ],
    "colorNum": 3
  },
  {
    "category": "4 colors",
    "label": "4colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/429/29cd5839-464b-4a7a-a5c1-c7b40e9464d7.jpg",
    "tags": [
      {
        "id": 4,
        "name": "Closed banana"
      },
      {
        "id": 10,
        "name": "Whole eye"
      }
    ],
    "colorNum": 4
  },
  {
    "category": "5 colors",
    "label": "5colors1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/2/824dcf7c-1273-4a30-8f1f-2137926057d6.jpg",
    "tags": [
      {
        "id": 4,
        "name": "Closed banana"
      },
      {
        "id": 10,
        "name": "Whole eye"
      }
    ],
    "colorNum": 5
  }
]
```

   * `eyelashes`
```json
{
  "category": "eyelashes",             // string, const "eyelashes"
  "pattern": { "name": "" },           // object — name MUST equal a label from eyelashes.json
  "palettes": [
    { "color": "#ff0000", "colorIntensity": 50 }  // hex color, int range: 0..100
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/eyelashes.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "Artistic",
    "label": "Artistic1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/146/7a8ed606-1c27-4d91-9320-c40a904f621f.jpg",
    "tags": []
  },
  {
    "category": "Natural",
    "label": "Natural1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/287/cd5cae75-a1b3-48f8-8537-e6e259213901.png",
    "tags": []
  },
  {
    "category": "Upper&Lower",
    "label": "Upper&Lower1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/18/2689ea2d-725e-4fa0-8563-df874ae1a83f.jpg",
    "tags": []
  },
  {
    "category": "Upper",
    "label": "Upper1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/982/c99bf74e-545f-4da7-a314-f3bd84b82156.jpg",
    "tags": []
  },
  {
    "category": "UpperDense",
    "label": "UpperDense1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/888/452ec863-f0a8-40e7-aa33-31c0c39f57e2.jpg",
    "tags": []
  },
  {
    "category": "Winged",
    "label": "Winged1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/825/36ab3859-eae5-49e4-9d97-161698bbb8bb.jpg",
    "tags": []
  },
  {
    "category": "Wispies",
    "label": "Wispies1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/722/a2a727f6-748c-41e7-8ac0-c9c57c18c05a.png",
    "tags": []
  }
]
```

   * `foundation`
```json
{
  "category": "foundation",            // string, const "foundation"
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "colorIntensity": 50,            // integer, range: 0..100
      "glowIntensity": 50,             // integer, range: 0..100
      "coverageIntensity": 50          // integer, range: 0..100
    }
  ]
}
```

   * `highlighter`
```json
{
  "category": "highlighter",           // string, const "highlighter"
  "pattern": { "name": "" },           // object — name MUST equal a label from highlighter.json
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "glowIntensity": 50,             // integer, range: 0..100
      "shimmerIntensity": 50,          // integer, range: 0..100
      "shimmerDensity": 50,            // integer, range: 0..100
      "shimmerSize": 50,               // integer, range: 0..100
      "colorIntensity": 50             // integer, range: 0..100
    }
  ]
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/patterns/highlighter.json

**固有のメイクアップパターンカテゴリ:**
```json
[
  {
    "category": "Heart face",
    "label": "HeartFace4",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/246/6ca40279-79cc-4918-b48a-64306009b365.jpg",
    "tags": []
  },
  {
    "category": "Invtriangle",
    "label": "Invtriangle2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/7/6b0b9760-612c-4319-bd81-855d262d8e89.jpg",
    "tags": []
  },
  {
    "category": "Oblong",
    "label": "Oblong11",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/862/b7279f4e-edf2-43f3-8156-561fe5a52ec3.jpg",
    "tags": []
  },
  {
    "category": "Oval face",
    "label": "OvalFace2",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/369/91097a05-9fd2-43cb-82e9-dd45e72b613b.jpg",
    "tags": []
  },
  {
    "category": "Round face",
    "label": "RoundFace3",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/520/2d3ccbe2-36c3-43df-9e78-4c2c931fa431.jpg",
    "tags": []
  },
  {
    "category": "Square face",
    "label": "SquareFace3",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/989/2959777b-19ca-4f4a-a023-3c8927191497.jpg",
    "tags": []
  },
  {
    "category": "Triangle face",
    "label": "TriangleFace3",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/customer/guest/SkuCustomImage/765/221c1f12-c621-4567-a8ee-1433038ee8a2.jpg",
    "tags": []
  }
]
```

   * `lip_color`
```json
{
  "category": "lip_color",             // string, const "lip_color"
  "shape": {                           // object — driven by lipshape.json
    "name": "original"                 // string — MUST equal a `label` from lipshape.json
  },
  "morphology": {                      // optional object
    "fullness": 50,                    // integer, range: 0..100 (default: 0)
    "wrinkless": 50                    // integer, range: 0..100 (default: 0)
  },
  "palettes": [                        // minItems depends on style; often ≥1
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "texture": "matte",              // string, enum ["matte","gloss","holographic","metallic","satin","sheer","shimmer"]
      "colorIntensity": 50,            // integer, range: 0..100
      "gloss": 50,                     // int, range: 0..100 — REQUIRED if texture in ["gloss","holographic","metallic","sheer","shimmer"]
      "shimmerColor": "#ff0000",       // string, hex color "#RRGGBB" — REQUIRED if texture in ["holographic","metallic","shimmer"]
      "shimmerIntensity": 50,          // integer, range: 0..100 — REQUIRED if texture in ["holographic","metallic","shimmer"]
      "shimmerDensity": 50,            // integer, range: 0..100 — REQUIRED if texture in ["holographic","metallic","shimmer"]
      "shimmerSize": 50,               // integer, range: 0..100 — REQUIRED if texture in ["holographic","metallic","shimmer"]
      "transparencyIntensity": 50      // integer, range: 0..100 — REQUIRED if texture in ["gloss","sheer","shimmer"]
    }
  ],
  "style": {
    "type": "full",                    // string, enum ["full","ombre","twoTone"]
    "innerRatio": 50,                  // int, range: 0..100 — REQUIRED if type="ombre"
    "featherStrength": 50              // int, range: 0..100 — REQUIRED if type="ombre"
  }
}
```

**パターンカタログ全体:**
https://plugins-media.makeupar.com/wcm-saas/shapes/lipshape.json
**異なるメイクパターンのカテゴリ:**
```json
[{
        "category": "general",
        "label": "original",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/original.png",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "heart-shaped",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/heart-shaped.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "m-shaped",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/m-shaped.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "petal",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/petal.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "plump",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/plump.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "pouty",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/pouty.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "smile",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/smile.jpg",
        "tags": [
        ]
    }, {
        "category": "general",
        "label": "vintage",
        "thumbnail": "https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/vintage.jpg",
        "tags": [
        ]
    }
]
```

   * `lip_liner`
```json
{
  "category": "lip_liner",             // string, const "lip_liner"
  "pattern": { "name": "" },           // object — name MUST equal a label from lipliner.json
  "palettes": [
    {
      "color": "#ff0000",              // string, hex color "#RRGGBB"
      "texture": "matte",              // string, enum ["matte","satin"]
      "colorIntensity": 50,            // integer, range: 0..100
      "thickness": 50,                 // integer, range: 0..100
      "smoothness": 50                 // integer, range: 0..100
    }
  ]
}
```

**パターンの全カタログ:**
https://plugins-media.makeupar.com/wcm-saas/patterns/lipliner.json

**異なるメイクパターンのカテゴリ:**
```json
[
  {
    "category": "Large & Full",
    "label": "Large&Full1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/417/7ac66cb2-2c7b-451c-8284-cc77791b7001.jpg",
    "tags": []
  },
  {
    "category": "Larger Lower",
    "label": "LargerLower1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/878/84b2ef48-3af4-4851-86d2-b01d10db82b2.jpg",
    "tags": []
  },
  {
    "category": "Larger Upper",
    "label": "LargerUpper1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/867/674f9f4c-7961-462e-8cc9-9a8acaad4168.jpg",
    "tags": []
  },
  {
    "category": "Natural",
    "label": "Natural1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/258/7533c08a-cc9c-45ab-9294-5d5a8114037d.jpg",
    "tags": []
  },
  {
    "category": "Rosebud",
    "label": "Rosebud1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/47/eb95e91f-6ef1-41f7-bc4f-aecd7d780c42.jpg",
    "tags": []
  },
  {
    "category": "Small",
    "label": "Small1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/396/6b78e461-24a6-4c6d-afb4-88beb71f1732.jpg",
    "tags": []
  },
  {
    "category": "Wider",
    "label": "Wider1",
    "thumbnail": "https://app-cdn-01.makeupar.com/console/SkuCustomImage/guest/867/21f92b70-72b5-4a57-b4d7-81c5cce757a6.jpg",
    "tags": []
  }
]
```

---
## ペイロードの例

ここでは、複数の効果を適用した有効な `effectJson` ペイロードの完全な例を示します。

```json
{
  "version": "1.0",
  "effects": [
    {
      "category": "skin_smooth",
      "skinSmoothStrength": 55,
      "skinSmoothColorIntensity": 45
    },
    {
      "category": "blush",
      "pattern": { "name": "2colors1" },
      "palettes": [
        {
          "color": "#e19f9f",
          "texture": "matte",
          "colorIntensity": 60,
          "shimmerColor": "#d63252",
          "shimmerDensity": 50
        },
        {
          "color": "#c98a8a",
          "texture": "satin",
          "glowStrength": 40,
          "colorIntensity": 70
        }
      ]
    },
    {
        "category": "lip_color",
        "shape": { "name": "plump" },
        "morphology": { "fullness": 30, "wrinkless": 25 },
        "style": { "type": "full" },
        "palettes": [
            {
                "color": "#e11c43",
                "texture": "gloss",
                "colorIntensity": 80,
                "gloss": 75
            }
        ]
    }
  ]
}
```
この例では、`blush` は `blush.json` の `2colors1` パターンを使用しており、これには正確に 2 つのパレットが必要です。`lip_color` 効果は `lipshape.json` の `plump` シェイプを使用しています。

## ファイル仕様とエラー (File Specs & Errors)
* 対応フォーマットとサイズ

|AI 機能|対応サイズ|対応ファイルサイズ|対応フォーマット|
|  ----  | ----  | ----  | ----  |
|バーチャルメイク (AI Makeup Virtual Try-On)|長辺 < 1920、顔の幅 >= 100|< 10MB|jpg/jpeg/png|

* エラーコード

|エラーコード|説明|
|  ----  | ----  |
|error_below_min_image_size|ソース画像のサイズが最小値より小さくなっています（期待値: 幅 >= 100px、高さ >= 100px）
|error_exceed_max_image_size|ソース画像のサイズが最大値より大きくなっています（期待値: 幅 < 1920px、高さ < 1080px）
|error_face_position_invalid |顔全体が画像内に完全に写っていることを確認してください|
|error_face_position_too_small|検出された顔が小さすぎます。カメラにもっと近づいてください|
|error_face_position_out_of_boundary|顔が大きすぎるか、画像フレームの一部が外に出ています。位置を調整してください|
|error_face_angle_invalid|顔の角度が正しくありません。正面を向いた写真では頭を 10° 以内に保ってください。横向きの写真では 15° 以上にしてください。|

* 環境と依存関係

| サンプルコードの言語 / ツール | 推奨ランタイムバージョン |
|---|---|
| cURL | - bash >= 3.2</br>   - curl >= 7.58（モダンな TLS/HTTP 対応）</br>   - jq >= 1.6（堅牢な JSON パース） |
| Node.js (JavaScript) | Node >= 18（グローバル fetch 用） |
| JavaScript | - Chrome / Edge >= 80</br>   - Firefox >= 74</br>   - Safari >= 13.1 |
| PHP | PHP >= 7.4（モダンな TLS/互換性のため）、ext-curl（推奨）または allow_url_fopen=On + ext-openssl、ext-json |
| Python | Python >= 3.10（f-string を使用するため）、requests >= 2.20.0 |
| Java | Java 11+（HttpClient を使用するため）、Jackson Databind >= 2.12.0 |

---

## JS Camera Kit
{% partial file="/_partials/js-camera-kit.md" /%}

---

## ユニット消費 (Unit Consumption)

| AI 機能 | 消費ユニット数 |
|---|---|
| バーチャルメイク V1.0 | 1 |

---


License: Privacy policy

## Servers

```
https://yce-api-01.makeupar.com
```

## Security

### BearerAuthenticationV2

[object Object]

Type: http
Scheme: bearer

## Download OpenAPI description

 - [バーチャルメイク](https://docs.perfectcorp.com/_bundle/@l10n/ja/reference/makeup_vto.yaml)

## V1.0

 - [POST /s2s/v2.0/task/makeup-vto](https://docs.perfectcorp.com/ja/reference/makeup_vto/v1.0/paths/~1s2s~1v2.0~1task~1makeup-vto/post.md): このエンドポイントは、バーチャルメイク処理を開始します。ソースファイル（URL または File ID 経由）を提供し、定義されたエフェクトスキーマを使用して適用するエフェクトを指定する必要があります。タスクは非同期で処理され、このレスポンスで返される task_id を使用してステータスを確認できます。
 - [GET /s2s/v2.0/task/makeup-vto/{task_id}](https://docs.perfectcorp.com/ja/reference/makeup_vto/v1.0/paths/~1s2s~1v2.0~1task~1makeup-vto~1%7Btask_id%7D/get.md)
