{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/musicsforyou-com/json-schema/musicsforyou-com-song-request-schema.json",
  "title": "SongRequest",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/musicsforyou-com-openapi.json#/components/schemas/SongRequest",
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "一句话需求 / What the song is for"
    },
    "uiLanguage": {
      "$ref": "#/$defs/UiLanguage",
      "default": "zh"
    },
    "lyricLanguage": {
      "oneOf": [
        {
          "$ref": "#/$defs/LyricLanguage"
        },
        {
          "type": "null"
        }
      ]
    },
    "vocalPreference": {
      "oneOf": [
        {
          "$ref": "#/$defs/VocalPreference"
        },
        {
          "type": "null"
        }
      ]
    },
    "instrumental": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "durationSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 10,
      "maximum": 360
    },
    "waitSeconds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 180,
      "default": 120,
      "description": "最多等待多少秒再返回；0 表示立即返回 / How long to wait for the song before returning; 0 returns immediately"
    }
  },
  "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"
    },
    "VocalPreference": {
      "type": "string",
      "enum": [
        "m",
        "f",
        "duet",
        "choir"
      ],
      "description": "人声偏好 / Vocal preference"
    }
  }
}