跳至主要内容

音樂生成

本頁收錄 Suno 歌曲生成、歌詞生成、上傳與任務查詢接口。

Apifox 覆蓋範圍補充

  • Suno:異步任務、生成歌曲、生成歌詞、上傳音樂、歌曲拼接、單個查詢任務、批量查詢任務
  • Udio:Chat 格式調用

模型接口/音樂(Music)/Suno

POST 生成歌曲

POST /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

Body 請求參數

以下任選其一

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-fenix",
"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-fenix",
"title": "City Lights",
"task_id": "736a6f88-bd29-4b1e-b110-37132a5325ac"
"continue_clip_id": "ce2cfbce-9ea0-45b0-9386-020c0ff54a49",
"continue_at": 80
}

請求參數

名稱位置類型必選說明
Authorizationheaderstringnone
Content-Typeheaderstringnone
Acceptheaderstringnone
bodybodyobjectnone
» promptbodystring歌詞 (自定義模式專用)
» mvbodystringmv模型,chirp-v3-0、chirp-v3-5。不寫默認 chirp-v3-0
» titlebodystring標題(自定義模式專用)
» tagsbodystring風格標籤(自定義模式專用)
» make_instrumentalbodyboolean是否生成純音樂,true 為生成純音樂
» task_idbodystring任務id,用於對之前的任務再操作
» continue_atbodynumberfloat,歌曲延長時間,單位秒
» continue_clip_idbodystring歌曲id,需要續寫哪首歌
» gpt_description_promptbodystring靈感模式提示詞(靈感模式專用)
» notify_hookbodystring回調地址: https://xxxxxxx

返回示例

200 Response

{
"code": "string",
"message": "string",
"data": "string"
}

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline

返回數據結構

狀態碼 200

名稱類型必選約束中文名說明
» codestringtruenonenone
» messagestringtruenone錯誤信息
» datastringtruenonetask_id

POST 生成歌詞

POST /suno/submit/lyrics

Body 請求參數

{
"prompt": "dance"
}

請求參數

名稱位置類型必選說明
Authorizationheaderstringnone
Content-Typeheaderstringnone
Acceptheaderstringnone
bodybodyobjectnone
» promptbodystring歌詞提示詞
» notify_hookbodystring回調地址

返回示例

200 Response

{
"code": "string",
"message": "string",
"data": "string"
}

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline

返回數據結構

狀態碼 200

名稱類型必選約束中文名說明
» codestringtruenonenone
» messagestringtruenonenone
» datastringtruenonetask_id

POST 上傳音樂

POST /suno/uploads/audio-url

Body 請求參數

{
"url": "http://cdnimg.example.com/ai/2024-06-18/d416d9c3c34eb22c7d8c094831d8dbd0.mp3"
}

請求參數

名稱位置類型必選說明
Authorizationheaderstringnone
Content-Typeheaderstringnone
Acceptheaderstringnone
bodybodyobjectnone
» promptbodystring歌詞 (自定義模式專用)
» mvbodystringmv模型,chirp-v3-0、chirp-v3-5。不寫默認 chirp-v3-0
» titlebodystring標題(自定義模式專用)
» tagsbodystring風格標籤(自定義模式專用)
» make_instrumentalbodyboolean是否生成純音樂,true 為生成純音樂
» task_idbodystring任務id,用於對之前的任務再操作
» continue_atbodynumberfloat,歌曲延長時間,單位秒
» continue_clip_idbodystring歌曲id,需要續寫哪首歌
» gpt_description_promptbodystring靈感模式提示詞(靈感模式專用)
» notify_hookbodystring回調地址: https://xxxxxxx

返回示例

200 Response

{
"code": "string",
"message": "string",
"data": "string"
}

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline

返回數據結構

狀態碼 200

名稱類型必選約束中文名說明
» codestringtruenonenone
» messagestringtruenone錯誤信息
» datastringtruenonetask_id

POST 歌曲拼接

POST /suno/submit/concat

