curl --request POST \
--url https://api.evolink.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "magi-2-reference-to-video",
"prompt": "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",
"image_urls": [
"https://example.com/character.jpg"
],
"video_urls": [
"https://example.com/reference.mp4"
],
"audio_urls": [
"https://example.com/bgm.mp3"
],
"duration": 10,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-reference-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-reference-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 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-reference-to-video",
"prompt": "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",
"image_urls": [
"https://example.com/character.jpg"
],
"video_urls": [
"https://example.com/reference.mp4"
],
"audio_urls": [
"https://example.com/bgm.mp3"
],
"duration": 10,
"quality": "1080p",
"aspect_ratio": "16:9",
"generate_audio": true
}
'{
"created": 1761313744,
"id": "task-unified-1774857405-abc123",
"model": "magi-2-reference-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-reference-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
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"
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"]
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"]
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"]
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