{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-music-video-task-create-request-schema.json",
  "title": "MusicVideoTaskCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatapi-music-video-api-openapi.yml#/components/schemas/MusicVideoTaskCreateRequest",
  "oneOf": [
    {
      "$ref": "#/$defs/StandardMusicVideoTaskCreateRequest"
    },
    {
      "$ref": "#/$defs/PremiumMusicVideoTaskCreateRequest"
    }
  ],
  "$defs": {
    "PremiumMusicVideoDanceTaskCreateRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/PremiumMusicVideoTaskRequestBase"
        },
        {
          "type": "object",
          "required": [
            "images"
          ],
          "not": {
            "required": [
              "lip_ref_urls"
            ],
            "properties": {
              "lip_ref_urls": {}
            }
          },
          "properties": {
            "mv_mode": {
              "type": "string",
              "enum": [
                "dance"
              ]
            },
            "images": {
              "type": "array",
              "minItems": 6,
              "maxItems": 6,
              "description": "Required for dance mode. Provide exactly six public HTTPS PNG, JPEG, or WebP scene images.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      ]
    },
    "PremiumMusicVideoPerformTaskCreateRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/PremiumMusicVideoTaskRequestBase"
        },
        {
          "type": "object",
          "required": [
            "images"
          ],
          "not": {
            "required": [
              "lip_ref_urls"
            ],
            "properties": {
              "lip_ref_urls": {}
            }
          },
          "properties": {
            "mv_mode": {
              "type": "string",
              "enum": [
                "perform"
              ]
            },
            "images": {
              "type": "array",
              "minItems": 6,
              "maxItems": 6,
              "description": "Required for perform mode. Provide exactly six public HTTPS PNG, JPEG, or WebP scene images.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      ]
    },
    "PremiumMusicVideoSingPerformTaskCreateRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/PremiumMusicVideoTaskRequestBase"
        },
        {
          "type": "object",
          "required": [
            "lip_ref_urls"
          ],
          "properties": {
            "mv_mode": {
              "type": "string",
              "enum": [
                "sing_perform"
              ]
            },
            "images": {
              "type": "array",
              "minItems": 0,
              "maxItems": 6,
              "description": "Optional Premium scene images for sing and perform mode. Provide up to six public HTTPS PNG, JPEG, or WebP URLs.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            },
            "lip_ref_urls": {
              "type": "array",
              "minItems": 1,
              "maxItems": 2,
              "description": "Required for sing and perform mode. One or two public HTTPS close-up, front-facing face images for lip synchronization.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      ]
    },
    "PremiumMusicVideoSingTaskCreateRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/PremiumMusicVideoTaskRequestBase"
        },
        {
          "type": "object",
          "required": [
            "lip_ref_urls"
          ],
          "properties": {
            "mv_mode": {
              "type": "string",
              "enum": [
                "sing"
              ]
            },
            "images": {
              "type": "array",
              "minItems": 0,
              "maxItems": 6,
              "description": "Optional Premium scene images for sing mode. Provide up to six public HTTPS PNG, JPEG, or WebP URLs.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            },
            "lip_ref_urls": {
              "type": "array",
              "minItems": 1,
              "maxItems": 2,
              "description": "Required for sing mode. One or two public HTTPS close-up, front-facing face images for lip synchronization.",
              "items": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      ]
    },
    "PremiumMusicVideoTaskCreateRequest": {
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/$defs/PremiumMusicVideoSingTaskCreateRequest"
            },
            {
              "$ref": "#/$defs/PremiumMusicVideoSingPerformTaskCreateRequest"
            },
            {
              "$ref": "#/$defs/PremiumMusicVideoDanceTaskCreateRequest"
            },
            {
              "$ref": "#/$defs/PremiumMusicVideoPerformTaskCreateRequest"
            }
          ]
        }
      ]
    },
    "PremiumMusicVideoTaskRequestBase": {
      "type": "object",
      "required": [
        "mv_tier",
        "mv_mode",
        "audio_url"
      ],
      "not": {
        "anyOf": [
          {
            "required": [
              "quality"
            ],
            "properties": {
              "quality": {}
            }
          },
          {
            "required": [
              "language"
            ],
            "properties": {
              "language": {}
            }
          },
          {
            "required": [
              "lip_sync"
            ],
            "properties": {
              "lip_sync": {}
            }
          },
          {
            "required": [
              "lip_ref_url"
            ],
            "properties": {
              "lip_ref_url": {}
            }
          },
          {
            "required": [
              "srt_url"
            ],
            "properties": {
              "srt_url": {}
            }
          },
          {
            "required": [
              "compose_mode"
            ],
            "properties": {
              "compose_mode": {}
            }
          }
        ]
      },
      "properties": {
        "mv_tier": {
          "type": "string",
          "enum": [
            "premium"
          ],
          "description": "Selects the Premium Music Video workflow and its mode-specific inputs."
        },
        "mv_mode": {
          "type": "string",
          "enum": [
            "sing",
            "sing_perform",
            "dance",
            "perform"
          ],
          "description": "Premium performance mode. Sing modes require `lip_ref_urls`; dance and perform require exactly six `images`."
        },
        "audio_url": {
          "type": "string",
          "format": "uri",
          "description": "Public HTTPS audio URL; Premium audio must be 10-300 seconds."
        },
        "prompt": {
          "type": "string",
          "maxLength": 3000,
          "description": "Optional creative direction for story, setting, performance, camera, lighting, and pacing. Maximum 3000 characters."
        },
        "style": {
          "type": "string",
          "maxLength": 200
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4"
          ],
          "description": "Target output placement. Set explicitly for the destination player or social feed."
        },
        "resolution": {
          "type": "string",
          "enum": [
            "720p"
          ],
          "default": "720p",
          "description": "Premium output is fixed to 720p."
        },
        "add_subtitle": {
          "type": "boolean",
          "default": false,
          "description": "Burn generated subtitles into the final video."
        },
        "subtitle_color": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$",
          "description": "Subtitle text color as a six-digit hexadecimal value. Used when subtitles are enabled."
        },
        "duration": {
          "type": "integer",
          "minimum": 10,
          "maximum": 300,
          "description": "Premium billing fallback only; detected audio duration wins."
        }
      }
    },
    "StandardMusicVideoTaskCreateRequest": {
      "type": "object",
      "required": [
        "images",
        "audio_url"
      ],
      "allOf": [
        {
          "if": {
            "required": [
              "lip_sync"
            ],
            "properties": {
              "lip_sync": {
                "const": true
              }
            }
          },
          "then": {
            "required": [
              "lip_ref_url"
            ],
            "properties": {
              "lip_ref_url": {}
            }
          }
        }
      ],
      "not": {
        "anyOf": [
          {
            "required": [
              "mv_mode"
            ],
            "properties": {
              "mv_mode": {}
            }
          },
          {
            "required": [
              "lip_ref_urls"
            ],
            "properties": {
              "lip_ref_urls": {}
            }
          }
        ]
      },
      "properties": {
        "mv_tier": {
          "type": "string",
          "enum": [
            "standard"
          ],
          "default": "standard",
          "description": "May be omitted to preserve the backwards-compatible Standard contract."
        },
        "images": {
          "type": "array",
          "minItems": 1,
          "maxItems": 7,
          "description": "Standard scene images. Provide 1-7 public HTTPS PNG, JPEG, or WebP URLs; place the primary subject or opening scene first. Upload local files through `POST /v1/files` and use the returned `data.url`.",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "audio_url": {
          "type": "string",
          "format": "uri",
          "description": "Public HTTPS audio URL; Standard audio must be 10-180 seconds."
        },
        "prompt": {
          "type": "string",
          "maxLength": 3000,
          "description": "Optional creative direction for story, setting, performance, camera, lighting, and pacing. Maximum 3000 characters."
        },
        "language": {
          "type": "string",
          "enum": [
            "en",
            "zh"
          ],
          "description": "Dialogue and lyric language used by the Standard workflow."
        },
        "quality": {
          "type": "string",
          "enum": [
            "standard",
            "high"
          ],
          "default": "standard",
          "description": "Generation quality tier. High quality is unavailable at 540p."
        },
        "style": {
          "type": "string",
          "maxLength": 200,
          "description": "Optional concise visual style, such as cinematic, anime, documentary, or fashion editorial."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4"
          ],
          "description": "Target output placement. Set explicitly for the destination player or social feed."
        },
        "resolution": {
          "type": "string",
          "enum": [
            "540p",
            "720p",
            "1080p"
          ],
          "default": "720p",
          "description": "Output resolution. 540p cannot be combined with high quality or lip sync."
        },
        "lip_sync": {
          "type": "boolean",
          "default": false,
          "description": "Generate lip-synchronized performance. When true, `lip_ref_url` is required."
        },
        "lip_ref_url": {
          "type": "string",
          "format": "uri",
          "description": "Public HTTPS close-up, front-facing face image used for Standard lip sync."
        },
        "add_subtitle": {
          "type": "boolean",
          "default": false,
          "description": "Burn generated or supplied subtitles into the final video."
        },
        "subtitle_color": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$",
          "description": "Subtitle text color as a six-digit hexadecimal value. Used when subtitles are enabled."
        },
        "srt_url": {
          "type": "string",
          "format": "uri",
          "description": "Optional public HTTPS `.srt` subtitle file. Upload a local subtitle through `POST /v1/files`."
        },
        "duration": {
          "type": "integer",
          "minimum": 10,
          "maximum": 180,
          "description": "Billing fallback only; detected audio duration wins."
        },
        "compose_mode": {
          "type": "string",
          "enum": [
            "auto",
            "manual"
          ],
          "default": "auto",
          "description": "Auto composes the final Music Video; manual pauses at `requires_action` so shots can be reviewed or edited before compose."
        }
      }
    }
  }
}