Developer Docs

Integrating Mirelo Audio APIs into Creative Workflows

Learn how to integrate Mirelo's AI audio generation API into your creative workflow to automate sound effects, foley, and background ambiance production for video and games.

What this guide covers

Mirelo provides a developer API for generating custom sound effects, foley, and background ambiance from text and video, plus native plugins for Adobe Premiere, DaVinci Resolve Studio, and Roblox Studio. This guide is for developers and creators who want to replace manual sound-design work with programmatic audio generation.

  1. Set up the Developer API and store an API key.
  2. Generate foley and ambiance from a text prompt, or from a video clip.
  3. Drop the result into an editing timeline with a native plugin, or keep it in your own pipeline.

Setting up the Mirelo Developer API

The REST API lives at https://api.mirelo.ai. It exposes text-to-SFX and video-to-SFX generation, plus extend and inpaint. The interactive reference is at /api-docs, and the production v3 OpenAPI document is at https://api.mirelo.ai/v3/openapi.json.

  1. Create an API key in Studio and send it as a Bearer token.
  2. Call preflight on a generation before you spend credits.
  3. Submit the create with ?wait=25, then poll if the job is still running.

Getting your API key

API requests authenticate with a Bearer token. Keys are issued in your Mirelo Studio account, begin with sk-, and are billed against Studio credits.

  1. Sign in at mirelo.ai/studio.
  2. Open Developer → API Keys (/studio/api-keys).
  3. Click "Create key", give it a name, and copy it immediately. It is shown once.
  4. The playground at /studio/playground runs requests before you write code. It does not create keys.
  5. Hosted MCP (Cursor, Claude, and ChatGPT) signs you in through the browser instead of this key, and bills the same Studio credits.

Configuring environment variables

Store the key in an environment variable rather than hardcoding it. Send it on every request.

  1. Set MIRELO_API_KEY to the key you copied.
  2. Set MIRELO_IDEMPOTENCY_KEY to a unique identifier for each new generation. Reuse that value and the same request body when retrying the generation.
  3. Send Authorization: Bearer $MIRELO_API_KEY.
  4. Send Content-Type: application/json.

Generating foley and ambiance from text

Preflight the request to read its credit cost, then create the generation with ?wait=25. If the job is still running, poll urls.self and check the job's status before downloading audio. Send an Idempotency-Key on create and reuse it with the same body if you retry. The reference below covers response shapes, job outcomes, and download expiry.

  1. POST /v3/text-to-sfx/generations/preflight with the same body you intend to generate.
  2. Gate the create on the quoted credits.
  3. POST /v3/text-to-sfx/generations?wait=25.
  4. If the response is 202, poll urls.self until status is final. A successful HTTP response alone does not mean the job succeeded.

Preflight

curl https://api.mirelo.ai/v3/text-to-sfx/generations/preflight \
  --request POST \
  --header "Authorization: Bearer $MIRELO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "sfx-1.6",
  "duration_ms": 8000,
  "num_variants": 1,
  "input": { "prompt": "Heavy rain on a metal roof with distant thunder" }
}'

Create

curl https://api.mirelo.ai/v3/text-to-sfx/generations?wait=25 \
  --request POST \
  --header "Authorization: Bearer $MIRELO_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: ${MIRELO_IDEMPOTENCY_KEY:?Set a unique key for this generation}" \
  --data '{
  "model": "sfx-1.6",
  "duration_ms": 8000,
  "num_variants": 1,
  "input": { "prompt": "Heavy rain on a metal roof with distant thunder" }
}'

Picture-locked foley from video

For silent or AI-generated footage, video-to-SFX watches the picture and times effects to on-screen action. The clip is input.video on POST /v3/video-to-sfx/generations. Pass a public HTTP or HTTPS URL, or upload a local file with the two requests below. An optional input.prompt covers off-screen detail: the video still drives the timing. Text-to-SFX suites make you generate, then place and sync the audio yourself.

  1. For a local file, POST /v3/assets with your API key and the file's content_type. The 201 response is an upload ticket with id, upload_url, fields, upload_expires_at, and max_bytes; it does not mean the file has arrived.
  2. POST multipart/form-data to upload_url without an Authorization header. Send every returned fields entry first, then the file bytes as the final part named file. Keep the upload within max_bytes and start before upload_expires_at.
  3. Wait for the storage upload's own 2xx response before using the asset id. Generating before the bytes arrive returns asset_not_ready, which can be retried after the upload finishes.
  4. Send input.video as { "type": "url", "url": "https://…" } or { "type": "asset", "id": "…" }.
  5. Add input.prompt only when you want to steer which sound to generate.
  6. Preflight and create the same way as text-to-SFX, on /v3/video-to-sfx/generations.

Create from a video URL

curl https://api.mirelo.ai/v3/video-to-sfx/generations?wait=25 \
  --request POST \
  --header "Authorization: Bearer $MIRELO_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: ${MIRELO_IDEMPOTENCY_KEY:?Set a unique key for this generation}" \
  --data '{
  "model": "sfx-1.6",
  "duration_ms": 10000,
  "input": {
    "video": { "type": "url", "url": "https://example.com/scene.mp4" },
    "prompt": "Footsteps on wet concrete"
  }
}'

Integrating with video editing software

Native plugins connect generated audio to an editing timeline or a game engine. They are listed at /plugins.

Adobe Premiere

Generate sound from a selected clip or a text prompt, then use Timeline Sync to place it in Premiere.

Premiere installation and usage

DaVinci Resolve Studio

Generate audio and place it on the timeline with Timeline Sync. The plugin requires DaVinci Resolve Studio.

DaVinci Resolve Studio installation and usage

Roblox Studio

Generate game-ready sound effects from a prompt and publish them to your Roblox account for use in an experience.

Roblox Studio installation and usage

What you can build with this

The same API and plugins cover three common jobs.

  1. Automated foley and ambiance: room tone, weather, and impact sounds from text prompts, with a credit preflight so the cost is known first.
  2. Timeline-native sound design: Premiere, DaVinci Resolve Studio, or Roblox Studio, with sync handled by the plugin.
  3. Programmatic pipelines: the REST API on its own, or an MCP-connected agent in Cursor, Claude, or ChatGPT for on-demand generation.

Related resources

The API reference and plugins sit next to this guide. They do not replace it.