剪辑与改造
curl --request POST \
--url https://toapis.com/v1/music/generations/crop \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"speed": 123,
"keep_pitch": true,
"start_s": 123,
"end_s": 123,
"infill_lyrics": "<string>",
"max_mode": true,
"gpt_description": "<string>",
"custom": true,
"prompt": "<string>",
"style": "<string>",
"variation_category": "<string>",
"task_ids": [
{}
],
"audio_indexes": [
{}
]
}
'import requests
url = "https://toapis.com/v1/music/generations/crop"
payload = {
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"speed": 123,
"keep_pitch": True,
"start_s": 123,
"end_s": 123,
"infill_lyrics": "<string>",
"max_mode": True,
"gpt_description": "<string>",
"custom": True,
"prompt": "<string>",
"style": "<string>",
"variation_category": "<string>",
"task_ids": [{}],
"audio_indexes": [{}]
}
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,
speed: 123,
keep_pitch: true,
start_s: 123,
end_s: 123,
infill_lyrics: '<string>',
max_mode: true,
gpt_description: '<string>',
custom: true,
prompt: '<string>',
style: '<string>',
variation_category: '<string>',
task_ids: [{}],
audio_indexes: [{}]
})
};
fetch('https://toapis.com/v1/music/generations/crop', 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/crop",
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,
'speed' => 123,
'keep_pitch' => true,
'start_s' => 123,
'end_s' => 123,
'infill_lyrics' => '<string>',
'max_mode' => true,
'gpt_description' => '<string>',
'custom' => true,
'prompt' => '<string>',
'style' => '<string>',
'variation_category' => '<string>',
'task_ids' => [
[
]
],
'audio_indexes' => [
[
]
]
]),
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/crop"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\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/crop")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/crop")
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 \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}Suno 音乐
剪辑与改造
crop/removeSection/fadeIn/fadeOut/adjustSpeed/replaceMusic/sample/mashup/concat/coverSong/remaster
POST
/
v1
/
music
/
generations
/
crop
剪辑与改造
curl --request POST \
--url https://toapis.com/v1/music/generations/crop \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"speed": 123,
"keep_pitch": true,
"start_s": 123,
"end_s": 123,
"infill_lyrics": "<string>",
"max_mode": true,
"gpt_description": "<string>",
"custom": true,
"prompt": "<string>",
"style": "<string>",
"variation_category": "<string>",
"task_ids": [
{}
],
"audio_indexes": [
{}
]
}
'import requests
url = "https://toapis.com/v1/music/generations/crop"
payload = {
"model": "<string>",
"task_id": "<string>",
"audio_index": 123,
"speed": 123,
"keep_pitch": True,
"start_s": 123,
"end_s": 123,
"infill_lyrics": "<string>",
"max_mode": True,
"gpt_description": "<string>",
"custom": True,
"prompt": "<string>",
"style": "<string>",
"variation_category": "<string>",
"task_ids": [{}],
"audio_indexes": [{}]
}
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,
speed: 123,
keep_pitch: true,
start_s: 123,
end_s: 123,
infill_lyrics: '<string>',
max_mode: true,
gpt_description: '<string>',
custom: true,
prompt: '<string>',
style: '<string>',
variation_category: '<string>',
task_ids: [{}],
audio_indexes: [{}]
})
};
fetch('https://toapis.com/v1/music/generations/crop', 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/crop",
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,
'speed' => 123,
'keep_pitch' => true,
'start_s' => 123,
'end_s' => 123,
'infill_lyrics' => '<string>',
'max_mode' => true,
'gpt_description' => '<string>',
'custom' => true,
'prompt' => '<string>',
'style' => '<string>',
'variation_category' => '<string>',
'task_ids' => [
[
]
],
'audio_indexes' => [
[
]
]
]),
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/crop"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\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/crop")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"audio_index\": 123,\n \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/crop")
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 \"speed\": 123,\n \"keep_pitch\": true,\n \"start_s\": 123,\n \"end_s\": 123,\n \"infill_lyrics\": \"<string>\",\n \"max_mode\": true,\n \"gpt_description\": \"<string>\",\n \"custom\": true,\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"variation_category\": \"<string>\",\n \"task_ids\": [\n {}\n ],\n \"audio_indexes\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}国内用户请注意: 中国大陆用户请使用
https://toapis.cn 作为接口地址(Base URL)。POST https://toapis.com/v1/music/generations/{operation}
string
必填
固定
"suno"string
必填
源任务 ID(本平台
tsk_aud_ ID)number
源曲目序号
时间段剪辑($0.008 / 次)
| operation | 说明 | 额外必填 |
|---|---|---|
crop | 截取时间段保留 | start_s、end_s |
removeSection | 删除时间段 | start_s、end_s |
curl --request POST \
--url https://toapis.com/v1/music/generations/crop \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"model":"suno","task_id":"tsk_aud_xxx","audio_index":1,"start_s":10,"end_s":40}'
淡入淡出($0.008 / 次)
| operation | 说明 | 额外必填 |
|---|---|---|
fadeIn | 开头淡入 | duration_s |
fadeOut | 结尾淡出 | duration_s |
adjustSpeed — 变速($0.024)
number
必填
速度倍率,如
0.8 / 1.25boolean
变速时保持音调
换写与重制
replaceMusic — 片段换写(0.05,Max0.10)
number
必填
换写起点(秒)
number
必填
换写终点(秒)
string
该片段的新歌词
boolean
Max 档(本操作无
custom,直接生效)sample — 采样重编排(0.05,Max0.10)
task_id 必须是 uploadTask 产物,其他源会被拒绝。number
必填
采样起点(秒)
number
必填
采样终点(秒)
string
重编排描述(custom=false 时必填)
coverSong — 翻唱(0.05,Max0.10)
string
目标风格描述(custom=false 时必填)
boolean
string
custom=true 时的歌词
string
目标风格
remaster — 音质重制($0.05)
string
重制取向(可选)
mashup — 混编(0.05,Max0.10)
array
必填
恰好 2 个源任务 ID
array
各源任务的曲目序号
string
混编风格描述(custom=false 时必填)
curl --request POST \
--url https://toapis.com/v1/music/generations/mashup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"model":"suno","task_ids":["tsk_aud_aaa","tsk_aud_bbb"],"gpt_description":"blend into seamless lo-fi"}'
concat — 拼接($0.004)
拼接extend 产生的分段为完整曲目。
string
必填
extend 源任务 IDResponse
string
新任务 ID
string
submitted