Sand.ai native video API
Use the native parts array to send a text prompt and media references. Set duration, aspect ratio, and audio in the same request.
Format referenceGenerate MAGI-2 video from your app with Sand.ai native, OpenAI-compatible, or xAI-compatible requests. Submit a prompt or first frame and retrieve the finished MP4.
API access coming soon
POST /v2/generations{
"model": "magi-2",
"parts": [
{
"type": "text",
"text": "A slow tracking shot along a riverside promenade at dusk."
}
],
"duration": 8,
"aspectRatio": "16:9",
"generateAudio": true
}Choose the video request format that fits your app. Each format will run MAGI-2 on magi2ai.run.
Use the native parts array to send a text prompt and media references. Set duration, aspect ratio, and audio in the same request.
Format referenceUse the OpenAI Videos request format with a prompt, seconds, size, and an optional first-frame file.
Format referenceUse the xAI video generation format with a prompt, duration, and aspect ratio. For image to video, include a first-frame image URL.
Format referenceCreate, track, and download clips through the same account as the web studio.
Start with a text prompt or a first frame. Pick the clip length, aspect ratio, and sound, then review the estimated cost.
Use a magi2ai.run API key to create a job. Track that job by ID until it succeeds or fails. Download the MP4 when the job returns its video URL.
Describe the shot to the MAGI-2 Agent Skill. Review the prompt and estimate, then approve the job to get the MP4 in your coding agent.
A create request will return a job ID. Use that ID with the status endpoint. Your app can persist it and restore progress after a reload.
With the Sand.ai native format, add a first-frame asset ID to the prompt in the parts array. When the job succeeds, read the MP4 download address from output.videoUrl.
GET /v2/generations/{id}Sample response{
"id": "123456789",
"status": "succeeded",
"output": {
"videoUrl": "https://static.magi.world/media/website/01f847c8f459fa2b2831796dade7fa9b72acdfe5f77538044d455973f07c6362.mp4"
}
}| Sand.ai native status | What the client does |
|---|---|
queued | The request is accepted and waiting for a worker. |
processing | The video is rendering. Keep the same job ID. |
succeeded | The MP4 is ready at the URL in the response. |
failed | The job has finished with an error. Read the error before retrying. |
canceled | The generation was canceled. Stop polling the job. |
Turn a product description or reference photo into a video job from your coding agent.