Generate music
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
suno: {
prompt: '<string>',
style: '<string>',
title: '<string>',
customMode: true,
instrumental: true,
personaId: '<string>',
model: '<string>',
negativeTags: '<string>',
styleWeight: 0.5,
weirdnessConstraint: 0.5,
audioWeight: 0.5,
callBackUrl: '<string>'
},
elevenlabs: {
prompt: '<string>',
composition_plan: {},
music_length_ms: 123,
model_id: '<string>',
force_instrumental: true,
store_for_inpainting: true,
with_timestamps: true,
sign_with_c2pa: true,
output_format: '<string>'
},
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
}
})
};
fetch('https://api.phaseo.ai/v1/music/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.ai/v1/music/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"suno": {
"prompt": "<string>",
"style": "<string>",
"title": "<string>",
"customMode": True,
"instrumental": True,
"personaId": "<string>",
"model": "<string>",
"negativeTags": "<string>",
"styleWeight": 0.5,
"weirdnessConstraint": 0.5,
"audioWeight": 0.5,
"callBackUrl": "<string>"
},
"elevenlabs": {
"prompt": "<string>",
"composition_plan": {},
"music_length_ms": 123,
"model_id": "<string>",
"force_instrumental": True,
"store_for_inpainting": True,
"with_timestamps": True,
"sign_with_c2pa": True,
"output_format": "<string>"
},
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.ai/v1/music/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"suno": {
"prompt": "<string>",
"style": "<string>",
"title": "<string>",
"customMode": true,
"instrumental": true,
"personaId": "<string>",
"model": "<string>",
"negativeTags": "<string>",
"styleWeight": 0.5,
"weirdnessConstraint": 0.5,
"audioWeight": 0.5,
"callBackUrl": "<string>"
},
"elevenlabs": {
"prompt": "<string>",
"composition_plan": {},
"music_length_ms": 123,
"model_id": "<string>",
"force_instrumental": true,
"store_for_inpainting": true,
"with_timestamps": true,
"sign_with_c2pa": true,
"output_format": "<string>"
},
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.ai/v1/music/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\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.phaseo.ai/v1/music/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.ai/v1/music/generate",
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>',
'prompt' => '<string>',
'duration' => 123,
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'suno' => [
'prompt' => '<string>',
'style' => '<string>',
'title' => '<string>',
'customMode' => true,
'instrumental' => true,
'personaId' => '<string>',
'model' => '<string>',
'negativeTags' => '<string>',
'styleWeight' => 0.5,
'weirdnessConstraint' => 0.5,
'audioWeight' => 0.5,
'callBackUrl' => '<string>'
],
'elevenlabs' => [
'prompt' => '<string>',
'composition_plan' => [
],
'music_length_ms' => 123,
'model_id' => '<string>',
'force_instrumental' => true,
'store_for_inpainting' => true,
'with_timestamps' => true,
'sign_with_c2pa' => true,
'output_format' => '<string>'
],
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.ai/v1/music/generate")
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 \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\n}"
response = http.request(request)
puts response.read_body{}Music
Music Generation (Beta)
Generates music using the requested model and provider settings.
POST
/
music
/
generate
Generate music
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
},
suno: {
prompt: '<string>',
style: '<string>',
title: '<string>',
customMode: true,
instrumental: true,
personaId: '<string>',
model: '<string>',
negativeTags: '<string>',
styleWeight: 0.5,
weirdnessConstraint: 0.5,
audioWeight: 0.5,
callBackUrl: '<string>'
},
elevenlabs: {
prompt: '<string>',
composition_plan: {},
music_length_ms: 123,
model_id: '<string>',
force_instrumental: true,
store_for_inpainting: true,
with_timestamps: true,
sign_with_c2pa: true,
output_format: '<string>'
},
echo_upstream_request: true,
debug: {
enabled: true,
return_upstream_request: true,
return_upstream_response: true,
trace: true
}
})
};
fetch('https://api.phaseo.ai/v1/music/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.ai/v1/music/generate"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"suno": {
"prompt": "<string>",
"style": "<string>",
"title": "<string>",
"customMode": True,
"instrumental": True,
"personaId": "<string>",
"model": "<string>",
"negativeTags": "<string>",
"styleWeight": 0.5,
"weirdnessConstraint": 0.5,
"audioWeight": 0.5,
"callBackUrl": "<string>"
},
"elevenlabs": {
"prompt": "<string>",
"composition_plan": {},
"music_length_ms": 123,
"model_id": "<string>",
"force_instrumental": True,
"store_for_inpainting": True,
"with_timestamps": True,
"sign_with_c2pa": True,
"output_format": "<string>"
},
"echo_upstream_request": True,
"debug": {
"enabled": True,
"return_upstream_request": True,
"return_upstream_response": True,
"trace": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.ai/v1/music/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
},
"suno": {
"prompt": "<string>",
"style": "<string>",
"title": "<string>",
"customMode": true,
"instrumental": true,
"personaId": "<string>",
"model": "<string>",
"negativeTags": "<string>",
"styleWeight": 0.5,
"weirdnessConstraint": 0.5,
"audioWeight": 0.5,
"callBackUrl": "<string>"
},
"elevenlabs": {
"prompt": "<string>",
"composition_plan": {},
"music_length_ms": 123,
"model_id": "<string>",
"force_instrumental": true,
"store_for_inpainting": true,
"with_timestamps": true,
"sign_with_c2pa": true,
"output_format": "<string>"
},
"echo_upstream_request": true,
"debug": {
"enabled": true,
"return_upstream_request": true,
"return_upstream_response": true,
"trace": true
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.ai/v1/music/generate"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\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.phaseo.ai/v1/music/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.ai/v1/music/generate",
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>',
'prompt' => '<string>',
'duration' => 123,
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
],
'suno' => [
'prompt' => '<string>',
'style' => '<string>',
'title' => '<string>',
'customMode' => true,
'instrumental' => true,
'personaId' => '<string>',
'model' => '<string>',
'negativeTags' => '<string>',
'styleWeight' => 0.5,
'weirdnessConstraint' => 0.5,
'audioWeight' => 0.5,
'callBackUrl' => '<string>'
],
'elevenlabs' => [
'prompt' => '<string>',
'composition_plan' => [
],
'music_length_ms' => 123,
'model_id' => '<string>',
'force_instrumental' => true,
'store_for_inpainting' => true,
'with_timestamps' => true,
'sign_with_c2pa' => true,
'output_format' => '<string>'
],
'echo_upstream_request' => true,
'debug' => [
'enabled' => true,
'return_upstream_request' => true,
'return_upstream_response' => true,
'trace' => true
]
]),
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;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.ai/v1/music/generate")
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 \"prompt\": \"<string>\",\n \"duration\": 123,\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n },\n \"suno\": {\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"title\": \"<string>\",\n \"customMode\": true,\n \"instrumental\": true,\n \"personaId\": \"<string>\",\n \"model\": \"<string>\",\n \"negativeTags\": \"<string>\",\n \"styleWeight\": 0.5,\n \"weirdnessConstraint\": 0.5,\n \"audioWeight\": 0.5,\n \"callBackUrl\": \"<string>\"\n },\n \"elevenlabs\": {\n \"prompt\": \"<string>\",\n \"composition_plan\": {},\n \"music_length_ms\": 123,\n \"model_id\": \"<string>\",\n \"force_instrumental\": true,\n \"store_for_inpainting\": true,\n \"with_timestamps\": true,\n \"sign_with_c2pa\": true,\n \"output_format\": \"<string>\"\n },\n \"echo_upstream_request\": true,\n \"debug\": {\n \"enabled\": true,\n \"return_upstream_request\": true,\n \"return_upstream_response\": true,\n \"trace\": true\n }\n}"
response = http.request(request)
puts response.read_body{}Creates an asynchronous music generation job.
Poll completion with
The public music routes are currently mounted but temporarily disabled, so requests currently return
501 not_implemented.GET /music/generate/{music_id}.
Request Shape
{
"model": "suno/v4.5plus",
"prompt": "Warm jazz trio with brushed drums",
"duration": 8,
"provider": { "only": ["suno"] },
"suno": {
"customMode": false,
"instrumental": false
}
}
Suno Options
suno.customMode(boolean, defaultfalse)suno.instrumental(boolean, defaultfalse)suno.prompt(optional override for top-levelprompt)suno.style,suno.title(required whencustomMode = true)suno.personaId,suno.personaModelsuno.negativeTags,suno.vocalGendersuno.styleWeight,suno.weirdnessConstraint,suno.audioWeight
Validation Rules
- When
customMode = false,promptis required. - When
customMode = true, bothstyleandtitleare required. - When
customMode = trueandinstrumental = false,promptis required.
400 with:
{
"error": "validation_error",
"reason": "..."
}
Response
{
"id": "task_123",
"object": "music",
"status": "in_progress",
"provider": "suno",
"model": "V4_5PLUS",
"nativeResponseId": "task_123",
"usage": {
"requests": 1
}
}
usage can include output_audio_seconds when duration is provided and pricing is computed against seconds.Authorizations
Bearer token authentication
Body
application/json
Available options:
mp3, wav, ogg, aac Provider routing preferences for gateway selection.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Gateway debug controls. These flags are never forwarded upstream.
Show child attributes
Show child attributes
Response
200 - application/json
Music generation response
The response is of type object.
Last modified on May 19, 2026
Was this page helpful?
⌘I