Skip to content

任务:生成歌曲

简洁描述:使用 Suno 音乐创作接口提交歌曲生成任务。


概览

  • 请求方法:POST
  • 路径:/suno/submit/music
  • 内容类型:application/json

认证方式

  • Header:Authorization: Bearer <token>

请求示例

请求体参数

参数类型必填描述
promptstring歌词内容,仅在定制模式和续写模式下使用。空字符串表示生成纯音乐
mvstring模型版本,支持 chirp-v3-0chirp-v3-5chirp-v4chirp-aukchirp-crow
titlestring歌名,仅在定制模式和续写模式下使用
tagsstring风格标签,仅在定制模式和续写模式下使用
make_instrumentalboolean是否生成纯音乐,仅在灵感模式使用
task_idstring前一次任务 ID,用于继续操作同一任务
continue_atnumber续写时长,单位秒,仅在续写模式使用
continue_clip_idstring续写歌曲 ID,仅在续写模式使用
gpt_description_promptstring歌曲提示词,仅在灵感模式使用
notify_hookstring回调地址

三种创作方式:灵感模式、定制模式、续写模式。


curl 示例

bash
curl -X POST "https://api.gpt.ge/suno/submit/music" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxx" \
  -d '{
    "gpt_description_prompt": "欢快的磁性女声歌曲,中文,主题:难忘周末",
    "mv": "chirp-v3-0"
  }'

JavaScript (fetch) 示例

javascript
fetch('https://api.gpt.ge/suno/submit/music', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk-xxxx'
  },
  body: JSON.stringify({
    gpt_description_prompt: '欢快的磁性女声歌曲,中文,主题:难忘周末',
    mv: 'chirp-v3-0'
  })
}).then(r => r.json()).then(console.log);

Python (requests) 示例

python
import requests

response = requests.post(
    'https://api.gpt.ge/suno/submit/music',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer sk-xxxx'
    },
    json={
        'gpt_description_prompt': '欢快的磁性女声歌曲,中文,主题:难忘周末',
        'mv': 'chirp-v3-0'
    }
)
print(response.json())

返回示例(200)

json
{
  "code": "success",
  "message": "",
  "data": "2a145658-3342-4228-b779-b8323a2b77df"
}

注意:

  • 灵感模式仅需 gpt_description_promptmv 和可选 make_instrumental
  • 定制模式需要 prompttitletagsmv
  • 续写模式在定制模式基础上还需 task_idcontinue_atcontinue_clip_id