@openpets/suno
v1.0.1
Published
Generate songs, lyrics, and music with Suno AI - create custom music from text prompts
Maintainers
Readme
Suno AI Music Generation Plugin
Generate songs, lyrics, and music with Suno AI - create custom music from text prompts.
Quick Start
1. Get Your Suno Cookie
The Suno API requires a session cookie from suno.com:
Go to suno.com and log in
Open browser DevTools (F12 or right-click → Inspect)
Go to Application tab → Cookies →
https://suno.comFind and copy these cookie values:
__client(required)__client_uatajs_anonymous_id
Format as a single string:
__client=your_client_value; __client_uat=your_uat_value; ajs_anonymous_id=your_id
Alternative method (easier):
- Open DevTools → Network tab
- Make any request on suno.com (e.g., click Create)
- Click any request to
studio-api.prod.suno.com - In Headers, find
Cookie:under Request Headers - Copy the entire cookie string
2. Configure Environment
# Create .env file
echo 'SUNO_COOKIE="your_cookie_string_here"' > .env
# Optional: For CAPTCHA solving during generation
echo 'TWOCAPTCHA_KEY="your_2captcha_key"' >> .env3. Install & Test
pnpm install
opencode run "get my suno credits"Available Tools
| Tool | Description |
|------|-------------|
| generate-music | Generate songs from text prompts |
| custom-generate-music | Generate with custom lyrics, tags, title |
| generate-lyrics | Generate lyrics from a prompt |
| extend-audio | Extend existing songs from a timestamp |
| concatenate-clips | Combine clips into full songs |
| generate-stems | Separate audio into stems (vocals, drums, etc.) |
| get-audio | Get song info and status |
| get-clip | Get detailed clip information |
| get-lyric-alignment | Get word-by-word timing for karaoke |
| get-credits | Check account credits |
Usage Examples
Generate a Song
generate a song about summer adventuresCustom Song with Specific Style
create a custom song with:
- lyrics: "Walking down the street, feeling the beat..."
- style: pop, upbeat, female vocals
- title: Summer VibesGenerate Lyrics Only
generate lyrics about missing someoneCheck Generation Status
get audio status for song id abc123Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| SUNO_COOKIE | Yes | Session cookie from suno.com |
| TWOCAPTCHA_KEY | No | 2Captcha API key for solving CAPTCHAs |
Troubleshooting
"Failed to get session ID"
- Your cookie has expired. Get a fresh cookie from suno.com
"CAPTCHA required"
- Suno sometimes requires CAPTCHA verification
- Add
TWOCAPTCHA_KEYfor automatic solving, or try again later
"No credits remaining"
- Check your Suno subscription at suno.com/account
Models
Default model: chirp-v3-5
You can specify different models when generating music via the model parameter.
Notes
- Each generation creates 2 song variations
- Generation takes 30-60 seconds
- Use
waitForCompletion: trueto wait for audio URLs - Cookies expire periodically - refresh if you get auth errors
