I Tried Out the New Ability to Generate Audio Data by Specifying Musical Style and Length with the Composition Plan in the ElevenLabs Music v2 API

I Tried Out the New Ability to Generate Audio Data by Specifying Musical Style and Length with the Composition Plan in the ElevenLabs Music v2 API

I tried the "composition plan" feature in ElevenLabs' new Music v2 API, which lets you set duration, lyrics and style per section. I generated an original J-pop demo and a 45-second orchestral piece, and share my process and takeaways.
2026.06.19

This page has been translated by machine translation. View original

Hi! I'm Yuji Nishimura from the Ops Team!

The Music v2 API was added in ElevenLabs's June 15, 2026 Changelog.

With music_v2, in addition to generating songs from just a prompt as before, you can use composition_plan to specify a song's sections, durations, lyrics, and styles chunk by chunk.

In this article, I'll use the music_v2 composition plan to generate a short original J-pop demo and a 45-second orchestral piece.

What Changed in the Music v2 API

According to the Changelog, specifying music_v2 for model_id lets you use the new model in Generate music, Stream music, Generate music detailed, and Upload music.

The major change is the chunk-based composition plan using GenerationChunk and AudioRefChunk. The official documentation explains that a music_v2 plan is treated as an ordered list of chunks, and each chunk can have its own lyrics, styles, and duration per section.

Roughly speaking, they can be used as follows.

Usage Suitable case
Generate with prompt only You want to quickly try out a mood first
Generate with composition_plan You want to specify the song structure, lyrics, and the duration of each section
Create a plan with /v1/music/plan and then generate You want the AI to draft it rather than writing the JSON from scratch yourself

Note that in the official guide on composition plans, prompt and composition_plan are not used together; you specify one or the other.

Environment Used

The environment used for this test is as follows.

  • Run date: 2026-06-17
  • OS: macOS
  • API: ElevenLabs Music API
  • Model: music_v2
  • Execution method: curl + jq
  • Output format: mp3_48000_192

The API key is set in the environment variable ELEVENLABS_API_KEY. The key value is not covered in this article.

export ELEVENLABS_API_KEY="<YOUR_ELEVENLABS_API_KEY>"

First, Generate a Composition Plan

First, we generate a composition plan using POST /v1/music/plan.

This endpoint returns not the audio itself but JSON of the song structure. According to the official Create composition plan, this endpoint itself can be used without consuming credits, but it is subject to rate limits depending on your plan.

This time, I tried a prompt to create a 10-second city-pop-style instrumental.

jq -n \
  --arg prompt 'Create a 10-second instrumental city pop loop for a product demo. Structure it as a soft intro, a brighter main groove, and a clean ending. Use 95 BPM, electric piano, muted guitar, light bass, tight drums, and no vocals.' \
  '{prompt:$prompt,music_length_ms:10000,model_id:"music_v2"}' \
| curl -sS \
  -X POST 'https://api.elevenlabs.io/v1/music/plan' \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary @- \
| jq .

The returned plan was JSON with chunks. In practice, it was split into three sections: Intro, Main Groove, and Ending, as follows.

{
  "chunks": [
    {
      "text": "[Soft Intro]",
      "duration_ms": 3000,
      "positive_styles": [
        "city pop",
        "instrumental",
        "95 bpm",
        "electric piano",
        "muted guitar"
      ],
      "negative_styles": [
        "vocals",
        "aggressive",
        "heavy metal"
      ],
      "context_adherence": "high"
    },
    {
      "text": "[Brighter Main Groove]",
      "duration_ms": 4500,
      "positive_styles": [
        "bright funky muted guitar riffing",
        "tight snare drum and hi-hat groove",
        "funky walking bassline"
      ],
      "negative_styles": [
        "distorted lead guitar",
        "vocals"
      ],
      "context_adherence": "high"
    },
    {
      "text": "[Clean Ending]",
      "duration_ms": 3000,
      "positive_styles": [
        "staccato electric piano stabs",
        "clean guitar tail",
        "snare hit ending on beat"
      ],
      "negative_styles": [
        "fade out",
        "reverb crash",
        "vocals"
      ],
      "context_adherence": "high"
    }
  ]
}

