Implemented feature request issue #132

https://github.com/gcui-art/suno-api/issues/132
This commit is contained in:
Maxim Karpovich 2024-07-14 19:01:25 +02:00
parent 75dd490171
commit b4860a23dc
2 changed files with 0 additions and 19 deletions

View File

@ -10,15 +10,6 @@ export async function POST(req: NextRequest) {
try { try {
const body = await req.json(); const body = await req.json();
const { prompt, tags, title, make_instrumental, model, wait_audio } = body; const { prompt, tags, title, make_instrumental, model, wait_audio } = body;
if (!prompt || !tags || !title) {
return new NextResponse(JSON.stringify({ error: 'Prompt, tags, and title are required' }), {
status: 400,
headers: {
'Content-Type': 'application/json',
...corsHeaders
}
});
}
const audioInfo = await (await sunoApi).custom_generate( const audioInfo = await (await sunoApi).custom_generate(
prompt, tags, title, prompt, tags, title,
Boolean(make_instrumental), Boolean(make_instrumental),

View File

@ -10,16 +10,6 @@ export async function POST(req: NextRequest) {
const body = await req.json(); const body = await req.json();
const { prompt } = body; const { prompt } = body;
if (!prompt) {
return new NextResponse(JSON.stringify({ error: 'Prompt is required' }), {
status: 400,
headers: {
'Content-Type': 'application/json',
...corsHeaders
}
});
}
const lyrics = await (await sunoApi).generateLyrics(prompt); const lyrics = await (await sunoApi).generateLyrics(prompt);
return new NextResponse(JSON.stringify(lyrics), { return new NextResponse(JSON.stringify(lyrics), {