ElevenLabs Music

From 720.00 credits
ae_elevenlabs_music

Generate music from a text prompt or detailed composition plan, with options for lyrics, styles, sections, duration, and instrumental tracks.

AudioEntertainment
From 720.00 credits

Pricing

From 720.00 credits
ConditionCharge
Explicit duration or complete segment plan720.00 credits/started minute
Automatic duration3600.00 credits/call

Charged by explicit-duration or automatic-duration mode.

Starting price applies to successful calls with the minimum explicit duration; automatic duration uses the fixed fee stated above.

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
request_bodyobjectYesNo parameter description.—
request_body.promptstring | unknownNoThe text prompt describing the music to generate—
request_body.output_formatenum (mp3_22050_32 | mp3_44100_32 | mp3_44100_64 | mp3_44100_96 | mp3_44100_128 | mp3_44100_192 | pcm_8000 | pcm_16000 | pcm_22050 | pcm_24000 | pcm_44100 | pcm_48000 | ulaw_8000 | alaw_8000 | opus_48000_32 | opus_48000_64 | opus_48000_96 | opus_48000_128 | opus_48000_192)NoOutput format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.mp3_44100_128
request_body.music_length_msinteger | unknownNoThe length of the song to generate in milliseconds. Used only in conjunction with prompt. Must be between 3000ms and 600000ms. Optional - if not provided, the model will choose a length based on the prompt.—
request_body.composition_planobject | unknownNoThe composition plan for the music—
request_body.composition_plan.sectionsarrayConditionalThe sections of the song.—
request_body.composition_plan.sections[].linesarrayYesThe lyrics of the section. Each line must be at most 200 characters long.—
request_body.composition_plan.sections[].duration_msintegerYesThe duration of the section in milliseconds. Must be between 3000ms and 120000ms.—
request_body.composition_plan.sections[].section_namestringYesThe name of the section. Must be between 1 and 100 characters.—
request_body.composition_plan.sections[].negative_local_stylesarrayYesThe styles that should not be present in this section.—
request_body.composition_plan.sections[].positive_local_stylesarrayYesThe styles that should be present in this section.—
request_body.composition_plan.negative_global_stylesarrayConditionalThe styles that should not be present in the entire song.—
request_body.composition_plan.positive_global_stylesarrayConditionalThe styles that should be present in the entire song.—
request_body.force_instrumentalbooleanNoIf true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the prompt. Can only be used with prompt.false
request_body.respect_sections_durationsbooleanNoControls how strictly section durations in the composition_plan are enforced. It will only have an effect if it is used with composition_plan. When set to true, the model will precisely respect each section's duration_ms from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan.true

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key

Submit first, then query with the returned task_id until the task completes.

Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_elevenlabs_music' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "request_body": {
      "composition_plan": {
        "negative_global_styles": [
          "spoken word",
          "talking",
          "narration",
          "speech",
          "recitation",
          "monotone",
          "chanting",
          "rap",
          "aggressive",
          "dark"
        ],
        "positive_global_styles": [
          "pop",
          "melodic",
          "sung vocals",
          "emotive female vocal",
          "melisma",
          "catchy singable melody",
          "bright uplifting",
          "mandopop"
        ],
        "sections": [
          {
            "duration_ms": 10000,
            "lines": [
              "上班族 想做近视手术呀",
              "纠结的不是价格 是请假呀",
              "其实不用纠结 一个双休就够啦"
            ],
            "negative_local_styles": [
              "talking",
              "spoken",
              "recitation"
            ],
            "positive_local_styles": [
              "melodic",
              "sung female vocal",
              "warm",
              "flowing melody"
            ],
            "section_name": "主歌"
          },
          {
            "duration_ms": 12500,
            "lines": [
              "不用请假 双休就够",
              "摘掉眼镜 换个清晰的世界哦",
              "不用请假 双休就够",
              "摘掉眼镜 去看更远的街"
            ],
            "negative_local_styles": [
              "talking",
              "spoken"
            ],
            "positive_local_styles": [
              "catchy hook",
              "melodic",
              "soaring melody",
              "bright female vocal",
              "sung"
            ],
            "section_name": "副歌"
          },
          {
            "duration_ms": 10000,
            "lines": [
              "激光手术 三趟就够啦",
              "检查加面诊 半天呀",
              "手术加休息 一天呀",
              "复查半天 就收工啦"
            ],
            "negative_local_styles": [
              "talking",
              "spoken",
              "recitation"
            ],
            "positive_local_styles": [
              "melodic",
              "clear sung female vocal",
              "upbeat",
              "flowing"
            ],
            "section_name": "主歌"
          },
          {
            "duration_ms": 10000,
            "lines": [
              "三条建议 你听好啦",
              "先看双休 倒排手术日呀",
              "检查当天 别安排费眼的活儿",
              "手术当天 有人陪 别开车啦"
            ],
            "negative_local_styles": [
              "talking",
              "spoken",
              "recitation",
              "rap"
            ],
            "positive_local_styles": [
              "melodic",
              "sung",
              "warm female vocal",
              "emotive",
              "melisma"
            ],
            "section_name": "桥段"
          },
          {
            "duration_ms": 7500,
            "lines": [
              "不用请假 双休就够",
              "摘掉眼镜 去见更远的天"
            ],
            "negative_local_styles": [
              "talking",
              "spoken"
            ],
            "positive_local_styles": [
              "catchy hook",
              "melodic",
              "bright sung female vocal",
              "uplifting"
            ],
            "section_name": "副歌"
          }
        ]
      },
      "output_format": "mp3_44100_128",
      "respect_sections_durations": true
    }
  }
}'
Response exampleresponse.json
JSON
{
  "description": "task accepted; poll the result via query_tool with this task_id",
  "query_tool": "ae_get_result",
  "status": "created",
  "task_id": "6f57502b-2d1d-471c-b8c5-06a3c255e642"
}