Suno Voice 重新生成验证短句
curl --request POST \
--url https://apibox.erweima.ai/api/v1/voice/regenerate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "xxxxxxx",
"calBackUrl": "https://example.com/callback/suno/voice_regenerate"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/voice/regenerate"
payload = {
"taskId": "xxxxxxx",
"calBackUrl": "https://example.com/callback/suno/voice_regenerate"
}
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({
taskId: 'xxxxxxx',
calBackUrl: 'https://example.com/callback/suno/voice_regenerate'
})
};
fetch('https://apibox.erweima.ai/api/v1/voice/regenerate', 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/voice/regenerate",
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([
'taskId' => 'xxxxxxx',
'calBackUrl' => 'https://example.com/callback/suno/voice_regenerate'
]),
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/voice/regenerate"
payload := strings.NewReader("{\n \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\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/voice/regenerate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/voice/regenerate")
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 \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "xxx_task_id_xxx"
}
}Suno Voice
Suno Voice 重新生成验证短句
为已有 Suno Voice 任务重新生成验证短句。
POST
/
api
/
v1
/
voice
/
regenerate
Suno Voice 重新生成验证短句
curl --request POST \
--url https://apibox.erweima.ai/api/v1/voice/regenerate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"taskId": "xxxxxxx",
"calBackUrl": "https://example.com/callback/suno/voice_regenerate"
}
'import requests
url = "https://apibox.erweima.ai/api/v1/voice/regenerate"
payload = {
"taskId": "xxxxxxx",
"calBackUrl": "https://example.com/callback/suno/voice_regenerate"
}
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({
taskId: 'xxxxxxx',
calBackUrl: 'https://example.com/callback/suno/voice_regenerate'
})
};
fetch('https://apibox.erweima.ai/api/v1/voice/regenerate', 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/voice/regenerate",
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([
'taskId' => 'xxxxxxx',
'calBackUrl' => 'https://example.com/callback/suno/voice_regenerate'
]),
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/voice/regenerate"
payload := strings.NewReader("{\n \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\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/voice/regenerate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/voice/regenerate")
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 \"taskId\": \"xxxxxxx\",\n \"calBackUrl\": \"https://example.com/callback/suno/voice_regenerate\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "xxx_task_id_xxx"
}
}使用指南
- 当之前的验证短句失败、过期,或用户需要新的短句时使用此接口。
- 提交音色验证流程中已有的
taskId。 - API 源数据中回调地址字段名为
calBackUrl。系统会在重新生成的验证短句完成或任务失败时发送 POST 回调。回调地址必须可公网访问,并在 15 秒内返回 HTTP 200。 - 使用返回的
taskId再次查询新的验证短句结果。
流程
- 提交已有验证任务 ID。
- 保存接口返回的
taskId。 - 通过查询接口或回调等待重新生成的
validateInfo。 - 让用户录制新的验证短句,并将验证音频提交到音色生成接口。为获得更佳的音色生成效果,建议采用演唱方式录制。
回调
重新生成验证短句回调
查看重新生成验证短句完成或失败时发送的回调格式
开发者注意事项
- 请确保重新生成的短句和后续验证录音属于同一个任务流程。
- 如果短句反复生成失败,建议选择更清晰的人声片段并重新开始验证步骤。
授权
API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
请求体
application/json
任务id
用于接收重新生成验证短句结果的回调地址。注意:该接口字段名为 calBackUrl。新的验证短句生成完成(status: wait_validating)或任务失败时,系统会向该地址发送 POST 请求。该地址必须可公网访问,并在 15 秒内返回 HTTP 200。回调数据格式请参考 重新生成验证短句回调。
⌘I
