Mirelo AI Sfx 2.0 Text To Audio API Documentation

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 from 0.1 seconds up to 600 seconds.

  • Multiple output formats
    Export as wav, mp3, aac, or flac.

  • Bitrate control
    Configure bitrate for MP3 and AAC when specific encoding requirements matter.

  • Seed support
    Use a fixed seed when reproducibility is useful.


Parameters

ParameterRequiredDescription
promptYesText description of the sound effects or ambience to generate. Maximum 2000 characters.
negative_promptNoOptional description of sounds or elements to avoid. Maximum 1000 characters.
durationNoRequested audio duration in seconds. Range: 0.1–600. Default: 30.
audio_bitrate_kbpsNoOptional target bitrate for MP3 or AAC output. Omit for automatic encoding.
output_formatNoOutput audio format: wav, mp3, aac, or flac. Default: wav.
seedNoOptional integer seed from 0 to 2147483647. Omit for random generation.

How to Use

  1. Describe the sound — Specify the sound source, environment, intensity, texture, and how it should evolve.
  2. Add a negative prompt optional — Describe sounds, voices, music, or other elements that should be avoided.
  3. Set duration — Choose a length from 0.1 to 600 seconds.
  4. Choose output format — Select wav, mp3, aac, or flac.
  5. Set bitrate optional — Configure bitrate when using MP3 or AAC.
  6. Set seed optional — Use a fixed seed when reproducibility is needed.
  7. Submit — Generate the audio and retrieve the result.

Pricing

Pricing is based on the requested duration.

The rate is $0.016 per requested second.

DurationPrice
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_prompt to reduce unwanted music, speech, voices, or background elements.
  • Start with shorter generations when testing a new sound direction before creating longer audio.
  • Use wav or flac when lossless output is preferred.
  • Set a fixed seed when comparing prompt or parameter changes.

Notes

  • prompt is required and supports up to 2000 characters.
  • negative_prompt supports up to 1000 characters.
  • duration supports 0.1–600 seconds and defaults to 30.
  • output_format defaults to wav.
  • Supported output formats are wav, mp3, aac, and flac.
  • Leave audio_bitrate_kbps empty for WAV and FLAC.
  • MP3 supports 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320 kbps.
  • AAC accepts an integer target bitrate from 32 to 256 kbps; actual encoded bitrate may be lower.
  • When no bitrate is specified, MP3 uses variable bitrate and AAC uses a 256 kbps target.
  • This endpoint is designed for sound effects and ambience rather than text-to-speech or voice cloning.

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
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes1 ~ 2000 characters · pattern: \SDescribe the sound effects or ambience to generate.
negative_promptstringNo0 ~ 1000 charactersSounds to avoid, such as music, voices, or traffic.
durationnumberNo300.1 ~ 600Sound duration in seconds, from 0.1 to 600.
audio_bitrate_kbpsintegerNo-32 ~ 320Optional MP3 or AAC bitrate in kbps. Leave empty for automatic encoding.
output_formatstringNowavwav, mp3, aac, flacOutput audio format.
seedintegerNo-0 ~ 2147483647Random seed. Leave empty for random generation.

Conditional constraints

  • When audio_bitrate_kbps is provided: output_format is required; output_format must be one of mp3, aac.
  • When output_format is mp3 and audio_bitrate_kbps is provided: audio_bitrate_kbps must be one of 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320.
  • When output_format is aac and audio_bitrate_kbps is provided: audio_bitrate_kbps must be at most 256.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<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.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.