Eleven Music v2.5
Songs and instrumentals from a text prompt, 10 seconds to 5 minutes.
- by ElevenLabs
- Audio
- $0.60/minute
- Text to musicVocals or instrumental
On this page
1.Call
Music and sound effects run as jobs: create one, then follow progress over Server-Sent Events, poll, or receive a webhook. Every response carries an x-request-id trace ID.
# 1. Create the job
curl https://api.ewest.ai/v1/audio/generations \
-H "Authorization: Bearer $EWEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ewest/eleven-music-v2.5", "prompt": "upbeat lo-fi beat with warm piano", "duration": 30}'
# → 202 {"id": "job_…", "type": "audio", "status": "queued", "progress": 0, …}
# 2. Follow it (Server-Sent Events), or poll GET /v1/jobs/job_…
curl -N https://api.ewest.ai/v1/jobs/job_…/events -H "Authorization: Bearer $EWEST_KEY"
# → … "output": {"url": "https://cdn.ewest.ai/aud/….mp3"}2.Authentication
Send your API key in the Authorization: Bearer header, as the examples above do (clients built for the Anthropic API can use x-api-key). Create keys under API keys. Keep the key on your server, never in browser code. More in the authentication guide.
3.Jobs
Music and sound runs as a job. The create call answers 202 with a job; follow it with GET /v1/jobs/{id}/events (Server-Sent Events), poll GET /v1/jobs/{id}, or pass a webhook_url. The status is one of queued, running, succeeded or failed; the file is in output.url once it has succeeded. See the audio guide.
4.Schema
What you send and what comes back, for ewest/eleven-music-v2.5. The output tables are read from the API's OpenAPI description.
Input
POST /v1/audio/generations- The model id,
modelstringRequiredewest/eleven-music-v2.5. - What the music should be. Up to 4,000 characters.
promptstringRequired - Length in seconds. One of: 10, 15, 30, 60, 90, 120, 180, 240, 300.
durationintegerOptionaldefault30 - Music without vocals.
instrumentalbooleanOptionaldefaultfalse - Public https URL that receives a POST with the finished job.
webhook_urlstringOptional
Output
Returns audio. POST /v1/audio/generations answers 202: The job, queued. GET /v1/jobs/{id} answers 200: The job.
- Also the trace id (
idstringAlwaysx-request-id). - Always
objectstringAlwaysjob. - Always
typestringAlwaysaudio. - The model that runs the job.
modelstringAlways statusstringAlwaysqueuedandrunningare in progress;succeededandfailedare final. One ofqueued,running,succeeded,failed.- Estimated from elapsed time; 0 for failed jobs.
progressintegerAlways - Expected seconds left; null when finished or when the job runs longer than usual.
eta_secondsinteger or nullAlways - Unix seconds when the job was created.
created_atintegerAlways - Unix seconds when the model started generating; null while the job is queued.
started_atinteger or nullAlways - Unix seconds when the job reached
completed_atinteger or nullAlwayssucceededorfailed; null while it is in progress. - The parameters of a music or sound-effect job, defaults filled in.
inputobjectAlways - The prompt.
input.promptstringAlways - Length in seconds; null when the model chooses the length.
input.durationinteger or nullAlways - Music without vocals.
input.instrumentalbooleanAlways - A sound effect that loops.
input.loopbooleanAlways - Set once the job succeeded, null before and when it failed. The file is on
outputobject or nullAlwayscdn.ewest.aifor 7 days. - Link to the audio file on
output.urlstring (uri)Always (when set)cdn.ewest.ai, kept for 7 days. - Always
output.content_typestringAlways (when set)audio/mpeg. - Length in seconds as requested; null when the model chooses the length.
output.durationnumber or nullAlways (when set) - Set when the job failed, null otherwise.
errorobject or nullAlways - Why the job failed.
error.codestring or nullAlways (when set)generation_failed: The model could not generate the output; retry, or contact support if it keeps happening.content_policy: The prompt or an input was rejected by the model's safety filters.timeout: Generation took too long and was stopped.storage_error: The output was generated but could not be stored; retry.cancelled: You cancelled the job (POST /v1/jobs/{id}/cancel) before it started; it is not charged. One ofgeneration_failed,content_policy,timeout,storage_error,cancelled. - A fixed, readable explanation for the
error.messagestringAlways (when set)code. Branch oncode, not on this text. - Billed units once the audio job succeeded, null before and when it failed:
usageobject or nullAlways{"seconds": n}for models with set lengths, or{"generations": 1}for models that choose their own length. - Seconds of audio billed.
usage.secondsnumberSometimes - Number of generations billed (1).
usage.generationsintegerSometimes
Sample response
{
"id": "job_7Hq2xK9mPz",
"object": "job",
"type": "audio",
"model": "ewest/eleven-music-v2.5",
"created_at": 1793530277,
"input": {
"prompt": "upbeat lo-fi beat with warm piano",
"duration": 30,
"instrumental": false,
"loop": false
},
"status": "queued",
"progress": 2,
"eta_seconds": 45,
"started_at": null,
"completed_at": null,
"output": null,
"error": null,
"usage": null
}5.Details
- Type
- Music (songs and instrumentals)
- Length
- 10 s, 15 s, 30 s, 1 min, 1.5 min, 2 min, 3 min, 4 min, 5 min
- Options
- instrumental
- Output
- MP3 on cdn.ewest.ai (kept 7 days)