获取 MIDI 生成详情
curl --request GET \
--url https://api.sunoapi.org/api/v1/midi/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sunoapi.org/api/v1/midi/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/midi/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/midi/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/midi/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/midi/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunoapi.org/api/v1/midi/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",
"recordTaskId": -1,
"audioId": "e231****-****-****-****-****8cadc7dc",
"callbackUrl": "https://example.callback",
"completeTime": 1760335255000,
"midiData": {
"state": "complete",
"instruments": [
{
"name": "Drums",
"notes": [
{
"pitch": 73,
"start": 0.036458333333333336,
"end": 0.18229166666666666,
"velocity": 1
},
{
"pitch": 61,
"start": 0.046875,
"end": 0.19270833333333334,
"velocity": 1
}
]
},
{
"name": "Electric Bass (finger)",
"notes": [
{
"pitch": 44,
"start": 7.6875,
"end": 7.911458333333333,
"velocity": 1
}
]
}
]
},
"successFlag": 1,
"createTime": 1760335251000,
"errorCode": null,
"errorMessage": null
}
}Vocal Removal
获取 MIDI 生成详情
检索 MIDI 生成任务的详细信息,包括所有检测到的乐器的完整音符数据。
GET
/
api
/
v1
/
midi
/
record-info
获取 MIDI 生成详情
curl --request GET \
--url https://api.sunoapi.org/api/v1/midi/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sunoapi.org/api/v1/midi/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/midi/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/midi/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/midi/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/midi/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunoapi.org/api/v1/midi/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",
"recordTaskId": -1,
"audioId": "e231****-****-****-****-****8cadc7dc",
"callbackUrl": "https://example.callback",
"completeTime": 1760335255000,
"midiData": {
"state": "complete",
"instruments": [
{
"name": "Drums",
"notes": [
{
"pitch": 73,
"start": 0.036458333333333336,
"end": 0.18229166666666666,
"velocity": 1
},
{
"pitch": 61,
"start": 0.046875,
"end": 0.19270833333333334,
"velocity": 1
}
]
},
{
"name": "Electric Bass (finger)",
"notes": [
{
"pitch": 44,
"start": 7.6875,
"end": 7.911458333333333,
"velocity": 1
}
]
}
]
},
"successFlag": 1,
"createTime": 1760335251000,
"errorCode": null,
"errorMessage": null
}
}使用指南
- 使用此接口检查 MIDI 生成任务的状态
- 处理完成后访问完整的 MIDI 音符数据
- 检索详细的乐器和音符信息
- 跟踪处理进度和可能发生的任何错误
查询参数
| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskId | string | 是 | MIDI 生成请求返回的任务 ID |
开发者注意事项
midiData字段包含完整的 MIDI 数据,是包含乐器 and 音符的结构化对象- MIDI 数据包含所有检测到的乐器,每个音符都有音高、时间和力度信息
- MIDI 生成记录保留 14 天
- 重要提醒: 当使用 人声分离 接口的
type: split_stem参数时,midiData可能为空
授权
🔑 API 认证说明
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key
- 访问 API Key 管理页面 获取您的 API Key
使用方式
在请求头中添加:
Authorization: Bearer YOUR_API_KEY⚠️ 注意:
- 请妥善保管您的 API Key,不要泄露给他人
- 如果怀疑 API Key 泄露,请立即在管理页面重置
查询参数
MIDI 生成请求返回的任务 ID
⌘I
