Mage API · Audio model
Eleven Music API
ElevenLabs songs, with vocals or without
POST https://api.mage.space/v1/eleven_music/generateAt a glance
The Eleven Music API runs Eleven Music v2.5 through Mage at POST https://api.mage.space/v1/eleven_music/generate. A request at the default settings costs 113 Gems (about $0.113), with no subscription. Eleven Music takes no @handle mentions.
- AudioOutput
- 1Variant
- 113Gems per clip, default
- $0.113About, in USD
Overview
What the Eleven Music API does
Eleven Music by ElevenLabs: songs with lyrics and vocals, or instrumentals, from a description, at exactly the length you pick, up to 5 minutes.
ElevenLabs' music model: songs with vocals or instrumentals, as an MP3 of exactly the requested duration. A prompt that names an artist or quotes copyrighted lyrics is refused by ElevenLabs; the request fails and is refunded.
It generates from the prompt alone.
Quick start
Call the Eleven Music API
Set MAGE_API_KEY, submit to /eleven_music/generate, and poll status_url until the request completes.
cURL
STATUS_URL=$(curl --request POST 'https://api.mage.space/v1/eleven_music/generate' \
--header "Authorization: Bearer $MAGE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "An upbeat indie pop song about a summer road trip, bright guitars, handclaps, female vocals, 110 BPM.",
"duration": "30",
"model_id": "eleven-music-v2.5"
}' | jq -r '.status_url')
# Repeat until status is "completed"; result.url is the file
curl "$STATUS_URL" --header "Authorization: Bearer $MAGE_API_KEY"TypeScript
// npm install @mage-space/sdk
import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
const request = await mage.run('eleven_music', {
prompt: 'An upbeat indie pop song about a summer road trip, bright guitars, handclaps, female vocals, 110 BPM.',
duration: '30',
model_id: 'eleven-music-v2.5',
});
console.log(request.result.url);Python
# pip install mage-space
from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
request = mage.run("eleven_music", {
"prompt": "An upbeat indie pop song about a summer road trip, bright guitars, handclaps, female vocals, 110 BPM.",
"duration": "30",
"model_id": "eleven-music-v2.5",
})
print(request["result"]["url"])Models
Eleven Music model_id values
Send model_id to pick a variant. A request without one runs the default.
| model_id | Name | Default |
|---|---|---|
| eleven-music-v2.5 | Eleven Music v2.5 | Yes |
Options
Eleven Music parameters
Allowed values across all variants; a variant may offer fewer. The docs list the options per variant.
| Field | Values |
|---|---|
| duration | 10, 30, 60, 120, 180, 300 |
Rules
What the Eleven Music API enforces
- The prompt describes the song, at most 2000 characters.
More audio models
Other audio generation APIs on Mage
Eleven Speech API
ElevenLabs v4: lifelike speech you can direct
Seed Audio API
Voices, music, and sound effects from one prompt
FAQ
Frequently asked questions
How much does the Eleven Music API cost?
What is the Eleven Music API endpoint?
Which Eleven Music models can I call?
Does Eleven Music support reference images or characters?
Can I use Eleven Music from Claude or ChatGPT?
How long are Eleven Music results kept?
Start building with Mage
One account, one Gems balance, every model. Pay only for what you generate.