接口与鉴权

POST https://top.qingyuntop.ai/v1/responses

使用 Authorization: Bearer YOUR_API_KEY 和 Content-Type: application/json。

参数

model 为 suno_lyrics,input 填主题、语言和段落要求。插件最终需要非空 prompt,其优先级为:非空 metadata.prompt、input 提取文本、顶层 prompt。建议采用本页的 input 写法,避免同时传多个来源。

无需 mv 和 make_instrumental。下面采用 background=true,创建后使用 GET 查询。

代码示例

curl --fail-with-body "https://top.qingyuntop.ai/v1/responses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "suno_lyrics",
  "input": "写一首关于清晨海边的中文民谣歌词,包含主歌和副歌。",
  "background": true
}'

文本数组写法

若应用已经使用消息数组,input 可以写为:

{"model":"suno_lyrics","input":[{"role":"user","content":[{"type":"input_text","text":"写一首关于海边日出的中文民谣歌词。"}]}],"background":true}

插件提取 input_text 或 text 的 text 字符串,多个文本片段通过换行合并;不要只发图片、音频或 file_id。

获取歌词

按Responses 查询说明等待 completed,然后遍历 output 中 message 的 content,读取 type=output_text 的 text。歌词常带标题;此任务没有音频播放器和 MP3 产物。