[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-gcui-art--suno-api":3,"tool-gcui-art--suno-api":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":80,"owner_email":80,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":100,"forks":101,"last_commit_at":102,"license":103,"difficulty_score":10,"env_os":104,"env_gpu":105,"env_ram":106,"env_deps":107,"category_tags":116,"github_topics":117,"view_count":23,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":124,"updated_at":125,"faqs":126,"releases":161},3592,"gcui-art\u002Fsuno-api","suno-api","Use API to call the music generation AI of suno.ai, and easily integrate it into agents like GPTs.","suno-api 是一个开源项目，旨在通过 API 接口调用 Suno.ai 强大的 AI 音乐生成能力。由于 Suno 官方尚未开放公共 API，这款工具巧妙地填补了空白，让开发者能够轻松将音乐创作功能集成到自己的应用或 AI 智能体（如 GPTs、Coze）中。\n\n它主要解决了无法直接通过代码自动化调用 Suno 服务的痛点。suno-api 不仅能完美复刻 Suno 官方的创建接口，支持自定义模式，还内置了自动保活机制。其独特的技术亮点在于结合了 Playwright 浏览器自动化技术与 2Captcha 服务，能够自动解决 Suno 登录时遇到的 hCaptcha 验证挑战，无需依赖任何非官方的闭源付费接口。此外，它还兼容 OpenAI 的 `\u002Fv1\u002Fchat\u002Fcompletions` 标准格式，极大降低了接入门槛。\n\n这款工具非常适合开发者、AI 智能体构建者以及希望将音乐生成功能融入工作流的研究人员使用。无论是想一键部署到 Vercel 或 Docker 快速搭建服务，还是希望在大型语言模型中增加“作曲”插件，suno-api 都提供了灵活且宽松的开源许可支持。只需获取账号","suno-api 是一个开源项目，旨在通过 API 接口调用 Suno.ai 强大的 AI 音乐生成能力。由于 Suno 官方尚未开放公共 API，这款工具巧妙地填补了空白，让开发者能够轻松将音乐创作功能集成到自己的应用或 AI 智能体（如 GPTs、Coze）中。\n\n它主要解决了无法直接通过代码自动化调用 Suno 服务的痛点。suno-api 不仅能完美复刻 Suno 官方的创建接口，支持自定义模式，还内置了自动保活机制。其独特的技术亮点在于结合了 Playwright 浏览器自动化技术与 2Captcha 服务，能够自动解决 Suno 登录时遇到的 hCaptcha 验证挑战，无需依赖任何非官方的闭源付费接口。此外，它还兼容 OpenAI 的 `\u002Fv1\u002Fchat\u002Fcompletions` 标准格式，极大降低了接入门槛。\n\n这款工具非常适合开发者、AI 智能体构建者以及希望将音乐生成功能融入工作流的研究人员使用。无论是想一键部署到 Vercel 或 Docker 快速搭建服务，还是希望在大型语言模型中增加“作曲”插件，suno-api 都提供了灵活且宽松的开源许可支持。只需获取账号 Cookie 并配置简单的验证服务，即可开启自动化音乐创作之旅，让 AI  Agents 真正拥有谱曲的能力。","\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\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_e406eaa8ffd3.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\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_f984a5fd8380.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\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_a4c0f8073a9c.png)](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","\u003Cdiv align=\"center\">\n  \u003Ch1 align=\"center\">\n      Suno AI API\n  \u003C\u002Fh1>\n  \u003Cp>使用 API 调用 Suno.ai 的音乐生成 AI，并轻松集成到 GPTs 等代理中。\u003C\u002Fp>\n  \u003Cp>👉 我们更新迅速，请点赞支持。\u003C\u002Fp>\n\u003C\u002Fdiv>\n\u003Cp align=\"center\">\n  \u003Ca target=\"_blank\" href=\".\u002FREADME.md\">英文\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\">演示\u003C\u002Fa> \n  | \u003Ca target=\"_blank\" href=\"https:\u002F\u002Fsuno.gcui.ai\u002Fdocs\">文档\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\">通过 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;开源 SunoAI API - 使用 API 调用 suno.ai 的音乐生成 AI。| Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n> 🔥 欢迎查看我的新项目：[Linkly-ai-cli：专为 AI 代理打造的文档搜索引擎 CLI。](https:\u002F\u002Fgithub.com\u002FLinklyAI\u002Flinkly-ai-cli)\n\n![suno-api 封面图](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_e406eaa8ffd3.png)\n\n## 简介\n\nSuno 是一款令人惊叹的 AI 音乐服务。尽管官方 API 尚未推出，我们仍迫不及待地希望将其功能整合到其他地方。\n\n我们发现一些用户也有类似的需求，因此决定将此项目开源，希望能得到大家的喜爱。\n\n该实现使用付费的 [2Captcha](https:\u002F\u002F2captcha.com\u002Fabout) 服务（又称 ruCaptcha）自动解决 hCaptcha 挑战，并且不依赖任何现成的闭源付费 Suno API 实现。\n\n## 演示\n\n我们部署了一个绑定免费 Suno 账户的示例，因此每日使用次数有限，但你可以看到它的运行情况：\n[suno.gcui.ai](https:\u002F\u002Fsuno.gcui.ai)\n\n## 功能\n\n- 完美实现了 suno.ai 的创作 API。\n- 自动保持账户活跃。\n- 使用 [2Captcha](https:\u002F\u002F2captcha.com) 和 [Playwright](https:\u002F\u002Fplaywright.dev) 结合 [rebrowser-patches](https:\u002F\u002Fgithub.com\u002Frebrowser\u002Frebrowser-patches) 自动解决 CAPTCHA。\n- 兼容 OpenAI 的 `\u002Fv1\u002Fchat\u002Fcompletions` API 格式。\n- 支持自定义模式。\n- 一键部署至 [Vercel](#deploy-to-vercel) 和 [Docker](#docker)。\n- 除了标准 API 外，还适配了 GPTs 和 Coze 等代理平台的 API Schema，因此你可以将其用作 LLM 的工具\u002F插件\u002FAction，并集成到任何 AI 代理中。\n- 采用宽松的开源许可协议，允许你自由集成和修改。\n\n## 快速开始\n\n### 1. 获取你的 Suno 账户 Cookie\n\n1. 使用浏览器访问 [suno.com\u002Fcreate](https:\u002F\u002Fsuno.com\u002Fcreate)。\n2. 打开浏览器控制台：按下 `F12` 或进入“开发者工具”。\n3. 切换到“网络”选项卡。\n4. 快速刷新页面。\n5. 找到包含关键词 `?__clerk_api_version` 的最新请求。\n6. 点击该请求，切换到“标头”选项卡。\n7. 查找“Cookie”部分，将鼠标悬停在其上，复制 Cookie 的值。\n\n![获取 Cookie](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_f984a5fd8380.gif)\n\n### 2. 注册 2Captcha 并充值余额\n[2Captcha](https:\u002F\u002F2captcha.com\u002Fabout) 是一项付费的 CAPTCHA 解决服务，它通过真人工作人员来解决 CAPTCHA，准确率很高。由于 Suno 不断要求解决 hCaptcha，而目前没有任何免费方式可以做到这一点，因此需要使用这项服务。\n\n[注册](https:\u002F\u002F2captcha.com\u002Fauth\u002Fregister?userType=customer) 一个新的 2Captcha 账户，[充值](https:\u002F\u002F2captcha.com\u002Fpay) 余额，并[获取 API 密钥](https:\u002F\u002F2captcha.com\u002Fenterpage#recognition)。\n\n> [!注意]\n> 如果你位于俄罗斯或白俄罗斯，请使用 [ruCaptcha](https:\u002F\u002Frucaptcha.com) 接口，而不是 2Captcha。两者是同一项服务，但 ruCaptcha 支持来自这些国家的支付。\n\n> [!提示]\n> 如果你希望尽量减少 CAPTCHA 出现的次数，建议使用 macOS 系统。macOS 系统通常比 Linux 和 Windows 更少遇到 CAPTCHA——这主要是因为 macOS 在网络爬虫行业中并不流行。在 Windows 和 Linux 上运行 suno-api 也是可行的，但在某些情况下，你可能会遇到相当多的 CAPTCHA。\n\n### 3. 克隆并部署该项目\n\n你可以选择你喜欢的部署方式：\n\n#### 部署至 Vercel\n\n[![通过 Vercel 部署](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_readme_a4c0f8073a9c.png)](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#### 本地运行\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api.git\ncd suno-api\nnpm install\n```\n#### Docker\n>[!重要]\n> Docker 中将禁用 GPU 加速。如果你的 CPU 较慢，建议 [本地部署](#run-locally)。\n\n你也可以使用 [Docker Compose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002F)。不过，在运行之前请先执行以下步骤。\n\n```bash\ndocker compose build && docker compose up\n```\n\n### 4. 配置 suno-api\n\n- 如果部署到 Vercel，请在 Vercel 控制面板中添加环境变量。\n- 如果你在本地运行，请务必在 `.env` 文件中添加以下内容：\n#### 环境变量\n- `SUNO_COOKIE` — 第一步中获取的 `Cookie` 标头。\n- `TWOCAPTCHA_KEY` — 第二步中获得的 2Captcha API 密钥。\n- `BROWSER` — 用于解决 CAPTCHA 的浏览器名称。仅支持 `chromium` 和 `firefox`。\n- `BROWSER_GHOST_CURSOR` — 使用 ghost-cursor-playwright 模拟平滑的鼠标移动。请注意，这似乎并不会影响 CAPTCHA 的出现频率，因此你可以将其设置为 `false`。保留此项以供未来测试。\n- `BROWSER_LOCALE` — 浏览器的语言。建议使用 `en` 或 `ru`，因为这两个语言在 2Captcha 上有最多的工人。[支持的语言列表](https:\u002F\u002F2captcha.com\u002F2captcha-api#language)\n- `BROWSER_HEADLESS` — 无窗口运行浏览器。你可能希望将其设置为 `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. 运行 suno-api\n\n- 如果你已部署到 Vercel：\n  - 请在 Vercel 控制台中点击“Deploy”，并等待部署成功。\n  - 访问 `https:\u002F\u002F\u003Cvercel-assigned-domain>\u002Fapi\u002Fget_limit` API 进行测试。\n- 如果在本地运行：\n  - 运行 `npm run dev`。\n  - 访问 `http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fget_limit` API 进行测试。\n- 如果返回以下结果：\n\n```json\n{\n  \"credits_left\": 50,\n  \"period\": \"day\",\n  \"monthly_limit\": 50,\n  \"monthly_usage\": 50\n}\n```\n\n则表示程序运行正常。\n\n### 6. 使用 Suno API\n\n你可以查看详细的 API 文档，地址为：\n[suno.gcui.ai\u002Fdocs](https:\u002F\u002Fsuno.gcui.ai\u002Fdocs)\n\n## API 参考\n\nSuno API 目前主要实现了以下 API：\n\n```bash\n- `\u002Fapi\u002Fgenerate`: 生成音乐\n- `\u002Fv1\u002Fchat\u002Fcompletions`: 生成音乐 - 以与 OpenAI API 兼容的格式调用 generate API。\n- `\u002Fapi\u002Fcustom_generate`: 生成音乐（自定义模式，支持设置歌词、音乐风格、标题等）\n- `\u002Fapi\u002Fgenerate_lyrics`: 根据提示词生成歌词\n- `\u002Fapi\u002Fget`: 根据 ID 获取音乐信息。多个 ID 之间用逗号分隔。如果不提供 ID，则返回所有音乐。\n- `\u002Fapi\u002Fget_limit`: 获取配额信息\n- `\u002Fapi\u002Fextend_audio`: 延长音频时长\n- `\u002Fapi\u002Fgenerate_stems`: 制作分轨音源（分离人声和伴奏）\n- `\u002Fapi\u002Fget_aligned_lyrics`: 获取歌词中每个单词的时间戳列表\n- `\u002Fapi\u002Fclip`: 根据查询参数 `id` 传入的 ID 获取片段信息\n- `\u002Fapi\u002Fconcat`: 从片段生成完整歌曲\n```\n\n你还可以在请求的 `Cookie` 头中指定 cookies，覆盖 `SUNO_COOKIE` 环境变量中的默认 cookies。这在例如你想同时使用多个免费账号时非常有用。\n\n如需更详细的文档，请访问演示站点：\n[suno.gcui.ai\u002Fdocs](https:\u002F\u002Fsuno.gcui.ai\u002Fdocs)\n\n## API 集成代码示例\n\n### Python\n\n```python\nimport time\nimport requests\n\n# 替换为你自己的 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\": \"一首关于战争的流行重金属歌曲，由低沉男声演唱，节奏缓慢而富有旋律感。歌词描绘了战后人们的悲痛。\",\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        # 暂停5秒\n        time.sleep(5)\n\n```\n\n### JavaScript\n\n```js\nconst axios = require(\"axios\");\n\n\u002F\u002F 替换你的 Vercel 域名\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      \"一首关于战争的流行重金属歌曲，由低沉男声演唱，节奏缓慢而富有旋律感。歌词描绘了战后人们的悲痛。\",\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 暂停5秒\n    await new Promise((resolve) => setTimeout(resolve, 5000));\n  }\n}\n\nmain();\n```\n\n## 与自定义智能体集成\n\n你可以将 Suno AI 作为工具\u002F插件\u002F动作集成到你的 AI 代理中。\n\n### 与 GPTs 集成\n\n[即将推出...]\n\n### 与 Coze 集成\n\n[即将推出...]\n\n### 与 LangChain 集成\n\n[即将推出...]\n\n## 贡献\n\n你可以通过以下四种方式支持本项目：\n\n1. 分支并提交 Pull 请求：我们欢迎任何增强功能、API、响应时间和可用性的 PR。你也可以仅仅通过将此 README 翻译成你的语言来帮助我们——对本项目的任何帮助我们都十分欢迎！\n2. 提出问题：我们感谢合理的建议和错误报告。\n3. 捐赠：如果该项目对你有所帮助，请考虑使用项目顶部的赞助按钮为我们买杯咖啡。干杯！☕\n4. 宣传：向他人推荐该项目，给仓库加星，或在使用项目后添加反向链接。\n\n## 问题、建议、疑问或Bug？\n\n我们使用 [GitHub Issues](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues) 来管理反馈。欢迎随时提交Issue，我们会尽快处理。\n\n## 许可证\n\n本项目的许可证为 LGPL-3.0 或更高版本。更多信息请参阅 [LICENSE](LICENSE) 文件。\n\n## 相关链接\n\n- 项目仓库：[github.com\u002Fgcui-art\u002Fsuno-api](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api)\n- Suno.ai 官方网站：[suno.ai](https:\u002F\u002Fsuno.ai)\n- 演示：[suno.gcui.ai](https:\u002F\u002Fsuno.gcui.ai)\n- [Readpo](https:\u002F\u002Freadpo.com?utm_source=github&utm_medium=suno-api)：ReadPo 是一款由AI驱动的阅读与写作助手。以闪电般的速度收集、整理和创作内容。\n- Album AI：[自动生成图片元数据，并与相册进行对话。RAG + Album。](https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Falbum-ai)\n\n## 声明\n\nsuno-api 是一个非官方的开源项目，仅用于学习和研究目的。","# Suno-API 快速上手指南\n\nSuno-API 是一个开源项目，允许你通过 API 调用 Suno.ai 的音乐生成能力，并轻松集成到 GPTs、Coze 等 AI Agent 平台中。由于 Suno 官方尚未开放 API，本项目通过自动化技术（结合 2Captcha 验证码解决服务）实现了非官方的 API 封装。\n\n## 环境准备\n\n在开始之前，请确保满足以下要求：\n\n*   **操作系统**：推荐 macOS（验证码触发频率较低），Linux 和 Windows 也可用。\n*   **运行环境**：\n    *   Node.js (建议 v18+)\n    *   npm 或 pnpm\n    *   Docker (可选，用于容器化部署)\n*   **必要账号与密钥**：\n    1.  **Suno 账号 Cookie**：你需要一个有效的 Suno.ai 账号。\n    2.  **2Captcha API Key**：该项目依赖 [2Captcha](https:\u002F\u002F2captcha.com) (或俄罗斯的 ruCaptcha) 来自动解决 hCaptcha 验证码。这是一个付费服务，需注册并充值获取 API Key。\n        *   *注意：目前无法免费绕过 Suno 的验证码机制。*\n\n## 安装步骤\n\n### 第一步：获取 Suno Cookie\n\n1.  浏览器访问 [suno.com\u002Fcreate](https:\u002F\u002Fsuno.com\u002Fcreate) 并登录。\n2.  按 `F12` 打开开发者工具，切换到 **Network (网络)** 标签页。\n3.  刷新页面。\n4.  在请求列表中找到包含 `?__clerk_api_version` 的最新请求。\n5.  点击该请求，在右侧 **Headers (标头)** 标签页中找到 **Cookie** 字段，复制其值。\n\n### 第二步：配置环境变量\n\n你可以选择本地运行或 Vercel 部署，均需配置以下变量：\n\n*   `SUNO_COOKIE`: 第一步中获取的 Cookie 字符串。\n*   `TWOCAPTCHA_KEY`: 你的 2Captcha API Key。\n*   `BROWSER`: 浏览器类型，仅支持 `chromium` 或 `firefox`。\n*   `BROWSER_LOCALE`: 浏览器语言，推荐 `en` 或 `ru`（2Captcha 工人较多）。\n*   `BROWSER_HEADLESS`: 是否无头模式运行，推荐 `true`。\n*   `BROWSER_GHOST_CURSOR`: 模拟平滑鼠标移动，可设为 `false`。\n\n### 第三步：部署项目\n\n#### 方式 A：本地运行 (推荐开发调试)\n\n1.  克隆项目：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api.git\n    cd suno-api\n    npm install\n    ```\n\n2.  创建 `.env` 文件并填入配置：\n    ```bash\n    SUNO_COOKIE=\u003C你的 Suno Cookie>\n    TWOCAPTCHA_KEY=\u003C你的 2Captcha Key>\n    BROWSER=chromium\n    BROWSER_GHOST_CURSOR=false\n    BROWSER_LOCALE=en\n    BROWSER_HEADLESS=true\n    ```\n\n3.  启动服务：\n    ```bash\n    npm run dev\n    ```\n\n#### 方式 B：Docker 部署\n\n> **注意**：Docker 模式下 GPU 加速将被禁用。如果 CPU 性能较弱，建议使用本地运行方式。\n\n```bash\ndocker compose build && docker compose up\n```\n\n#### 方式 C：一键部署到 Vercel\n\n点击下方按钮即可快速部署，并在 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## 基本使用\n\n部署完成后，可通过 HTTP 请求调用 API。\n\n### 1. 验证服务状态\n\n访问 `http:\u002F\u002Flocalhost:3000\u002Fapi\u002Fget_limit` (本地) 或你的 Vercel 域名对应接口。若返回如下 JSON，说明服务正常：\n\n```json\n{\n  \"credits_left\": 50,\n  \"period\": \"day\",\n  \"monthly_limit\": 50,\n  \"monthly_usage\": 50\n}\n```\n\n### 2. 生成音乐示例 (Python)\n\n以下是最简单的通过提示词生成音乐的流程：\n\n```python\nimport time\nimport requests\n\n# 替换为你的服务地址\nbase_url = 'http:\u002F\u002Flocalhost:3000'\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\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\nif __name__ == '__main__':\n    # 1. 发起生成请求\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.\",\n        \"make_instrumental\": False,\n        \"wait_audio\": False\n    })\n\n    # 获取任务 ID\n    ids = f\"{data[0]['id']},{data[1]['id']}\"\n    print(f\"Task IDs: {ids}\")\n\n    # 2. 轮询查询生成状态\n    for _ in range(60):\n        data = get_audio_information(ids)\n        if data[0][\"status\"] == 'streaming':\n            print(f\"生成成功!\")\n            print(f\"音频 1: {data[0]['audio_url']}\")\n            print(f\"音频 2: {data[1]['audio_url']}\")\n            break\n        time.sleep(5)\n```\n\n### 3. 主要 API 端点\n\n*   `\u002Fapi\u002Fgenerate`: 根据提示词生成音乐。\n*   `\u002Fapi\u002Fcustom_generate`: 自定义模式生成（支持指定歌词、风格、标题等）。\n*   `\u002Fapi\u002Fget`: 根据 ID 查询音乐信息。\n*   `\u002Fapi\u002Fget_limit`: 查询配额使用情况。\n*   `\u002Fv1\u002Fchat\u002Fcompletions`: 兼容 OpenAI 格式的生成接口，方便接入 LLM Agent。\n\n更多详细文档请访问：[suno.gcui.ai\u002Fdocs](https:\u002F\u002Fsuno.gcui.ai\u002Fdocs)","某独立游戏开发者正在为一款动态生成的奇幻冒险游戏制作实时背景音乐，希望根据玩家当前的剧情进度和情绪状态自动匹配专属曲目。\n\n### 没有 suno-api 时\n- 开发者必须手动登录 Suno 官网，每次输入提示词生成音乐，无法与游戏引擎实现自动化联动。\n- 面对频繁的 hCaptcha 验证码拦截，人工操作极易中断，难以满足游戏运行时高频调用的需求。\n- 音乐资产更新滞后，玩家体验割裂，无法实现“剧情变、音乐变”的沉浸式动态音效。\n- 若尝试自行破解验证码或模拟浏览器，技术门槛高且维护成本巨大，容易因反爬机制失效而停滞。\n\n### 使用 suno-api 后\n- 通过标准 API 接口直接将 suno-api 集成到游戏后端，代码即可触发音乐生成，实现全流程自动化。\n- 内置 2Captcha 服务自动解决验证难题，无需人工干预，确保高并发下音乐生成服务的稳定性。\n- 支持 OpenAI 兼容格式，可轻松嵌入 AI Agent（如 Coze 或 GPTs），让 NPC 根据对话内容实时创作背景旋律。\n- 一键部署至 Vercel 或 Docker，大幅降低运维复杂度，让开发者专注于游戏玩法而非基础设施搭建。\n\nsuno-api 将原本割裂的手动创作流程转化为可编程的自动化能力，让动态音乐真正融入实时交互应用。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgcui-art_suno-api_eb96eba0.png","gcui-art","gcui.ai","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgcui-art_1ac46232.png","Making AI Creation Simple.",null,"BlueeonY","https:\u002F\u002Fsuno.gcui.ai","https:\u002F\u002Fgithub.com\u002Fgcui-art",[85,89,93,97],{"name":86,"color":87,"percentage":88},"TypeScript","#3178c6",94.6,{"name":90,"color":91,"percentage":92},"Dockerfile","#384d54",4.3,{"name":94,"color":95,"percentage":96},"JavaScript","#f1e05a",0.6,{"name":98,"color":99,"percentage":96},"CSS","#663399",2801,747,"2026-04-04T19:23:36","LGPL-3.0","Linux, macOS, Windows","不需要 GPU（Docker 部署明确禁用 GPU 加速，本地运行依赖 CPU）","未说明（但在 Docker 中提示若 CPU 较慢建议本地部署）",{"notes":108,"python":109,"dependencies":110},"该项目是基于 Node.js 的 API 封装工具，并非直接运行 AI 模型，因此无需高性能 GPU。核心依赖是浏览器自动化库 Playwright 用于解决验证码。必须配置 Suno 账号 Cookie 和 2Captcha 付费服务密钥。在 macOS 上运行时遇到的验证码频率通常低于 Linux 和 Windows。Docker 部署模式下 GPU 加速被禁用，若硬件性能较弱建议使用本地源码部署。","未说明（项目基于 Node.js 运行）",[111,112,113,114,115],"Node.js","npm","Playwright","rebrowser-patches","2Captcha API",[55,15,14,13,53],[118,119,120,121,122,123],"ai","suno","suno-ai","suno-ai-api","typescript","music","2026-03-27T02:49:30.150509","2026-04-06T05:36:50.983864",[127,132,137,142,147,152,156],{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},16445,"调用 API 时遇到 500 错误或 403 错误（Internal server error）怎么办？","这通常是因为 Suno 官方 API 发生了变更。维护者通常会更新代码以适配新接口。如果遇到此问题，请尝试拉取最新的代码并重新部署。如果是本地或 Vercel 部署，更新后通常即可恢复正常。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F31",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},16446,"如何正确获取和更新 Suno API 所需的 Cookie？","请在浏览器中打开 Suno 官网，按 F12 打开开发者工具，进入 Network（网络）标签页。刷新页面或执行任意操作，找到一个包含 `?__clerk_api_version` 参数的 GET 或 POST 请求（注意不要选 OPTIONS 请求）。复制该请求头中的 `Cookie` 字段值即可。如果未点击“退出登录”或更换设备，Cookie 通常可长期有效。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F215",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},16447,"调用 custom_generate 接口时报错\"CAPTCHA verification is required\"（需要验证码）如何解决？","Suno 的 hCaptcha 不仅验证结果，还会检测鼠标路径和点击行为等非人类特征。简单的破解令牌可能无效。解决方案包括：1. 使用能完全模拟人类行为的浏览器自动化方案（如特定的 Playwright 配置）；2. 检查是否账号已被标记，有时即使手动生成歌曲也会因账号被标记而失败；3. 参考社区提供的最新 PR 或补丁（如 #193）来绕过检测。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F201",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},16448,"生成的歌曲中包含\"this is a fake app\"的歌词是怎么回事？","这通常意味着你的 Suno 账号已被官方标记为使用第三方软件或 API。一旦账号被标记，即使你后续在官网手动创建歌曲，或者通过 API 生成，都可能会在歌词中强制插入这段警告内容。目前除了更换未被标记的新账号外，暂无确切的移除方法。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F221",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},16449,"如何在 Python 或 AI Agent（如 Autogen、GPTs）中调用 Suno API？","你可以使用标准的 HTTP 请求库（如 requests）调用部署好的 API 端点。示例代码如下：\nimport requests\nbase_url = '你的部署域名'\n# 生成音频\ndef generate_audio(prompt):\n    url = f\"{base_url}\u002Fapi\u002Fgenerate\"\n    response = requests.post(url, json={\"prompt\": prompt}, headers={'Content-Type': 'application\u002Fjson'})\n    return response.json()\n请确保将 base_url 替换为你自己的 Vercel 或其他服务器部署地址，并参考项目 README 中的详细文档。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F4",{"id":153,"question_zh":154,"answer_zh":155,"source_url":136},16450,"遇到 401 认证错误，且文档中提到的 Clerk 版本参数似乎已变更（从 js_version 变为 api_version），如何处理？","Suno 更新了其 Clerk 认证机制。获取 Cookie 时，不再寻找 `_clerk_js_version`，而应搜索包含 `client?__clerk_api_version` 的网络请求。在该请求的 Header 中复制 Cookie 即可解决 401 错误。此外，确保使用的是最新的代码库，因为旧版本可能硬编码了过时的版本号。",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},16451,"免费账户和付费账户在使用 API 时有什么区别？遇到 500 错误是否可以通过购买会员解决？","遇到 500 错误通常是由于 API 接口变更或服务器端问题，而非账户类型导致，因此购买会员不一定能直接修复代码层面的 500 错误。但是，如果错误提示涉及配额限制或特定的访问限制，付费账户可能拥有更高的稳定性。如果所有账户（包括新注册的免费账户）都报 500 错误，大概率是项目代码需要更新以适配 Suno 的最新策略。","https:\u002F\u002Fgithub.com\u002Fgcui-art\u002Fsuno-api\u002Fissues\u002F192",[]]