In the API reference examples in the official documentation, the plan shapes of music_v1 and music_v2 seem to be mixed in places, but the response from running with model_id: "music_v2" this time was chunks-based.

Generate Music from the Composition Plan

Next, we pass the generated plan to POST /v1/music to generate an audio file.

With the Compose music API, you can generate a song by specifying either prompt or composition_plan. The default output format for music_v2 is mp3_48000_192, but this time I specified it explicitly via a query parameter.

jq -n --slurpfile plan /tmp/elevenlabs_music_v2_plan.json '{
  model_id: "music_v2",
  composition_plan: $plan[0]
}' \
| curl -sS \
  -X POST 'https://api.elevenlabs.io/v1/music?output_format=mp3_48000_192' \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary @- \
  -o elevenlabs_music_v2_citypop.mp3

The result was HTTP 200, and an MP3 file was generated.

Content-Type: audio/mpeg
MPEG Layer III, 192 kbps, 48 kHz, Joint Stereo
Duration: 10.512 seconds

I was able to confirm that everything from plan generation to audio generation can be run end to end with just the REST API.

The generated audio is below.
https://app.box.com/s/w4p0vcd8244bcq9ihpun38wuev3wu7eq

Trying to Make a J-pop Demo

Now for the main part.

To make a short J-pop demo, I had the AI write a composition plan that supports J-pop songs and lyrics. I avoided resembling any existing artists or songs, making it a completely original demo, and split it into 5 chunks: Intro, Verse, Pre-Chorus, Chorus, and Outro.

{
  "model_id": "music_v2",
  "composition_plan": {
    "chunks": [
      {
        "text": "[Intro]\n{instrumental hook}",
        "duration_ms": 4000,
        "positive_styles": [
          "modern J-pop",
          "bright female vocal production",
          "128 BPM",
          "A major",
          "sparkling electric piano",
          "clean electric guitar",
          "tight pop drums",
          "warm synth pad",
          "catchy instrumental hook",
          "polished radio mix"
        ],
        "negative_styles": [
          "existing artist imitation",
          "cover song",
          "dark",
          "heavy metal",
          "lo-fi",
          "distorted vocals"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Verse 1]\n夜明け前のホームで\nほどけた夢を結んだ",
        "duration_ms": 8000,
        "positive_styles": [
          "gentle verse",
          "clear Japanese female vocals",
          "natural Japanese pronunciation",
          "spacious phrasing",
          "soft electric piano",
          "light guitar arpeggios",
          "subtle sidechain synth",
          "steady pop groove"
        ],
        "negative_styles": [
          "rap",
          "shouting",
          "spoken word",
          "a cappella",
          "crammed lyrics",
          "rushed syllables",
          "overly dramatic vibrato"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Pre-Chorus]\n風が背中を押す",
        "duration_ms": 6000,
        "positive_styles": [
          "rising pre chorus",
          "clear Japanese female vocals",
          "natural Japanese pronunciation",
          "building drums",
          "layered harmonies",
          "uplifting synth lift",
          "snare build",
          "emotional but hopeful"
        ],
        "negative_styles": [
          "dropout",
          "quiet ending",
          "dark chord change",
          "crammed lyrics",
          "rushed syllables",
          "screaming"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Chorus]\n走れ 朝焼けライン\n胸の奥まで照らして\n新しい今日へ",
        "duration_ms": 11000,
        "positive_styles": [
          "big J-pop chorus",
          "clear Japanese female vocals",
          "natural Japanese pronunciation",
          "spacious singable topline",
          "catchy topline",
          "full band",
          "bright synth strings",
          "driving drums",
          "wide vocal harmonies",
          "uplifting melody",
          "radio-ready hook"
        ],
        "negative_styles": [
          "sad ballad",
          "minimal arrangement",
          "low energy",
          "crammed lyrics",
          "rushed syllables",
          "spoken voice"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Outro]\n{short instrumental tag}\n朝焼けライン",
        "duration_ms": 3000,
        "positive_styles": [
          "short outro",
          "clean final chord",
          "sparkling synth tail",
          "memorable pop ending"
        ],
        "negative_styles": [
          "long fade out",
          "abrupt cut",
          "dark ending"
        ],
        "context_adherence": "high"
      }
    ]
  }
}

