Операции с ассетами
curl --request POST \
--url https://toapis.com/v1/music/generations/persona \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"name": "<string>",
"describe": "<string>",
"audio_url": "<string>",
"audio_urls": [
{}
],
"vocal_start_s": 123,
"vocal_end_s": 123,
"styles": "<string>"
}
'import requests
url = "https://toapis.com/v1/music/generations/persona"
payload = {
"model": "<string>",
"task_id": "<string>",
"name": "<string>",
"describe": "<string>",
"audio_url": "<string>",
"audio_urls": [{}],
"vocal_start_s": 123,
"vocal_end_s": 123,
"styles": "<string>"
}
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>',
name: '<string>',
describe: '<string>',
audio_url: '<string>',
audio_urls: [{}],
vocal_start_s: 123,
vocal_end_s: 123,
styles: '<string>'
})
};
fetch('https://toapis.com/v1/music/generations/persona', 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/persona",
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>',
'name' => '<string>',
'describe' => '<string>',
'audio_url' => '<string>',
'audio_urls' => [
[
]
],
'vocal_start_s' => 123,
'vocal_end_s' => 123,
'styles' => '<string>'
]),
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/persona"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\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/persona")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/persona")
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 \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}Suno
Операции с ассетами
persona вокальная персона, createVoice клонирование, createModel обучение, vox(устар.)
POST
/
v1
/
music
/
generations
/
persona
Операции с ассетами
curl --request POST \
--url https://toapis.com/v1/music/generations/persona \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"task_id": "<string>",
"name": "<string>",
"describe": "<string>",
"audio_url": "<string>",
"audio_urls": [
{}
],
"vocal_start_s": 123,
"vocal_end_s": 123,
"styles": "<string>"
}
'import requests
url = "https://toapis.com/v1/music/generations/persona"
payload = {
"model": "<string>",
"task_id": "<string>",
"name": "<string>",
"describe": "<string>",
"audio_url": "<string>",
"audio_urls": [{}],
"vocal_start_s": 123,
"vocal_end_s": 123,
"styles": "<string>"
}
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>',
name: '<string>',
describe: '<string>',
audio_url: '<string>',
audio_urls: [{}],
vocal_start_s: 123,
vocal_end_s: 123,
styles: '<string>'
})
};
fetch('https://toapis.com/v1/music/generations/persona', 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/persona",
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>',
'name' => '<string>',
'describe' => '<string>',
'audio_url' => '<string>',
'audio_urls' => [
[
]
],
'vocal_start_s' => 123,
'vocal_end_s' => 123,
'styles' => '<string>'
]),
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/persona"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\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/persona")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"task_id\": \"<string>\",\n \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/music/generations/persona")
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 \"name\": \"<string>\",\n \"describe\": \"<string>\",\n \"audio_url\": \"<string>\",\n \"audio_urls\": [\n {}\n ],\n \"vocal_start_s\": 123,\n \"vocal_end_s\": 123,\n \"styles\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>",
"status": "<string>"
}Ассетные операции производят ID upstream-ассетов(
persona_id / voice_id / model_id), пригодные для повторного использования.
POST https://toapis.com/v1/music/generations/{operation}
string
обязательно
Фиксированное
"suno"persona — вокальная персона($0.004)
Извлекает персону из существующего трека; полученныйpersona_id используется в generation и др.
string
обязательно
ID исходной задачи
string
обязательно
Имя персоны
string
Описание(опционально)
createVoice — клонирование голоса($0.016)
string
обязательно
URL аудио — только чистый вокал; полный микс upstream отклонит
string
Имя голоса
createModel — обучение кастомной модели($0.96)
Обучение на 6-24 треках. Полученныйcustom_model_id передаётся в generation(при этом опускайте version и persona_id).
string
обязательно
Имя модели
array
обязательно
6-24 публичных URL аудио
curl --request POST \
--url https://toapis.com/v1/music/generations/createModel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"model":"suno","name":"my-voice-model","audio_urls":["https://.../a.mp3","https://.../b.mp3","..."]}'
vox — извлечение вокала($0.004, устар.)
string
обязательно
ID исходной задачи
number
Начало вокального фрагмента(сек, опц.)
number
Конец вокального фрагмента(сек, опц.)
string
Стиль(опционально)
Устарело — upstream рекомендует
persona.Response
string
ID задачи
string
submitted