const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
format: 'mp3',
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true
},
suno: {
prompt: '<string>',
style: '<string>',
title: '<string>',
customMode: true,
instrumental: true,
personaId: '<string>',
model: '<string>',
negativeTags: '<string>',
vocalGender: 'm',
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,
trace_level: 'summary'
}
})
};
fetch('https://api.phaseo.app/v1/music/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));