I passed this plan as is to POST /v1/music to generate the song.

curl -sS \
  -X POST 'https://api.elevenlabs.io/v1/music?output_format=mp3_48000_192' \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary @composition-plan.json \
  -o elevenlabs_jpop_asayake-line.mp3

The generation results are as follows.

HTTP 200
Content-Type: audio/mpeg
File size: 769,005 bytes
Format: MP3, 48 kHz, 192 kbps
Duration: 32.040 seconds

The generated song is below.
There are some dubious parts, but the song came out nicely.
https://app.box.com/s/51wq9sd7px5dhpajza133gbij5ab3aji

Changing the Style and Length to Make a 45-Second Song

A composition plan is also easy to work with when you want to change the style or length.

As a test, separately from the J-pop demo, I also made a 45-second orchestral piece with a specified duration in which the main melody plays right from the start with no intro. The premise is a completely original BGM for a fantasy RPG, not a recreation of any existing game work or composer.

The whole plan is long, so here I'll excerpt just the key points.

{
  "model_id": "music_v2",
  "composition_plan": {
    "chunks": [
      {
        "text": "[Main Theme - immediate start]\n{full heroic orchestral theme begins on the first beat}",
        "duration_ms": 12000,
        "positive_styles": [
          "original fantasy RPG orchestral music",
          "immediate main theme",
          "no intro",
          "grand symphonic arrangement",
          "full strings",
          "heroic brass fanfare",
          "timpani and cymbal swells",
          "cinematic game soundtrack",
          "majestic and adventurous",
          "140 BPM"
        ],
        "negative_styles": [
          "existing game franchise imitation",
          "cover song",
          "recognizable melody",
          "slow intro",
          "fade in",
          "lyrics"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Rising Adventure]\n{strings drive forward while brass answers the main theme}",
        "duration_ms": 10000,
        "positive_styles": [
          "driving ostinato strings",
          "French horns answer melody",
          "snare and timpani rhythm",
          "heroic journey feeling",
          "fantasy world map energy"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Heroic Lift]\n{main theme modulates upward with brighter brass and soaring strings}",
        "duration_ms": 10000,
        "positive_styles": [
          "soaring violin melody",
          "bright brass counter melody",
          "wordless choir texture",
          "uplifting modulation",
          "large fantasy battle theme"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Climax]\n{full orchestra peaks with percussion hits and triumphant cadence}",
        "duration_ms": 10000,
        "positive_styles": [
          "full orchestra climax",
          "triumphant brass",
          "rapid string runs",
          "crash cymbals",
          "timpani rolls"
        ],
        "context_adherence": "high"
      },
      {
        "text": "[Final Hit]\n{short decisive orchestral ending with a resonant final chord}",
        "duration_ms": 3000,
        "positive_styles": [
          "decisive final chord",
          "orchestral hit",
          "short reverb tail",
          "complete ending",
          "no fade out"
        ],
        "context_adherence": "high"
      }
    ]
  }
}

You just pass this plan to the same POST /v1/music.

curl -sS \
  -X POST 'https://api.elevenlabs.io/v1/music?output_format=mp3_48000_192' \
  -H "xi-api-key: ${ELEVENLABS_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data-binary @fantasy-rpg-plan.json \
  -o elevenlabs_fantasy-rpg_45s_no-intro.mp3

The generation results are as follows.

HTTP 200
Content-Type: audio/mpeg
File size: 1,080,621 bytes
Format: MP3, 48 kHz, 192 kbps
Duration: 45.024 seconds

From the 32-second J-pop demo to a grand 45-second orchestral piece, I could generate both from the same API just by changing the JSON duration_ms and style specifications. Since the request can include the style, the length, and even how the piece starts right away, it's easy to work with when you want to quickly make short BGM material or demo tracks.

