curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2-text-to-video",
"prompt": "A macro lens focuses on a green glass frog on a leaf. The focus gradually shifts from its smooth skin to its completely transparent abdomen, where a bright red heart is beating powerfully and rhythmically.",
"duration": 8,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-text-to-video",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": false,
"estimated_time": 165,
"video_duration": 8
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 50
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: magi-2-text-to-video",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}MAGI-2 Complete Parameter Guide
Complete parameter reference for MAGI-2. Use model to select a model in this folder. Required fields and input requirements are listed for each mode.
| Model ID | Mode | Required fields (excluding model) |
|---|---|---|
magi-2-text-to-video | Text-to-Video | prompt |
magi-2-image-to-video | Image-to-Video | image_urls |
magi-2-reference-to-video | Reference-to-Video | At least one of image_urls / video_urls / audio_urls |
Text-to-Video
- Generate 1080p videos from text prompts, with synchronized audio by default
- Supports any integer duration from
4–30seconds
Image-to-Video
- Input 1 image for first-frame video generation, input 2 images for first-last-frame video generation
- The prompt is optional; the first frame alone can drive the video
Reference-to-Video
-
Input reference images (0–10) + reference videos (0–5) + reference audio (0–5) + text prompt to generate video
-
At least one of the three reference types is required; they can be combined freely
-
Asynchronous processing mode, use the returned task ID to query status
-
Generated video links are valid for 7 days, please save them promptly
curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2-text-to-video",
"prompt": "A macro lens focuses on a green glass frog on a leaf. The focus gradually shifts from its smooth skin to its completely transparent abdomen, where a bright red heart is beating powerfully and rhythmically.",
"duration": 8,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-text-to-video",
"object": "video.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": false,
"estimated_time": 165,
"video_duration": 8
},
"type": "video",
"usage": {
"billing_rule": "per_second",
"credits_reserved": 50
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: magi-2-text-to-video",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Authorizations
##All endpoints require Bearer Token authentication##
Get API Key:
Visit the API Key Management Page to obtain your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
This page combines the parameters of all modes. Required fields, accepted values, and defaults depend on the selected model; differences are listed by mode below.
Video generation model name
| Model ID | Mode | Required fields (excluding model) |
|---|---|---|
magi-2-text-to-video | Text-to-Video | prompt |
magi-2-image-to-video | Image-to-Video | image_urls |
magi-2-reference-to-video | Reference-to-Video | At least one of image_urls / video_urls / audio_urls |
magi-2-text-to-video, magi-2-image-to-video, magi-2-reference-to-video "magi-2-text-to-video"
Text-to-Video
Text prompt describing the desired video. Supports both Chinese and English. Maximum prompt length: 15000 characters
Note:
- This model is text-to-video only and does not support
image_urls,video_urls, oraudio_urlsinput
Image-to-Video
Text prompt describing the desired video (optional). Supports both Chinese and English. Maximum prompt length: 15000 characters
Note:
- This model does not support
video_urlsoraudio_urlsinput
Reference-to-Video
Text prompt describing the desired video (optional). Supports both Chinese and English. Maximum prompt length: 15000 characters
"Follow the camera movement and rhythm of the reference video, and have the character from the image dance on a city rooftop to the beat of the reference audio"
Applies only to: Image-to-Video, Reference-to-Video
Image-to-Video
Image URL array, 1–2 images
Image count and behavior:
| Image Count | Behavior | Role |
|---|---|---|
| 1 image | First-frame image-to-video | Automatically set as first_frame |
| 2 images | First-last-frame image-to-video | 1st image → first_frame, 2nd image → last_frame |
Image requirements:
- Max size per image:
30MB - URL length per image must not exceed
8192characters - Only HTTPS URLs are supported; image URLs must be directly accessible by the server
Reference-to-Video
Reference image URL array, 0–10 images
Role description:
| Media Type | Role | Typical Usage |
|---|---|---|
| Image | reference_image | Character reference, style reference, product image |
Image requirements:
- Max size per image:
30MB - Only HTTPS URLs are supported; image URLs must be directly accessible by the server
Note: At least one of image_urls, video_urls, or audio_urls must be provided
10["https://example.com/ref1.jpg"]
Applies only to: Reference-to-Video
Reference video URL array, 0–5 videos
Role description:
| Media Type | Role | Typical Usage |
|---|---|---|
| Video | reference_video | Camera movement reference, motion reference, visual style reference |
Video requirements:
- Supported formats:
.mp4,.mov - Duration per video:
2~30seconds, max 5 videos, total duration of all videos ≤30seconds - Max size per video:
200MB - Only HTTPS URLs are supported; video URLs must be directly accessible by the server
Note: At least one of image_urls, video_urls, or audio_urls must be provided
5["https://example.com/reference.mp4"]
Applies only to: Reference-to-Video
Reference audio URL array, 0–5 clips
Role description:
| Media Type | Role | Typical Usage |
|---|---|---|
| Audio | reference_audio | Background music, sound effects, voice/dialogue reference |
Audio requirements:
- Supported formats:
.wav,.mp3 - Duration per clip:
2~30seconds, max 5 clips, total duration of all audio ≤30seconds - Max size per clip:
15MB - Only HTTPS URLs are supported; audio URLs must be directly accessible by the server
Note: At least one of image_urls, video_urls, or audio_urls must be provided
5["https://example.com/bgm.mp3"]
Text-to-Video / Image-to-Video
Video duration (seconds), defaults to 5 seconds
Details:
- Supports any integer value between
4–30seconds - Duration directly affects billing
Reference-to-Video
Output video duration (seconds), defaults to 5 seconds
Details:
- Supports any integer value between
4–30seconds - Duration directly affects billing
4 <= x <= 308
Text-to-Video / Reference-to-Video
Video aspect ratio, defaults to 16:9
Options:
16:9(landscape),9:16(portrait),1:1(square),4:3,3:4,21:9(ultrawide)
Image-to-Video
Video aspect ratio, defaults to 16:9
Options:
16:9(landscape),9:16(portrait),1:1(square),4:3,3:4,21:9(ultrawide)
Details:
- The video is generated at the selected aspect ratio; if the first-frame image has a different aspect ratio, the first frame is center-cropped to fit
- If the first frame is a portrait image, set an aspect ratio close to the image's, such as
9:16
16:9, 9:16, 1:1, 4:3, 3:4, 21:9 "16:9"
Text-to-Video
Whether to generate synchronized audio, defaults to true
Options:
true: Video includes synchronized audio (voice, sound effects, background music) at no additional charge. It is recommended to place dialogue within double quotes to optimize audio generationfalse: Output silent video
Image-to-Video / Reference-to-Video
Whether to generate synchronized audio, defaults to true
Options:
true: Video includes synchronized audio at no additional chargefalse: Output silent video
true
HTTPS callback URL for task completion
Callback timing:
- Triggered when the task is completed, failed, or cancelled
- Sent after billing confirmation is complete
Security restrictions:
- Only HTTPS protocol is supported
- Callbacks to private IP addresses are prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
- URL length must not exceed
2048characters
Callback mechanism:
- Timeout:
10seconds - Up to
3retries after failure (at1/2/4seconds after failure respectively) - Callback response body format is consistent with the task query endpoint response format
- A 2xx status code is considered successful; other status codes trigger retries
"https://your-domain.com/webhooks/video-task-completed"
Response
Video generation task created successfully