MAGI 2 API: Text, Image and Reference to Video over REST
The magi2vid.org MAGI 2 API turns a prompt, a first frame or up to 10 reference images into a 4–30 second 1080p MAGI-2 video with sound. It costs $0.12 per second from a prepaid USD balance, and a video that fails is refunded automatically.
Facts checked: 2026-11-27
- Price
- $0.12 per second, 1080p with sound
- Clip length
- 4–30 s (4 s = $0.48)
- Modes
- Text, image, reference to video
- Top-ups
- $5, $10, $50 or $200
How do I start with the MAGI 2 API?
Sign in, open API keys, add balance and create a key. The key starts with m2v_ and is shown once, so store it in your server’s secrets. Send it in the Authorization header of every request.
All endpoints live under https://magi2vid.org/api/v1 and take and return JSON. Call them from your own server: the key gives full access to your balance and must never be shipped in a browser or mobile app.
- Top up the API balance at /settings/apikeys (Stripe checkout; the balance never expires and is separate from site credits).
- Create an API key on the same page.
- POST a job to /videos, then GET /videos/{id} every 30 seconds until status is succeeded or failed.
- Download video_url (valid for 1 hour; GET the job again for a fresh link).
Create a video
POST /videos starts one MAGI-2 render. The price is taken from your balance only after every check passes (prompt and image safety checks, limits, balance), so a refused request costs nothing. The response has HTTP 201 and the job in status queued.
Send an Idempotency-Key header (any unique string up to 100 characters) so a network retry returns the same job instead of charging twice.
curl https://magi2vid.org/api/v1/videos \
-H "Authorization: Bearer $MAGI2VID_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1234" \
-d '{
"mode": "text-to-video",
"prompt": "A red paper boat drifts down a rainy neon street, close-up, soft rain sounds",
"duration": 4,
"aspect_ratio": "16:9"
}'{
"mode": "image-to-video",
"prompt": "The courier rides off through the rain, camera slowly pushes in",
"duration": 6,
"first_frame_url": "https://example.com/first.jpg",
"last_frame_url": "https://example.com/last.jpg"
}{
"mode": "reference-to-video",
"prompt": "@Image1 walks into the cafe from @Image2 and orders a coffee",
"duration": 8,
"aspect_ratio": "9:16",
"reference_image_urls": [
"https://example.com/character.png",
"https://example.com/cafe.jpg"
]
}{
"id": "vid_02615fb324df3a529935c21f",
"object": "video",
"model": "magi-2",
"mode": "text-to-video",
"status": "queued",
"duration": 4,
"aspect_ratio": "16:9",
"generate_audio": true,
"cost_usd": 0.48,
"refunded": false,
"error": null,
"video_url": null,
"created_at": "2026-11-27T08:08:30.522Z",
"balance_usd": 4.52
}Request parameters
Image URLs must be reachable without login (no IP addresses or internal hosts). We download each image once, check it with the same safety filter as site uploads, and delete our copy about 22 hours later. Reference video and audio files are not available through the API yet.
| Field | Type | Rules |
|---|---|---|
| mode | string | text-to-video, image-to-video or reference-to-video (required) |
| prompt | string | Up to 5,000 characters; at least 3 for text and reference to video |
| duration | integer | Seconds, 4 to 30 (required); billed per requested second |
| aspect_ratio | string | 16:9 (default), 9:16, 1:1, 4:3, 3:4 or 21:9; image to video follows the frame |
| generate_audio | boolean | Default true; the price is the same either way |
| first_frame_url | string | Image to video only (required there): public https JPEG, PNG or WebP, max 5 MB |
| last_frame_url | string | Image to video only, optional; same rules |
| reference_image_urls | string[] | Reference to video only: 1–10 public https images, max 10 MB each |
| model | string | Optional, always magi-2 |
Check status and download the video
GET /videos/{id} returns the job. Status moves from queued to processing to succeeded or failed. MAGI-2 renders usually take several minutes and can take over an hour at busy times, so poll every 30 seconds or more. There are no webhooks yet.
When status is succeeded, video_url is a signed MP4 link (1080p, H.264 with AAC audio) that stays valid for 1 hour. Download the file and keep your own copy.
- GET /videos?limit=20 lists your latest API videos (up to 50).
- GET /balance returns balance_usd and price_usd_per_second.
import os, time, requests
API = "https://magi2vid.org/api/v1"
headers = {"Authorization": f"Bearer {os.environ['MAGI2VID_API_KEY']}"}
job = requests.post(f"{API}/videos", headers=headers, json={
"mode": "text-to-video",
"prompt": "A lighthouse in a storm at night, waves crash, thunder rumbles",
"duration": 4,
}).json()
while job["status"] in ("queued", "processing"):
time.sleep(30)
job = requests.get(f"{API}/videos/{job['id']}", headers=headers).json()
if job["status"] == "succeeded":
open("video.mp4", "wb").write(requests.get(job["video_url"]).content)
else:
print("failed:", job["error"], "refunded:", job["refunded"])const API = "https://magi2vid.org/api/v1";
const headers = {
Authorization: `Bearer ${process.env.MAGI2VID_API_KEY}`,
"Content-Type": "application/json",
};
let job = await (await fetch(`${API}/videos`, {
method: "POST",
headers,
body: JSON.stringify({ mode: "text-to-video", prompt: "A cat surfing a wave at sunset", duration: 4 }),
})).json();
while (job.status === "queued" || job.status === "processing") {
await new Promise((r) => setTimeout(r, 30_000));
job = await (await fetch(`${API}/videos/${job.id}`, { headers })).json();
}
console.log(job.status, job.video_url ?? job.error);How much does the MAGI 2 API cost?
Every mode costs $0.12 per requested second of 1080p video, with or without sound: $0.48 for 4 seconds, $1.20 for 10 seconds and $3.60 for 30 seconds. The charge is taken when the job is accepted and refunded in full if the video fails. Compare channels on the MAGI-2 pricing page.
| Clip | Price | Clips per $50 top-up |
|---|---|---|
| 4 s | $0.48 | 104 |
| 10 s | $1.20 | 41 |
| 15 s | $1.80 | 27 |
| 30 s | $3.60 | 13 |
Limits and errors
Each key allows 120 requests per minute. Each account can have 3 videos in progress and start 50 videos per UTC day; ask support@magi2vid.org if you need more. Errors return JSON like {"error": {"code": "insufficient_balance", "message": "…"}}.
| HTTP | error.code | Meaning |
|---|---|---|
| 400 | invalid_request | Bad JSON, a field out of range, or an image URL that is not public https |
| 401 | unauthorized | Missing, wrong, disabled or expired key |
| 402 | insufficient_balance | Balance below the price of the video |
| 403 | forbidden | Account suspended |
| 404 | not_found | No such video for this account |
| 422 | prompt_blocked / image_blocked | Refused by the content policy; not charged |
| 422 | image_unavailable | An image URL could not be downloaded |
| 429 | rate_limited / busy / daily_limit | Too many requests, 3 videos already running, or 50 today |
| 503 | capacity / generation_closed / moderation_error | Temporarily unavailable; not charged, retry later |
Why a finished job can fail
- content_policy: the model provider refused the render.
- provider: the render could not be started or broke on the provider side.
- timeout: no result after about 3 hours.
- storage: the result could not be saved.
- In every case refunded becomes true and the price is back in your balance.
Content rules and reporting
The Terms of Service apply to every API request: no sexual content, no minors, no real people or celebrities without consent, no violence or hate. If your app lets other people send prompts or images, you are responsible for what they submit: run your own checks and give your users a way to report content.
To report a video made through this API or this site, email support@magi2vid.org with the subject “Content report” and the video id (vid_…) or link. We review reports, remove content that breaks the rules and suspend the keys involved.
Get a MAGI-2 API key
Top up from $5, create a key and render your first 4-second clip for $0.48.
Frequently asked questions
Is this the official Sand AI MAGI-2 API?
+
No. magi2vid.org is an independent site, not affiliated with Sand AI or Higgsfield. It runs the MAGI-2 model through third-party API providers and sells access per second from a prepaid balance.
How much does a MAGI-2 video cost through the API?
+
$0.12 per second in every mode, 1080p with sound: a 4-second clip costs $0.48 and a 30-second clip $3.60. Failed videos are refunded automatically.
Does the API balance expire?
+
No. The API balance never expires and is separate from the credits used on the website. Unused balance can be refunded within 14 days of purchase by emailing support@magi2vid.org.
How long does a MAGI-2 API video take?
+
Usually several minutes; in busy periods it can take more than an hour. Poll GET /videos/{id} every 30 seconds or more. Jobs with no result after about 3 hours fail and are refunded.
Can I call the API from a browser or mobile app?
+
No. Keep the key on your server. Anyone who has the key can spend your balance; delete a leaked key at /settings/apikeys and create a new one.
Can I use API videos commercially?
+
Yes, subject to the Terms of Service and the model provider’s terms. You are responsible for what you and your users generate.
Related
magi2vid.org is an independent website, not affiliated with Sand AI or Higgsfield. MAGI-2 is a video model developed by Sand AI.