Mirelo AI Sfx 2.0 Text To Audio API Documentation
Playground
Try it on WaveSpeedAI!Mirelo SFX 2.0 Text-to-Audio generates sound effects and ambience from text descriptions, with positive and negative prompt controls, configurable duration, and one audio output per request for sound design, video production, games, ads, and creative audio workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Mirelo SFX 2.0 Text-to-Audio generates sound effects and ambience directly from text descriptions. Describe the sound you want, use an optional negative prompt to exclude unwanted elements, choose the duration and audio format, and generate a finished audio track.
It is designed for game audio, cinematic sound design, environmental ambience, Foley-style effects, and other non-speech audio workflows.
Why Choose This?
-
Text-to-sound generation
Create sound effects and ambience directly from natural-language descriptions. -
Positive and negative guidance
Describe both what should be present and what should be avoided in the generated audio. -
Flexible duration
Generate audio from0.1seconds up to600seconds. -
Multiple output formats
Export aswav,mp3,aac, orflac. -
Bitrate control
Configure bitrate for MP3 and AAC when specific encoding requirements matter. -
Seed support
Use a fixed seed when reproducibility is useful.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Text description of the sound effects or ambience to generate. Maximum 2000 characters. |
| negative_prompt | No | Optional description of sounds or elements to avoid. Maximum 1000 characters. |
| duration | No | Requested audio duration in seconds. Range: 0.1–600. Default: 30. |
| audio_bitrate_kbps | No | Optional target bitrate for MP3 or AAC output. Omit for automatic encoding. |
| output_format | No | Output audio format: wav, mp3, aac, or flac. Default: wav. |
| seed | No | Optional integer seed from 0 to 2147483647. Omit for random generation. |
How to Use
- Describe the sound — Specify the sound source, environment, intensity, texture, and how it should evolve.
- Add a negative prompt optional — Describe sounds, voices, music, or other elements that should be avoided.
- Set duration — Choose a length from
0.1to600seconds. - Choose output format — Select
wav,mp3,aac, orflac. - Set bitrate optional — Configure bitrate when using MP3 or AAC.
- Set seed optional — Use a fixed seed when reproducibility is needed.
- Submit — Generate the audio and retrieve the result.
Pricing
Pricing is based on the requested duration.
The rate is $0.016 per requested second.
| Duration | Price |
|---|---|
| 1s | $0.016 |
| 5s | $0.080 |
| 10s | $0.160 |
| 30s | $0.480 |
| 60s | $0.960 |
| 600s | $9.600 |
negative_prompt, output_format, audio_bitrate_kbps, and seed do not add separate charges.
Best Use Cases
- Game sound effects — Generate interaction sounds, environmental effects, impacts, machinery, creatures, and other game audio.
- Cinematic sound design — Create dramatic effects, transitions, atmospheres, and environmental sound.
- Ambient soundscapes — Generate rain, city ambience, forests, interiors, crowds, and other background environments.
- Foley-style audio — Create footsteps, object handling, doors, fabric movement, and other action-related sounds.
- Soundtrack prototyping — Explore alternate sound directions before final production.
- Interactive media — Generate custom sound assets for applications, installations, and immersive experiences.
Pro Tips
- Describe concrete sound sources, materials, movement, intensity, and environment.
- Explain how the sound should change over time when progression matters.
- Use
negative_promptto reduce unwanted music, speech, voices, or background elements. - Start with shorter generations when testing a new sound direction before creating longer audio.
- Use
wavorflacwhen lossless output is preferred. - Set a fixed
seedwhen comparing prompt or parameter changes.
Notes
promptis required and supports up to2000characters.negative_promptsupports up to1000characters.durationsupports0.1–600seconds and defaults to30.output_formatdefaults towav.- Supported output formats are
wav,mp3,aac, andflac. - Leave
audio_bitrate_kbpsempty for WAV and FLAC. - MP3 supports
32,40,48,56,64,80,96,112,128,160,192,224,256, or320kbps. - AAC accepts an integer target bitrate from
32to256kbps; actual encoded bitrate may be lower. - When no bitrate is specified, MP3 uses variable bitrate and AAC uses a
256kbps target. - This endpoint is designed for sound effects and ambience rather than text-to-speech or voice cloning.
Related Models
- Mirelo SFX 2.0 Video-to-Audio — Generate synchronized sound effects from video with optional text guidance and speech preservation.
- Mirelo SFX 2.0 Video-to-Video — Add synchronized sound effects to an existing video and return the video with the new soundtrack.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"duration": 30,
"output_format": "wav"
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/mirelo-ai/sfx-2.0/text-to-audio" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | 1 ~ 2000 characters · pattern: \S | Describe the sound effects or ambience to generate. | |
| negative_prompt | string | No | 0 ~ 1000 characters | Sounds to avoid, such as music, voices, or traffic. | |
| duration | number | No | 30 | 0.1 ~ 600 | Sound duration in seconds, from 0.1 to 600. |
| audio_bitrate_kbps | integer | No | - | 32 ~ 320 | Optional MP3 or AAC bitrate in kbps. Leave empty for automatic encoding. |
| output_format | string | No | wav | wav, mp3, aac, flac | Output audio format. |
| seed | integer | No | - | 0 ~ 2147483647 | Random seed. Leave empty for random generation. |
Conditional constraints
- When
audio_bitrate_kbpsis provided:output_formatis required;output_formatmust be one ofmp3,aac. - When
output_formatismp3andaudio_bitrate_kbpsis provided:audio_bitrate_kbpsmust be one of32,40,48,56,64,80,96,112,128,160,192,224,256,320. - When
output_formatisaacandaudio_bitrate_kbpsis provided:audio_bitrate_kbpsmust be at most 256.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |