Skip to content

生成歌曲

POST  v1/suno/submit/music

Suno v5版本更新公告

模型版本标识:mv=chirp-crow

v5 智能模型升级

我们迄今为止制作的最清晰的音频

真实还原人声

更富创意地掌控每个元素

更深入地理解和混音音乐类型

分为3种模式

1.灵感模式:

只需要提交以下参数

gpt_description_prompt

make_instrumental

mv

Suno 会自动生成 歌词、标题、风格标签

2.自定义模式:

需要提交参数

prompt

title

tags

make_instrumental

mv

3.续写

需要在自定义模式基础上携带

task_id

continue_at

continue_clip_id

请求参数

Authorization

在 Header 添加参数 Authorization,其值为在 Bearer 之后拼接 Token。

Authorization: Bearer ******************

Body 参数

Content-Type: application/json

参数名类型必填说明
promptstring可选歌词/提示词。用于描述想要生成的歌曲内容或歌词。
mvstring可选模型版本。可选值为 chirp-v3-0chirp-v3-5。不填写时默认为 chirp-v3-0
titlestring可选标题。仅在“自定义模式”下使用,用于指定歌曲名称。
tagsstring可选风格标签。仅在“自定义模式”下使用,用于指定音乐流派(如 Pop, Rock, Jazz)。
make_instrumentalboolean可选纯音乐模式。设为 true 时生成无歌词的纯音乐。
task_idstring可选任务 ID。用于对之前的任务进行二次操作(如重新生成或查询)。
continue_atnumber可选续写时间点。Float 类型,单位为秒,指定从哪一秒开始延长歌曲。
continue_clip_idstring可选续写源 ID。指定需要续写的那首歌的 Clip ID。
gpt_description_promptstring可选灵感模式提示词。在“灵感模式”下使用,用于描述音乐风格让 AI 自动生成歌词和曲调。
notify_hookstring可选回调地址。生成任务完成后,服务器向该 URL 发送通知。

请求示例 (JSON)

以下任选其一

1.灵感模式

{
    "gpt_description_prompt": "cat"
}

2.自定义模式(推荐)
{
    "prompt": "[Verse]\nWalking down the streets\nBeneath the city lights\nNeon signs flickering\nLighting up the night\nHeart beating faster\nLike a drum in my chest\nI'm alive in this moment\nFeeling so blessed\n\nStilettos on the pavement\nStepping with grace\nSurrounded by the people\nMoving at their own pace\nThe rhythm of the city\nIt pulses in my veins\nLost in the energy\nAs my worries drain\n\n[Verse 2]\nConcrete jungle shining\nWith its dazzling glow\nEvery corner hiding secrets that only locals know\nA symphony of chaos\nBut it's music to my ears\nThe hustle and the bustle\nWiping away my fears",
    "tags": "emotional punk",
    "mv": "chirp-auk",
    "title": "City Lights"
}

3.续写(推荐)
{
    "prompt": "[Verse]\nWalking down the streets\nBeneath the city lights\nNeon signs flickering\nLighting up the night\nHeart beating faster\nLike a drum in my chest\nI'm alive in this moment\nFeeling so blessed\n\nStilettos on the pavement\nStepping with grace\nSurrounded by the people\nMoving at their own pace\nThe rhythm of the city\nIt pulses in my veins\nLost in the energy\nAs my worries drain\n\n[Verse 2]\nConcrete jungle shining\nWith its dazzling glow\nEvery corner hiding secrets that only locals know\nA symphony of chaos\nBut it's music to my ears\nThe hustle and the bustle\nWiping away my fears",
    "tags": "bass-driven atmospheric heavy metal",
    "mv": "chirp-auk",
    "title": "City Lights",
    "task_id": "736a6f88-bd29-4b1e-b110-37132a5325ac"
    "continue_clip_id": "ce2cfbce-9ea0-45b0-9386-020c0ff54a49",
    "continue_at": 80
}

返回响应

200 成功

Content-Type: application/json

响应参数

字段名类型必填说明
codestring必需状态码。
messagestring必需提示信息。
datastring必需数据载荷。

响应示例

{
    "code": "success",
    "message": "",
    "data": "736a6f88-bd29-4b1e-b110-37132a5325ac"
}

示例代码

python
import http.client
import json

conn = http.client.HTTPSConnection("nxaiapp.com")
payload = "以下任选其一\r\n\r\n1.灵感模式\r\n\r\n{\r\n    \"gpt_description_prompt\": \"cat\"\r\n}\r\n\r\n2.自定义模式(推荐)\r\n{\r\n    \"prompt\": \"[Verse]\\nWalking down the streets\\nBeneath the city lights\\nNeon signs flickering\\nLighting up the night\\nHeart beating faster\\nLike a drum in my chest\\nI'm alive in this moment\\nFeeling so blessed\\n\\nStilettos on the pavement\\nStepping with grace\\nSurrounded by the people\\nMoving at their own pace\\nThe rhythm of the city\\nIt pulses in my veins\\nLost in the energy\\nAs my worries drain\\n\\n[Verse 2]\\nConcrete jungle shining\\nWith its dazzling glow\\nEvery corner hiding secrets that only locals know\\nA symphony of chaos\\nBut it's music to my ears\\nThe hustle and the bustle\\nWiping away my fears\",\r\n    \"tags\": \"emotional punk\",\r\n    \"mv\": \"chirp-auk\",\r\n    \"title\": \"City Lights\"\r\n}\r\n\r\n3.续写(推荐)\r\n{\r\n    \"prompt\": \"[Verse]\\nWalking down the streets\\nBeneath the city lights\\nNeon signs flickering\\nLighting up the night\\nHeart beating faster\\nLike a drum in my chest\\nI'm alive in this moment\\nFeeling so blessed\\n\\nStilettos on the pavement\\nStepping with grace\\nSurrounded by the people\\nMoving at their own pace\\nThe rhythm of the city\\nIt pulses in my veins\\nLost in the energy\\nAs my worries drain\\n\\n[Verse 2]\\nConcrete jungle shining\\nWith its dazzling glow\\nEvery corner hiding secrets that only locals know\\nA symphony of chaos\\nBut it's music to my ears\\nThe hustle and the bustle\\nWiping away my fears\",\r\n    \"tags\": \"bass-driven atmospheric heavy metal\",\r\n    \"mv\": \"chirp-auk\",\r\n    \"title\": \"City Lights\",\r\n    \"task_id\": \"736a6f88-bd29-4b1e-b110-37132a5325ac\"\r\n    \"continue_clip_id\": \"ce2cfbce-9ea0-45b0-9386-020c0ff54a49\",\r\n    \"continue_at\": 80\r\n}\r\n"
headers = {
   'Authorization': 'Bearer <token>',
   'Content-Type': 'application/json'
}
conn.request("POST", "/v1/suno/submit/music", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))