MAGI-2 API-Referenz: Sand.ai Magi AI Video-Endpunkte & Schemas
Das 480B-Flaggschiff MAGI-2 von Sand.ai stellt auf Atlas Cloud drei kanonische Magi-AI-Video-Modell-IDs bereit – `sand-ai/magi-2/text-to-video`, `sand-ai/magi-2/image-to-video` und `sand-ai/magi-2/reference-to-video`. Alle werden über `POST https://api.atlascloud.ai/api/v1/model/generateVideo` eingereicht und über `GET /api/v1/model/prediction/{request_id}` abgeglichen. Jeder Endpunkt rechnet pauschal 0,08 $/Sekunde im Großhandel ab (Ganzzahlschritte 4–30 s), inklusive nativem Audio und bis zu 20 Omni-References.
- Basis-Origin
- https://api.atlascloud.ai
- Modellanzahl
- 3 Flaggschiff-Endpunkte
- Dauerbereich
- Ganzzahl 4–30 s (Schritt 1)
- Max. Prompt
- 15.000 Zeichen
Live Atlas Cloud OpenAPI-Schemas (2026-12-02)
MAGI-2 Text-to-Video
| Feld | Typ | Erforderlich | Grenzen & Verhalten |
|---|---|---|---|
| model | string | Pflicht | Literal "sand-ai/magi-2/text-to-video" Canonical Atlas Cloud model identifier for flagship MAGI-2 T2V. |
| prompt | string | Pflicht | 1–15,000 characters Structured director brief describing subjects, camera moves, lighting, timestamped shot cuts, dialogue lines, foley, and explicit "no music" if score is unwanted. |
| duration | integer | Optional (5) | Integer 4–30 (1-second steps) Requested clip duration in seconds. Billed per integer second. |
| aspect_ratio | enum | Optional (16:9) | "16:9" | "9:16" | "21:9" | "4:3" | "3:4" | "1:1" Target 1080p-class framing ratio. |
{
"model": "sand-ai/magi-2/text-to-video",
"prompt": "[00:00-00:04] Medium close-up in a rain-streaked diner booth under warm tungsten overhead lamps, slow 50mm dolly-in. A tired detective sets a chipped ceramic mug on Formica and says calmly: \"You left the ledger at Pier Nine.\" Audio: muffled rain on glass, ceramic clink, no music.",
"duration": 4,
"aspect_ratio": "16:9"
}MAGI-2 Image-to-Video (First / Last Frame)
| Feld | Typ | Erforderlich | Grenzen & Verhalten |
|---|---|---|---|
| model | string | Pflicht | Literal "sand-ai/magi-2/image-to-video" Canonical Atlas Cloud model identifier for flagship MAGI-2 I2V. |
| image | string | Pflicht | Public HTTPS image URL or Base64 data URI (JPEG/PNG/WebP) Opening keyframe. Output aspect ratio automatically follows this image. |
| last_image | string | Optional | Public HTTPS image URL or Base64 data URI matching start aspect ratio Optional closing keyframe for guided start-to-end camera and subject transitions. |
| prompt | string | Pflicht | 1–15,000 characters Motion, camera choreography, dialogue, foley, and lighting progression between keyframes. |
| duration | integer | Optional (5) | Integer 4–30 (1-second steps) Requested clip duration in seconds. Billed per integer second. |
{
"model": "sand-ai/magi-2/image-to-video",
"image": "https://assets.magiai.ai/examples/espresso-start.webp",
"last_image": "https://assets.magiai.ai/examples/espresso-pour-end.webp",
"prompt": "Macro 100mm locked push-in as tiger-striped espresso crema flows smoothly from a naked portafilter into a preheated stoneware demitasse. Steam rises against a dark slate background. Audio: pump hum, steady espresso drip, subtle ceramic resonance, no music.",
"duration": 6
}MAGI-2 Reference-to-Video (Omni-Reference)
| Feld | Typ | Erforderlich | Grenzen & Verhalten |
|---|---|---|---|
| model | string | Pflicht | Literal "sand-ai/magi-2/reference-to-video" Canonical Atlas Cloud model identifier for flagship MAGI-2 Omni-Reference. |
| prompt | string | Pflicht | 1–15,000 characters referencing @image_n, @video_n, @audio_n roles Director brief explicitly binding each uploaded reference slot to its subject, motion, or audio role. |
| duration | integer | Optional (5) | Integer 4–30 (1-second steps) Requested clip duration in seconds. Flat $0.08/s regardless of reference count. |
| aspect_ratio | enum | Optional (16:9) | "16:9" | "9:16" | "21:9" | "4:3" | "3:4" | "1:1" Target 1080p-class framing ratio. |
| images | string[] | Optional | Max 10 items (public HTTPS URLs or Base64) Identity portraits, product angles, wardrobe sheets, or set plates. |
| videos | string[] | Optional | Max 5 public HTTPS URLs; 2–30s each; combined duration <= 30s Camera movement, actor blocking, or performance pacing references. |
| audios | string[] | Optional | Max 5 public HTTPS URLs; 2–30s each; combined duration <= 30s Voice timbre samples, spoken stems, musical grooves, or foley beds. |
{
"model": "sand-ai/magi-2/reference-to-video",
"prompt": "Using the speaker in @image_1 wearing the linen jacket in @image_2 inside the sunlit studio from @image_3, match the natural voice timbre of @audio_1 and slow handheld framing of @video_1. [00:00-00:05] She holds the serum bottle toward camera and says clearly: \"Three drops after cleansing keeps winter redness calm all day.\" Audio: crisp room tone, soft glass click, no music.",
"duration": 8,
"aspect_ratio": "9:16",
"images": [
"https://assets.magiai.ai/examples/founder-portrait.webp",
"https://assets.magiai.ai/examples/serum-bottle.webp",
"https://assets.magiai.ai/examples/bathroom-vanity.webp"
],
"videos": [
"https://assets.magiai.ai/examples/handheld-framing-4s.mp4"
],
"audios": [
"https://assets.magiai.ai/examples/founder-voice-5s.wav"
]
}Authentifizierung, Header & Basis-Endpunkte
Alle direkten Atlas-Cloud-Anfragen erfordern HTTPS mit `Authorization: Bearer <API_KEY>` und `Content-Type: application/json`. Antworten kapseln Prediction-Metadaten in einem Top-Level-Objekt `data` (in Client-Parsern empfiehlt sich zusätzlich ein defensiver Fallback auf Top-Level-Felder). Der einheitliche Workspace von MagiAI Studio stellt authentifizierte Endpunkte unter `/api/jobs` (POST zum Reservieren von Credits und Absenden, GET zum Statusabgleich und Abrufen des Ledger-Kontostands) sowie `/api/keys` zur Bereitstellung berechtigungsbegrenzter `mgk_live_*`-Zugangsdaten bereit.
| Vorgang | Methode & URL | Erfolgsstatus | Hinweise |
|---|---|---|---|
| MAGI-2-Job absenden (Atlas direkt) | POST https://api.atlascloud.ai/api/v1/model/generateVideo | 200 / 201 / 202 | Sendet T2V, I2V oder Omni-Ref asynchron ab; liefert `data.id` zurück |
| Prediction pollen (Atlas direkt) | GET https://api.atlascloud.ai/api/v1/model/prediction/{request_id} | 200 OK | Alle 20–30 s pollen bis `completed`, `succeeded`, `failed` oder `canceled` |
| Job absenden (MagiAI Studio) | POST https://magiai.ai/api/jobs | 201 Created | Validiert Prompt/Referenzen, erzwingt `likenessConsent` bei R2V, reserviert atomar 10 Cr./s |
| Jobs auflisten & abgleichen (MagiAI Studio) | GET https://magiai.ai/api/jobs | 200 OK | Fragt offene Renderings ab und bucht bei fehlgeschlagenen/gefilterten Jobs automatisch 100 % Credits zurück |
Unterschiede bei Feldnamen: Atlas Cloud direkt vs. MagiAI Studio `/api/jobs`
Beachten Sie bei der Verbindung von MagiAI-Studio-Jobs mit direkten Atlas-Cloud-Aufrufen zwei Schema-Besonderheiten: Erstens akzeptiert `sand-ai/magi-2/image-to-video` **kein** `aspect_ratio` (es übernimmt immer das Seitenverhältnis des übergebenen Startbilds `image`); zweitens nutzt der Endpunkt `/api/jobs` von MagiAI Studio camelCase-Schlüssel (`aspectRatio`, `lastImage`, `referenceImages`, `referenceVideos`, `referenceAudios`, `likenessConsent`) und übersetzt diese automatisch in die Payloads der Upstream-Anbieter, während Ihr einheitliches Credit-Wallet nachgeführt wird.
{
"mode": "reference-to-video",
"prompt": "Using Mara (@image_1) in the diner booth (@image_2) with dry voice (@audio_1) and dolly pacing (@video_1): [00:00-00:05] She sets down the ceramic mug and says calmly: \"You left the ledger at Pier Nine.\" Audio: rain on glass, ceramic clink, no music.",
"duration": 8,
"aspectRatio": "16:9",
"referenceImages": [
"https://assets.magiai.ai/examples/founder-portrait.webp",
"https://assets.magiai.ai/examples/diner-booth.webp"
],
"referenceVideos": ["https://assets.magiai.ai/examples/handheld-framing-4s.mp4"],
"referenceAudios": ["https://assets.magiai.ai/examples/founder-voice-5s.wav"],
"likenessConsent": true
}HTTP-Statuscodes & finale Prediction-Zustände
Trennen Sie stets zwischen wiederholbaren Transportfehlern (HTTP 429 für Rate-/Concurrency-Limits, HTTP 502/503/504 für vorübergehende Edge-Timeouts) und nicht wiederholbaren Payload-Fehlern (HTTP 400/422 bei ungültiger Dauer, >20 Referenzen, >30 s kombinierter Referenzvideo-/Audio-Dauer oder HEIC-Bildern).
| Code / Zustand | Bedeutung | Credit- / Abrechnungseffekt | Client-Aktion |
|---|---|---|---|
| processing / queued | Aktiv auf vorgelagertem 480B-Cluster | Belastungsreservierung aktiv | Weiter alle 20–30 s pollen (typisch 7–26 Min.) |
| completed / succeeded + outputs[0] | MP4 in 1080p @ 25 fps bereit | Reservierung finalisiert (0,08 $/s / 10 Cr./s) | MP4 sofort herunterladen & in R2/S3 archivieren |
| completed + leeres outputs[] | Ausgabe durch PG-13-Sicherheitsfilter entfernt | 0 $ Upstream · 100 % Auto-Rückerstattung | Als `policy_filtered` markieren, Wallet erstatten, PG-13-Bearbeitungshinweise anzeigen |
| failed / canceled | Upstream-Fehler oder Moderationssperre | 0 $ Upstream · 100 % Auto-Rückerstattung | `error`-Meldung prüfen; Prompt oder Assets vor erneutem Versuch anpassen |
| HTTP 402 | Unzureichende Wallet-Credits (MagiAI Studio) | Keine Abbuchung erfolgt | Nutzer zum Aufladen eines nicht verfallenden PAYG-Pakets auffordern |
| HTTP 429 | Konto-Concurrency- oder Rate-Limit erreicht | Keine Abbuchung erfolgt | Retry-After beachten / lokal einreihen, bis ein aktiver Slot frei wird |
API-Host wählen & Multi-Modell-Routing-Architektur
Teams, die direkt gegen MAGI-2 entwickeln, können sich an Sand.ai Direct (`platform.sand.ai`), Atlas Cloud (`atlascloud.ai`), WaveSpeedAI (`wavespeed.ai`), Runware (`runware.ai`) oder die Higgsfield API anbinden – alle weisen mit Stand 2026-12-02 Basispreise von 0,08 $/s aus. Wenn Ihr Backend MAGI-2 gemeinsam mit Kling 4.0, Seedance 2.5, Google Veo 3.1 und Text-LLMs über einen einzigen API-Key und eine konsolidierte Rechnung orchestriert, ersparen Multi-Modell-Entwickler-Gateways wie SpicyAPI (`https://spicyapi.ai`) die Pflege separater SDK-Adapter pro Anbieter. Beachten Sie, dass mit Stand 2026-12-02 weder fal.ai (laut `r/fal` noch auf der Roadmap) noch Replicate das 480B-Flaggschiff MAGI-2 hosten.
Erstanbieter-MAGI-2-API (0,08 $/s)
Verifizierte produktive T2V-/I2V-/R2V-REST-Schemas (0,08 $/s)
Produktiver MAGI-2-Inferenz-Host (0,08 $/s)
Produktiver Inferenz-Router (~0,08 $/s)
Einheitliches Multi-Modell-Gateway für MAGI-2 zusammen mit Kling, Seedance, Veo & LLMs über einen Key