Guides

  • Overview
  • Getting Started
  • Blog Automation
  • AI Video Creation
  • AI Image Generation
  • Template Market
  • MCP API Integration Guide
    • Video
    • Audio / BGM
    • Image
HomeGuidesMCP API Integration Guide

MCP API Integration Guide · Audio / BGM

MCP API — Audio / BGM

Guide to generating AI background music with create_bgm (Stable Audio 2.5) and auto-mixing it during video composition.

Overview

This section covers generating background music (BGM) and mixing it into the final video via MCP. The provider is Stable Audio 2.5 (fal.ai), and the create_bgm tool handles generation and callback end-to-end.

create_bgm

Pass a prompt and duration to generate an AI background music WAV. Async like create_clip, returns a taskId.

Parameters

  • prompt (required) — BGM description in English. ", seamless loop" is auto-appended for loop-friendly output.
  • secondsTotal (required) — 1-190 seconds. Match the final video length for best results.
  • numInferenceSteps (optional) — 4-8, default 8. Higher = better quality, slower.
  • guidanceScale (optional) — 1-25, default 1. Higher = stronger prompt adherence.
  • seed (optional) — reproducibility seed
  • workflowId (optional) — dashboard workflow association

Prompt Examples

  • "upbeat cinematic orchestral, 120 bpm, inspirational"
  • "lo-fi hip hop, relaxed, jazz piano, 85 bpm"
  • "epic trailer music, tension build, strings and percussion"
  • "ambient electronic, dreamy pad, 90 bpm, ethereal"

Pricing

500 coins (length-independent, auto-refunded on failure)

Output

  • 44.1kHz stereo WAV
  • Max 190 seconds
  • Commercial license OK
  • Auto-uploaded to Supabase Storage (public URL stored in bgm_url)

Automatic Mixing during Compose

If a BGM node is connected to the compose node in your workflow graph, compose_video automatically mixes it. Default processing:

1. Crossfade Loop

When BGM is shorter than the video, the loop boundary is crossfaded (0.5-1s overlap) for seamless continuation.

2. End-of-Video Fade Out

BGM volume fades to 0 in the last 1-2 seconds of the video (default fade_out_ms: 1500).

3. Volume Ducking

When source clip audio exists (Veo3/Seedance/Kling auto-generated), BGM volume is automatically lowered by -12dB.

Example Workflow

  1. create_workflow → workflowId
  2. create_clip for a 30s video (multiple scenes)
  3. create_bgm for a 30s BGM
    {
      "prompt": "upbeat cinematic orchestral, inspirational, 120 bpm",
      "secondsTotal": 30,
      "workflowId": "wf_..."
    }
  4. get_job_status polling until BGM is done (check bgm_url)
  5. compose_video — BGM is auto-mixed if connected in the workflow

Note

LTX-2.3 models do not generate audio, so BGM is especially important. Veo3/Seedance/Kling generate audio automatically, so BGM should layer with ducking enabled.