跳转到主要内容
POST
引用源音轨:源音轨必须是你用 uploadTask 上传的自有音频,传该上传任务的 task_id + audio_index(结果 music[] 里第几首,1-based,默认 1)。用生成的音轨作源会失败,只能引用自己上传的音轨。
custom 决定哪些字段生效:写在错误模式下的字段会被上游静默忽略(不报错)。custom=trueprompt(歌词)、titletagsnegative_tagsstyle_weightweirdness_constraintaudio_weight 生效,gpt_description 被忽略;custom=false 时只读 gpt_description(此时必填,缺了提交期直接返回 400)。vocal_gender 两种模式都生效。不传 custom 时后端按此顺序推断:有 prompttrue;无 prompt 但有 gpt_descriptionfalse;否则有 tags/titletrue

Authorizations

Authorization
string
必填
所有接口均需要使用Bearer Token进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:

Body

model
string
默认值:"suno"
音频模型。当前传 suno(不传默认 suno)。
task_id
string
必填
源音轨所在 uploadTask 上传任务的 task_id(须为你自己上传的音轨;用生成任务的音轨作源会失败)。缺失或无法解析源时提交期直接返回 400
audio_index
integer
默认值:"1"
引用源任务结果 data.music[] 中的第几首(1-based;默认 1;一次生成通常 2 首:索引 1 与 2)。
version
string
默认值:"v5.5"
生成版本:v5 / v5.5;不传默认 v5.5。传其它值提交期直接返回 400
custom
boolean
true=自定义模式(用 prompt 作歌词);false=灵感模式(用 gpt_description);不传时按内容推断(见上方 Warning)。
prompt
string
歌词,custom=true 时生效(灵感模式下会被忽略)。
gpt_description
string
灵感提示词,custom=false必填(缺了提交期直接 400、不打上游、不扣费)。
title
string
标题。custom=true 时生效
tags
string
风格标签。custom=true 时生效
negative_tags
string
要排除的风格标签。custom=true 时生效
style_weight
number
风格权重,0.001.00(越界提交期直接返回 400)。custom=true 时生效
weirdness_constraint
number
创意权重,0.001.00(别名 weirdness)。custom=true 时生效
audio_weight
number
音频权重,0.001.00custom=true 时生效
vocal_gender
string
人声性别:Male / Female两种模式都生效
获取结果:本接口为异步任务。提交后拿到 task_id,按 3–5s 间隔轮询 GET /v1/music/tasks/{task_id},直到 statuscompletedfailed(音乐生成通常 30–120s;生成中 statuspendingprogress 排队 10 → 就绪 50 → 完成 100)。完成后从 data.result.music[]audio_url。失败时 data.error.message 给出原因,且预扣额度自动退回。

Response

code
integer
响应状态码
data
array
返回数据数组