Generate from prompt
Describe any sound in natural language and get back audio clips ready to drop into your project.
Endpoint
https://api.mirelo.ai/v2/text-to-sfx/v1.6/syncParameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | required | Bearer token authentication using your API key. Example: |
Content-Type | string | required | Must be application/json. Example: |
Body
| 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. Must be between 1,000 and 60,000. When loop is true, minimum is 3,000. Default: |
loop | boolean | optional | When true, the output is optimized for seamless looping at the requested duration — ideal for background ambience and game audio. Requires duration_ms between 3,000 and 60,000. Default: |
num_samples | integer | optional | Number of audio variants to generate in parallel. Returns one URL per sample. Default: |
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 'Content-Type: application/json' \
--data '{
"prompt": "Heavy rain on a metal roof with distant thunder",
"duration_ms": 8000,
"loop": false,
"num_samples": 1
}'200 OK
{
"result_urls": [
"https://cdn.mirelo.ai/output/abc123.wav"
]
}