Sand AI MAGI-2 Image to Video API

MAGI-2 Image to Video: 4-30 second 1080p video with native audio.

Image to VideoVideo

Provider

MAGI

Billing

Provider cost

ScalingTensor price

Provider cost $0.08 / second; native audio included

Playground

Try Sand AI MAGI-2 Image to Video

Edit the params, add your API key and run the model here. The result plays on this page when the job completes.

Input

Used for this request only and never stored. Get a key

Running a request charges your wallet: Provider cost $0.08 / second; native audio included.

Output

preview

Request summary

Endpoint
POST /api/media/generate
Model ID
sandai/magi-2/image-to-video
image
https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1280&auto=format&fit=crop
prompt
At dawn, waves break gently against the rocks as the camera slowly moves forward.
duration
5
resolution
1080p
aspect_ratio
16:9
generate_audio
true

Need job lookups or the raw response? Open the full playground.

Pricing

Sand AI MAGI-2 Image to Video API pricing

Prices come from the live catalog. There is no subscription; each request is charged to your prepaid wallet.

ScalingTensor price

Provider cost

Live catalog price

Provider cost

$0.08 / second; native audio included

Compare all model prices

Shared balance

Add credits

Top up

One wallet and one API key for every model in the catalog. Top-ups start at $10 and are paid through Stripe.

Parameters

Input parameters

These parameters belong inside the request body's params object.

Input parameters
nametyperequireddescription
promptstringOptionalOptional. Describe the motion and sound.
imagestringRequiredFirst frame (upload or public HTTPS URL). JPEG, PNG, WebP, BMP, TIFF, GIF or HEIC, under 30 MB.
end_imagestringOptionalOptional last frame (upload or public HTTPS URL).
durationintegerOptionalOutput video duration in seconds (4-30). Billed per second.; default: 5; minimum: 4; maximum: 30
aspect_ratiostringOptionalOutput aspect ratio.; enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"]; default: "16:9"
resolutionstringOptionalOutput resolution. MAGI-2 renders 1080p only.; enum: ["1080p"]; default: "1080p"
generate_audiobooleanOptionalGenerate a native audio track with the video. Included in the price.; default: true
seedintegerOptionalRandom seed for reproducibility (0-4294967295). Omit for a random seed.; minimum: 0; maximum: 4294967295

Output fields

Output fields
nametypedescription
idstringUnique identifier for the generation task.
errorstringError message if the task failed. Empty on success.
modelstringModel ID used for the prediction.
statusstringStatus of the task: pending, running, completed, failed, or timeout.; enum: ["pending", "running", "completed", "failed", "timeout"]
outputsobject[]Array of generated content. Empty when status is not completed.
outputs[].urlstringThe URL where the generated content can be downloaded from.
outputs[].content_typestringThe MIME type of the output file.

API

Call Sand AI MAGI-2 Image to Video from your code

Create a key in the console and call the API from your server using the apiKey header. Save data.jobId and poll GET /api/media/result?jobId=... with the same key; a code of 0 means success.

POST /api/media/generate
curl --request POST 'https://restapi.scalingtensor.com/api/media/generate' \
  --header 'apiKey: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "model": "sandai/magi-2/image-to-video",
  "params": {
    "image": "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1280&auto=format&fit=crop",
    "prompt": "At dawn, waves break gently against the rocks as the camera slowly moves forward.",
    "duration": 5,
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  }
}'
const response = await fetch("https://restapi.scalingtensor.com/api/media/generate", {
  method: "POST",
  headers: {
    apiKey: process.env.SCALINGTENSOR_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "sandai/magi-2/image-to-video",
    "params": {
      "image": "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1280&auto=format&fit=crop",
      "prompt": "At dawn, waves break gently against the rocks as the camera slowly moves forward.",
      "duration": 5,
      "resolution": "1080p",
      "aspect_ratio": "16:9",
      "generate_audio": true
    }
  }),
});

const result = await response.json();
if (!response.ok || result.code !== 0) {
  throw new Error(result.msg || `Request failed: ${response.status}`);
}
console.log(result.data); // Save data.jobId to query /api/media/result
import os
import requests

payload = {
    "model": "sandai/magi-2/image-to-video",
    "params": {
        "image": "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1280&auto=format&fit=crop",
        "prompt": "At dawn, waves break gently against the rocks as the camera slowly moves forward.",
        "duration": 5,
        "resolution": "1080p",
        "aspect_ratio": "16:9",
        "generate_audio": True,
    },
}

response = requests.post(
    "https://restapi.scalingtensor.com/api/media/generate",
    headers={"apiKey": os.environ["SCALINGTENSOR_API_KEY"]},
    json=payload,
    timeout=60,
)
result = response.json()
if result["code"] != 0:
    raise RuntimeError(result["msg"])
print(result["data"])  # Save data["jobId"] to query /api/media/result

API documentation · This page as Markdown · Markdown API reference

Related models

Sand AI MAGI-2 Image to Video API FAQ

How much does the Sand AI MAGI-2 Image to Video API cost?

Sand AI MAGI-2 Image to Video is billed at the provider's actual cost for each job ($0.08 / second; native audio included). The charge is deducted from your prepaid ScalingTensor wallet.

How do I call the Sand AI MAGI-2 Image to Video API?

Send POST /api/media/generate with "model": "sandai/magi-2/image-to-video" and the parameters in a params object, using your apiKey header. The call returns a jobId. Poll GET /api/media/result?jobId=... until the status is completed, then read the output URL from the result.

Which parameters does Sand AI MAGI-2 Image to Video accept?

Required: image. Optional: prompt, end_image, duration, aspect_ratio, resolution, generate_audio and seed. The parameter table on this page describes each one.

Do I need a MAGI account to use Sand AI MAGI-2 Image to Video?

No. You call Sand AI MAGI-2 Image to Video with your ScalingTensor API key and pay from your ScalingTensor wallet. The same key works for every other model in the catalog.