分軌與添加音軌
curl --request POST \
--url https://toapis.com/v1/music/generations/stems \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"gpt_description": "<string>",
"custom": true,
"prompt": "<string>",
"max_mode": true
}
'import requests
url = "https://toapis.com/v1/music/generations/stems"
payload = {
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"gpt_description": "<string>",
"custom": True,
"prompt": "<string>",
"max_mode": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
task_id: '<string>',
audio_index: 123,
gpt_description: '<string>',
custom: true,
prompt: '<string>',
max_mode: true
})
};
fetch('https://toapis.com/v1/music/generations/stems', 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://toapis.com/v1/music/generations/stems",
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([
'model' => '<string>',
'task_id' => '<string>',
'audio_index' => 123,
'gpt_description' => '<string>',
'custom' => true,
'prompt' => '<string>',
'max_mode' => true
]),
CURLOPT_HTTPHEADER => [
"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://toapis.com/v1/music/generations/stems"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://toapis.com/v1/music/generations/stems")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/stems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}Suno 音樂
分軌與添加音軌
stems/stemsAll 分軌,addStem/addVocals/addInstrumental 添加音軌
POST
/
v1
/
music
/
generations
/
stems
分軌與添加音軌
curl --request POST \
--url https://toapis.com/v1/music/generations/stems \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"gpt_description": "<string>",
"custom": true,
"prompt": "<string>",
"max_mode": true
}
'import requests
url = "https://toapis.com/v1/music/generations/stems"
payload = {
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"gpt_description": "<string>",
"custom": True,
"prompt": "<string>",
"max_mode": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
task_id: '<string>',
audio_index: 123,
gpt_description: '<string>',
custom: true,
prompt: '<string>',
max_mode: true
})
};
fetch('https://toapis.com/v1/music/generations/stems', 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://toapis.com/v1/music/generations/stems",
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([
'model' => '<string>',
'task_id' => '<string>',
'audio_index' => 123,
'gpt_description' => '<string>',
'custom' => true,
'prompt' => '<string>',
'max_mode' => true
]),
CURLOPT_HTTPHEADER => [
"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://toapis.com/v1/music/generations/stems"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://toapis.com/v1/music/generations/stems")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/stems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"max_mode\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}POST https://toapis.com/v1/music/generations/{operation}
string
必填
固定
"suno"string
必填
源任務 ID
number
源曲目序號
分軌
| operation | 說明 | 價格 |
|---|---|---|
stems | 人聲 / 伴奏兩條分軌 | $0.10 |
stemsAll | 全樂器分軌(每條樂器一軌) | $0.24 |
result.music[] 中每軌一個 audio_url,已鏡像本站 CDN。
curl --request POST \
--url https://toapis.com/v1/music/generations/stemsAll \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"model":"suno","task_id":"tsk_aud_xxx"}'
添加音軌(各 0.05,Max0.10)
addVocals/addInstrumental/addStem 的 task_id 必須是 uploadTask 產物。| operation | 說明 |
|---|---|
addVocals | 為上傳素材生成人聲 |
addInstrumental | 為上傳素材生成伴奏 |
addStem | 新增一條樂器軌 |
string
目標描述(custom=false 時必填)
boolean
string
custom=true 時的歌詞
boolean
Max 檔
curl --request POST \
--url https://toapis.com/v1/music/generations/addVocals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"model":"suno","task_id":"tsk_aud_upload_task","gpt_description":"add dreamy female vocals"}'
Response
string
新任務 ID
string
submitted