{"openapi":"3.1.0","info":{"title":"MAGI-2 API — CheaperGen","version":"1.0.0","description":"Sand.ai MAGI-2 generates video with sound in the 1080p tier from text, first and last frames, or multimodal references."},"servers":[{"url":"https://cheapergen.com/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Generation":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"generation"},"model":{"type":"string"},"endpoint":{"type":"string"},"status":{"enum":["queued","running","succeeded","failed","canceled"]},"output":{"type":["object","null"]},"error":{"type":["object","null"]},"cost":{"type":"object","properties":{"amount_usd":{"type":"number"},"official_usd":{"type":["number","null"],"description":"The list price for the same request: see list_price_source."},"list_price_source":{"enum":["official","reference"],"description":"official: the developer's own list price; reference: another price we compare with, named by list_price_label (e.g. fal API)."},"list_price_label":{"type":"string"},"saved_usd":{"type":["number","null"]},"estimated":{"type":"boolean"}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}}}},"paths":{"/run/sand-ai/magi-2/text-to-video":{"post":{"summary":"MAGI-2 — Text to Video","operationId":"sand_ai_magi_2_text_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":15000},"aspect_ratio":{"title":"Aspect ratio","description":"Output frame shape.","type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"],"default":"16:9"},"resolution":{"title":"Resolution","description":"The 1080p tier. Pixel dimensions depend on the output aspect ratio.","type":"string","enum":["1080p"],"default":"1080p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (4–30s). You pay per second.","type":"integer","minimum":4,"maximum":30,"default":5},"generate_audio":{"title":"Generate audio","description":"Generate synchronized sound, ambience and dialogue. No extra cost.","type":"boolean","default":true},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/run/sand-ai/magi-2/image-to-video":{"post":{"summary":"MAGI-2 — Image to Video","operationId":"sand_ai_magi_2_image_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","image_url"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":15000},"image_url":{"title":"First frame","description":"Image used as the opening frame. JPG/PNG/WebP, URL or upload.","type":"string","format":"uri"},"end_image_url":{"title":"Last frame","description":"Optional closing frame — the model animates between the two.","type":"string","format":"uri"},"resolution":{"title":"Resolution","description":"The 1080p tier. Pixel dimensions depend on the output aspect ratio.","type":"string","enum":["1080p"],"default":"1080p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (4–30s). You pay per second.","type":"integer","minimum":4,"maximum":30,"default":5},"generate_audio":{"title":"Generate audio","description":"Generate synchronized sound, ambience and dialogue. No extra cost.","type":"boolean","default":true},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/run/sand-ai/magi-2/reference-to-video":{"post":{"summary":"MAGI-2 — Reference to Video","operationId":"sand_ai_magi_2_reference_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":15000},"reference_image_urls":{"title":"Reference images","description":"Up to 10 images for characters, products, style or scene. Refer to them in the prompt as @Image1, @Image2…","type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"reference_video_urls":{"title":"Reference videos","description":"Up to 5 MP4/MOV clips for motion, camera moves or effects (2–30 s each, 30 s in total). Refer to them as @Video1, @Video2… References add no charge.","type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"x-media-limits":{"formats":["mp4","mov"],"min_seconds":2,"max_seconds":30,"max_total_seconds":30}},"reference_audio_urls":{"title":"Reference audio","description":"Up to 5 MP3/WAV clips for voice, music or sound (2–30 s each, 30 s in total). Refer to them as @Audio1, @Audio2…","type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"x-media-limits":{"formats":["mp3","wav"],"min_seconds":2,"max_seconds":30,"max_total_seconds":30}},"aspect_ratio":{"title":"Aspect ratio","description":"Output frame shape.","type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"],"default":"16:9"},"resolution":{"title":"Resolution","description":"The 1080p tier. Pixel dimensions depend on the output aspect ratio.","type":"string","enum":["1080p"],"default":"1080p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (4–30s). You pay per second.","type":"integer","minimum":4,"maximum":30,"default":5},"generate_audio":{"title":"Generate audio","description":"Generate synchronized sound, ambience and dialogue. No extra cost.","type":"boolean","default":true},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/generations/{id}":{"get":{"summary":"Get a generation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}}}}