編集と変換
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>"
}編集・変換系操作はすべて既存タスクをソースにします:
POST https://toapis.com/v1/music/generations/{operation}
string
必須
固定
"suno"string
必須
元タスク ID(
tsk_aud_)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 産物のセグメントを 1 曲に結合。
string
必須
extend 元タスク IDResponse
string
新タスク ID
string
submitted