Generate music using ElevenLabs Music API - instrumental tracks, songs with lyrics, and fine-grained composition plans
95
93%
Does it follow best practices?
Impact
99%
1.57xAverage score across 5 eval scenarios
Passed
No findings from the security scan
A media production team uses a Linux-based automation pipeline for their content. They don't want to install any language-specific SDKs — instead they need a bash shell script that calls the ElevenLabs Music API directly via HTTP to generate multiple tracks.
Write a bash script called batch_generate.sh that generates three different tracks:
For each track, the script should make the API call and save the resulting audio to appropriately named MP3 files (e.g., jingle.mp3, ambient.mp3, sting.mp3).
The script should read the API key from the environment and include comments explaining each API call. Clean up any temporary files at the end.
batch_generate.sh — The bash script (should be executable)