[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [ElevenLabs Music v2](https://spiral.ai/integrations/opencode/elevenlabs-music-v2)

# 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.

|  |  |
| --- | --- |
| Model | ElevenLabs Music v2 |
| Available through | fal |
| Category | Audio |
| Price | $0.78 per 60,000 seconds. Billed on `music_length_ms`, default 600,000. |
| Returns | audio |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with ElevenLabs Music v2 in opencode

- 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.
- 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.

```bash
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.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
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.

```bash
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.

```bash
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.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## ElevenLabs Music v2 tools and prices

- [Elevenlabs Music v2](https://spiral.ai/tools/fal/elevenlabs/music/v2) (fal): $0.78 per minute. Billed on `music_length_ms`, default 600,000, rounded up to the next minute.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| prompt |  | — | The text prompt describing the music to generate |
| composition_plan |  | — | The chunk-based composition plan for the music |
| music_length_ms | 3000 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_instrumental |  | false | 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. |
| seed |  | — | 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_format | mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, mp3_48000_128, mp3_48000_192, mp3_48000_240, mp3_48000_320, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_32000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192 | mp3_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. |

## 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.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## ElevenLabs Music v2 in other agents

- [Amp](https://spiral.ai/integrations/amp/elevenlabs-music-v2)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/elevenlabs-music-v2)
- [Claude](https://spiral.ai/integrations/claude-desktop/elevenlabs-music-v2)
- [Claude Code](https://spiral.ai/integrations/claude-code/elevenlabs-music-v2)
- [Cline](https://spiral.ai/integrations/cline/elevenlabs-music-v2)
- [Codex](https://spiral.ai/integrations/codex/elevenlabs-music-v2)
- [Cursor](https://spiral.ai/integrations/cursor/elevenlabs-music-v2)
- [Devin](https://spiral.ai/integrations/devin/elevenlabs-music-v2)
- [dots](https://spiral.ai/integrations/dots/elevenlabs-music-v2)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/elevenlabs-music-v2)
- [Gemini](https://spiral.ai/integrations/gemini/elevenlabs-music-v2)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/elevenlabs-music-v2)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/elevenlabs-music-v2)
- [goose](https://spiral.ai/integrations/goose/elevenlabs-music-v2)
- [Grok](https://spiral.ai/integrations/grok/elevenlabs-music-v2)
- [Grok Build](https://spiral.ai/integrations/grok-build/elevenlabs-music-v2)
- [Hermes](https://spiral.ai/integrations/hermes/elevenlabs-music-v2)
- [Instinct](https://spiral.ai/integrations/instinct/elevenlabs-music-v2)
- [Manus](https://spiral.ai/integrations/manus/elevenlabs-music-v2)
- [Muse](https://spiral.ai/integrations/muse/elevenlabs-music-v2)
- [Muse Code](https://spiral.ai/integrations/muse-code/elevenlabs-music-v2)
- [n8n](https://spiral.ai/integrations/n8n/elevenlabs-music-v2)
- [Notion](https://spiral.ai/integrations/notion/elevenlabs-music-v2)
- [OpenClaw](https://spiral.ai/integrations/openclaw/elevenlabs-music-v2)
- [Perplexity](https://spiral.ai/integrations/perplexity/elevenlabs-music-v2)
- [Raycast](https://spiral.ai/integrations/raycast/elevenlabs-music-v2)
- [VS Code](https://spiral.ai/integrations/vscode/elevenlabs-music-v2)
- [Windsurf](https://spiral.ai/integrations/windsurf/elevenlabs-music-v2)
- [Zapier](https://spiral.ai/integrations/zapier/elevenlabs-music-v2)

## More opencode guides

- [ElevenLabs Music](https://spiral.ai/integrations/opencode/elevenlabs-music)
- [ElevenLabs Scribe v1](https://spiral.ai/integrations/opencode/elevenlabs-scribe-v1)
- [ElevenLabs Multilingual v2](https://spiral.ai/integrations/opencode/elevenlabs-multilingual-v2)
- [ElevenLabs Scribe v2](https://spiral.ai/integrations/opencode/elevenlabs-scribe-v2)
- [ElevenLabs Forced Alignment](https://spiral.ai/integrations/opencode/elevenlabs-forced-alignment)
- [ElevenLabs Sound Effects](https://spiral.ai/integrations/opencode/elevenlabs-sound-effects)

## 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.

