提交生成任务
所有 Suno 相关 API 都是直接从 Cookie 池中随机选取一个 Token ,然后转发相应的请求到 suno。
URL 前缀:后端接口路径 + /gateway
API1 生成歌曲
路径: /generate/v2
此接口有两首模式,第一种对应 Custom 模式,也就是自定义模式。
介绍一下这种模式下的参数
方法:POST
类型:application/json
参数:
| 参数名 | 类型 | 描述 | 备注 |
|---|---|---|---|
| title | string | 音乐标题 | |
| tags | string | 音乐风格, 使用半角逗号隔开 | |
| prompt | string | 音乐创作提示词, 包括但不限于歌词 | |
| mv | string | 模型 | 最新为chirp-v3-5,也可以是chirp-v3-0和chirp-v2-xxl-alpha。当扩展上传的音频文件时,使用 chirp-v3-5-upload |
| continue_at | int | 非必传参数, 需要继续创作时使用。 含义为,从第几秒开始继续创作。例如 9.5 | |
| continue_clip_id | string | 非必传参数,需要继续创作时使用。含义为,需要继续创作的歌曲 id |
对 prompt 参数的说明: 歌词是文本内容,prompt 除了歌词外,还包含有标签,例如下面的 prompt
[Verse]
Blue skies shining bright
Morning turns into night
[Verse 2]
Butterflies in my eyes
Feel the music loud
[Chorus]
Dance with me through the day
[Verse 3]
Feel so right tonight
[Bridge]
Touch the clouds
Reaching for the sky
[Verse 4]
Let's just float away
还有一种模式是简易创作模式,根据描述来生成音乐,本质上是 suno 自动帮你生成歌词。
同样还是这个接口路径,但是参数有所不同:
参数:
| 参数名 | 类型 | 描述 | 备注 |
|---|---|---|---|
| gpt_description_prompt | String | 对音乐的描述 | |
| make_instrumental | Bool | 如果是true,则表示没有歌词 | |
| mv | string | 模型 | 最新为chirp-v3-5,也可以是chirp-v3-0和chirp-v2-xxl-alpha。 |
| prompt | string | 非必传参数 |
这个接口的返回结果如下:
[
{
"id": "e48ff1e7-09ca-4e35-9441-348fbb198298",
"video_url": "",
"audio_url": "",
"image_url": null,
"image_large_url": null,
"is_video_pending": false,
"major_model_version": "v3",
"model_name": "chirp-v3",
"metadata": {
"tags": null,
"prompt": "",
"gpt_description_prompt": "jazz",
"audio_prompt_id": null,
"history": null,
"concat_history": null,
"type": "gen",
"duration": null,
"refund_credits": null,
"stream": true,
"infill": null,
"has_vocal": null,
"is_audio_upload_tos_accepted": null,
"error_type": null,
"error_message": null
},
"is_liked": false,
"user_id": "a86b15d2-97be-4cd4-abdc-8e6936225e7b",
"display_name": "GalvanizingWhiteNoise784",
"handle": "galvanizingwhitenoise784",
"is_handle_updated": false,
"avatar_image_url": null,
"is_trashed": false,
"reaction": null,
"created_at": "2024-06-25T04:05:53.328Z",
"status": "submitted",
"title": "",
"play_count": 0,
"upvote_count": 0,
"is_public": false
},
{
"id": "19e0a0c3-db70-49ff-8440-75e97e637c0d",
"video_url": "",
"audio_url": "",
"image_url": null,
"image_large_url": null,
"is_video_pending": false,
"major_model_version": "v3",
"model_name": "chirp-v3",
"metadata": {
"tags": null,
"prompt": "",
"gpt_description_prompt": "jazz",
"audio_prompt_id": null,
"history": null,
"concat_history": null,
"type": "gen",
"duration": null,
"refund_credits": null,
"stream": true,
"infill": null,
"has_vocal": null,
"is_audio_upload_tos_accepted": null,
"error_type": null,
"error_message": null
},
"is_liked": false,
"user_id": "a86b15d2-97be-4cd4-abdc-8e6936225e7b",
"display_name": "GalvanizingWhiteNoise784",
"handle": "galvanizingwhitenoise784",
"is_handle_updated": false,
"avatar_image_url": null,
"is_trashed": false,
"reaction": null,
"created_at": "2024-06-25T04:05:53.328Z",
"status": "submitted",
"title": "",
"play_count": 0,
"upvote_count": 0,
"is_public": false
}
]
可以得到一个数组, 长度为 2,每个成员都有一个 id 属性,我习惯称为 clip_id,对应的正是歌曲的 id。
e48ff1e7-09ca-4e35-9441-348fbb198298
19e0a0c3-db70-49ff-8440-75e97e637c0d