Overview
Use model IDmagi-2 to generate videos from a prompt, a first frame with an optional last frame, or a prompt with optional image, video, and audio references.
Output dimensions
1080p is the output tier. The actual pixel dimensions depend on aspect_ratio.
Set
aspect_ratio explicitly to control framing. If you omit it, text-to-video and reference-to-video use 16:9. Image-to-video uses the closest supported ratio to the first frame.
Endpoints and authentication
Base URL:
Send
Authorization: Bearer YOUR_API_KEY with both requests and Content-Type: application/json with the POST body.
Request examples
Text-to-video
Image-to-video
This example requests square output and uses both a first and a last frame. To animate a single image, pass only the first URL.Reference-to-video
Parameters
Supported values:
async, callback. With async, poll until data.state is success or failed. With callback, read the final webhook payload. On success, parse data.resultJson as JSON and read resultUrls. On failure, read data.failCode and data.failMsg.Required when
request_type is callback. Use a public HTTPS URL that can receive the final task payload. See Webhooks.Task status and results
The creation response returnsdata.taskId.
data.state is success or failed. For callback requests, read the same result fields from the final webhook payload.
data.resultJson as JSON and read the MP4 URLs from resultUrls. On failure, read data.failCode and data.failMsg. See Status Task and Error Codes for the shared response fields.
Billing
The standard price is $0.080 per requested output second** for all three modes. Aspect ratio, the sound setting, and reference media leave the rate unchanged. A 4-second request costs **$0.32 at the standard rate. See API Pricing for current rates.MCP integration
The model schema declares video decoding inmcp.result and file bindings in mcp.attachments for image_urls, video_urls, and audio_urls. Preserve image order when binding first and last frames.