suno-api-client
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 oh-my-skill add qianleigood/crawclaw/suno-api-clientcurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- qianleigood/crawclaw/suno-api-clientnpx oh-my-skill verify qianleigood/crawclaw/suno-api-client怎么用
商店整理自技能原文 · 版本 f27e175 · 表述以原文为准Claude 会帮你本地部署非官方的 Suno API(用 Docker),然后通过 Python 脚本生成音乐、歌词、查询歌曲状态、扩展片段等。部署前会确认你的 Suno Cookie 和验证码密钥。
当你想自托管 Suno 兼容 API、检查配额/健康、生成音乐或歌词、轮询歌曲状态、扩展片段或调试本地 Suno 包装器时触发。
技能原文 SKILL.md
Suno API Client
Prefer local Docker deployment first.
Confirm inputs
Confirm these before deployment:
SUNO_COOKIETWOCAPTCHA_KEY- Optional but recommended:
BROWSER=chromiumBROWSER_GHOST_CURSOR=falseBROWSER_LOCALE=enBROWSER_HEADLESS=true
Never invent or silently substitute the user's cookie or 2Captcha key.
Deploy
- Clone
gcui-art/suno-api. - Copy
.env.exampleto.env. - Fill the required envs.
- Start the service with Docker Compose.
- 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: appendhttps://suno.com/song/<id>to each result item--download-dir <dir>: download returnedaudio_urlfiles 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-audiocalls
Generate and send workflow
When the user wants the generated result delivered back into the current chat:
- Run
generateorgetwith--download-dir. - Prefer
--only-genwhen preview results would add noise. - Use
--fieldsonly if the next step needs a compact manifest. - 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.mdfor Docker behavior, envs, and troubleshooting. - Read
references/api_reference.mdfor endpoint payloads and response shapes.
Guardrails
- Treat this as an unofficial Suno wrapper.
- Verify health before debugging generation failures.
- Poll
/api/getfor async generation instead of assuming immediate success. - Do not claim CAPTCHA solving is free; this stack expects 2Captcha / ruCaptcha.