The generated song is below.
https://app.box.com/s/ow3pc4qmjc9pux8jm74jmh3z6c630nm6

What I Learned from Actually Trying It

Being able to handle song structure as JSON is convenient

When generating a song with just a prompt, even if you write "include a verse, pre-chorus, and chorus," how far the actual durations and divisions are reflected tends to be left up to the model.

With a composition plan, at least as the intent on the request side, you can specify the song structure explicitly, such as 4 seconds for the Intro, 8 seconds for the Verse, 6 seconds for the Pre-Chorus, 11 seconds for the Chorus, and 3 seconds for the Outro.

In music_v2, section durations are always respected, and respect_sections_durations is described as a parameter for music_v1. This point is also clear if you want to make a song on the premise of a specified structure.

Japanese lyrics could be passed in as is

In this J-pop demo, I put Japanese lyrics directly into text. In this short test, there was no API error and an MP3 was generated.

However, how well the lyrics can be heard and how natural the pronunciation is depend on the style, length, and amount of lyrics. For short demos, it seems easier to work with if you don't cram too many lyrics into each chunk. Also, since there are misreadings of kanji, small adjustments such as rewriting the lyrics in hiragana still seem necessary.

You can experiment while changing the style and length

For the J-pop demo, I generated a 32.040-second MP3 with the structure Intro, Verse, Pre-Chorus, Chorus, and Outro. Next, when I passed the same endpoint a plan in a different direction—no intro, 45 seconds, a grand fantasy RPG-style orchestral piece—a 45.024-second MP3 was generated.

Being able to produce this difference with just an API request is convenient. Rather than just roughly specifying the style and length in text, you can write instructions per chunk such as "this part is 12 seconds," "build up from here," and "finish decisively in 3 seconds at the end," so it seems well suited to a workflow of making short BGM tailored to the purpose.

negative_styles also helps with tuning

In this plan, I put things like existing artist imitation, cover song, a cappella, and spoken voice in negative_styles.

In music generation, being able to write not only what you want to include but also what you want to avoid makes trial and error easier. Especially when you want to generate an original song, it's easier to work with if you not only avoid specifications that resemble existing artists or songs but also state them explicitly on the negative side.

I want to try the detailed endpoint separately

This time I received MP3s from the regular POST /v1/music.

Generate music detailed returns a multipart/mixed response containing JSON metadata and a binary audio file, so it seems convenient if you also want to handle the metadata of the generated result.

However, it seemed better to prepare an SDK or a small parsing script than to handle it with curl alone, so this time I focused on regular audio generation.

Caveats

Even plan generation didn't work without an API key

The /v1/music/plan is described as not consuming credits, but in this environment, calling it without an API key resulted in HTTP 401.

{
  "status": "needs_authorization",
  "message": "Neither authorization header nor xi-api-key received, please provide one."
}

It seems best to think of not consuming credits and being usable without authentication as separate matters.

Check your plan and the terms for publishing and commercial use

In this article, I generated short demos as a technical verification.

If you publish the generated output or incorporate it into videos, ads, or products, please check your current plan, the commercial use conditions, and the handling of outputs on the official Pricing page and the terms of service.

Summary

Using the composition plan of the ElevenLabs Music v2 API, I generated a short original J-pop demo and a 45-second orchestral piece.

Within the scope of this test, the music_v2 composition_plan was convenient when you want to handle the song structure as JSON. In particular, since you can specify the duration, lyrics, desired styles, and styles to avoid separately for each section, it's easier to organize your intent than with one-shot prompt generation.

On the other hand, the final intelligibility of the lyrics and the impression of the melody need to be judged by listening to the generated results. A workflow that seems easy to work with is to first create a structure draft with /v1/music/plan, generate with a short duration, and then refine the plan while changing the style and length.

Next, I'd like to handle responses with metadata using POST /v1/music/detailed and also compare the differences between prompt-only generation and composition plan specification.

I hope this is helpful to someone.


Reference links:

Share this article