elevenlabs-music
Requires internet access and ELEVENLABS_API_KEY. Use the direct API, SDK, or CLI; no connected plugin or browser OAuth is required. If credentials are missing, use API-key setup. Load a chosen .env explicitly when needed; saving it does not automatically configure the process environment.
ElevenLabs Music Generation
Generate music from text prompts - supports instrumental tracks, songs with lyrics, and fine-grained control via composition plans.
Setup: See Installation Guide. For JavaScript, use
@elevenlabs/*packages only.
All examples below use music_v2_5, the most advanced generation model. Pass music_v2 or
music_v1 only when an older model is explicitly requested.
Local output and remote cleanup
Default: retain outputs locally and remove this task's remote generations after saving them. This also applies to previews, retries, test clips and streamed output. The examples below show generation only; complete these cleanup steps before reporting success.
- Capture response headers and returned resource IDs alongside the local output path. Finish the download or stream, then verify the actual audio/video decodes or the transcript parses and contains the expected result. A filename or nonzero size alone is insufficient.
- After verification and any dependent calls finish, delete only remote resources positively identified as created by this task. Keep IDs needed for cleanup locally until deletion is confirmed. Do not delete on a failed local save, while a dependent generation still needs the resource, or based only on voice, prompt or recency. Never bulk-delete unrelated history or voice profiles.
- Verify removal using the resource lookup or a fully paginated, appropriately filtered listing. An authentication error or missing item on just the first page is not proof. If cleanup fails, retry once for a transient failure, then report the remaining IDs and reason. Preserve local files.