{
"code": 200,
"data": {
"callbackType": "complete",
"data": [
{
"audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c43e125bbbdcafc1d387f/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"createTime": 1795015940224,
"duration": 41.12,
"id": "1150f859-c087-408b-9866-b07863e75ce7",
"image_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/4ba7f3ce592ddbce92b41/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"model_name": "chirp-hawk",
"prompt": "[Verse]\nKettle starts its little song\nFirst light slips across the floor\nCoffee warms my hands awake\nAnd I'm ready for the day\n\n[Chorus]\nGood morning, sunshine, here we go\nOne bright step and the whole world glows\nA little warmth, a little cheer\nThe best part of the morning's here\n\n[Outro]\nGood morning, coffee, cheers to today!",
"stream_audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2f034639e8ad0540457c3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"tags": "folk-pop, acoustic",
"title": "Good Morning, Sunshine"
},
{
"audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/cecb105a41a06b6f8ce3e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"createTime": 1795015940224,
"duration": 41.12,
"id": "7190052a-d671-4f70-a949-b26c4873c561",
"image_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/e2de1e355b9b2956604d3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"model_name": "chirp-hawk",
"prompt": "[Verse]\nKettle starts its little song\nFirst light slips across the floor\nCoffee warms my hands awake\nAnd I'm ready for the day\n\n[Chorus]\nGood morning, sunshine, here we go\nOne bright step and the whole world glows\nA little warmth, a little cheer\nThe best part of the morning's here\n\n[Outro]\nGood morning, coffee, cheers to today!",
"stream_audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2457e4995b7820a787e56/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"tags": "folk-pop, acoustic",
"title": "Good Morning, Sunshine"
}
],
"task_id": "7d3f0a9c41e85b2f6a1c9e04b8d27f53"
},
"msg": "success"
}替换音乐片段
替换音乐片段:任务完成回调
创建任务时传了 callBackUrl,任务成功或失败后 DreamTo 向该地址发送此 POST 请求(只发送一次,data.callbackType 固定为 complete)。成功时 code 为 200、data.data 为结果;失败时 code 为失败代码、msg 为原因。用 X-DreamTo-Signature 校验来源,返回任意 2xx 表示已收到。
WEBHOOK
sunoTaskCompleted
{
"code": 200,
"data": {
"callbackType": "complete",
"data": [
{
"audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/c43e125bbbdcafc1d387f/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"createTime": 1795015940224,
"duration": 41.12,
"id": "1150f859-c087-408b-9866-b07863e75ce7",
"image_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/4ba7f3ce592ddbce92b41/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"model_name": "chirp-hawk",
"prompt": "[Verse]\nKettle starts its little song\nFirst light slips across the floor\nCoffee warms my hands awake\nAnd I'm ready for the day\n\n[Chorus]\nGood morning, sunshine, here we go\nOne bright step and the whole world glows\nA little warmth, a little cheer\nThe best part of the morning's here\n\n[Outro]\nGood morning, coffee, cheers to today!",
"stream_audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2f034639e8ad0540457c3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"tags": "folk-pop, acoustic",
"title": "Good Morning, Sunshine"
},
{
"audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/cecb105a41a06b6f8ce3e/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"createTime": 1795015940224,
"duration": 41.12,
"id": "7190052a-d671-4f70-a949-b26c4873c561",
"image_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/e2de1e355b9b2956604d3/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"model_name": "chirp-hawk",
"prompt": "[Verse]\nKettle starts its little song\nFirst light slips across the floor\nCoffee warms my hands awake\nAnd I'm ready for the day\n\n[Chorus]\nGood morning, sunshine, here we go\nOne bright step and the whole world glows\nA little warmth, a little cheer\nThe best part of the morning's here\n\n[Outro]\nGood morning, coffee, cheers to today!",
"stream_audio_url": "https://api.dreamto.ai/v1/tasks/7d3f0a9c41e85b2f6a1c9e04b8d27f53/artifacts/2457e4995b7820a787e56/content?access=Xq3vR8sK1mN6pT2wY9bC4dF7gH0jL5zA8eU1iO3rS6t",
"tags": "folk-pop, acoustic",
"title": "Good Morning, Sunshine"
}
],
"task_id": "7d3f0a9c41e85b2f6a1c9e04b8d27f53"
},
"msg": "success"
}请求头
请求体
application/json
响应
200
返回任意 2xx 状态码表示已收到;超时(10 秒)或非 2xx 时在 1、5、30 分钟后重试,最多投递 4 次。

