
ElevenLabs Music Generation
FreeCreate AI-generated music from text prompts.
Free · Opens the source repo
What ElevenLabs Music Generation does
The ElevenLabs Music Generation skill allows developers and designers to generate music compositions directly from text prompts using the ElevenLabs Music API. This skill is particularly useful for creating instrumental tracks, songs with lyrics, background music, jingles, or any other type of AI-generated music. Users can leverage prompt-based generation to quickly produce audio that matches their creative vision, making it a valuable tool for content creators and musicians alike.
With support for composition plans, users can achieve granular control over their music generation process. By first creating a structured composition plan, they can modify specific styles and sections before generating the final audio. This feature is especially beneficial for those who want to ensure their compositions meet specific artistic criteria or adhere to particular genres.
The skill provides a straightforward interface for both Python and JavaScript developers, along with a cURL command for quick API access. This flexibility allows users to integrate music generation into various applications, whether for personal projects, commercial products, or creative experiments. Additionally, the ability to upload audio files for inpainting workflows enhances the skill's versatility, although this feature is limited to enterprise clients.
Overall, ElevenLabs Music Generation is designed for anyone looking to incorporate AI-generated music into their projects, whether they are seasoned developers or those new to music composition.
When to use it
Use this skill when you need to create unique music tracks quickly, whether for videos, games, or other multimedia projects.
When not to use it
This skill may not be suitable for users looking for highly specific musical styles or those needing to reference copyrighted material directly.
What you can build with it
Creating Background Music for Videos
Generate unique background music for your video projects by simply providing a descriptive prompt.
Developing Game Soundtracks
Use the skill to create engaging soundtracks that enhance the gaming experience based on specific themes or moods.
Experimenting with Music Composition
Leverage the composition plans to explore different musical styles and refine your compositions before finalizing them.
How to install ElevenLabs Music Generation
View source1. Install with the skills CLI
npx skills add calesthio/openmontage/music --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by calesthioElevenLabs Music Generation
Generate music from text prompts - supports instrumental tracks, songs with lyrics, and fine-grained control via composition plans.
Setup: See Installation Guide. For JavaScript, use
@elevenlabs/*packages only.
Quick Start
Python
from elevenlabs import ElevenLabs
client = ElevenLabs()
audio = client.music.compose(
prompt="A chill lo-fi hip hop beat with jazzy piano chords",
music_length_ms=30000
)
with open("output.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)
JavaScript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createWriteStream } from "fs";
const client = new ElevenLabsClient();
const audio = await client.music.compose({
prompt: "A chill lo-fi hip hop beat with jazzy piano chords",
musicLengthMs: 30000,
});
audio.pipe(createWriteStream("output.mp3"));
cURL
curl -X POST "https://api.elevenlabs.io/v1/music" \
-H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
-d '{"prompt": "A chill lo-fi beat", "music_length_ms": 30000}' --output output.mp3
Methods
| Method | Description |
|---|---|
music.compose | Generate audio from a prompt or composition plan |
music.composition_plan.create | Generate a structured plan for fine-grained control |
music.compose_detailed | Generate audio + composition plan + metadata |
music.upload | Upload an audio file for later inpainting workflows and optionally extract its composition plan |
See API Reference for full parameter details.
music.upload is available to enterprise clients with access to the inpainting feature.
Composition Plans
For granular control, generate a composition plan first, modify it, then compose:
plan = client.music.composition_plan.create(
prompt="An epic orchestral piece building to a climax",
music_length_ms=60000
)
# Inspect/modify styles and sections
print(plan.positiveGlobalStyles) # e.g. ["orchestral", "epic", "cinematic"]
audio = client.music.compose(
composition_plan=plan,
music_length_ms=60000
)
Content Restrictions
- Cannot reference specific artists, bands, or copyrighted lyrics
bad_prompterrors include aprompt_suggestionwith alternative phrasingbad_composition_planerrors include acomposition_plan_suggestion
Error Handling
try:
audio = client.music.compose(prompt="...", music_length_ms=30000)
except Exception as e:
print(f"API error: {e}")
Common errors: 401 (invalid key), 422 (invalid params), 429 (rate limit).
References
Frequently asked questions about ElevenLabs Music Generation
Similar skills
Avatar Video
Create customizable AI avatar videos with ease.
AudioCraft Audio Generation
Generate music and sound effects from text descriptions.
Music Generation
Generate custom music tracks from prompts and lyrics.
Seedance Video Generation
Create AI-generated videos from text, images, and audio.
Seedance 2.0
Generate high-quality cinematic video clips effortlessly.
Face Swap
Easily swap faces in videos using AI technology.
