Skip to content

Elevenlabs Music v2

Integrate

Model id elevenlabs/music/v2
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/elevenlabs/music/v2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Files like the example: $1.20 1,200 API credits your files are measured before the run Run it on this page

Get API key
ElevenLabs Text to Music #music#text-to-music

Composes music from a text prompt or a chunk-based composition plan, with optional instrumental-only mode

ElevenLabs · Audio

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

88 / 4100

Text description of the desired music.

Optional song duration in milliseconds, ranging from 3000 ms to 600000 ms, applicable only when using a prompt. When omitted, the model determines the duration from the prompt.

Advanced output_format · seed · force_instrumental · composition_plan
default mp3_48000_192

Choose the generated audio's format using the pattern codec_sample_rate_bitrate. Twilio audio inputs commonly use μ-law, also written mu-law or approximated as u-law; an MP3 example is mp3_22050_32, which specifies a 22.05 kHz sample rate and a bitrate of 32 kbs.

Music-generation initialization seed, usable only alongside `composition_plan`, for improved consistency across runs with identical parameters and seed. Results are not guaranteed to reproduce exactly.

Music composition plan organized into chunks.

POST /run/elevenlabs/music/v2?wait=20 quote → $1.20
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/elevenlabs/music/v2?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Elevenlabs Music v2

Creates music from a text `prompt` of up to 4100 characters, or from a structured `composition_plan`. `music_length_ms` sets the length between 3000 and 600000 ms when used with a prompt, and `force_instrumental` removes vocals. `output_format` selects the codec, sample rate and bitrate, including MP3 and PCM options. `seed` works only with a composition plan.

Parameters

NameType DefaultAllowed Description
promptoptional
Typestring | null
≤ 4,100 characters
Text description of the desired music.
composition_planoptional
Typeobject
Music composition plan organized into chunks.
composition_plan.chunksrequired
Typeobject[]
1 – 30 items
Ordered chunks used for generation, limited to 30 chunks with a combined duration of 3000 ms to 600000 ms.
composition_plan.chunks[].textrequired
Typestring
Chunk-generation text, limited to 30 lines of up to 200 characters each. Lyrics may include inline directions in curly braces, such as {scratching}, and may follow an optional opening section name in square brackets, such as [Verse 1]. That section name must contain 1–100 characters.
composition_plan.chunks[].duration_msrequired
Typeinteger
3,000 – 120,000
Chunk length in milliseconds, ranging from 3000 ms to 120000 ms.
composition_plan.chunks[].positive_stylesrequired
Typestring[]
Desired styles and musical directions for this chunk, with the greatest influence coming from the first chunk's choices: these establish the song's overall genre and tone. Later chunks may develop the music, add nuance, or shift direction; English descriptions work best.
composition_plan.chunks[].negative_stylesoptional
Typestring[]
Musical styles and directions to avoid in this chunk; specify entries only for explicit exclusions, otherwise leaving the list empty is a good default.
composition_plan.chunks[].context_adherenceoptional
Typeenum
lowmediumhigh
Context adherence balances creative freedom against consistency with neighboring chunks: choose high for consistency, or low to allow more creative deviations.
composition_plan.chunks[].audio_referenceoptional
Typeobject
Style-conditioning audio clip for this chunk; to shape the entire song, supply it on the first chunk. That placement has the greatest influence because its reference affects every subsequent chunk.
music_length_msoptional
Typeinteger | null
3,000 – 600,000
Optional song duration in milliseconds, ranging from 3000 ms to 600000 ms, applicable only when using a prompt. When omitted, the model determines the duration from the prompt.
force_instrumentaloptional
Typeboolean
Defaultfalse
Instrumental-only control, available only when using a prompt. Setting it to true guarantees instrumental output; false allows either instrumental or non-instrumental music according to the prompt.
seedoptional
Typeinteger | null
Music-generation initialization seed, usable only alongside `composition_plan`, for improved consistency across runs with identical parameters and seed. Results are not guaranteed to reproduce exactly.
output_formatoptional
Typeenum
Defaultmp3_48000_192
mp3_22050_32mp3_24000_48mp3_44100_32mp3_44100_64mp3_44100_96mp3_44100_128mp3_44100_192mp3_48000_128mp3_48000_192mp3_48000_240mp3_48000_320pcm_8000pcm_16000pcm_22050pcm_24000pcm_32000
+9 morepcm_44100pcm_48000ulaw_8000alaw_8000opus_48000_32opus_48000_64opus_48000_96opus_48000_128opus_48000_192
Choose the generated audio's format using the pattern codec_sample_rate_bitrate. Twilio audio inputs commonly use μ-law, also written mu-law or approximated as u-law; an MP3 example is mp3_22050_32, which specifies a 22.05 kHz sample rate and a bitrate of 32 kbs.
required

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "elevenlabs/music/v2",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1200,
    "usd": "1.20",
    "charged": 1200,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
audio
object {url, content_type, file_name, file_size}Generated music file encoded as MP3 audio.

More models: Text to Music

For AI agents: this page as Markdown is at https://doitong.com/developers/models/elevenlabs/music/v2.md. All models and guides: https://doitong.com/developers/llms.txt