获取音乐视频详情
curl --request GET \
--url https://api.sunoapi.org/api/v1/mp4/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunoapi.org/api/v1/mp4/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": "988e****c8d3",
"musicId": "376c687e-d439-42c1-b1e4-bcb43b095ec2",
"musicIndex": 0,
"callbackUrl": "https://api.example.com/callback",
"completeTime": "2025-01-01 00:10:00",
"response": {
"videoUrl": "https://example.com/videos/video_847715e66259.mp4"
},
"successFlag": "SUCCESS",
"createTime": "2025-01-01 00:00:00",
"errorCode": null,
"errorMessage": null
}
}Music Video Generation
获取音乐视频详情
获取音乐视频生成任务的详细信息,包括状态和下载链接。
GET
/
api
/
v1
/
mp4
/
record-info
获取音乐视频详情
curl --request GET \
--url https://api.sunoapi.org/api/v1/mp4/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/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://api.sunoapi.org/api/v1/mp4/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunoapi.org/api/v1/mp4/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": "988e****c8d3",
"musicId": "376c687e-d439-42c1-b1e4-bcb43b095ec2",
"musicIndex": 0,
"callbackUrl": "https://api.example.com/callback",
"completeTime": "2025-01-01 00:10:00",
"response": {
"videoUrl": "https://example.com/videos/video_847715e66259.mp4"
},
"successFlag": "SUCCESS",
"createTime": "2025-01-01 00:00:00",
"errorCode": null,
"errorMessage": null
}
}状态说明
- PENDING: 任务等待处理中
- SUCCESS: 视频生成成功完成
- CREATE_TASK_FAILED: 创建视频任务失败
- GENERATE_MP4_FAILED: MP4生成失败
- CALLBACK_EXCEPTION: 回调异常
授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY
⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
查询参数
从 '创建音乐视频' 接口返回的任务ID。用于获取视频生成任务的详细信息,包括处理状态和下载URL。
响应
请求成功
状态码说明
- ✅ 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
