依 ID 查詢音樂任務
curl --request GET \
--url https://api.aiid.edu.kg/suno/fetch/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/suno/fetch/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiid.edu.kg/suno/fetch/{task_id}', 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.aiid.edu.kg/suno/fetch/{task_id}",
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.aiid.edu.kg/suno/fetch/{task_id}"
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.aiid.edu.kg/suno/fetch/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/suno/fetch/{task_id}")
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": "success",
"message": "",
"data": {
"task_id": "task_xxx",
"platform": "suno",
"action": "MUSIC",
"status": "SUCCESS",
"progress": "100%",
"result_url": "https://example.com/audio.mp3",
"properties": {
"upstream_model_name": "suno_music",
"origin_model_name": "suno-v5.5"
},
"data": [
{
"id": "clip_xxx",
"title": "夏日海风",
"audio_url": "https://example.com/audio.mp3",
"image_url": "https://example.com/cover.jpg",
"model_name": "suno-v5.5",
"metadata": {
"duration": 180,
"prompt": "轻快电子流行,夏日海边,女声 旋律"
}
}
]
}
}音樂生成任務格式
依 ID 查詢音樂任務
透過 path task_id 查詢音樂生成任務。
音樂生成任務查詢介面。建立介面返回的 data 即任務 ID,透過 GET /suno/fetch/{task_id} 查詢單個任務。
查詢方式
GET /suno/fetch/task_xxx
查詢輸出
外層保持 new-api 任務結構:
code:成功時為success。message:錯誤或提示資訊。data.task_id:任務 ID。data.status:任務狀態,常見值NOT_START、SUBMITTED、QUEUED、IN_PROGRESS、SUCCESS、FAILURE。data.progress:任務進度。data.result_url:成功後可用的結果位址,若上游返回多首歌曲,以data.data內片段為準。data.data:上游音樂結果原始資料,通常包含歌曲片段陣列或物件。
成功態範例:
{
"code": "success",
"message": "",
"data": {
"task_id": "task_xxx",
"platform": "suno",
"action": "MUSIC",
"status": "SUCCESS",
"progress": "100%",
"result_url": "https://example.com/audio.mp3",
"properties": {
"upstream_model_name": "suno_music",
"origin_model_name": "suno-v5.5"
},
"data": [
{
"id": "clip_xxx",
"title": "夏日海风",
"audio_url": "https://example.com/audio.mp3",
"image_url": "https://example.com/cover.jpg",
"model_name": "suno-v5.5",
"metadata": {
"duration": 180,
"prompt": "轻快电子流行,夏日海边,女声 旋律"
}
}
]
}
}
GET
/
suno
/
fetch
/
{task_id}
依 ID 查詢音樂任務
curl --request GET \
--url https://api.aiid.edu.kg/suno/fetch/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aiid.edu.kg/suno/fetch/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aiid.edu.kg/suno/fetch/{task_id}', 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.aiid.edu.kg/suno/fetch/{task_id}",
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.aiid.edu.kg/suno/fetch/{task_id}"
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.aiid.edu.kg/suno/fetch/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiid.edu.kg/suno/fetch/{task_id}")
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": "success",
"message": "",
"data": {
"task_id": "task_xxx",
"platform": "suno",
"action": "MUSIC",
"status": "SUCCESS",
"progress": "100%",
"result_url": "https://example.com/audio.mp3",
"properties": {
"upstream_model_name": "suno_music",
"origin_model_name": "suno-v5.5"
},
"data": [
{
"id": "clip_xxx",
"title": "夏日海风",
"audio_url": "https://example.com/audio.mp3",
"image_url": "https://example.com/cover.jpg",
"model_name": "suno-v5.5",
"metadata": {
"duration": 180,
"prompt": "轻快电子流行,夏日海边,女声 旋律"
}
}
]
}
}授權
使用 Bearer Token 認證。
格式: Authorization: Bearer sk-xxxxxx
路徑參數
提交音樂任務後返回的任務 ID。
範例:
"task_xxx"
