MAPI
音频(Audio)Suno

生成混搭

把两首已有歌曲混搭再创作。task_ids 须恰好 2 个;可选 audio_indexes 与之平行(1-based,默认都取 1)。

custom 决定哪些字段生效。已提交字段无论当前模式是否生效,都须满足类型、范围和长度。不传 custom 时按此推断:有 prompt → true;无 prompt 但有 gpt_description → false;否则有 tags 或 title → true。

  • custom=true 时 prompt、title、tags、negative_tags、auto_lyrics、style_weight、weirdness、audio_weight、persona_id 生效,gpt_description 被忽略。custom=true 且 instrumental=false 时 prompt 必填。
  • custom=false 时只读 gpt_description(必填,缺失提交期 400、不扣费)。vocal_gender 两种模式都生效。
  • version:v6 / v6-wild / v6-mini,省略默认 v6。使用 custom_model_id 时省略。custom_model_id 与 version、persona_id 互斥。
  • 不支持目标时长。max_mode 启用要求自定义模式,按普通售价的 2 倍计费。创意度用 weirdness,兼容旧名 weirdness_constraint。
  • 提交接口:POST /v1/music/generations,model: "suno-mashup"。
  • 任务查询:GET /v1/music/generations/{task_id}。
POST
/v1/music/generations

Authorization

BearerAuth

AuthorizationBearer <token>

使用 MAPI Bearer Token 认证。格式:Authorization: Bearer sk-xxxxxx。

In: header

Request Body

application/json

model*string

固定填写 suno-mashup。

task_ids*array<string>

2 个源音轨所属任务的 ID,须恰好 2 个。数量不对提交期直接返回 400。

Items2 <= items <= 2
audio_indexes?array<integer>

与 task_ids 平行,指定各任务取结果 music[] 第几首(1-based,默认都取 1)。

instrumental?boolean

是否纯器乐。true 表示无人声;省略默认 false(要人声)。

Defaultfalse
version?string

公共版本:v6 / v6-wild / v6-mini。省略默认 v6。使用 custom_model_id 时省略。

Default"v6"
Value in"v6" | "v6-wild" | "v6-mini"
custom_model_id?string

创建模型任务返回的完整 UUID。与 version、persona_id 互斥。

custom?boolean

true 为自定义模式,prompt 作歌词;false 为灵感模式,用 gpt_description。省略时按内容推断:有 prompt → true;无 prompt 但有 gpt_description → false;否则有 tags 或 title → true。

prompt?string

歌词。custom=true 且 instrumental=false 时必填。灵感模式下不生效,但已提交值仍须满足长度要求。

gpt_description?string

灵感提示词。custom=false 时必填,缺失提交期直接返回 400、不扣费。custom=true 时被忽略。

title?string

标题。仅 custom=true 时生效。

tags?string

风格标签。仅 custom=true 时生效。

negative_tags?string

要排除的风格标签。仅 custom=true 时生效。

auto_lyrics?boolean

是否对输入歌词进行二次创作。仅 custom=true 时生效。

style_weight?number

风格权重,范围 0.00–1.00。越界提交期直接返回 400。仅 custom=true 时生效。

Range0 <= value <= 1
weirdness?number

创意权重,范围 0.00–1.00。兼容旧名 weirdness_constraint;新请求请使用 weirdness。

Range0 <= value <= 1
audio_weight?number

音频权重,范围 0.00–1.00。仅 custom=true 时生效。

Range0 <= value <= 1
vocal_gender?string

人声性别:Male / Female。两种模式都生效。

Value in"Male" | "Female"
persona_id?string

Persona 风格 ID。仅 custom=true 时生效,与 custom_model_id 互斥。

variety?string

风格变化程度:off / normal / high / extra / max。可省略。

Value in"off" | "normal" | "high" | "extra" | "max"
max_mode?boolean

是否启用 Max 模式。启用时要求自定义模式,并按普通售价的 2 倍计费。

Defaultfalse
audio_format?string

输出音频格式:mp3 / m4a / wav。本接口不支持目标时长字段。

Value in"mp3" | "m4a" | "wav"

Response Body

application/json

application/json

curl -X POST "https://loading/v1/music/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "suno-mashup",    "task_ids": [      "task_01ABC",      "task_01DEF"    ],    "audio_indexes": [      1,      2    ],    "custom": true,    "prompt": "upbeat mashup of the two tracks"  }'
{
  "code": 200,
  "message": "success",
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
    }
  ]
}
{
  "code": "invalid_request",
  "message": "mashup requires exactly 2 task_ids, got 1",
  "data": null
}

最后更新于