恢复音频
curl --request POST \
--url https://apibox.erweima.ai/api/v1/suno/recovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sunoTaskId": "5c79****be8e",
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/suno/recovery"
payload = {
"sunoTaskId": "5c79****be8e",
"callBackUrl": "https://api.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sunoTaskId: '5c79****be8e', callBackUrl: 'https://api.example.com/callback'})
};
fetch('https://apibox.erweima.ai/api/v1/suno/recovery', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apibox.erweima.ai/api/v1/suno/recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sunoTaskId' => '5c79****be8e',
'callBackUrl' => 'https://api.example.com/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/suno/recovery"
payload := strings.NewReader("{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apibox.erweima.ai/api/v1/suno/recovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/suno/recovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "dc19****18b3"
}
}Generate Music
恢复音频
为已有的音乐生成任务恢复可播放的音频链接。
POST
/
api
/
v1
/
suno
/
recovery
恢复音频
curl --request POST \
--url https://apibox.erweima.ai/api/v1/suno/recovery \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sunoTaskId": "5c79****be8e",
"callBackUrl": "https://api.example.com/callback"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/suno/recovery"
payload = {
"sunoTaskId": "5c79****be8e",
"callBackUrl": "https://api.example.com/callback"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sunoTaskId: '5c79****be8e', callBackUrl: 'https://api.example.com/callback'})
};
fetch('https://apibox.erweima.ai/api/v1/suno/recovery', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apibox.erweima.ai/api/v1/suno/recovery",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sunoTaskId' => '5c79****be8e',
'callBackUrl' => 'https://api.example.com/callback'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/suno/recovery"
payload := strings.NewReader("{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apibox.erweima.ai/api/v1/suno/recovery")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/suno/recovery")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sunoTaskId\": \"5c79****be8e\",\n \"callBackUrl\": \"https://api.example.com/callback\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"task_id": "dc19****18b3"
}
}用于为已经生成完成的音乐任务恢复可播放的音频链接。传入原任务的
任务级
sunoTaskId,服务会为该任务下的每一首音轨重新生成可访问的音频地址。
🚀 使用指南
- Suno 的原始链接只在一段时间内有效,失效后无法再通过该地址播放或下载音频。
- 传入原音乐生成任务的
sunoTaskId,该任务下的所有音轨会一起恢复。 - 本接口只负责创建任务:立即返回恢复任务的
task_id,实际恢复过程为异步执行。 - 任务结束后结果会推送到
callBackUrl,也可通过轮询获取恢复音频详情获取。
source_audio_url 已废弃。生成结果与回调中的 source_audio_url 指向 Suno 的原始文件,该链接会在一段时间后失效且不再维护,不能作为长期存储使用。请改用本接口重新获取可播放的链接。📌 使用场景
- 🔗 恢复很久之前生成的歌曲的播放能力
- 📦 归档或迁移自有曲库前刷新音频链接
- 🛠️ 修复用户反馈的音频地址失效问题
⚠️ 注意事项
- 请求体中的
sunoTaskId是音乐生成任务 ID(例如生成音乐返回的 ID),不是本接口返回的 ID。 - 返回的
task_id是恢复任务 ID,只能用于调用获取恢复音频详情。 callBackUrl为必填,恢复任务结束后结果会推送到该地址。- 任务创建成功不代表每一首音轨都能恢复成功,最终结果以每条记录的
status为准。
📩 回调说明
恢复任务结束后,会向callBackUrl 发起 POST 请求:
{
"code": 200,
"msg": "success",
"task_id": "bbbb****0f7b",
"data": [
{
"id": "3bc3****48fc",
"audio_url": "https://example.com/****.m4a",
"title": "Sunrise Love",
"status": "success",
"error": ""
}
]
}
code 为 200 表示至少有一首音轨恢复成功,为 500 表示全部失败。data 的顺序与原任务的音轨顺序一致。授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
请求体
application/json
响应
请求成功
状态码说明
- ✅ 200 - 请求成功
- ⚠️ 400 - 参数错误
- ⚠️ 401 - 没有访问权限
- ⚠️ 404 - 请求方式或者路径错误
- ⚠️ 405 - 调用超过限制
- ⚠️ 413 - 主题或者prompt过长
- ⚠️ 429 - 积分不足
- ⚠️ 430 - 您的调用频率过高。请稍后再试。
- ⚠️ 455 - 网站维护
- ❌ 500 - 服务器异常
可用选项:
200, 400, 401, 404, 405, 413, 429, 430, 455, 500 示例:
200
当 code != 200 时,展示错误信息
示例:
"success"
Show child attributes
Show child attributes
