Sand AI MAGI-2 · Text to video · Image to video
MAGI-2 API
Generate 1080p video from a prompt or a starting image with Sand AI's MAGI-2 model, through one REST endpoint. No invite and no waitlist: create a key and pay $0.078 per second of video.
- Output resolution
- 1080p
- Clip length per task
- 4–30 s
- Aspect ratios
- 6
- Pay as you go
- $0.078/s
Playground
Try MAGI-2 without a key: 2 free clips per day, each 5 seconds at 1080p. The playground calls the same API you get with a key.
No video yet
Write a prompt and press Generate. Clips usually take one to three minutes.
MAGI-2 API reference
Two model IDs, one endpoint. Send Authorization: Bearer <key>, create a task, then poll it or receive a webhook. Base URL https://api.eggapi.ai.
Endpoints
- POST/v1/generateCreate a video task
- GET/v1/tasks/{id}Poll a task until it is completed or failed
- POST/v1/uploadsHost a local image for image-to-video (free)
Model IDs
- sand-ai/magi-2/text-to-videoText to video · 1080p
- sand-ai/magi-2/image-to-videoImage to video · 1080p
curl https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer $EGGAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sand-ai/magi-2/text-to-video",
"prompt": "A paper boat drifting down a rain-soaked street at dusk, neon reflections, slow dolly shot",
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "1080p"
}'
# Poll until data.status is "completed", then read data.output.url
curl https://api.eggapi.ai/v1/tasks/<task_id> \
-H "Authorization: Bearer $EGGAPI_API_KEY"| Field | Type | Required | Notes |
|---|---|---|---|
| model | string | Yes | One of the two model IDs above |
| prompt | string | Yes | What happens in the clip: subject, motion, camera, light |
| duration | integer | Yes | 4–30 seconds; the task is billed for this length |
| image_urls | string[] | Image to video | Public URL of the starting frame |
| aspect_ratio | string | No | 16:9, 9:16, 4:3, 3:4, 1:1 or 21:9 |
| resolution | string | No | 1080p |
| negative_prompt | string | No | What to keep out of the clip |
| parameters.generate_audio | boolean | No | Provider option to generate audio with the video |
| parameters.last_image | string | No | Image to video only: public URL of the end frame |
| webhook_url | string | No | HTTPS endpoint called when the task completes or fails |
MAGI-2 API pricing
$0.078 per second of 1080p video. A task costs the price times its duration. Image uploads are free, and there is no subscription or minimum.
Text to video and image to video
$0.078/ second
Pay as you go from a prepaid balance.
| Clip length | Resolution | Price per clip |
|---|---|---|
| 4 seconds | 1080p | $0.31 |
| 5 seconds | 1080p | $0.39 |
| 10 seconds | 1080p | $0.78 |
| 15 seconds | 1080p | $1.17 |
| 30 seconds | 1080p | $2.34 |
MAGI-2 API FAQ
Access, pricing, limits and how the API works.
What is the MAGI-2 API?
The MAGI-2 API gives programmatic access to MAGI-2, Sand AI's video generation model. You send a prompt, and optionally a starting image, to one REST endpoint and get back a 1080p MP4. Text-to-video and image-to-video each have their own model ID.
Do I need an invite from Sand AI to use MAGI-2?
No. At the time of writing, Sand AI's own MAGI-2 platform is invite-only. The API on this page is served by EggAPI, where anyone can create a key, top up a balance and call MAGI-2 right away.
How much does the MAGI-2 API cost?
MAGI-2 costs $0.078 per second of 1080p video, so a task costs the price times its duration: a 5-second clip is $0.39 and a 30-second clip is $2.34. Uploading input images is free, and there is no subscription.
How long can a MAGI-2 clip be?
Each task produces one clip between 4 and 30 seconds long, in 16:9, 9:16, 4:3, 3:4, 1:1 or 21:9.
How long does a generation take?
Tasks are asynchronous. Most MAGI-2 videos finish in one to three minutes. Poll GET /v1/tasks/{id} every few seconds, or pass a webhook_url and EggAPI will call your server when the task completes or fails.
How do I use my own image with image-to-video?
Image-to-video reads the starting frame from a public URL in image_urls. If your image is local, upload it first with POST /v1/uploads, which is free, and pass the returned URL. You can also set an end frame with parameters.last_image.
Is magi2api.ai affiliated with Sand AI?
No. magi2api.ai is an independent site about the MAGI-2 API. Keys, billing and the API itself are provided by EggAPI. MAGI-2 is a model by Sand AI.