Eleven Music v2.5
curl --request POST \
--url https://api.snapgen.org/v1/audio/music \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"duration_seconds": 123,
"instrumental": true,
"response_format": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/music"
payload = {
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"duration_seconds": 123,
"instrumental": True,
"response_format": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
lyrics: '<string>',
duration_seconds: 123,
instrumental: true,
response_format: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.snapgen.org/v1/audio/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'lyrics' => '<string>',
'duration_seconds' => 123,
'instrumental' => true,
'response_format' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.snapgen.org/v1/audio/music"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.snapgen.org/v1/audio/music")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyElevenLabs Music & Sound
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.
POST
/
v1
/
audio
/
music
Eleven Music v2.5
curl --request POST \
--url https://api.snapgen.org/v1/audio/music \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"duration_seconds": 123,
"instrumental": true,
"response_format": "<string>"
}
'import requests
url = "https://api.snapgen.org/v1/audio/music"
payload = {
"model": "<string>",
"prompt": "<string>",
"lyrics": "<string>",
"duration_seconds": 123,
"instrumental": True,
"response_format": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
lyrics: '<string>',
duration_seconds: 123,
instrumental: true,
response_format: '<string>'
})
};
fetch('https://api.snapgen.org/v1/audio/music', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.snapgen.org/v1/audio/music",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'lyrics' => '<string>',
'duration_seconds' => 123,
'instrumental' => true,
'response_format' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.snapgen.org/v1/audio/music"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.snapgen.org/v1/audio/music")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snapgen.org/v1/audio/music")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"lyrics\": \"<string>\",\n \"duration_seconds\": 123,\n \"instrumental\": true,\n \"response_format\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyeleven-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) |
string
required
Set to
eleven-music-v2.5.string
required
What the music should sound like, up to 4,100 characters: genre, mood,
instruments, tempo, and structure.
string
Lyrics to sing, up to 4,000 characters.
integer
default:"30"
Length in whole seconds, from
3 to 300. Billed as requested.boolean
true guarantees an instrumental with no vocals.string
default:"mp3"
mp3, opus, or pcm. See
Output formats.Request
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
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())
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()));
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
lyricswhen 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 |
To edit a song in later steps, such as extending, covering, remixing, or
splitting stems, generate it with
suno-music
or flow-music instead. Those models run as
tasks that later operations can reference.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
for the response and errors.