{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatra-ai/json-schema/beatra-ai-text-to-music-request-schema.json",
  "title": "TextToMusicRequest",
  "description": "Generate music from a prompt and optional lyrics.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatra-ai-music-api-openapi.yml#/components/schemas/TextToMusicRequest",
  "properties": {
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata",
      "description": "Caller-supplied metadata; limited by task creation policy."
    },
    "callback_url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2048,
          "pattern": "^https://"
        },
        {
          "type": "null"
        }
      ],
      "title": "Callback Url",
      "description": "HTTPS URL beatra will POST the final Task envelope to when the Task reaches a terminal state"
    },
    "callback_signing_key_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64,
          "minLength": 1,
          "pattern": "^whkey_[A-Za-z0-9]+$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Callback Signing Key Id",
      "description": "Optional standalone callback signing key. Omit for unsigned callback delivery; requires callback_url when provided."
    },
    "model": {
      "type": "string",
      "enum": [
        "auto",
        "minimax-music-3.0",
        "suno-6"
      ],
      "title": "Model"
    },
    "prompt": {
      "type": "string",
      "maxLength": 2000,
      "minLength": 1,
      "title": "Prompt",
      "description": "Style, mood, genre, and instrumentation. When lyrics are supplied (or Suno custom mode is on) this maps to the provider's style-conditioning field; otherwise it is the song description the model writes the song from. Either way it is not an instruction field: execution directives written here (for example \"do not omit anything\", \"sing it verbatim\", \"make chapter three differ from chapter one\") are not read as instructions and will not be obeyed. Put the words to be sung in `lyrics`, or set `instrumental` to true for a track with no vocals."
    },
    "lyrics": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 5000
        },
        {
          "type": "null"
        }
      ],
      "title": "Lyrics",
      "description": "Optional lyrics text. Must be omitted for instrumental music."
    },
    "instrumental": {
      "type": "boolean",
      "title": "Instrumental",
      "description": "When true, generate instrumental music without vocals.",
      "default": false
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "model_options": {
      "anyOf": [
        {
          "$ref": "#/$defs/MusicModelOptions"
        },
        {
          "type": "null"
        }
      ],
      "description": "Options grouped by public music model family."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "model",
    "prompt"
  ],
  "$defs": {
    "MiniMaxMusicAudioSetting": {
      "properties": {
        "sample_rate": {
          "anyOf": [
            {
              "type": "integer",
              "enum": [
                16000,
                24000,
                32000,
                44100
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Sample Rate"
        },
        "bitrate": {
          "anyOf": [
            {
              "type": "integer",
              "enum": [
                32000,
                64000,
                128000,
                256000
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Bitrate"
        },
        "format": {
          "anyOf": [
            {
              "type": "string",
              "const": "mp3"
            },
            {
              "type": "null"
            }
          ],
          "title": "Format"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "MiniMaxMusicAudioSetting"
    },
    "MiniMaxMusicOptions": {
      "properties": {
        "lyrics_optimizer": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lyrics Optimizer"
        },
        "aigc_watermark": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Aigc Watermark"
        },
        "audio_setting": {
          "anyOf": [
            {
              "$ref": "#/$defs/MiniMaxMusicAudioSetting"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "MiniMaxMusicOptions"
    },
    "MusicModelOptions": {
      "properties": {
        "suno": {
          "anyOf": [
            {
              "$ref": "#/$defs/SunoMusicOptions"
            },
            {
              "type": "null"
            }
          ]
        },
        "minimax": {
          "anyOf": [
            {
              "$ref": "#/$defs/MiniMaxMusicOptions"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "MusicModelOptions",
      "description": "Model-family scoped public options for music generation."
    },
    "SunoMusicOptions": {
      "properties": {
        "custom_mode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Custom Mode"
        },
        "negative_tags": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Negative Tags",
          "description": "Suno traits to exclude; limited independently from prompt, lyrics, and title."
        },
        "vocal_gender": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "m",
                "f"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Vocal Gender"
        },
        "style_weight": {
          "anyOf": [
            {
              "type": "number",
              "multipleOf": 0.01,
              "maximum": 1.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Style Weight"
        },
        "weirdness_constraint": {
          "anyOf": [
            {
              "type": "number",
              "multipleOf": 0.01,
              "maximum": 1.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Weirdness Constraint"
        },
        "audio_weight": {
          "anyOf": [
            {
              "type": "number",
              "multipleOf": 0.01,
              "maximum": 1.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Audio Weight"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SunoMusicOptions"
    }
  }
}