elevenlabs/music-v2
Music · Up to $0.627 per request
Endpoint
POST /v1/audio/music — answers 202 with a job. Poll GET /v1/jobs/{id}, or receive it by webhook, until its state is final.
Dependencies
No field depends on another.
Request
curl https://api.opinference.com/v1/audio/music \
-H "Authorization: Bearer $OP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs/music-v2",
"prompt": "a paper boat drifting down a rain gutter"
}'Response
The job resource once it has succeeded.
{
"id": "job_01J9K2…",
"generation_id": "gen_01J9K2…",
"object": "job",
"state": "succeeded",
"modality": "music",
"model": "elevenlabs/music-v2",
"created_at": "2026-09-30T08:00:00Z",
"started_at": "2026-09-30T08:00:04Z",
"completed_at": "2026-09-30T08:01:12Z",
"output": [
{
"url": "https://…?X-Amz-Signature=…",
"url_expires_at": "2026-09-30T09:01:12Z",
"type": "audio/mpeg",
"bytes": 3841920,
"checksum_sha256": "…"
}
],
"usage": {
"units": {
"audio_second": 30
}
}
}Input
A JSON body. A key not listed here is refused, and the error names it.
| Field | Description |
|---|---|
| modelstring · required | The id of this model. |
| duration_secondsinteger | Length of the track in seconds.From 3 to 60 · Default: 10 |
| instrumentalboolean | Generates the track without vocals. |
| output_formatenum | File format of the generated audio.One of: 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 · Default: mp3_48000_192 |
| promptstring | Style, mood and instruments of the track.Up to 4100 characters |
| modelsstring[] | Other model ids to try, in order, if this one is unavailable. Up to 5. |
| providerobject | Routing preferences: region, zdr, data_collection, sort, max_price. |
| opobject | Gateway options: retention (may only tighten), tags, session_id. |
Output
A job resource.
| Field | Description |
|---|---|
| id | The job id. Poll GET /v1/jobs/{id} with it. |
| generation_id | The generation this job belongs to. |
| object | Always "job". |
| state | queued, processing, succeeded, failed or canceled. The last three are final. |
| modality | The kind of output. |
| model | The model id that was asked for. |
| created_at | When the job was accepted. |
| started_at | When work began. Absent while queued. |
| completed_at | When the job reached a final state. |
| progress.percent | Percent complete, 0 to 100, or null when not reported. |
| progress.phase | queued, running or done. |
| progress.queue_position | Always null today. |
| output[] | The files produced: url (signed, re-issued on every read), url_expires_at, type, bytes, checksum_sha256. |
| usage | The billable units the job consumed. |
| usage.cost | An estimate from the published price: billing_usd, cost_source, cost_status ("estimated") and price_version. Your balance is charged the settled amount. |
| op_metadata | What applied when the job was accepted: generation_id, requested_model, retention_class, region and policy[]. |
| error | On failure: code, kind and a fixed message for the code. |