Body 請求參數

{
"clip_id": "extend 後的 歌曲ID",
"is_infill": false
}

請求參數

名稱位置類型必選說明
Authorizationheaderstringnone
Content-Typeheaderstringnone
Acceptheaderstringnone
bodybodyobjectnone
» promptbodystring歌詞 (自定義模式專用)
» mvbodystringmv模型,chirp-v3-0、chirp-v3-5。不寫默認 chirp-v3-0
» titlebodystring標題(自定義模式專用)
» tagsbodystring風格標籤(自定義模式專用)
» make_instrumentalbodyboolean是否生成純音樂,true 為生成純音樂
» task_idbodystring任務id,用於對之前的任務再操作
» continue_atbodynumberfloat,歌曲延長時間,單位秒
» continue_clip_idbodystring歌曲id,需要續寫哪首歌
» gpt_description_promptbodystring靈感模式提示詞(靈感模式專用)
» notify_hookbodystring回調地址: https://xxxxxxx

返回示例

200 Response

{
"code": "string",
"message": "string",
"data": "string"
}

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline

返回數據結構

狀態碼 200

名稱類型必選約束中文名說明
» codestringtruenonenone
» messagestringtruenone錯誤信息
» datastringtruenonetask_id

GET 單個查詢任務

GET /suno/fetch/{task_id}

請求參數

名稱位置類型必選說明
task_idpathstringnone
Authorizationheaderstringnone

返回示例

200 Response

{
"code": "string",
"message": "string",
"data": {
"task_id": "string",
"notify_hook": "string",
"action": "string",
"status": "string",
"fail_reason": "string",
"submit_time": 0,
"start_time": 0,
"finish_time": 0,
"progress": "string",
"data": [
{
"id": "string",
"title": "string",
"status": "string",
"metadata": {
"tags": "string",
"prompt": "string",
"duration": 0,
"error_type": null,
"error_message": null,
"audio_prompt_id": null,
"gpt_description_prompt": "string"
},
"audio_url": "string",
"image_url": "string",
"video_url": "string",
"model_name": "string",
"image_large_url": "string",
"major_model_version": "string"
}
]
}
}

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline

返回數據結構

狀態碼 200

名稱類型必選約束中文名說明
» codestringtruenonenone
» messagestringtruenonenone
» dataobjecttruenonenone
»» task_idstringtruenonenone
»» notify_hookstringtruenonenone
»» actionstringtruenonenone
»» statusstringtruenonenone
»» fail_reasonstringtruenonenone
»» submit_timeintegertruenonenone
»» start_timeintegertruenonenone
»» finish_timeintegertruenonenone
»» progressstringtruenonenone
»» data[object]truenonenone
»»» idstringtruenonenone
»»» titlestringtruenonenone
»»» statusstringtruenonenone
»»» metadataobjecttruenonenone
»»»» tagsstringtruenonenone
»»»» promptstringtruenonenone
»»»» durationintegertruenonenone
»»»» error_typenulltruenonenone
»»»» error_messagenulltruenonenone
»»»» audio_prompt_idnulltruenonenone
»»»» gpt_description_promptstringtruenonenone
»»» audio_urlstringtruenonenone
»»» image_urlstringtruenonenone
»»» video_urlstringtruenonenone
»»» model_namestringtruenonenone
»»» image_large_urlstringtruenonenone
»»» major_model_versionstringtruenonenone

POST 批量查詢任務

POST /suno/fetch

Body 請求參數

{
"ids": [
"task_id"
],
"action": "MUSIC"
}

請求參數

名稱位置類型必選說明
Content-Typeheaderstringnone
Acceptheaderstringnone
Authorizationheaderstringnone
bodybodyanynone

返回示例

200 Response

[
null
]

返回結果

狀態碼狀態碼含義說明數據模型
200OKnoneInline
201CreatednoneInline
401UnauthorizednoneInline
403ForbiddennoneInline
404Not FoundnoneInline

返回數據結構