Skip to content

Commit

Permalink
Merge pull request #104 from blueeon/main
Browse files Browse the repository at this point in the history
🦄 refactor: opt params
  • Loading branch information
blueeon authored Jun 8, 2024
2 parents ed7fb28 + eb484df commit f2804ad
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<p align="center">
<a target="_blank" href="./README.md">English</a>
| <a target="_blank" href="./README_CN.md">简体中文</a>
| <a target="_blank" href="https://suno.gcui.art">Demo</a>
| <a target="_blank" href="https://suno.gcui.art/docs">Docs</a>
| <a target="_blank" href="https://suno.gcui.ai">Demo</a>
| <a target="_blank" href="https://suno.gcui.ai/docs">Docs</a>
| <a target="_blank" href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fgcui-art%2Fsuno-api&env=SUNO_COOKIE&project-name=suno-api&repository-name=suno-api">Deploy with Vercel</a>
</p>
<p align="center">
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<p align="center">
<a target="_blank" href="./README.md">English</a>
| <a target="_blank" href="./README_CN.md">简体中文</a>
| <a target="_blank" href="https://suno.gcui.art">Demo</a>
| <a target="_blank" href="https://suno.gcui.art/docs">文档</a>
| <a target="_blank" href="https://suno.gcui.ai">Demo</a>
| <a target="_blank" href="https://suno.gcui.ai/docs">文档</a>
| <a target="_blank" href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fgcui-art%2Fsuno-api&env=SUNO_COOKIE&project-name=suno-api&repository-name=suno-api">一键部署到 Vercel</a>

</p>
Expand All @@ -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

Expand Down Expand Up @@ -107,7 +107,7 @@ SUNO_COOKIE=<your-cookie>

### 5. 使用 Suno API

你可以在 [suno.gcui.art](https://suno.gcui.art/docs)查看详细的 API 文档,并在线测试。
你可以在 [suno.gcui.ai](https://suno.gcui.ai/docs)查看详细的 API 文档,并在线测试。

## API 说明

Expand All @@ -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 集成代码示例

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/custom_generate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/generate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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), {
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions src/lib/SunoApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class SunoApi {
tags: tags,
title: title
});
console.log("response:\n", response);
return response.data;
}

Expand Down

0 comments on commit f2804ad

Please sign in to comment.