# MiniMax (Hailuo AI) Music v1.5

> Generate music from text prompts using the MiniMax model, which leverages advanced AI techniques to create high-quality, diverse musical compositions.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/minimax-music/v1.5`
- **Model ID**: `fal-ai/minimax-music/v1.5`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: music



## Pricing

- **Price**: $0.03 per generations

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`prompt`** (`string`, _required_):
  Lyrics, supports [intro][verse][chorus][bridge][outro] sections. 10-600 characters.
  - Examples: "[verse]\n Fast and Limitless   \n In the heart of the code, where dreams collide,   \n\nFAL's the name, taking tech for a ride.    \nGenerative media, blazing the trail,   \n\nFast inference power, we'll never fail.\n##"

- **`audio_setting`** (`AudioSetting`, _optional_):
  Audio configuration settings

- **`lyrics_prompt`** (`string`, _required_):
  Control music generation. 10-3000 characters.
  - Examples: "R&B, energetic"



**Required Parameters Example**:

```json
{
  "prompt": "[verse]\n Fast and Limitless   \n In the heart of the code, where dreams collide,   \n\nFAL's the name, taking tech for a ride.    \nGenerative media, blazing the trail,   \n\nFast inference power, we'll never fail.\n##",
  "lyrics_prompt": "R&B, energetic"
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  The generated music
  - Examples: {"url":"https://v3.fal.media/files/lion/b3-wJ5bbmVo8S-KPqDBMK_output.mp3"}



**Example Response**:

```json
{
  "audio": {
    "url": "https://v3.fal.media/files/lion/b3-wJ5bbmVo8S-KPqDBMK_output.mp3"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/minimax-music/v1.5 \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "[verse]\n Fast and Limitless   \n In the heart of the code, where dreams collide,   \n\nFAL's the name, taking tech for a ride.    \nGenerative media, blazing the trail,   \n\nFast inference power, we'll never fail.\n##",
     "lyrics_prompt": "R&B, energetic"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/minimax-music/v1.5",
    arguments={
        "prompt": "[verse]
     Fast and Limitless
     In the heart of the code, where dreams collide,

    FAL's the name, taking tech for a ride.
    Generative media, blazing the trail,

    Fast inference power, we'll never fail.
    ##",
        "lyrics_prompt": "R&B, energetic"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/minimax-music/v1.5", {
  input: {
    prompt: "[verse]
   Fast and Limitless
   In the heart of the code, where dreams collide,

  FAL's the name, taking tech for a ride.
  Generative media, blazing the trail,

  Fast inference power, we'll never fail.
  ##",
    lyrics_prompt: "R&B, energetic"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/minimax-music/v1.5)
- [API Documentation](https://fal.ai/models/fal-ai/minimax-music/v1.5/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/minimax-music/v1.5)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
