{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/musicsforyou-com/json-schema/musicsforyou-com-compile-request-schema.json",
  "title": "CompileRequest",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/musicsforyou-com-openapi.json#/components/schemas/CompileRequest",
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "一句话需求，任何语言 / What the song is for, in any language"
    },
    "uiLanguage": {
      "$ref": "#/$defs/UiLanguage",
      "default": "zh"
    },
    "sceneId": {
      "type": [
        "string",
        "null"
      ],
      "description": "场景 id，见 GET /v1/presets / Scene id from list_presets"
    },
    "lyricLanguage": {
      "oneOf": [
        {
          "$ref": "#/$defs/LyricLanguage"
        },
        {
          "type": "null"
        }
      ]
    },
    "vocalPreference": {
      "oneOf": [
        {
          "$ref": "#/$defs/VocalPreference"
        },
        {
          "type": "null"
        }
      ]
    },
    "instrumental": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "纯音乐 / Instrumental only"
    },
    "durationSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 10,
      "maximum": 360,
      "description": "目标时长（秒）/ Target length in seconds"
    },
    "userLyrics": {
      "oneOf": [
        {
          "$ref": "#/$defs/UserLyrics"
        },
        {
          "type": "null"
        }
      ]
    },
    "clarificationAnswer": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500,
      "description": "对上一次 status=needs_input 的 question 的回答 / Answer to a previous needs_input question"
    }
  },
  "required": [
    "text"
  ],
  "$defs": {
    "LyricLanguage": {
      "type": "string",
      "enum": [
        "zh",
        "yue",
        "en",
        "ja"
      ],
      "description": "歌词语言 / Lyric language (yue = Cantonese)"
    },
    "UiLanguage": {
      "type": "string",
      "enum": [
        "zh",
        "en",
        "ja"
      ],
      "description": "界面/解释文字语言 / Language of explanations"
    },
    "UserLyrics": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 10000,
          "description": "用户自带歌词 / User-supplied lyrics"
        },
        "action": {
          "type": "string",
          "enum": [
            "preserve",
            "edit"
          ],
          "description": "preserve 一字不改；edit 允许润色 / preserve = keep verbatim, edit = may polish"
        }
      },
      "required": [
        "text",
        "action"
      ]
    },
    "VocalPreference": {
      "type": "string",
      "enum": [
        "m",
        "f",
        "duet",
        "choir"
      ],
      "description": "人声偏好 / Vocal preference"
    }
  }
}