[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73784":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":14,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},73784,"suno-api","gcui-art\u002Fsuno-api","gcui-art","Use API to call the music generation AI of suno.ai, and easily integrate it into agents like GPTs.","https:\u002F\u002Fsuno.gcui.ai",null,"TypeScript",2994,831,51,100,0,17,27,89,103.16,"GNU Lesser General Public License v3.0",false,"main",[25,26,27,28,29,30],"ai","music","suno","suno-ai","suno-ai-api","typescript","2026-06-12 04:01:11","\u003Cdiv align=\"center\">\n  \u003Ch1 align=\"center\">\n      Suno AI API\n  \u003C\u002Fh1>\n  \u003Cp>Use API to call the music generation AI of Suno.ai and easily integrate it into agents like GPTs.\u003C\u002Fp>\n  \u003Cp>👉 We update quickly, please star.\u003C\u002Fp>\n\u003C\u002Fdiv>\n\u003Cp align=\"center\">\n  \u003Ca target=\"_blank\" href=\".\u002FREADME.md\">English\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\".\u002FREADME_CN.md\">简体中文\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\".\u002FREADME_RU.md\">русский\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\"https:\u002F\u002Fsuno.gcui.ai\">Demo\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\"https:\u002F\u002Fsuno.gcui.ai\u002Fdocs\">Docs\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\"https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fgcui-art%2Fsuno-api&env=SUNO_COOKIE,TWOCAPTCHA_KEY,BROWSER,BROWSER_GHOST_CURSOR,BROWSER_LOCALE,BROWSER_HEADLESS&project-name=suno-api&repository-name=suno-api\">Deploy with Vercel\u003C\u002Fa> \n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.producthunt.com\u002Fproducts\u002Fgcui-art-suno-api-open-source-sunoai-api\u002Freviews?utm_source=badge-product_review&utm_medium=badge&utm_souce=badge-gcui&#0045;art&#0045;suno&#0045;api&#0045;open&#0045;source&#0045;sunoai&#0045;api\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fapi.producthunt.com\u002Fwidgets\u002Fembed-image\u002Fv1\u002Fproduct_review.svg?product_id=577408&theme=light\" alt=\"gcui&#0045;art&#0047;suno&#0045;api&#0058;Open&#0045;source&#0032;SunoAI&#0032;API - Use&#0032;API&#0032;to&#0032;call&#0032;the&#0032;music&#0032;generation&#0032;AI&#0032;of&#0032;suno&#0046;ai&#0046; | Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n> 🔥 Check out my new project: [Linkly-ai-cli: A document search engine CLI, built for AI Agents.](https:\u002F\u002Fgithub.com\u002FLinklyAI\u002Flinkly-ai-cli)\n\n![suno-api banner](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fblob\u002Fmain\u002Fpublic\u002Fsuno-banner.png)\n\n## Introduction\n\nSuno is an amazing AI music service. Although the official API is not yet available, we couldn't wait to integrate its capabilities somewhere.\n\nWe discovered that some users have similar needs, so we decided to open-source this project, hoping you'll like it.\n\nThis implementation uses the paid [2Captcha](https:\u002F\u002F2captcha.com\u002Fabout) service (a.k.a. ruCaptcha) to solve the hCaptcha challenges automatically and does not use any already made closed-source paid Suno API implementations.\n\n## Demo\n\nWe have deployed an example bound to a free Suno account, so it has daily usage limits, but you can see how it runs:\n[suno.gcui.ai](https:\u002F\u002Fsuno.gcui.ai)\n\n## Features\n\n- Perfectly implements the creation API from suno.ai.\n- Automatically keep the account active.\n- Solve CAPTCHAs automatically using [2Captcha](https:\u002F\u002F2captcha.com) and [Playwright](https:\u002F\u002Fplaywright.dev) with [rebrowser-patches](https:\u002F\u002Fgithub.com\u002Frebrowser\u002Frebrowser-patches).\n- Compatible with the format of OpenAI’s `\u002Fv1\u002Fchat\u002Fcompletions` API.\n- Supports Custom Mode.\n- One-click deployment to [Vercel](#deploy-to-vercel) & [Docker](#docker).\n- In addition to the standard API, it also adapts to the API Schema of Agent platforms like GPTs and Coze, so you can use it as a tool\u002Fplugin\u002FAction for LLMs and integrate it into any AI Agent.\n- Permissive open-source license, allowing you to freely integrate and modify.\n\n## Getting Started\n\n### 1. Obtain the cookie of your Suno account\n\n1. Head over to [suno.com\u002Fcreate](https:\u002F\u002Fsuno.com\u002Fcreate) using your browser.\n2. Open up the browser console: hit `F12` or access the `Developer Tools`.\n3. Navigate to the `Network` tab.\n4. Give the page a quick refresh.\n5. Identify the latest request that includes the keyword `?__clerk_api_version`.\n6. Click on it and switch over to the `Header` tab.\n7. Locate the `Cookie` section, hover your mouse over it, and copy the value of the Cookie.\n\n![get cookie](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fblob\u002Fmain\u002Fpublic\u002Fget-cookie-demo.gif)\n\n### 2. Register on 2Captcha and top up your balance\n[2Captcha](https:\u002F\u002F2captcha.com\u002Fabout) is a paid CAPTCHA solving service that uses real workers to solve the CAPTCHA and has high accuracy. It is needed because of Suno constantly requesting hCaptcha solving that currently isn't possible for free by any means.\n\n[Create](https:\u002F\u002F2captcha.com\u002Fauth\u002Fregister?userType=customer) a new 2Captcha account, [top up](https:\u002F\u002F2captcha.com\u002Fpay) your balance and [get your API key](https:\u002F\u002F2captcha.com\u002Fenterpage#recognition).\n\n> [!NOTE]\n> If you are located in Russia or Belarus, use the [ruCaptcha](https:\u002F\u002Frucaptcha.com) interface instead of 2Captcha. It's the same service, but it supports payments from those countries.\n\n> [!TIP]\n> If you want as few CAPTCHAs as possible, it is recommended to use a macOS system. macOS systems usually get fewer CAPTCHAs than Linux and Windows—this is due to its unpopularity in the web scraping industry. Running suno-api on Windows and Linux will work, but in some cases, you could get a pretty large number of CAPTCHAs.\n\n### 3. Clone and deploy this project\n\nYou can choose your preferred deployment method:\n\n#### Deploy to Vercel\n\n[![Deploy with Vercel](https:\u002F\u002Fvercel.com\u002Fbutton)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fgcui-art%2Fsuno-api&env=SUNO_COOKIE,TWOCAPTCHA_KEY,BROWSER,BROWSER_GHOST_CURSOR,BROWSER_LOCALE,BROWSER_HEADLESS&project-name=suno-api&repository-name=suno-api)\n\n#### Run locally\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api.git\ncd suno-api\nnpm install\n```\n#### Docker\n>[!IMPORTANT]\n> GPU acceleration will be disabled in Docker. If you have a slow CPU, it is recommended to [deploy locally](#run-locally).\n\nAlternatively, you can use [Docker Compose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002F). However, follow the step below before running.\n\n```bash\ndocker compose build && docker compose up\n```\n\n### 4. Configure suno-api\n\n- If deployed to Vercel, please add the environment variables in the Vercel dashboard.\n\n- If you’re running this locally, be sure to add the following to your `.env` file:\n#### Environment variables\n- `SUNO_COOKIE` — the `Cookie` header you obtained in the first step.\n- `TWOCAPTCHA_KEY` — your 2Captcha API key from the second step.\n- `BROWSER` — the name of the browser that is going to be used to solve the CAPTCHA. Only `chromium` and `firefox` supported.\n- `BROWSER_GHOST_CURSOR` — use ghost-cursor-playwright to simulate smooth mouse movements. Please note that it doesn't seem to make any difference in the rate of CAPTCHAs, so you can set it to `false`. Retained for future testing.\n- `BROWSER_LOCALE` — the language of the browser. Using either `en` or `ru` is recommended, since those have the most workers on 2Captcha. [List of supported languages](https:\u002F\u002F2captcha.com\u002F2captcha-api#language)\n- `BROWSER_HEADLESS` — run the browser without the window. You probably want to set this to `true`.\n```bash\nSUNO_COOKIE=\u003C…>\nTWOCAPTCHA_KEY=\u003C…>\nBROWSER=chromium\nBROWSER_GHOST_CURSOR=false\nBROWSER_LOCALE=en\nBROWSER_HEADLESS=true\n```\n\n### 5. Run suno-api\n\n- If you’ve deployed to Vercel:\n  - Please click on Deploy in the Vercel dashboard and wait for the deployment to be successful.\n  - Visit the `https:\u002F\u002F\u003Cvercel-assigned-domain>\u002Fapi\u002Fget_limit` API for testing.\n- If running locally:\n  - Run `npm run dev`.\n  - Visit the `http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fget_limit` API for testing.\n- If the following result is returned:\n\n```json\n{\n  \"credits_left\": 50,\n  \"period\": \"day\",\n  \"monthly_limit\": 50,\n  \"monthly_usage\": 50\n}\n```\n\nit means the program is running normally.\n\n### 6. Use Suno API\n\nYou can check out the detailed API documentation at :\n[suno.gcui.ai\u002Fdocs](https:\u002F\u002Fsuno.gcui.ai\u002Fdocs)\n\n## API Reference\n\nSuno API currently mainly implements the following APIs:\n\n```bash\n- `\u002Fapi\u002Fgenerate`: Generate music\n- `\u002Fv1\u002Fchat\u002Fcompletions`: Generate music - Call the generate API in a format that works with OpenAI’s API.\n- `\u002Fapi\u002Fcustom_generate`: Generate music (Custom Mode, support setting lyrics, music style, title, etc.)\n- `\u002Fapi\u002Fgenerate_lyrics`: Generate lyrics based on prompt\n- `\u002Fapi\u002Fget`: Get music information based on the id. Use “,” to separate multiple ids.\n    If no IDs are provided, all music will be returned.\n- `\u002Fapi\u002Fget_limit`: Get quota Info\n- `\u002Fapi\u002Fextend_audio`: Extend audio length\n- `\u002Fapi\u002Fgenerate_stems`: Make stem tracks (separate audio and music track)\n- `\u002Fapi\u002Fget_aligned_lyrics`: Get list of timestamps for each word in the lyrics\n- `\u002Fapi\u002Fclip`: Get clip information based on ID passed as query parameter `id`\n- `\u002Fapi\u002Fconcat`: Generate the whole song from extensions\n```\n\nYou can also specify the cookies in the `Cookie` header of your request, overriding the default cookies in the `SUNO_COOKIE` environment variable. This comes in handy when, for example, you want to use multiple free accounts at the same time.\n\nFor more detailed documentation, please check out the demo site:\n[suno.gcui.ai\u002Fdocs](https:\u002F\u002Fsuno.gcui.ai\u002Fdocs)\n\n## API Integration Code Examples\n\n### Python\n\n```python\nimport time\nimport requests\n\n# replace with your suno-api URL\nbase_url = 'http:\u002F\u002Flocalhost:3000'\n\n\ndef custom_generate_audio(payload):\n    url = f\"{base_url}\u002Fapi\u002Fcustom_generate\"\n    response = requests.post(url, json=payload, headers={'Content-Type': 'application\u002Fjson'})\n    return response.json()\n\n\ndef extend_audio(payload):\n    url = f\"{base_url}\u002Fapi\u002Fextend_audio\"\n    response = requests.post(url, json=payload, headers={'Content-Type': 'application\u002Fjson'})\n    return response.json()\n\ndef generate_audio_by_prompt(payload):\n    url = f\"{base_url}\u002Fapi\u002Fgenerate\"\n    response = requests.post(url, json=payload, headers={'Content-Type': 'application\u002Fjson'})\n    return response.json()\n\n\ndef get_audio_information(audio_ids):\n    url = f\"{base_url}\u002Fapi\u002Fget?ids={audio_ids}\"\n    response = requests.get(url)\n    return response.json()\n\n\ndef get_quota_information():\n    url = f\"{base_url}\u002Fapi\u002Fget_limit\"\n    response = requests.get(url)\n    return response.json()\n\ndef get_clip(clip_id):\n    url = f\"{base_url}\u002Fapi\u002Fclip?id={clip_id}\"\n    response = requests.get(url)\n    return response.json()\n\ndef generate_whole_song(clip_id):\n    payload = {\"clip_id\": clip_id}\n    url = f\"{base_url}\u002Fapi\u002Fconcat\"\n    response = requests.post(url, json=payload)\n    return response.json()\n\n\nif __name__ == '__main__':\n    data = generate_audio_by_prompt({\n        \"prompt\": \"A popular heavy metal song about war, sung by a deep-voiced male singer, slowly and melodiously. The lyrics depict the sorrow of people after the war.\",\n        \"make_instrumental\": False,\n        \"wait_audio\": False\n    })\n\n    ids = f\"{data[0]['id']},{data[1]['id']}\"\n    print(f\"ids: {ids}\")\n\n    for _ in range(60):\n        data = get_audio_information(ids)\n        if data[0][\"status\"] == 'streaming':\n            print(f\"{data[0]['id']} ==> {data[0]['audio_url']}\")\n            print(f\"{data[1]['id']} ==> {data[1]['audio_url']}\")\n            break\n        # sleep 5s\n        time.sleep(5)\n\n```\n\n### JavaScript\n\n```js\nconst axios = require(\"axios\");\n\n\u002F\u002F replace your vercel domain\nconst baseUrl = \"http:\u002F\u002Flocalhost:3000\";\n\nasync function customGenerateAudio(payload) {\n  const url = `${baseUrl}\u002Fapi\u002Fcustom_generate`;\n  const response = await axios.post(url, payload, {\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n  });\n  return response.data;\n}\n\nasync function generateAudioByPrompt(payload) {\n  const url = `${baseUrl}\u002Fapi\u002Fgenerate`;\n  const response = await axios.post(url, payload, {\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n  });\n  return response.data;\n}\n\nasync function extendAudio(payload) {\n  const url = `${baseUrl}\u002Fapi\u002Fextend_audio`;\n  const response = await axios.post(url, payload, {\n    headers: { \"Content-Type\": \"application\u002Fjson\" },\n  });\n  return response.data;\n}\n\nasync function getAudioInformation(audioIds) {\n  const url = `${baseUrl}\u002Fapi\u002Fget?ids=${audioIds}`;\n  const response = await axios.get(url);\n  return response.data;\n}\n\nasync function getQuotaInformation() {\n  const url = `${baseUrl}\u002Fapi\u002Fget_limit`;\n  const response = await axios.get(url);\n  return response.data;\n}\n\nasync function getClipInformation(clipId) {\n  const url = `${baseUrl}\u002Fapi\u002Fclip?id=${clipId}`;\n  const response = await axios.get(url);\n  return response.data;\n}\n\nasync function main() {\n  const data = await generateAudioByPrompt({\n    prompt:\n      \"A popular heavy metal song about war, sung by a deep-voiced male singer, slowly and melodiously. The lyrics depict the sorrow of people after the war.\",\n    make_instrumental: false,\n    wait_audio: false,\n  });\n\n  const ids = `${data[0].id},${data[1].id}`;\n  console.log(`ids: ${ids}`);\n\n  for (let i = 0; i \u003C 60; i++) {\n    const data = await getAudioInformation(ids);\n    if (data[0].status === \"streaming\") {\n      console.log(`${data[0].id} ==> ${data[0].audio_url}`);\n      console.log(`${data[1].id} ==> ${data[1].audio_url}`);\n      break;\n    }\n    \u002F\u002F sleep 5s\n    await new Promise((resolve) => setTimeout(resolve, 5000));\n  }\n}\n\nmain();\n```\n\n## Integration with Custom Agents\n\nYou can integrate Suno AI as a tool\u002Fplugin\u002Faction into your AI agent.\n\n### Integration with GPTs\n\n[coming soon...]\n\n### Integration with Coze\n\n[coming soon...]\n\n### Integration with LangChain\n\n[coming soon...]\n\n## Contributing\n\nThere are four ways you can support this project:\n\n1. Fork and Submit Pull Requests: We welcome any PRs that enhance the functionality, APIs, response time and availability. You can also help us just by translating this README into your language—any help for this project is welcome!\n2. Open Issues: We appreciate reasonable suggestions and bug reports.\n3. Donate: If this project has helped you, consider buying us a coffee using the Sponsor button at the top of the project. Cheers! ☕\n4. Spread the Word: Recommend this project to others, star the repo, or add a backlink after using the project.\n\n## Questions, Suggestions, Issues, or Bugs?\n\nWe use [GitHub Issues](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues) to manage feedback. Feel free to open an issue, and we'll address it promptly.\n\n## License\n\nThe license of this project is LGPL-3.0 or later. See [LICENSE](LICENSE) for more information.\n\n## Related Links\n\n- Project repository: [github.com\u002Fgcui-art\u002Fsuno-api](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api)\n- Suno.ai official website: [suno.ai](https:\u002F\u002Fsuno.ai)\n- Demo: [suno.gcui.ai](https:\u002F\u002Fsuno.gcui.ai)\n- [Readpo](https:\u002F\u002Freadpo.com?utm_source=github&utm_medium=suno-api): ReadPo is an AI-powered reading and writing assistant. Collect, curate, and create content at lightning speed.\n- Album AI: [Auto generate image metadata and chat with the album. RAG + Album.](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Falbum-ai)\n\n## Statement\n\nsuno-api is an unofficial open source project, intended for learning and research purposes only.\n","suno-api 项目提供了一个接口，用于调用 suno.ai 的音乐生成 AI，并方便地将其集成到如 GPT 等智能代理中。其核心功能包括完美实现 suno.ai 的创作 API、自动保持账户活跃状态以及利用 2Captcha 和 Playwright 自动解决验证码问题。该项目使用 TypeScript 编写，支持与 OpenAI 的 `\u002Fv1\u002Fchat\u002Fcompletions` API 格式兼容，并适应于 GPTs 等平台的 API 架构，便于开发者快速部署至 Vercel 或 Docker。适用于需要将高质量音乐生成能力嵌入到对话系统或其他应用程序中的场景。",2,"2026-06-11 03:47:20","high_star"]