ElevenLabs Music API and Sound Effects API: What Developers Actually Need to Know
Last updated:
Affiliate link — we may earn a small commission.
Access the ElevenLabs Music and SFX APIs
One API key covers TTS, STT, Music, Sound Effects, Voice Cloning, and more. Usage-based billing, no minimum commitment.
Two ElevenLabs APIs that do not get enough attention: the Music API and the Sound Effects API. Both are available under the same API key as TTS and STT. This guide covers what each does, how to integrate them, and the licensing details you need to know before shipping.
Why These APIs Matter for Developers
The music licensing problem is real. Stock libraries require per-track licensing, often with usage restrictions. Commissioning original music is expensive. Using unlicensed audio exposes you to copyright strikes and DMCA takedowns.
The ElevenLabs Music API generates original tracks from text prompts — not retrieved from a catalogue, but generated fresh. The output is commercially licensed for standard use, which removes the licensing complexity for most creator and developer use cases.
The Sound Effects API solves a narrower but equally practical problem: generating specific audio on demand rather than sourcing from libraries. Four variations per request. Loopable output. Useful for game prototyping, app audio, and anywhere you need a specific sound that does not exist in your current asset library.
The Music API
What It Does
Generate studio-grade, commercially licensed AI music tracks from text descriptions. Control:
- Genre and style ("lo-fi hip hop", "cinematic orchestral", "upbeat electronic")
- Mood and energy ("melancholic", "tense and building", "warm and positive")
- Vocal presence ("no vocals", "female vocals in English", "male backing vocals")
- Structure (intro, verse, chorus, outro — controllable per section)
- Duration and looping
API Call
from elevenlabs.client import ElevenLabs
client = ElevenLabs(api_key="YOUR_API_KEY")
result = client.text_to_music.convert(
text="Upbeat acoustic guitar, warm and motivational, 60 seconds, no vocals, suitable for a YouTube tutorial intro",
make_instrumental=True,
)
with open("track.mp3", "wb") as f:
for chunk in result:
f.write(chunk)
import { ElevenLabsClient } from "elevenlabs";
const client = new ElevenLabsClient({ apiKey: "YOUR_API_KEY" });
const audio = await client.textToMusic.convert({
text: "Tense cinematic underscore, building strings, no drums, 30 seconds",
make_instrumental: true,
});
Access the Music and SFX APIs with one key
Prompting for Useful Output
Specific prompts produce specific output. Vague prompts produce generic results.
Less useful:
"Background music"
More useful:
"Warm acoustic guitar fingerpicking, slow tempo, reflective mood, 45 seconds, no vocals, suitable for documentary narration"
Include:
- Genre or style — gives the model a sonic reference point
- Instrumentation — which instruments, what role (lead, background)
- Mood — the emotional character of the piece
- Tempo — slow / mid-tempo / fast, or a BPM range
- Vocal presence — explicit instruction on vocals vs instrumental
- Duration — target length in seconds
- Use case — "for game background music", "for a podcast intro", "for an ad"
Looping
Music generated through the API is loopable. For game audio, app ambience, and anything that needs to run continuously:
# Generate a loopable background track
result = client.text_to_music.convert(
text="Ambient electronic, slow evolving pads, minimal percussion, seamlessly loopable, 60 seconds",
make_instrumental=True,
)
The model is aware of loop points when prompted for loopable output. Test the loop transition before shipping to production — trim a few milliseconds at the join point if needed.
Licensing: What You Need to Know
Music generated through the ElevenLabs API is commercially licensed for standard use. An additional license is required for:
- Marketing campaigns
- Paid advertising (social, video, display)
- Film and TV
- Games (commercial distribution)
- Enterprise distribution
Check your subscription tier's Terms at elevenlabs.io before using generated music in advertising or any of the above contexts. The distinction matters if your product or client project involves paid media.
"Commercially licensed" for standard use covers YouTube videos, podcasts, and creator content. It does not automatically cover paid advertising, games for sale, or film. Check the Terms for your subscription tier — do not assume the same licence applies across all use cases.
The Sound Effects API
What It Does
Generate realistic, loopable sound effects from text descriptions. Four variations returned per request. Variable output length — from a short UI click sound to a 60-second ambient texture.
API Call
result = client.text_to_sound_effects.convert(
text="Heavy rain on a tin roof, distant thunder",
duration_seconds=10,
prompt_influence=0.3, # 0.0–1.0, how strictly to follow the prompt
)
with open("rain.mp3", "wb") as f:
for chunk in result:
f.write(chunk)
const sfx = await client.textToSoundEffects.convert({
text: "Footsteps on gravel, slow and deliberate",
duration_seconds: 3,
});
The response is a list of four variations. Play each, pick the one that fits, or A/B test them in your UI.
Prompting for Sound Effects
Sound effect prompts work best when they describe the sound directly rather than the scene:
| Less specific | More useful |
|---|---|
| "Door sound" | "Heavy wooden door closing slowly, slight creak, reverb in a large room" |
| "Explosion" | "Explosion in a concrete room, bass-heavy impact, debris falling after" |
| "Notification" | "Soft chime notification, two ascending tones, gentle and unobtrusive" |
| "Water" | "Gentle stream flowing over rocks, ambient and calming, loopable" |
Include reverb characteristics ("small room", "large hall", "outdoors"), material details ("metal", "wood", "glass"), and distance ("close", "distant") for more accurate output.
Loopable SFX
For ambient audio and continuous game audio, prompt explicitly for loopable output:
ambient = client.text_to_sound_effects.convert(
text="Forest ambience, birds chirping, light wind through leaves, seamlessly loopable",
duration_seconds=30,
)
Licensing for Sound Effects
Sound effects generated through the API are royalty free for paid subscribers. They can be used in YouTube videos, social media content, games, apps, and advertising.
Note: royalty free commercial use rights do not extend to the free tier. Check your subscription plan before using SFX in production.
Common Use Cases
Games
Generate NPC sound effects, environmental ambience, UI sounds, and music on demand without building a sound asset library from scratch.
# Generate multiple sound variations for a weapon system
weapon_sounds = []
for _ in range(3):
sfx = client.text_to_sound_effects.convert(
text="Futuristic laser pistol shot, sharp and crisp, sci-fi aesthetic",
duration_seconds=0.8,
)
weapon_sounds.append(sfx)
# Pick the best variation or randomise between them at runtime
Podcasts and Video Content
Generate intro music, transition sounds, and section separators without sourcing from stock libraries.
intro_music = client.text_to_music.convert(
text="Podcast intro jingle, upbeat and professional, 8 seconds, branded feel",
make_instrumental=True,
)
App UI Audio
Notification sounds, confirmation chimes, error tones, ambient backgrounds for focus or productivity apps.
Content Localization Pipelines
Generate music that fits regional style conventions alongside dubbed audio — a single pipeline that produces dubbed speech, regional-style music, and relevant ambient audio for each target market.
Start generating music and sound effects with ElevenLabsIntegrating Music and SFX Into a Full Audio Pipeline
Both APIs live under the same API key as TTS and STT. A complete audio pipeline for a content generation system might look like:
async def generate_video_audio(script: str, music_prompt: str, sfx_prompts: list):
# Generate narration
narration = client.text_to_speech.convert(
voice_id=NARRATOR_VOICE_ID,
text=script,
model_id="eleven_multilingual_v2",
)
# Generate background music
music = client.text_to_music.convert(
text=music_prompt,
make_instrumental=True,
)
# Generate required sound effects
sfx_tracks = [
client.text_to_sound_effects.convert(text=prompt, duration_seconds=2)
for prompt in sfx_prompts
]
return narration, music, sfx_tracks
One API key, one client object, all audio assets generated programmatically.
Frequently Asked Questions
What is the ElevenLabs Music API? Generates studio-grade, commercially licensed AI music from text prompts. Control genre, mood, vocals, tempo, instrumentation, and track structure.
Is the music commercially usable? For standard creator use, yes. Advertising, film, TV, games for commercial distribution, and enterprise use require an additional license. Check your subscription tier's Terms.
What is the Sound Effects API? Generates realistic, loopable sound effects from text descriptions. Returns four variations per request. Variable output length.
Are sound effects royalty free? For paid subscribers, yes — in YouTube videos, social content, apps, and games. Free tier users do not have commercial use rights.
How many variations does the SFX API return? Four per request. Pick the best fit or randomise between variations at runtime.
How do I make loopable audio? Include "seamlessly loopable" in your prompt for both music and SFX. Test the loop transition before shipping to production.
Free: AI Voice Tool Comparison Guide
Which tool wins for your use case, ElevenLabs pricing decoded, and a quick-reference comparison table — sent straight to your inbox. No spam. Unsubscribe anytime.
Access the ElevenLabs Music and SFX APIs
One API key covers TTS, STT, Music, Sound Effects, Voice Cloning, and more. Usage-based billing, no minimum commitment.
Frequently Asked Questions
Last updated: