{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/yukkurigen-com/json-schema/yukkurigen-com-custom-character-schema.json",
  "title": "CustomCharacter",
  "description": "自分のキャラ（create_character / update_character / GET の 200）。characterId を create_yukkuri_video・update_lines の speaker に書く",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/yukkurigen-com-openapi.json#/components/schemas/CustomCharacter",
  "type": "object",
  "properties": {
    "characterId": {
      "type": "string",
      "description": "話者 id（20文字の英数字）。list_characters の custom:true の id と同じ"
    },
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "png",
        "psd"
      ],
      "description": "png=画像1枚（表情ごとの画像を update_character で足せる）/ psd=PSD から取り込んだ部品を重ねて描くキャラ（表情・口は画面で）"
    },
    "imageUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "立ち絵（通常の顔）の url"
    },
    "voice": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "speakerId": {
          "type": "integer"
        },
        "engine": {
          "type": "string",
          "enum": [
            "voicevox",
            "AquesTalk"
          ]
        },
        "label": {
          "type": "string"
        },
        "speed": {
          "type": "number",
          "description": "既定の話す速さ（標準の 1 なら無い）"
        },
        "pitch": {
          "type": "number",
          "description": "既定の声の高さ（標準の 0 なら無い）"
        }
      }
    },
    "emotionImages": {
      "type": "object",
      "description": "画像を設定した表情 → url（設定していない表情は近い表情か通常の顔で描かれる）",
      "additionalProperties": {
        "type": "string"
      }
    },
    "figure": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "full",
        "bust"
      ]
    },
    "face": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "x": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "y": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "required": [
        "x",
        "y"
      ],
      "description": "顔の中心（立ち絵の通常の絵の中の 0〜1。左上 0,0・右下 1,1。目の上端と口の下端の真ん中あたり）。カメラが話者に寄る（行の camera・cameraMode dynamic）ときに画面の真ん中に持ってくる所。null は保存していない（描くたびに絵から推し量る）"
    },
    "defaultScale": {
      "type": "number",
      "description": "立ち絵の大きさ（0.5〜2。既定 1。枠に合わせた大きさに掛ける・足元を支点に）"
    },
    "templates": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "出せるテンプレート（tohoku-ahiru-talk）"
    },
    "outfits": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "outfitId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "emotionImages": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "description": "衣装の差分（行の outfit に outfitId を書く）"
    },
    "outfitsSupported": {
      "type": "boolean",
      "description": "衣装を着せられるか（PSD のキャラは false）"
    },
    "mouth": {
      "type": "object",
      "description": "口パク。mode: whole-frame / none、ready（口の組がある衣装・表情）、missing（無い所＝口を動かさない）、holdFrames"
    }
  },
  "required": [
    "characterId",
    "name",
    "kind",
    "templates"
  ]
}