Suno Custom Model
curl --request POST \
--url https://api.snapgen.org/v1/music/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"name": "<string>",
"audio_urls": [
"<string>"
],
"webhook": "<string>",
"webhook_secret": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/music/generations"
payload = {
"model": "<string>",
"name": "<string>",
"audio_urls": ["<string>"],
"webhook": "<string>",
"webhook_secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
name: '<string>',
audio_urls: ['<string>'],
webhook: '<string>',
webhook_secret: '<string>'
})
};
fetch('https://api.snapgen.org/v1/music/generations', 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.snapgen.org/v1/music/generations",
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>',
'name' => '<string>',
'audio_urls' => [
'<string>'
],
'webhook' => '<string>',
'webhook_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.snapgen.org/v1/music/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.snapgen.org/v1/music/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/music/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpload
Suno Custom Model
Train a custom Suno model on 6 to 24 reference tracks. $1.44 per request.
POST
/
v1
/
music
/
generations
Suno Custom Model
curl --request POST \
--url https://api.snapgen.org/v1/music/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"name": "<string>",
"audio_urls": [
"<string>"
],
"webhook": "<string>",
"webhook_secret": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/music/generations"
payload = {
"model": "<string>",
"name": "<string>",
"audio_urls": ["<string>"],
"webhook": "<string>",
"webhook_secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
name: '<string>',
audio_urls: ['<string>'],
webhook: '<string>',
webhook_secret: '<string>'
})
};
fetch('https://api.snapgen.org/v1/music/generations', 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.snapgen.org/v1/music/generations",
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>',
'name' => '<string>',
'audio_urls' => [
'<string>'
],
'webhook' => '<string>',
'webhook_secret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.snapgen.org/v1/music/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.snapgen.org/v1/music/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/music/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"name\": \"<string>\",\n \"audio_urls\": [\n \"<string>\"\n ],\n \"webhook\": \"<string>\",\n \"webhook_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodysuno-custom-model trains a custom Suno model on 6 to 24 of your reference tracks. Later generations can use it through custom_model_task_id.
| Property | Value |
|---|---|
| Model ID | suno-custom-model |
| Endpoint | POST /v1/music/generations (asynchronous task) |
| Group | Suno > Upload |
| Input | A name and 6 to 24 public audio URLs |
| Result | A custom model in result.custom_model |
| Price | $1.44 per request (144 credits) |
string
required
Set to
suno-custom-model.string
required
Name of the custom model, up to 100 characters.
string[]
required
6 to 24 public
http or https audio URLs to learn from, without repeats. MP3, WAV, and M4A work best; one unreadable file can fail the whole task.string
Optional public
https URL that receives one signed event when the task finishes. See Task webhooks.string
Required with
webhook: 16 to 256 characters, used to sign the delivery.Request
curl https://api.snapgen.org/v1/music/generations \
-H "Authorization: Bearer $SNAPGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-custom-model",
"name": "Warm folk",
"audio_urls": [
"https://example.com/ref-01.mp3",
"https://example.com/ref-02.mp3",
"https://example.com/ref-03.mp3",
"https://example.com/ref-04.mp3",
"https://example.com/ref-05.mp3",
"https://example.com/ref-06.mp3"
]
}'
202 with a task object and a Location: /v1/tasks/{id} header. Poll GET /v1/tasks/{id} every 10 to 20 seconds until status is succeeded or failed.
Result
result.custom_model holds the model id and name. To generate with the model, pass this task’s id as custom_model_task_id; you never send the model id itself.
{
"urls": [],
"custom_model": {
"id": "b7c1e2d4-5f60-4a8b-9c0d-1e2f3a4b5c6d",
"name": "Warm folk"
}
}
Use it in later requests
Pass this task’sid as custom_model_task_id to any of these models: suno-music, suno-inspo, suno-upload-cover, suno-upload-extend, suno-extend, suno-cover, suno-add-vocals, suno-add-instrumental, suno-add-stem, suno-replace-section, suno-mashup, suno-sample. Omit version when you send it.
See Music generation tasks for the task lifecycle, result fields, webhooks, and errors.