‹ 首页

suno-api-client

@qianleigood · 收录于 昨天 · 上游提交 1 个月前

Deploy and operate the unofficial gcui-art/suno-api service locally, then call its music-generation endpoints from scripts or agent workflows. Use when a user wants to self-host a Suno-compatible API with Docker, check quota/health, generate music or lyrics, poll song status, extend clips, or debug a local Suno wrapper.

适合你,如果需要一个可本地部署的音乐生成API接口

/ 通过 npx 安装 校验哈希
npx oh-my-skill add qianleigood/crawclaw/suno-api-client
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- qianleigood/crawclaw/suno-api-client
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify qianleigood/crawclaw/suno-api-client
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
30GitHub stars
~810最小装载
~4.6K含声明引用
~6.6K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 f27e175 · 表述以原文为准
它做什么

Claude 会帮你本地部署非官方的 Suno API(用 Docker),然后通过 Python 脚本生成音乐、歌词、查询歌曲状态、扩展片段等。部署前会确认你的 Suno Cookie 和验证码密钥。

什么时候触发

当你想自托管 Suno 兼容 API、检查配额/健康、生成音乐或歌词、轮询歌曲状态、扩展片段或调试本地 Suno 包装器时触发。

装好后可以这样说
技能会运行脚本生成并等待音频返回。
使用 custom-generate 命令并下载到本地。
运行 get-limit 命令检查结果。
技能原文 SKILL.md作者撰写 · MIT · f27e175

Suno API Client

Prefer local Docker deployment first.

Confirm inputs

Confirm these before deployment:

  • SUNO_COOKIE
  • TWOCAPTCHA_KEY
  • Optional but recommended:
  • BROWSER=chromium
  • BROWSER_GHOST_CURSOR=false
  • BROWSER_LOCALE=en
  • BROWSER_HEADLESS=true

Never invent or silently substitute the user's cookie or 2Captcha key.

Deploy
  1. Clone gcui-art/suno-api.
  2. Copy .env.example to .env.
  3. Fill the required envs.
  4. Start the service with Docker Compose.
  5. Verify health before debugging generation.

Typical flow:

git clone https://github.com/gcui-art/suno-api.git
cd suno-api
docker compose build && docker compose up

On this machine, the service is typically exposed at http://localhost:3001.

Verify health

Check quota/health first:

curl http://localhost:3001/api/get_limit

If health fails, read references/docker_local.md before touching generation code.

Call the API

Prefer scripts/suno_api.py over ad-hoc curl.

Examples:

python3 <skill_dir>/scripts/suno_api.py get-limit
python3 <skill_dir>/scripts/suno_api.py generate --prompt "电子氛围,女声,空灵" --wait-audio --only-gen --include-page-url
python3 <skill_dir>/scripts/suno_api.py custom-generate --prompt "夜晚城市" --tags "synthwave, female vocals" --title "Midnight Run" --download-dir /tmp/suno
python3 <skill_dir>/scripts/suno_api.py get --ids <id1,id2> --only-gen --include-page-url --download-dir /tmp/suno
python3 <skill_dir>/scripts/suno_api.py extend-audio --audio-id <id> --prompt "继续副歌" --continue-at 115

The wrapper defaults to SUNO_API_BASE_URL=http://localhost:3001.

Useful wrapper-only options:

  • --only-gen: filter out preview/fenix candidates when mixed results are returned
  • --include-page-url: append https://suno.com/song/<id> to each result item
  • --download-dir <dir>: download returned audio_url files into a local directory when available
  • --fields id,status,audio_url,page_url: keep only the fields needed by the next step
  • --wait-audio-timeout <seconds>: override the HTTP timeout specifically for --wait-audio calls
Generate and send workflow

When the user wants the generated result delivered back into the current chat:

  1. Run generate or get with --download-dir.
  2. Prefer --only-gen when preview results would add noise.
  3. Use --fields only if the next step needs a compact manifest.
  4. Send the downloaded file with the current channel's native file-send capability instead of pasting raw links.

This workflow lives at the agent/tool layer, not inside scripts/suno_api.py itself.

Use --cookie "<cookie>" only when the user explicitly wants per-request account switching.

Smoke test

When the service is already running, verify both HTTP and CLI surfaces:

python3 <skill_dir>/tests/smoke_suno_api.py
python3 <skill_dir>/tests/smoke_suno_api.py --ids <id1,id2>
Read references only when needed
  • Read references/docker_local.md for Docker behavior, envs, and troubleshooting.
  • Read references/api_reference.md for endpoint payloads and response shapes.
Guardrails
  • Treat this as an unofficial Suno wrapper.
  • Verify health before debugging generation failures.
  • Poll /api/get for async generation instead of assuming immediate success.
  • Do not claim CAPTCHA solving is free; this stack expects 2Captcha / ruCaptcha.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。