guides

MAGI-2 API Video with Sound: Dialogue, Lip Sync and Ambience

Poyo.ai Team
8 min read
Share:

MAGI-2 API video with sound: dialogue, lip sync and ambience

The MAGI-2 API returns video and sound in one MP4: spoken lines, sound effects and ambience come out of the same generation as the picture, with no separate voice-over or foley step. This post shows how to ask for each kind of sound through the API with the model ID magi-2, what PoYo saw on launch day, and where the limits are. Try prompts in the MAGI-2 playground before wiring them into code.

How MAGI-2 generates audio

Sand AI says MAGI-2 "generates synchronized video and audio natively within a single backbone", covering "dialogue with lip-sync, foley, ambient sound, and music". For the Preview generation, Sand AI describes that backbone as processing text, video and audio tokens in one continuous sequence "so motion, lip-sync, and acoustics evolve together" (MAGI-2 announcement).

For an API integration, that design has three practical effects:

  • One request, one file. There is no second audio endpoint to call and nothing to align afterwards.
  • The prompt controls the sound. Whatever you write about voices and sounds is the audio spec.
  • No audio surcharge. On PoYo, audio is part of the 16 credits ($0.08) per second rate.

The audio fields in the MAGI-2 API

FieldEffect on sound
promptSpoken lines in quotes, plus the sound effects, ambience and music you want
generate_audiotrue (default) returns an AAC stereo track; false returns a silent MP4 at the same price
reference_audio_urlsUp to 5 MP3 or WAV clips, each 2–30 s, 30 s total, for voice, music or rhythm
duration4–30 s; give dialogue enough time to be spoken

The output is one MP4 with H.264 video at 25 fps and, when audio is on, an AAC stereo track (PoYo MAGI-2 docs).

Dialogue with lip sync

Put each line in quotes and tie it to a visible speaker. The docs say a quoted line is spoken by the character in the generated audio.

{
  "model": "magi-2",
  "input": {
    "prompt": "Medium two-shot on a ferry deck at sunset. A woman in a yellow raincoat turns to the man beside her and says: \"I never thought we would make this trip.\" He smiles and answers: \"Neither did I.\" Seagulls call overhead, the ship's engine hums, and waves slap the hull.",
    "duration": 8,
    "aspect_ratio": "16:9"
  }
}

Prompt habits that keep dialogue usable:

  • Name who speaks, in order. "The woman says ... He answers ..." gives each line a face.
  • Keep the camera on the speaker. A two-shot or close-up shows the mouth; a wide shot from behind does not.
  • Budget the time. Two short lines plus a reaction fit in 8 seconds; a paragraph of dialogue needs a longer duration.
  • Add the room. Background sound (engine, wind, crowd) makes a dialogue scene sound placed rather than recorded in a booth.

On November 28, 2026, the PoYo team ran an 8-second two-person dialogue scene on a ferry deck, with lip-synced lines, seagulls and engine hum in the prompt, on the production MAGI-2 API. It was charged 128 credits ($0.64), returned 1920×1080 at 25 fps with an audio track, and finished within about 3.5 minutes (polled, with two other tasks running in parallel).

Sound effects and ambience without dialogue

Not every clip needs a voice. Describe events that make sound and say there is no dialogue, so the model does not add speech.

{
  "model": "magi-2",
  "input": {
    "prompt": "Night, heavy rain at a railway crossing. Warning bells start ringing and red lights flash as the barrier lowers. A long freight train thunders past, wheels clattering over the joints, rain hissing on the asphalt. When the last car passes, the bells stop and only the rain remains. No dialogue, no music.",
    "duration": 6,
    "aspect_ratio": "16:9"
  }
}

Write sound as a sequence: what starts, what is loudest, what is left at the end. The launch-day test of this kind of prompt, a 6-second rainy railway crossing with a train passing and sound effects and ambience only, was charged 96 credits ($0.48) and finished within about 3 minutes (polled) at 1920×1080, 25 fps, with an audio track.

