Text to Music APIs
Explore fal’s Collection Of The Best Music Generation APIs
fal is the best developer-friendly, one-stop shop for AI music generation models. Every music generation model on fal runs through the same SDK pattern, so once you’ve integrated one, switching between Lyria 2, MiniMax Music v2.6, or ElevenLabs Music is a one-line endpoint change.
How do I generate music through fal’s API?
Music generation endpoints on fal accept a text prompt and return a URL to the generated audio file. Here’s how it looks after installing `@fal-ai/client` and setting your `FAL_KEY`.
jsimport { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/lyria2", { input: { prompt: "Ambient piano with soft strings, gentle and contemplative, slow tempo" } }); console.log(result.data.audio.url);
Switching models is a one-line endpoint change. Lyria 2, MiniMax Music v2.6, and ElevenLabs Music all share the same `subscribe` pattern, and each model has its own input schema.
Which models generate music with vocals or lyrics?
For vocal tracks, fal hosts several models that can turn lyrics and style instructions into complete songs.
- MiniMax Music 2.6 takes a style prompt plus lyrics with structure tags like
`[Verse]`,`[Chorus]`,`[Bridge]`, and`[Outro]`. It outputs complete tracks with singing and backing arrangements. - MiniMax Music 2.5 follows the same lyric-and-style pattern as 2.6, with a slightly different structure tag set.
- MiniMax Music 2.0 uses a dual-prompt system: a 10-300 character style prompt plus a lyrics prompt up to 3,000 characters, useful for full-length songs across multiple verses.
- ElevenLabs Music also supports vocal music generation, making it a strong option when you need polished songs with singing.
Use these models when the output needs vocals, structured lyrics, choruses, verses, or full song arrangements rather than background-only audio.
Which models work for instrumental tracks or ambient soundscapes?
Instrumental and ambient workflows benefit from models that expose controls for genre, instrumentation, tempo, mood, and vocal exclusion.
- Lyria 2 generates any music type with prompts covering genre, instrumentation, tempo, and mood. It outputs 30-second 48kHz WAV files and supports negative prompting to exclude unwanted elements like vocals.
- MiniMax Music 2.5 and 2.6 both support
`is_instrumental: true`, which generates vocal-free arrangements from the style prompt alone. - ElevenLabs Music has a
`force_instrumental`toggle that guarantees no singing, paired with`music_length_ms`for precise duration control between 3 seconds and 10 minutes.
For soundscapes specifically, such as environmental textures like rain, wind, or atmospheric ambience, Lyria 2’s prompt format explicitly supports environmental sound descriptions alongside musical instructions.
How do I control structure, style, or reproducibility?
There are three main approaches to structure and style control across fal’s music generation models.
- ElevenLabs Music supports a composition plan, which lets you define named sections, each with its own duration, lyrics, positive styles, and negative styles. The
`respect_sections_durations`toggle controls whether the model enforces exact section lengths or adjusts them for better continuity. - MiniMax Music 2.5 and 2.6 use inline structure tags in the lyrics field, such as
`[Intro]`,`[Verse]`,`[Pre Chorus]`,`[Chorus]`,`[Bridge]`, and`[Outro]`. The model arranges the composition around the tagged sections. - MiniMax Music legacy takes a reference audio URL alongside the prompt, drawing style cues from an existing track. The reference should be a
`.wav`or`.mp3`longer than 15 seconds containing music and vocals. - Lyria 2 supports seed-based reproducibility. The same prompt plus seed produces the same output across runs.
Use composition plans when you need precise section-level control, lyric tags when you want a song-like structure, reference audio when you want to steer style, and seeds when you need repeatable results.
Pricing
Pricing on fal for music generation varies by model and unit. Some models charge per generation, while others charge per audio minute or per fixed-duration output.
| Model | Price |
|---|---|
| MiniMax Music 2.0 | $0.03 / generation |
| Lyria 2 | $0.10 / 30 seconds of audio |
| MiniMax Music 2.5 | $0.15 / audio |
| MiniMax Music 2.6 | $0.15 / audio |
| ElevenLabs Music | $0.80 / output audio minute, rounded up |
As a worked example, a content team producing 100 background music tracks per month would spend roughly:
- $3/month on MiniMax Music 2.0
- $10/month on Lyria 2 for 30-second tracks
- $15/month on MiniMax Music 2.5 or 2.6
- $80/month on ElevenLabs Music for 1-minute tracks
You only pay for what you generate, which lets you test styles, compare models, and scale music production without subscriptions or minimums.
Quick Start
Install the client
bashnpm install --save @fal-ai/client
Set your API key
bashexport FAL_KEY="YOUR_API_KEY"
Call a model
jsimport { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/lyria2", { input: { prompt: "Ambient piano with soft strings, gentle and contemplative, slow tempo" } }); console.log(result.data.audio.url);
The same auth, billing, and queue logic carry across every music generation endpoint, so you can compare models side by side without rewriting integration code.
For longer generations or production workflows, submit to the queue and rely on webhooks instead of blocking on the result.