Spiral gives your agent every tool with one account. Browse the tools →

opencode · AudioReleased 2026-05-26

How to Use ElevenLabs Music v2 in opencode

ElevenLabs Music v2 makes complete songs and instrumental scores, including fast rap and genre changes within a track. Compared with Music v1, it improves vocal delivery, arrangement, and multilingual generation.

Prompts to try with ElevenLabs Music v2 in opencode

Copy an example into opencode, or ask in your own words.

Read the game's opening scene and use ElevenLabs Music v2 to create a 60-second instrumental exploration cue: ambient fantasy, curious mood, flute and soft strings, 80 BPM, acoustic production.

ElevenLabs Music v2opencode
Try asking
  • Read the product demo script and use ElevenLabs Music v2 to generate a 45-second instrumental bed with warm electric piano, restrained drums, 95 BPM, and a quiet middle for narration.

  • Use ElevenLabs Music v2 to score the trailer outline in this project with a 60-second composition plan: 20 seconds of tension, 25 seconds of orchestral build, and 15 seconds of resolution.

  • Read the original lyrics in the project and use ElevenLabs Music v2 to create a 90-second Spanish pop demo. Write the style directions in English and separate the verse, chorus, and outro.

  • Use ElevenLabs Music v2 to generate a 10-second instrumental victory theme for this game: bright brass, snare drum, triumphant mood, 120 BPM, orchestral production, and a clear final chord.

How to set up ElevenLabs Music v2 in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the server

    Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

    opencode mcp add spiral --global --url https://api.spiral.ai/mcp
  2. Sign in

    Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.

    opencode mcp auth spiral
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run ElevenLabs Music v2

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "fal",
        "model": "elevenlabs/music/v2",
        "input": {
          "prompt": "Mysterious original soundtrack, themes of jungle, rainforest, nature, woodwinds, busy rhythmic tribal percussion."
        }
      }'

Then paste one of the prompts above: opencode finds ElevenLabs Music v2 on Spiral, shows the price and runs it.

ElevenLabs Music v2 providers and prices

Spiral runs ElevenLabs Music v2 through fal. Open a card for today's price, with every fee included.

falAudio
Elevenlabs Music v2
elevenlabs/music/v2

Settings you can ask for

ElevenLabs Music v2 works from your prompt. Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Music length ms3000 to 600000

The length of the song to generate in milliseconds. Used only in conjunction with prompt. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.

Force instrumentalon or offoff

If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the prompt. Can only be used with prompt.

Seeda whole number

Random seed to initialize the music generation process. Can only be used with composition_plan. The same seed with the same parameters gives more consistent results, but exact reproducibility is not guaranteed.

Output formatmp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, mp3_48000_128 and 17 moremp3_48000_192

Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.

Every API field of Elevenlabs Music v2 is on its tool page: open its card above.

What can you do with ElevenLabs Music v2 in opencode?

Create music assets from the project's game scenes, demo scripts, and creative briefs. The agent can turn those files into specific musical directions and section plans for ElevenLabs Music v2.

Podcast intros and outros

Create a short instrumental theme with a clear opening motif and a deliberate ending. Describe the instruments and production era so the brief has a recognizable sound.

Product demo soundtracks

Generate a restrained instrumental bed for a narrated demonstration. Request sparse instrumentation and a gradual build that follows the written scene outline.

Short ad scores

Compose a 30-second cue with an opening hook, a quieter middle, and a closing musical phrase. Use a composition plan to define those sections.

Game scene music

Turn a written scene brief into an exploration, tension, or victory cue. Specify the mood, instruments, and tempo for each section.

Multilingual song demos

Develop original lyrics into vocal demos in English, Spanish, German, or Japanese. Keep the musical style directions in English.

Rap songwriting demos

Try original rap lyrics over a defined beat and arrangement. Request the delivery style and section structure instead of leaving them implicit.

Music with changing genres

Compose a continuous track that moves between contrasting genres, such as orchestral music and heavy metal. Describe the order and character of each transition.

Film cue sketches

Draft a score from a written dramatic arc: tension, climax, and resolution. Give each section its own duration and musical direction.

Questions about ElevenLabs Music v2 in opencode

Can opencode use ElevenLabs Music v2?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run ElevenLabs Music v2 like any built-in tool.

How much does ElevenLabs Music v2 cost in opencode?

$0.78 per 60,000 seconds. Billed on `music_length_ms`, default 600,000. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

Do I need a fal account to use ElevenLabs Music v2 in opencode?

No. Spiral runs ElevenLabs Music v2 on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up ElevenLabs Music v2 in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while ElevenLabs Music v2 runs?

ElevenLabs Music v2 runs in the background. opencode starts the run, checks on it and gives you the audio when it's ready.

What is ElevenLabs Music v2 good at?

It creates complete songs and instrumental scores, with support for fast rap and genre changes within one track. Compared with Music v1, it improves composition, multilingual output, and vocal delivery.

How long can a Music v2 track be?

A track can run from 3 seconds to 10 minutes. In a composition plan, each section must last between 3 and 120 seconds.

Can Music v2 sing in languages other than English?

Yes. Documented vocal languages include Spanish, German, and Japanese, alongside English.

What should I put in a music prompt?

Specify genre, mood, instruments, tempo, and production era. For example, ask for mellow 1990s boom bap at 90 BPM with dusty drums and warm electric piano.

When should I use a composition plan?

Use a composition plan when section structure, lyric placement, or multiple vocalists need deliberate control. Write the style descriptions in English, even when the lyrics use another language.

Get started

Start using ElevenLabs Music v2 in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options