Sound on a first frame

Audio works the same way when you start from an image. The prompt adds the motion and the sound the still cannot show.

{
  "model": "magi-2",
  "input": {
    "prompt": "The cyclist pedals along the coastal road, wind rushing past, tires humming on the asphalt, waves breaking on the rocks below.",
    "image_urls": ["https://example.com/cyclist-coastal-road.jpg"],
    "duration": 5
  }
}

PoYo's 5-second launch-day test of a cyclist on a coastal road, sent through image_urls, was charged 80 credits ($0.40) and finished within about 3 minutes (polled), again with an audio track at 1920×1080 and 25 fps.

Reference audio for voice and music

To keep a melody or a voice across clips, send it as reference audio and say in the prompt how to use it. Reference audio can be sent alone or with reference images and videos, but not together with image_urls.

{
  "model": "magi-2",
  "input": {
    "prompt": "The street musician from the reference image plays the saxophone melody from the reference audio on a seaside boardwalk. Gulls and soft waves under the music. At the end he lowers the saxophone and says: \"Morning light suits this tune.\"",
    "reference_image_urls": [
      "https://storage.poyo.ai/models/magi-2/examples/reference-character-6586977013a0.jpg"
    ],
    "reference_audio_urls": [
      "https://storage.poyo.ai/models/magi-2/examples/reference-audio-5bf2add370f4.mp3"
    ],
    "duration": 8,
    "aspect_ratio": "16:9"
  }
}

Reference clips are not billed; the charge stays at output seconds × 16 credits.

When to turn audio off

Set generate_audio to false when your pipeline adds licensed music or a human voice-over later, or when the clip is muted by default (some ad placements). The price does not change, so the only reason to turn audio off is that you do not want it in the file.

{
  "model": "magi-2",
  "input": {
    "prompt": "Ultrawide shot of a rider climbing a desert dune at sunset, ending as a silhouette against the sky.",
    "duration": 4,
    "aspect_ratio": "21:9",
    "generate_audio": false
  }
}

Check the audio track in your pipeline

If your app depends on sound, verify it before publishing. ffprobe (part of FFmpeg) lists the audio stream of the downloaded MP4:

ffprobe -v error -select_streams a -show_entries stream=codec_name,channels \
  -of csv=p=0 magi2-output.mp4

With generate_audio: true you should see an AAC stereo stream. An empty result means no audio track, which is what generate_audio: false returns.

Limits Sand AI states

Sand AI is open about where audio still falls short:

  • It says "complex soundscapes still have room for richer layering and physical realism". Scenes with many overlapping sources may need simpler prompts or a mix pass.
  • It notes that the pretrained checkpoint showed early cross-lingual translation and dialogue ability, but that these behaviors became harder to elicit after post-training. Sand AI does not list supported dialogue languages, so test non-English lines on your own prompts before relying on them.
  • Sand AI publishes no lip-sync or audio benchmark. Its 1150.3 average Elo on Artificial Analysis Video Arena v2.1 covers four tasks, two of them silent.

Frequently asked questions

Does the MAGI-2 API generate lip-synced dialogue? Sand AI says MAGI-2 generates dialogue with lip sync. Put the line in quotes in the prompt and keep the speaker on camera.

Does sound cost extra in the MAGI-2 API? No. Audio is on by default and included in 16 credits ($0.08) per second.

Can the MAGI-2 API use my own music or voice? Yes, as reference audio: up to 5 MP3 or WAV clips in reference_audio_urls, each 2–30 seconds, 30 seconds total.

How do I get a silent video from the MAGI-2 API? Send "generate_audio": false. You get a video-only MP4 at the same price.

Which languages can MAGI-2 API dialogue use? Sand AI does not publish a language list. Test the languages you need before you ship.

What audio format does the MAGI-2 API return? An AAC stereo track inside the MP4, alongside H.264 video at 25 fps.

Share: