generate
Compose music from prompts, lyrics, or composition plans, returning audio bytes; set output_path to save the file. Uses ElevenLabs credits.
Instructions
Compose Music Spends ElevenLabs credits. Returns audio/* bytes; pass output_path to save them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| prompt | No | ||
| model_id | No | ||
| finetune_id | No | ||
| lyrics_text | No | ||
| output_path | No | Where to write the returned bytes. Relative paths resolve against ELEVENLABS_OUTPUT_DIR. Omit it to get the data inline as base64 (small files only). | |
| music_prompt | No | Composition plan for the `music_v1` model. Using this field with any other model will result in an error. | |
| output_format | No | Output format of the generated audio. Formatted as codec_sample_rate_bitrate. Use "auto" (the default) to let the API pick the best format for the selected model: mp3_44100_128 for v1 models and mp3_48000_192 for v2 models. | |
| sign_with_c2pa | No | Whether to sign the generated song with C2PA. Applicable only for mp3 files. | |
| generation_mode | No | ||
| music_length_ms | No | ||
| composition_plan | No | ||
| finetune_strength | No | How strongly the finetune influences the generation. Defaults to 1.0 (full strength). Lower values soften the influence of the finetune, leaving more room for prompt-level steering. Only meaningful when `finetune_id` is also provided. | |
| force_instrumental | No | If 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`. | |
| use_phonetic_names | No | If true, proper names in the prompt will be phonetically spelled in the lyrics for better pronunciation by the music model. The original names will be restored in word timestamps. | |
| store_for_inpainting | No | Whether to store the generated song for inpainting. | |
| respect_sections_durations | No | Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan` and only applies to `music_v1`; for `music_v2` and `music_v2_5` section durations are always enforced and this is ignored. When false for `music_v1`, the model may adjust individual sect |