MAPI
AudioSuno

Generate Music

Generate a complete song from an inspiration prompt or custom lyrics.

custom controls text fields only. Mismatched text is ignored; weight fields are still validated:

  • custom=false (default, inspiration): prompt is the inspiration description. title, style, negative_tags, auto_lyrics, and persona_id are ignored.
  • custom=true (custom): prompt is lyrics. Those text fields take effect.
  • style_weight, weirdness_constraint, audio_weight, and vocal_gender apply in both modes and are validated. Out-of-range values return 400; they are not silently dropped.

This model uses style for genre tags, not tags. Creativity uses weirdness_constraint, not weirdness.

  • Provide either version (v6 / v6-wild / v6-mini) or custom_model_id, not both. persona_id cannot be combined with custom_model_id.
  • custom=false: prompt is required (≤3000). custom=true and not instrumental: prompt is required as lyrics (≤5000).
  • max_mode=true requires custom=true and bills at 2×. variety: "max" does not enable Max billing.
  • duration is custom-mode only, 10–360 seconds.
POST
/v1/music/generations

Authorization

BearerAuth

AuthorizationBearer <token>

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

In: header

Request Body

application/json

model*string

固定填写 suno-music。

version?string

公共版本:v6 / v6-wild / v6-mini。与 custom_model_id 至少提供一个;使用自定义模型时省略本字段。

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

创建自定义模型任务返回的完整 UUID。与 version、persona_id 互斥。与公共版本同价,创建模型本身另收 suno-create-model。

custom?boolean

false 为灵感模式,prompt 作为灵感描述;true 为自定义模式,prompt 作为歌词。默认 false。

Defaultfalse
instrumental?boolean

true 表示生成纯音乐、无人声;默认 false。

Defaultfalse
prompt?string

灵感提示词或歌词。custom=false 时必填(灵感描述,不超过 3000 字符);custom=true 且 instrumental=false 时必填(歌词,不超过 5000 字符);自定义纯音乐可省略。

title?string

歌曲标题,不超过 80 个字符。仅 custom=true 时生效。

style?string

歌曲风格标签,不超过 1000 个字符。仅 custom=true 时生效;本模型使用 style,不是 tags。

negative_tags?string

不希望出现的风格标签。仅 custom=true 时生效。

auto_lyrics?boolean

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

persona_id?string

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

vocal_gender?string

人声性别。支持 Male、Female 以及 m、f、male、female,两种生成模式均生效。

Value in"Male" | "Female" | "m" | "f" | "male" | "female"
style_weight?number

风格权重,范围 0.00–1.00。两种模式下都会校验并生效;数值 0 有效。

Range0 <= value <= 1
weirdness_constraint?number

创意度,范围 0.00–1.00。主生成使用本字段(不是 weirdness)。两种模式下都会校验并生效;数值 0 有效。

Range0 <= value <= 1
audio_weight?number

音频权重,范围 0.00–1.00。两种模式下都会校验并生效;数值 0 有效。

Range0 <= value <= 1
variety?string

风格变化程度。可省略,没有固定默认值。选择 max 不会自动开启 Max 计费。

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

是否启用 Max 模式。启用时要求 custom=true,按普通售价 2 倍计费。不支持时不要发送本字段。

Defaultfalse
audio_format?string

输出音频格式。省略时由服务自动选择。

Value in"mp3" | "m4a" | "wav"
duration?integer

目标生成时长,10–360 秒整数,仅 custom=true 时可用。实际成品时长以任务结果为准。

Range10 <= value <= 360

Response Body

application/json

application/json

curl -X POST "https://loading/v1/music/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "suno-music",    "version": "v6",    "custom": false,    "prompt": "深夜城市 lo-fi 钢琴配雨声"  }'
{
  "code": 200,
  "message": "success",
  "data": [
    {
      "status": "submitted",
      "task_id": "task_aehCmxJ5YUNOIQGgkhvxaco4T9P2h3Dw"
    }
  ]
}
{
  "code": "invalid_request",
  "message": "suno-music requires either version (v6/v6-wild/v6-mini) or custom_model_id",
  "data": null
}

Last updated on