# Mirelo SFX2.0

> Generates sound effects from text prompts with control over duration, negative prompts, sample count, and output audio format.


## Overview

- **Endpoint**: `https://fal.run/mirelo-ai/sfx2.0/text-to-audio`
- **Model ID**: `mirelo-ai/sfx2.0/text-to-audio`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: text-to-audio, sfx



## Pricing

Billing is calculated per second of output and per sample. From **October 14 through December 13, 2026**, the introductory price is **$0.010 per second**, reduced from **$0.015 per second** (approximately **33% off**). Standard pricing of **$0.015 per second** resumes on **December 14, 2026**. For example, **two 10-second samples** cost **$0.20** during the promotion and **$0.30** at the standard rate.

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_):
  What the sound effect should sound like
  - Examples: "Heavy rain on a metal roof with distant thunder"

- **`negative_prompt`** (`string`, _optional_):
  Sounds to keep out of the result

- **`duration`** (`float`, _optional_):
  Seconds of sound to generate, up to the deployment's text-to-SFX maximum Default value: `30`
  - Default: `30`
  - Range: `0.1` to `600`

- **`seed`** (`integer`, _optional_):
  Seed of the first sample; -1 or unset is random
  - Range: `-1` to `9223372036854776000`

- **`num_samples`** (`integer`, _optional_):
  Number of samples to generate, in one batched forward Default value: `2`
  - Default: `2`
  - Range: `1` to `4`

- **`upload_audio_format`** (`UploadAudioFormatEnum`, _optional_):
  Audio format to return Default value: `"wav"`
  - Default: `"wav"`
  - Options: `"wav"`, `"mp3"`, `"aac"`, `"flac"`

- **`upload_audio_bitrate_kbps`** (`integer`, _optional_):
  Bitrate in kbps for an mp3 or aac upload. mp3 is written at exactly this constant rate, one of 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320. aac takes 32 to 256 as a target the encoder may undershoot on mono or sparse audio. Unset keeps the default: mp3 at LAME V0 VBR, aac at a 256 kbps target. Refused with a lossless upload_audio_format.
  - Range: `32` to `320`



**Required Parameters Example**:

```json
{
  "prompt": "Heavy rain on a metal roof with distant thunder"
}
```

**Full Example**:

```json
{
  "prompt": "Heavy rain on a metal roof with distant thunder",
  "duration": 30,
  "num_samples": 2,
  "upload_audio_format": "wav"
}
```


### Output Schema

The API returns the following output format:

- **`model`** (`string`, _required_)

- **`audio`** (`list<Audio>`, _required_):
  The generated sound effects, one per sample
  - Array of Audio
  - Examples: [{"url":"https://di3otfzjg1gxa.cloudfront.net/rain_metal_roof_output_1.wav","file_name":"generated_audio_1.wav","content_type":"audio/wav"}]

- **`seeds`** (`list<integer>`, _required_):
  Each sample's seed, in the same order
  - Array of integer



**Example Response**:

```json
{
  "model": "",
  "audio": [
    {
      "url": "https://di3otfzjg1gxa.cloudfront.net/rain_metal_roof_output_1.wav",
      "file_name": "generated_audio_1.wav",
      "content_type": "audio/wav"
    }
  ]
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/mirelo-ai/sfx2.0/text-to-audio \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "prompt": "Heavy rain on a metal roof with distant thunder"
   }'
```

### 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(
    "mirelo-ai/sfx2.0/text-to-audio",
    arguments={
        "prompt": "Heavy rain on a metal roof with distant thunder"
    },
    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("mirelo-ai/sfx2.0/text-to-audio", {
  input: {
    prompt: "Heavy rain on a metal roof with distant thunder"
  },
  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/mirelo-ai/sfx2.0/text-to-audio)
- [API Documentation](https://fal.ai/models/mirelo-ai/sfx2.0/text-to-audio/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=mirelo-ai/sfx2.0/text-to-audio)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
