home / skills / idanbeck / claude-skills / suno-music

suno-music skill

/suno-music

This skill helps you generate AI-created music and songs with optional lyrics, instrumental tracks, and style tags using Suno AI.

npx playbooks add skill idanbeck/claude-skills --skill suno-music

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.8 KB
---
name: suno-music
description: Generate music using AI. Use when the user asks to create, generate, or make music, songs, audio, melodies, tracks, or beats. Supports custom lyrics, instrumental-only, and style tags.
allowed-tools: Bash, Read, Write
---

# Suno Music - AI Music Generation

Generate music using Suno AI's API.

## Setup (One-Time)

1. Sign in to [suno.ai](https://app.suno.ai/)
2. Open browser DevTools (F12) → Console tab
3. Run: `document.cookie`
4. Find the `__session=eyJ...` part (it's a long JWT token)
5. Export it: `export SUNO_COOKIE="__session=eyJ..."`

**Note:** The `__session` token expires after ~1 hour. You'll need to refresh it periodically.

## Usage

Run the generation script:

```bash
python3 ~/.claude/skills/suno-music/generate_music.py "your prompt here" [options]
```

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `--custom` | Treat prompt as lyrics (not description) | False |
| `--tags` | Style/voice tags (e.g., "female voice, pop, upbeat") | None |
| `--title` | Song title | None |
| `--instrumental` | Generate instrumental only (no vocals) | False |
| `--output` | Output directory path | ./generated_music |
| `--model` | Model key (e.g., chirp-auk-turbo) | Default free model |

## Examples

### Generate from description

```bash
python3 ~/.claude/skills/suno-music/generate_music.py "an upbeat electronic track for a tech product demo"
```

### Custom lyrics with style

```bash
python3 ~/.claude/skills/suno-music/generate_music.py "[Verse 1]
Walking through the morning light
Everything feels just right" --custom --tags "indie folk, acoustic guitar, male voice" --title "Morning Light"
```

### Instrumental track

```bash
python3 ~/.claude/skills/suno-music/generate_music.py "epic orchestral trailer music with building tension" --instrumental
```

## Output

Songs are saved with format: `{timestamp}_{sanitized_title}_{n}.mp3`

Example: `20260106_morning_light_1.mp3`

Suno generates 2 variations per request by default.

## Credits

- Free tier: **50 credits/day** (renews daily)
- Each generation uses **10 credits** (5 per song × 2 variations)
- So you can generate **5 songs per day** on the free tier

Check remaining credits:
```bash
python3 ~/.claude/skills/suno-music/generate_music.py --credits
```

## Models

| Model | Key | Notes |
|-------|-----|-------|
| v4.5-all | chirp-auk-turbo | Best free model (default) |
| v5 | chirp-crow | Pro only, beta |
| v4.5+ | chirp-bluejay | Pro only |
| v4 | chirp-v4 | Pro only |

## Requirements

- Python 3.x
- `requests` library (usually pre-installed)
- `SUNO_COOKIE` environment variable with `__session` token

## Troubleshooting

**"API Error: 401"** - Token expired. Get a fresh `__session` token from the browser.

**"API Error: 402"** - Out of credits. Wait for daily refresh or upgrade.

Overview

This skill generates complete songs, instrumentals, and vocal tracks using Suno AI. It accepts natural-language descriptions, custom lyrics, style tags, and options for instrumental-only output. The skill saves MP3 files and produces multiple variations per request for quick iteration.

How this skill works

The skill sends prompts and options to Suno AI models via an authenticated session token and receives generated audio files. It supports treating the prompt as lyrics, adding style/voice tags, selecting a model, and producing two variations by default. Outputs are saved with timestamped filenames and can be inspected locally.

When to use it

  • You want a quick demo track or mood bed for a product, video, or prototype
  • You need AI-generated vocal songs from custom lyrics
  • You want instrumental-only music for background, trailers, or podcasts
  • You want multiple stylistic variations to compare options
  • You need a fast way to iterate on melody, tempo, and arrangement ideas

Best practices

  • Provide concise, descriptive prompts (genre, mood, instrumentation) for predictable results
  • When supplying lyrics, use the --custom flag and format verses/chorus clearly
  • Include specific style tags (voice gender, tempo, instruments) to guide the model
  • Monitor and refresh the SUNO_COOKIE token regularly — it typically expires after about an hour
  • Keep track of daily credits; free tier limits generation to roughly five songs per day

Example use cases

  • Create an upbeat electronic loop for a product demo: "an upbeat electronic track for a tech product demo"
  • Generate a full song from lyrics: pass verse/chorus text with --custom and tags like "indie folk, acoustic guitar, male voice"
  • Make an instrumental trailer cue: use --instrumental with "epic orchestral trailer music with building tension"
  • Produce variations to choose a final mix: run the same prompt multiple times to compare the two default variations
  • Check remaining credits with the built-in --credits option before large runs

FAQ

How do I authenticate requests?

Set the SUNO_COOKIE environment variable to the __session JWT token copied from your browser session. The token expires after roughly one hour and must be refreshed periodically.

What if I see a 401 or 402 error?

401 indicates an expired or invalid token — obtain a fresh __session value from the Suno web app. 402 means you’re out of credits; wait for the daily refresh or upgrade your account.