Describe any sound in natural language and get back audio clips ready to drop into your project.
https://api.mirelo.ai/v2/text-to-sfx/v1.6/sync| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | required | Bearer token authentication using your API key. Example: |
Content-Type | string | required | Must be application/json. Example: |
Idempotency-Key | string | optional | Stable retry key for one logical sync request, up to 128 characters. Reusing it while the original request is in progress, after it completed, or with a different body returns 409 idempotency_conflict instead of starting a second billable request. A failed attempt may be retried with the same key. A completed request's key is remembered for 24 to 48 hours after the original request completes. A 409 retry does not extend this window; reusing the key after it is forgotten starts and bills a new request. Example: |
| Name | Type | Required | Description |
|---|---|---|---|
prompt | string | required | A text description of the sound to generate. Up to 5,000 characters. |
duration_ms | integer | optional | Target duration of the output audio in milliseconds. Without loop: 100–60000. With loop=true: 1000–600000 (up to 10 minutes). Requests longer than 60000 ms with loop=true are automatically handled by generating a loopable chunk and tiling it with ffmpeg. Default: |
loop | boolean | optional | When true, the output is optimized for seamless looping — ideal for background ambience and game audio. Enables extended durations up to 600000 ms (10 minutes). Minimum duration_ms is 1000. Default: |
num_samples | integer | optional | Number of audio variants to generate in parallel. Returns one URL per variant. Default: |
seed | integer | optional | Seed for reproducible generation. Integer, minimum -1. Omit, or send -1 or null, for a randomly chosen seed. The seed pins both generation and the server-side prompt rewrite. It does not guarantee identical audio: repeated identical requests still vary, because generation is not bit-deterministic across inference workers. |
output_format | wav | mp3 | aac | flac | optional | Container for the generated audio. Omit for WAV. Requests that need server-side post-processing — a tiled loop, a windowed extend or inpaint, a long video clip — are generated losslessly and encoded into this container once, at the end. Not accepted together with output: "video", which returns an MP4 whose audio track the model muxes itself. |
curl 'https://api.mirelo.ai/v2/text-to-sfx/v1.6/preflight?duration_ms=10000&num_samples=1' \
--header 'Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'200 OK — cost estimate
{
"credits": 2,
"estimated_ms": 4200
}curl https://api.mirelo.ai/v2/text-to-sfx/v1.6/sync \
--request POST \
--header 'Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Idempotency-Key: order-123' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Heavy rain on a metal roof with distant thunder",
"duration_ms": 8000,
"loop": false,
"num_samples": 1,
"seed": 42,
"output_format": "mp3"
}'200 OK
{
"result_urls": [
"https://cdn.mirelo.ai/output/abc123.wav"
]
}