> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snapgen.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Eleven Music v2.5

> Compose songs and instrumentals of 3 to 300 seconds with ElevenLabs Music v2.5, billed per requested second. $0.225 per minute.

`eleven-music-v2.5` composes a song or an instrumental from a text prompt, with optional lyrics, and returns the finished audio file in the response. You choose the length, from 3 seconds to 5 minutes, and pay for exactly that length.

| Property | Value |
| - | - |
| Model ID | `eleven-music-v2.5` |
| Endpoint | `POST /v1/audio/music` (synchronous) |
| Output | Audio bytes: MP3 (default), Opus, or PCM |
| Length | 3 to 300 seconds (default 30) |
| Billed on | Requested `duration_seconds` |
| Price | \$0.00375 per second (\$0.225 per minute, 0.375 credits per second) |

Confirm live rates on the [SnapGen models page](https://snapgen.org/models). Failed requests are not charged.

<ParamField body="model" type="string" required>
  Set to `eleven-music-v2.5`.
</ParamField>

<ParamField body="prompt" type="string" required>
  What the music should sound like, up to 4,100 characters: genre, mood,
  instruments, tempo, and structure.
</ParamField>

<ParamField body="lyrics" type="string">
  Lyrics to sing, up to 4,000 characters.
</ParamField>

<ParamField body="duration_seconds" type="integer" default="30">
  Length in whole seconds, from `3` to `300`. Billed as requested.
</ParamField>

<ParamField body="instrumental" type="boolean">
  `true` guarantees an instrumental with no vocals.
</ParamField>

<ParamField body="response_format" type="string" default="mp3">
  `mp3`, `opus`, or `pcm`. See
  [Output formats](/api-reference/audio-speech#output-formats).
</ParamField>

## Request

```bash theme={null}
curl https://api.snapgen.org/v1/audio/music \
  -H "Authorization: Bearer $SNAPGEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "eleven-music-v2.5",
    "prompt": "Uplifting cinematic trailer score with strings and big drums",
    "duration_seconds": 30
  }' \
  --output music.mp3
```

The request waits until the track is finished and returns the audio as the
body, so give your client a timeout of several minutes.

<CodeGroup>
  ```python Python theme={null}
  import json
  import os
  from urllib.request import Request, urlopen

  request = Request(
      "https://api.snapgen.org/v1/audio/music",
      data=json.dumps({
          "model": "eleven-music-v2.5",
          "prompt": "Warm acoustic folk song about a road trip, finger-picked guitar",
          "lyrics": "Miles of gold behind us\nKeep the windows down",
          "duration_seconds": 60,
      }).encode(),
      headers={
          "Authorization": f"Bearer {os.environ['SNAPGEN_API_KEY']}",
          "Content-Type": "application/json",
      },
  )

  with urlopen(request, timeout=600) as response, open("song.mp3", "wb") as file:
      file.write(response.read())
  ```

  ```javascript Node.js theme={null}
  import { writeFile } from "node:fs/promises";

  const response = await fetch("https://api.snapgen.org/v1/audio/music", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SNAPGEN_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "eleven-music-v2.5",
      prompt: "Lo-fi hip hop beat for studying, vinyl crackle, mellow keys",
      instrumental: true,
      duration_seconds: 120,
    }),
    signal: AbortSignal.timeout(600_000),
  });
  if (!response.ok) throw new Error(await response.text());
  await writeFile("beat.mp3", Buffer.from(await response.arrayBuffer()));
  ```
</CodeGroup>

## Write the prompt

* **Describe the sound:** genre, mood, instruments, tempo, and vocal style,
  for example `Uplifting cinematic trailer score with strings and big drums`.
* **Add lyrics** in `lyrics` when you want specific words sung, up to 4,000
  characters.
* **Force an instrumental** with `instrumental: true`, for background music or
  beds under speech.
* **Pick the length** with `duration_seconds`. You pay for the length you ask
  for, so request only what you need.

## Price examples

| Length | Price |
| - | - |
| 10 seconds | \$0.0375 |
| 30 seconds (default) | \$0.1125 |
| 60 seconds | \$0.225 |
| 300 seconds | \$1.125 |

<Tip>
  To edit a song in later steps, such as extending, covering, remixing, or
  splitting stems, generate it with [`suno-music`](/api-manual/audio/suno-music)
  or [`flow-music`](/api-manual/audio/flow-music) instead. Those models run as
  tasks that later operations can reference.
</Tip>

<Note>
  Synchronous audio endpoints reject `Idempotency-Key`. If a request times
  out, the track may already have been generated: check your Console request
  logs before you retry. See [Music composition](/api-reference/audio-music)
  for the response and errors.
</Note>
