music
This skill generates music from text prompts using the ElevenLabs Music API, supporting instrumental tracks, songs with lyrics, and fine-grained control…
Identity proven by GitHub's verified organisation badge (elevenlabs)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- 1d08a4apinned Oct 9, 2026
- Context cost
- about 3,300 tokenswhen the skill loads
- GitHub stars
- 482on elevenlabs/skills
- Scripts
- None found
What it does
“Generate music using ElevenLabs Music API. Use when creating instrumental tracks, songs with lyrics, background music, jingles, or any AI-generated music composition. Supports prompt-based generation, composition plans for granular control, and detailed output with metadata.”
Generated summary from the skill's own text
This skill generates music from text prompts using the ElevenLabs Music API, supporting instrumental tracks, songs with lyrics, and fine-grained control through composition plans. It provides methods for prompt-based generation, streaming audio, training custom finetunes, generating background music from video, and editing existing songs through inpainting. The skill requires an ElevenLabs API key and internet access.
When to use it
- Creating instrumental backgrounds, jingles, or full songs from text descriptions
- Generating music synchronized to video content or building custom styles
- Editing or extending existing audio tracks with new sections
- Training custom music models from sample audio files
When not to
- Cannot reference specific artists, bands, or generate copyrighted lyrics
- When offline access or local generation without API keys is required
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add elevenlabs/skills --skill musicInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install elevenlabs/skills music@1d08a4a250cff67cc8056ec31587c031ecb06d2fInstalls the commit we checked (1d08a4a).
Copy by hand
Download the folder at 1d08a4a and put it in .claude/skills/music for Claude Code and in .agents/skills/music for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "music" by ElevenLabs. Source, pinned to commit 1d08a4a250cff67cc8056ec31587c031ecb06d2f: https://github.com/elevenlabs/skills/tree/1d08a4a250cff67cc8056ec31587c031ecb06d2f/music 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/music/ for Claude Code and .agents/skills/music/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/elevenlabs/music
SKILL.md at the pin
---
name: music
description: Generate music using ElevenLabs Music API. Use when creating instrumental tracks, songs with lyrics, background music, jingles, or any AI-generated music composition. Supports prompt-based generation, composition plans for granular control, and detailed output with metadata.
license: MIT
compatibility: Requires internet access and an ElevenLabs API key (ELEVENLABS_API_KEY).
metadata: {"openclaw": {"requires": {"env": ["ELEVENLABS_API_KEY"]}, "primaryEnv": "ELEVENLABS_API_KEY"}}
---
# ElevenLabs Music Generation
Generate music from text prompts - supports instrumental tracks, songs with lyrics, and fine-grained control via composition plans.
> **Setup:** See [Installation Guide](references/installation.md). For JavaScript, use `@elevenlabs/*` packages only.
All examples below use `music_v2_5`, the most advanced generation model. Pass `music_v2` or
`music_v1` only when an older model is explicitly requested.
## Quick Start
### Python
```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,
model_id="music_v2_5",
)
with open("output.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)
```
### TypeScript
```typescript
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,
modelId: "music_v2_5",
});
audio.pipe(createWriteStream("output.mp3"));
```
### CLI
```bash
elevenlabs music compose \
--prompt "A chill lo-fi beat" \
--music-length-ms 30000 \
--model-id music_v2_5 \
--output output.mp3
```
## Methods
| Method | Description |
|--------|-------------|
| `music.compose` | Generate audio from a prompt or composition plan |
| `music.stream` | Stream audio chunks as they are generated (paid plans) |
| `music.composition_plan.create` | Generate a structured plan for fine-grained control |
| `music.compose_detailed` | Generate audio + composition plan + metadata; pass `store_for_inpainting=True` to enable inpainting |
| `music.compose_detailed_stream` | Stream audio plus composition plan, metadata, and optional word timestamps as Server-Sent Events |
| `music.video_to_music` | Generate background music from one or more uploaded video files |
| `music.upload` | Upload an audio file for later inpainting workflows, optionally extracting its composition plan or word-level timestamps |
| `music.finetunes.list` | List accessible music finetunes |
| `music.finetunes.create` | Train a music finetune from uploaded audio |
| `music.finetunes.get` | Retrieve finetune status and metadata |
| `music.finetunes.update` | Update finetune metadata or visibility |
| `music.finetunes.delete` | Delete a music finetune |
See [API Reference](references/api_reference.md) for full parameter details.
`music.upload` is available to enterprise clients with access to the inpainting feature.
## Music Finetunes
Create a finetune from training audio with
[`POST /v1/music/finetunes`](https://elevenlabs.io/docs/api-reference/music/finetunes/create),
then poll the [get endpoint](https://elevenlabs.io/docs/api-reference/music/finetunes/get) until
its status is `completed`. Pass the returned `id` as `finetune_id` when composing music.
Use the [list](https://elevenlabs.io/docs/api-reference/music/finetunes/list),
[update](https://elevenlabs.io/docs/api-reference/music/finetunes/update), and
[delete](https://elevenlabs.io/docs/api-reference/music/finetunes/delete) endpoints to manage
accessible finetunes.
## Video to Music
Generate background music from uploaded video clips via
[`POST /v1/music/video-to-music`](https://elevenlabs.io/docs/api-reference/music/video-to-music)
(`client.music.video_to_music`). This is separate from prompt-based
[`music.compose`](https://elevenlabs.io/docs/api-reference/music/compose) (`POST /v1/music`).
The API combines videos in order, accepts an optional natural-language description, and lets you
steer style with up to 10 tags such as `upbeat` or `cinematic`. This endpoint still defaults to
`music_v1`; pass `model_id="music_v2_5"` to use the most advanced model.
### Python
```python
from elevenlabs import ElevenLabs
client = ElevenLabs()
audio = client.music.video_to_music(
videos=["trailer.mp4"],
description="Build suspense, then resolve with a warm cinematic finish.",
tags=["cinematic", "suspenseful", "uplifting"],
model_id="music_v2_5",
)
with open("video-score.mp3", "wb") as f:
for chunk in audio:
f.write(chunk)
```
### TypeScript
```typescript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";
import { createReadStream, createWriteStream } from "fs";
const client = new ElevenLabsClient();
const audio = await client.music.videoToMusic({
videos: [createReadStream("trailer.mp4")],
description: "Build suspense, then resolve with a warm cinematic finish.",
tags: ["cinematic", "suspenseful", "uplifting"],
modelId: "music_v2_5",
});
audio.pipe(createWriteStream("video-score.mp3"));
```
### CLI
```bash
elevenlabs music video_to_music \
--videos trailer.mp4 \
--description "Build suspense, then resolve with a warm cinematic finish." \
--tags cinematic \
--model-id music_v2_5 \
--output video-score.mp3
```
The CLI currently accepts one `--videos` file and one `--tags` value per request; use the Python
or TypeScript SDK to send multiple videos or tags.
Constraints from the current API schema:
- Upload 1-10 video files per request
- Keep total combined upload size at or below 200 MB
- Keep total combined video duration at or below 600 seconds
- Use `description` for high-level musical direction and `tags` for concise style cues
## Composition Plans
`music_v2_5` composition plans are an ordered list of `chunks`. Each chunk specifies its own
`text` (section label, lyrics, inline cues), `duration_ms`, `positive_styles`, `negative_styles`,
and `context_adherence` (`low`, `medium`, or `high`, default `high`). Up to 30 chunks per plan,
each 3,000–120,000 ms, total length 3 s to 10 minutes. Each chunk's `text` supports up to 6,132
characters, with up to 30 lines of 200 characters each.
Generate a plan first, edit it, then compose:
```python
plan = client.music.composition_plan.create(
prompt="An epic orchestral piece building to a climax",
music_length_ms=60000,
model_id="music_v2_5",
)
# Edit chunks in place
plan["chunks"][0]["text"] = "[Intro]\nQuiet strings rising"
audio = client.music.compose(
composition_plan=plan,
model_id="music_v2_5",
)
```
```typescript
const plan = await client.music.compositionPlan.create({
prompt: "An epic orchestral piece building to a climax",
musicLengthMs: 60000,
modelId: "music_v2_5",
});
plan.chunks[0].text = "[Intro]\nQuiet strings rising";
const audio = await client.music.compose({
compositionPlan: plan,
modelId: "music_v2_5",
});
```
Or hand-build a plan to control lyrics and style per section:
```python
composition_plan = {
"chunks": [
{
"text": "[Verse]\nWalking down an empty street",
"duration_ms": 15000,
"positive_styles": ["pop", "upbeat", "female vocals", "acoustic guitar"],
"negative_styles": ["dark", "slow"],
"context_adherence": "high",
},
{
"text": "[Chorus]\nThis is my moment",
"duration_ms": 15000,
"positive_styles": ["powerful vocals", "full band"],
"negative_styles": [],
"context_adherence": "high",
},
]
}
audio = client.music.compose(composition_plan=composition_plan, model_id="music_v2_5")
```
```typescript
const compositionPlan = {
chunks: [
{
text: "[Verse]\nWalking down an empty street",
durationMs: 15000,
positiveStyles: ["pop", "upbeat", "female vocals", "acoustic guitar"],
negativeStyles: ["dark", "slow"],
contextAdherence: "high",
},
{
text: "[Chorus]\nThis is my moment",
durationMs: 15000,
positiveStyles: ["powerful vocals", "full band"],
negativeStyles: [],
contextAdherence: "high",
},
],
};
const audio = await client.music.compose({
compositionPlan,
modelId: "music_v2_5",
});
```
Put broader characteristics (genre, instrumentation, vocal style) in `positive_styles`, not in
`text`. The first chunk's styles set the overall tone — include 6–7 styles there.
## Output Formats
Use the `output_format` query parameter on compose, detailed compose, or stream requests to select
the generated audio format. `auto` chooses a model-appropriate MP3 format; for `music_v2` and
`music_v2_5`, it selects `mp3_48000_192`. Higher-bitrate MP3 options include
`mp3_48000_240` and `mp3_48000_320`.
## Streaming
For paid plans, stream audio chunks as they are generated instead of waiting for the full file:
```python
from io import BytesIO
stream = client.music.stream(
prompt="A driving synthwave track with arpeggiated leads",
music_length_ms=30000,
model_id="music_v2_5",
)
buffer = BytesIO()
for chunk in stream:
if chunk:
buffer.write(chunk)
```
```typescript
const stream = await client.music.stream({
prompt: "A driving synthwave track with arpeggiated leads",
musicLengthMs: 30000,
modelId: "music_v2_5",
});
const chunks: Buffer[] = [];
for await (const chunk of stream) {
chunks.push(chunk);
}
```
### Detailed streaming
Use detailed streaming when the application needs generated music metadata while audio is still
arriving. `POST /v1/music/detailed/stream` accepts the same prompt or composition-plan body as
detailed compose, streams `text/event-stream`, and can include word timestamps with
`with_timestamps`.
```bash
elevenlabs music compose_detailed_stream \
--prompt "A bright indie pop hook with warm guitars" \
--music-length-ms 30000 \
--model-id music_v2_5 \
--with-timestamps true \
--output-format auto
```
## Inpainting
Inpainting edits or extends a stored song by mixing **audio reference chunks** (unchanged slices
of a stored song) with new **generation chunks** in a single composition plan.
Step 1 — get a `song_id`, either by storing a fresh generation or uploading existing audio:
```python
# Option A: keep a generation for later editing
result = client.music.compose_detailed(
prompt="An upbeat pop song with verse and chorus",
music_length_ms=60000,
model_id="music_v2_5",
store_for_inpainting=True,
)
song_id = result.song_id
# Option B: upload an existing track and extract its plan
uploaded = client.music.upload(
file=open("my-song.mp3", "rb"),
extract_composition_plan="music_v2_5",
)
song_id = uploaded.song_id
composition_plan = uploaded.composition_plan
```
```typescript
import { createReadStream } from "fs";
// Option A: keep a generation for later editing
const result = await client.music.composeDetailed({
prompt: "An upbeat pop song with verse and chorus",
musicLengthMs: 60000,
modelId: "music_v2_5",
storeForInpainting: true,
});
let songId = result.songId;
// Option B: upload an existing track and extract its plan
const uploaded = await client.music.upload({
file: createReadStream("my-song.mp3"),
extractCompositionPlan: "music_v2_5",
});
songId = uploaded.songId;
const compositionPlan = uploaded.compositionPlan;
```
Step 2 — compose a plan that references the stored audio and regenerates the part you want to
change:
```python
plan = {
"chunks": [
{"song_id": song_id, "range": {"start_ms": 0, "end_ms": 30000}},
{
"text": "[Chorus]\nWe're rising up tonight",
"duration_ms": 30000,
"positive_styles": ["bigger drums", "layered vocals", "anthemic"],
"negative_styles": ["sparse"],
"context_adherence": "high",
},
]
}
audio = client.music.compose(composition_plan=plan, model_id="music_v2_5")
```
```typescript
const plan = {
chunks: [
{ songId, range: { startMs: 0, endMs: 30000 } },
{
text: "[Chorus]\nWe're rising up tonight",
durationMs: 30000,
positiveStyles: ["bigger drums", "layered vocals", "anthemic"],
negativeStyles: ["sparse"],
contextAdherence: "high",
},
],
};
const audio = await client.music.compose({
compositionPlan: plan,
modelId: "music_v2_5",
});
```
To match the feel of a stored slice without copying it, attach a `conditioning_ref` (up to
30,000 ms) plus a `condition_strength` of `low`, `medium`, `high`, or `xhigh` to a generation
chunk. Conditioning placed on the first chunk influences every later chunk.
See [API Reference](references/api_reference.md) for the full inpainting parameter list.
## Content Restrictions
- Cannot reference specific artists, bands, or copyrighted lyrics
- `bad_prompt` errors include a `prompt_suggestion` with alternative phrasing
- `bad_composition_plan` errors include a `composition_plan_suggestion`
## Error Handling
```python
try:
audio = client.music.compose(prompt="...", music_length_ms=30000)
except Exception as e:
print(f"API error: {e}")
```
```typescript
try {
const audio = await client.music.compose({
prompt: "...",
musicLengthMs: 30000,
});
} catch (err) {
console.error("API error:", err);
}
```
Common errors: 401 (invalid key), 422 (invalid params), 429 (rate limit).
## References
- [Installation Guide](references/installation.md)
- [API Reference](references/api_reference.md)
From elevenlabs/skills at 1d08a4a, shown as plain text under its license: MIT (permissive). The license text is in music/SKILL.md.
View SKILL.md on GitHub at 1d08a4aFiles
- SKILL.md14 KB · f2e204571b39
- references/
- api_reference.md18 KB · fd913eb337ca
- installation.md2.0 KB · 2ef32cf83d7f
3 files, 34 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 1d08a4aAlso in
The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.
More from ElevenLabs
agents
Build voice AI agents with natural conversation capabilities using ElevenLabs platform.
Contains scripts
Claude Code, Codex, Cursor +3 · about 6.4K tokens · pinned 6 days ago
dubbing
This skill dubs audio and video into other languages using ElevenLabs' Dubbing API, preserving original speakers' voices.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.1K tokens · pinned 6 days ago
setup-api-key
This skill guides users through obtaining and configuring an ElevenLabs API key for text-to-speech integrations.
Claude Code, Codex, Cursor +4 · about 840 tokens · pinned 6 days ago
sound-effects
This skill generates sound effects from text descriptions using ElevenLabs API, supporting various audio formats, custom durations up to 30 seconds, looping…
Contains scripts
Claude Code, Codex, Cursor +3 · about 830 tokens · pinned 6 days ago
speech-engine
This skill integrates ElevenLabs Speech Engine to add real-time voice conversations to custom agent runtimes.
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago
speech-to-text
Transcribe audio and video files to text using ElevenLabs Scribe v2, supporting 90+ languages, speaker identification, and word-level timestamps.
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.4K tokens · pinned 6 days ago
Related in Media and creative
text-to-speech
This skill converts text to speech using ElevenLabs API, supporting 90+ languages and multiple models optimized for quality or latency.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago
voice-changer
Converts the voice in an audio recording to a different target voice using ElevenLabs Speech-to-Speech API, preserving emotion, timing, and delivery.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 2.7K tokens · pinned 6 days ago
voice-isolator
This skill removes background noise and isolates vocals or speech from audio files using the ElevenLabs Voice Isolator API.
by ElevenLabsOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 770 tokens · pinned 6 days ago
creative-studio
This skill enables agents to generate and edit media including voiceovers, images, videos, music, and transcriptions through the ElevenLabs MCP server.
by ElevenLabsOfficial publisher
Claude Code, Codex, Cursor +4 · about 740 tokens · pinned 6 days ago
all-images-ai-automation
This skill automates All Images AI operations by discovering and executing tools through Composio's All Images AI toolkit via Rube MCP.
by ComposioOfficial publisher
Agents not labelled yet · about 710 tokens · pinned 6 days ago
remotion-best-practices
This skill routes the agent through Remotion's specialized knowledge bases for video creation, editing, and deployment.
by RemotionOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 920 tokens · pinned 6 days ago
Open roles at ElevenLabs
5 of 26 open roles on the jobs board
- Full-Stack Engineer (Back-End Leaning)
Remote (Global) (Remote)
- Infrastructure Engineer
Remote (Global) (Remote)
- Enterprise Solutions Engineer - Canada
Canada (Remote)
- Deployment Strategist - Colombia
Colombia (Remote)
- Enterprise Solutions Engineer - Greece
Greece (Remote)