# Text to music API

https://getmegabrain.com/media/text-to-music · prices from the live MegaBrain catalogue

> MegaBrain runs 6 music generation models on one API key: MiniMax Music 2.6, ElevenLabs Music, Lyria 2, Suno V6, Suno V6 Mini and Suno V6 Wild. At default settings the lowest price is Suno V6 at $0.072 per track; the highest is ElevenLabs Music at $0.72 per minute of audio. Prices are in US dollars from the live MegaBrain catalogue; a job the provider fails is refunded in full.

The models that write music from a description: background tracks for videos, jingles, songs with vocals and your own lyrics. Generate in the browser or through the API on one MegaBrain key, paid per track or per minute from a prepaid US-dollar balance.

## Music generation models and prices

| Model | ID | Price |
|---|---|---|
| [MiniMax Music 2.6](https://getmegabrain.com/media/minimax-music/v2.6) | `minimax-music/v2.6` | $0.18 per track |
| [ElevenLabs Music](https://getmegabrain.com/media/elevenlabs/music) | `elevenlabs/music` | $0.72 per minute of audio |
| [Lyria 2](https://getmegabrain.com/media/lyria2) | `lyria2` | $0.12 per track |
| [Suno V6](https://getmegabrain.com/media/suno/v6) | `suno/v6` | $0.072 per track |
| [Suno V6 Mini](https://getmegabrain.com/media/suno/v6-mini) | `suno/v6-mini` | $0.072 per track |
| [Suno V6 Wild](https://getmegabrain.com/media/suno/v6-wild) | `suno/v6-wild` | $0.072 per track |

## Which music model to pick

MiniMax Music 2.6 makes full songs with vocals from your lyrics, or writes the lyrics itself, at one price per track. ElevenLabs Music makes tracks from 3 seconds to 10 minutes with or without vocals, priced per started minute. Lyria 2 from Google DeepMind makes 30-second instrumental clips.

## Lyrics and instrumentals

Pass lyrics with structure tags like [Verse] and [Chorus] to MiniMax Music 2.6, or set is_instrumental for music without vocals. ElevenLabs Music takes force_instrumental, and the length in music_length_ms.

## Music for a clip

Turn a video model’s sound off and lay your own track under the clip: one key covers both.

## Call it

```python
import os, time, requests

BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}

job = requests.post(f"{BASE}/queue/minimax-music/v2.6", headers=HEADERS, json={
  "prompt": "warm lo-fi hip hop with soft piano chords and vinyl crackle"
}).json()

while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
    time.sleep(2)

print(requests.get(job["response_url"], headers=HEADERS).json())
```

## FAQ

**How much does AI music generation cost through an API?**

MegaBrain runs 6 music generation models on one API key: MiniMax Music 2.6, ElevenLabs Music, Lyria 2, Suno V6, Suno V6 Mini and Suno V6 Wild. At default settings the lowest price is Suno V6 at $0.072 per track; the highest is ElevenLabs Music at $0.72 per minute of audio. Prices are in US dollars from the live MegaBrain catalogue; a job the provider fails is refunded in full.

**Do I need an account with each model’s maker?**

No. Sign up on MegaBrain, top up the balance by card and create one API key: it works for every model in the table, for the other image, video and audio models and for the text models.

**How is generation paid for?**

From a prepaid US-dollar balance at the price in the table, with no subscription. The price of a job is held when it is submitted and refunded in full if the provider fails it.

**Can I use the music commercially?**

The models’ makers allow commercial use of the tracks they generate; check each maker’s terms for your use, and do not prompt for imitations of real artists or songs.

**How do I call it from code?**

A POST request to https://getmegabrain.com/api/gateway/v1/queue/<model id> submits the job; then poll status_url until it is COMPLETED and fetch the audio link from response_url. There is a Python example below, and every model’s parameters are on its page.
