From 4174ca8009c6d6c8f76d88262844935f20cc69bb Mon Sep 17 00:00:00 2001 From: blueeon Date: Sat, 8 Jun 2024 14:16:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A6=84=20refactor:=20opt=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/custom_generate/route.ts | 4 ++-- src/app/api/generate/route.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/api/custom_generate/route.ts b/src/app/api/custom_generate/route.ts index 8f1e8d3..8dc27d0 100644 --- a/src/app/api/custom_generate/route.ts +++ b/src/app/api/custom_generate/route.ts @@ -21,9 +21,9 @@ export async function POST(req: NextRequest) { } const audioInfo = await (await sunoApi).custom_generate( prompt, tags, title, - make_instrumental == true, + Boolean(make_instrumental), model || DEFAULT_MODEL, - wait_audio == true + Boolean(wait_audio) ); return new NextResponse(JSON.stringify(audioInfo), { status: 200, diff --git a/src/app/api/generate/route.ts b/src/app/api/generate/route.ts index 25592e6..5b44f47 100644 --- a/src/app/api/generate/route.ts +++ b/src/app/api/generate/route.ts @@ -22,9 +22,9 @@ export async function POST(req: NextRequest) { const audioInfo = await (await sunoApi).generate( prompt, - make_instrumental == true, + Boolean(make_instrumental), model || DEFAULT_MODEL, - wait_audio == true + Boolean(wait_audio) ); return new NextResponse(JSON.stringify(audioInfo), { From eb484dfa796b0d246124e1ecf696b5d0e68e20f3 Mon Sep 17 00:00:00 2001 From: blueeon Date: Sat, 8 Jun 2024 14:48:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=83=20docs:=20change=20domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- README_CN.md | 10 +++++----- package.json | 2 +- src/app/layout.tsx | 2 +- src/app/page.tsx | 4 ++-- src/lib/SunoApi.ts | 1 + 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 37e7fb0..b01f828 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@

English | 简体中文 - | Demo - | Docs + | Demo + | Docs | Deploy with Vercel

@@ -27,7 +27,7 @@ We discovered that some users have similar needs, so we decided to open-source t ## Demo We have deployed an example bound to a free Suno account, so it has daily usage limits, but you can see how it runs: -[suno.gcui.art](https://suno.gcui.art) +[suno.gcui.ai](https://suno.gcui.ai) ## Features @@ -109,7 +109,7 @@ it means the program is running normally. ### 5. Use Suno API You can check out the detailed API documentation at : -[suno.gcui.art/docs](https://suno.gcui.art/docs) +[suno.gcui.ai/docs](https://suno.gcui.ai/docs) ## API Reference @@ -129,7 +129,7 @@ Suno API currently mainly implements the following APIs: ``` For more detailed documentation, please check out the demo site: -[suno.gcui.art/docs](https://suno.gcui.art/docs) +[suno.gcui.ai/docs](https://suno.gcui.ai/docs) ## API Integration Code Example diff --git a/README_CN.md b/README_CN.md index 714eec5..98030b1 100644 --- a/README_CN.md +++ b/README_CN.md @@ -8,8 +8,8 @@

English | 简体中文 - | Demo - | 文档 + | Demo + | 文档 | 一键部署到 Vercel

@@ -27,7 +27,7 @@ Suno.ai v3 是一个令人惊叹的 AI 音乐服务,虽然官方还没有开 ## Demo 我们部署了一个示例,绑定了一个免费的 suno 账号,所以它每天有使用限制,但你可以看到它运行起来的样子: -[suno.gcui.art](https://suno.gcui.art) +[suno.gcui.ai](https://suno.gcui.ai) ## Features @@ -107,7 +107,7 @@ SUNO_COOKIE= ### 5. 使用 Suno API -你可以在 [suno.gcui.art](https://suno.gcui.art/docs)查看详细的 API 文档,并在线测试。 +你可以在 [suno.gcui.ai](https://suno.gcui.ai/docs)查看详细的 API 文档,并在线测试。 ## API 说明 @@ -126,7 +126,7 @@ Suno API 目前主要实现了以下 API: ``` 详细文档请查看演示站点: -[suno.gcui.art/docs](https://suno.gcui.art/docs) +[suno.gcui.ai/docs](https://suno.gcui.ai/docs) ## API 集成代码示例 diff --git a/package.json b/package.json index 955c969..a246917 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "suno-api", "description": "Use API to call the music generation service of suno.ai, and easily integrate it into agents like GPTs.", "author": { - "name": "gcui.art", + "name": "gcui.ai", "url": "https://github.com/gcui-art/" }, "license": "LGPL-3.0-or-later", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d9f49db..ff54845 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,7 +11,7 @@ export const metadata: Metadata = { title: "suno api", description: "Use API to call the music generation ai of suno.ai", keywords: ["suno", "suno api", "suno.ai", "api", "music", "generation", "ai"], - creator: "@gcui.art", + creator: "@gcui.ai", }; export default function RootLayout({ diff --git a/src/app/page.tsx b/src/app/page.tsx index 0d39d36..b945dff 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -89,7 +89,7 @@ it means the program is running normally. ### 5. Use Suno API -You can check out the detailed API documentation at [suno.gcui.art/docs](https://suno.gcui.art/docs). +You can check out the detailed API documentation at [suno.gcui.ai/docs](https://suno.gcui.ai/docs). ## 📚 API Reference @@ -111,7 +111,7 @@ Suno API currently mainly implements the following APIs: For more detailed documentation, please check out the demo site: -👉 [suno.gcui.art/docs](https://suno.gcui.art/docs) +👉 [suno.gcui.ai/docs](https://suno.gcui.ai/docs) `; return ( diff --git a/src/lib/SunoApi.ts b/src/lib/SunoApi.ts index 4d4f718..ec37731 100644 --- a/src/lib/SunoApi.ts +++ b/src/lib/SunoApi.ts @@ -312,6 +312,7 @@ class SunoApi { tags: tags, title: title }); + console.log("response:\n", response); return response.data; }