获取音乐生成详情
curl --request GET \
--url https://apibox.erweima.ai/api/v1/generate/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://apibox.erweima.ai/api/v1/generate/record-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apibox.erweima.ai/api/v1/generate/record-info', 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/generate/record-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/generate/record-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apibox.erweima.ai/api/v1/generate/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/generate/record-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e",
"parentMusicId": "",
"param": "{\"prompt\":\"A calm piano track\",\"style\":\"Classical\",\"title\":\"Peaceful Piano\",\"customMode\":true,\"instrumental\":true,\"model\":\"V4_5ALL\"}",
"response": {
"taskId": "5c79****be8e",
"sunoData": [
{
"id": "8551****662c",
"audioUrl": "https://example.cn/****.mp3",
"streamAudioUrl": "https://example.cn/****",
"imageUrl": "https://example.cn/****.jpeg",
"prompt": "[Verse] 夜晚城市 灯火辉煌",
"modelName": "chirp-v3-5",
"title": "钢铁侠",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 198.44
}
]
},
"status": "SUCCESS",
"type": "GENERATE",
"errorCode": null,
"errorMessage": null
}
}Generate Music
获取音乐生成详情
获取音乐生成任务的详细信息,包括状态、参数和结果。
GET
/
api
/
v1
/
generate
/
record-info
获取音乐生成详情
curl --request GET \
--url https://apibox.erweima.ai/api/v1/generate/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://apibox.erweima.ai/api/v1/generate/record-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apibox.erweima.ai/api/v1/generate/record-info', 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/generate/record-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apibox.erweima.ai/api/v1/generate/record-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apibox.erweima.ai/api/v1/generate/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apibox.erweima.ai/api/v1/generate/record-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "5c79****be8e",
"parentMusicId": "",
"param": "{\"prompt\":\"A calm piano track\",\"style\":\"Classical\",\"title\":\"Peaceful Piano\",\"customMode\":true,\"instrumental\":true,\"model\":\"V4_5ALL\"}",
"response": {
"taskId": "5c79****be8e",
"sunoData": [
{
"id": "8551****662c",
"audioUrl": "https://example.cn/****.mp3",
"streamAudioUrl": "https://example.cn/****",
"imageUrl": "https://example.cn/****.jpeg",
"prompt": "[Verse] 夜晚城市 灯火辉煌",
"modelName": "chirp-v3-5",
"title": "钢铁侠",
"tags": "electrifying, rock",
"createTime": "2025-01-01 00:00:00",
"duration": 198.44
}
]
},
"status": "SUCCESS",
"type": "GENERATE",
"errorCode": null,
"errorMessage": null
}
}状态说明
- PENDING: 任务正在等待处理
- TEXT_SUCCESS: 歌词/文本生成已成功完成
- FIRST_SUCCESS: 第一首曲目生成已成功完成
- SUCCESS: 所有曲目已成功生成
- CREATE_TASK_FAILED: 创建生成任务失败
- GENERATE_AUDIO_FAILED: 生成音乐曲目失败
- CALLBACK_EXCEPTION: 回调过程中发生错误
- SENSITIVE_WORD_ERROR: 内容包含禁用词
开发者注意事项
- 对于纯音乐曲目(instrumental=true),响应中不会包含歌词数据
- 可以使用此接口检查任务状态,而不必等待回调
授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
查询参数
从'生成音乐'或'延长音乐'接口返回的任务ID。用于标识要查询的特定生成任务。
响应
请求成功
状态码说明
- ✅ 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
⌘I
