API reference

Create a video task with an API key. The same models, durations, resolutions and credit costs as the studio.

Authentication

Create a key under API Keys, then send it on every request.

Authorization: Bearer YOUR_API_KEY

POST https://magi2.vip/api/v1/tasks
GET  https://magi2.vip/api/v1/tasks/{task_id}

API Keys

Create a task

Send the model id with duration and resolution. Text to video needs a prompt. Image, reference and extend tasks also need public HTTPS URLs. The response credits field is the cost for that model, resolution and duration.

curl -X POST https://magi2.vip/api/v1/tasks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan/v3.0-spark/text-to-video",
    "prompt": "A lantern drifting over a quiet harbor at dusk",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "generate_audio": true
  }'
{
  "code": 0,
  "message": "ok",
  "data": {
    "id": "task_xxx",
    "status": "pending",
    "model": "wan/v3.0-spark/text-to-video",
    "videoUrl": null,
    "error": null,
    "credits": 60
  }
}

Inputs by workflow

  • Text to video: prompt, duration, resolution, aspect_ratio. generate_audio when the model allows it.
  • Image to video: image_url, plus an optional prompt.
  • Reference to video: prompt, and at least one of reference_images, reference_videos, reference_audios.
  • Video extend: prompt and video_url. No aspect ratio.

Read a task

Poll the task you created. videoUrl is present when the clip is ready. You can only read tasks created with your own key.

curl https://magi2.vip/api/v1/tasks/task_xxx \
  -H "Authorization: Bearer YOUR_API_KEY"

Models

Duration is every whole second in the range. The example credit cost uses the duration and resolution in the last column.

ModelWorkflowResolutionDurationExample
Video Fast 1.0
video-fast/v1.0/text-to-video
Text to Video480p / 768p3–15s5s · 480p · 9
Wan 3.0 Spark
wan/v3.0-spark/text-to-video
Text to Video480p / 720p / 1080p2–30s5s · 720p · 60
Wan 3.0 Prime Spark
wan/v3.0-prime-spark/text-to-video
Text to Video480p / 720p / 1080p2–30s5s · 720p · 80
Video Fast 1.0
video-fast/v1.0/image-to-video
Image to Video480p / 768p3–15s5s · 480p · 9
Wan 3.0 Spark
wan/v3.0-spark/image-to-video
Image to Video480p / 720p / 1080p2–30s5s · 720p · 60
Wan 3.0 Prime Spark
wan/v3.0-prime-spark/image-to-video
Image to Video480p / 720p / 1080p2–30s5s · 720p · 80
Video Fast 1.0
video-fast/v1.0/reference-to-video
Reference to Video480p / 768p3–30s5s · 480p · 9
Wan 3.0 Spark
wan/v3.0-spark/reference-to-video
Reference to Video480p / 720p / 1080p2–30s5s · 720p · 60
Wan 3.0 Prime Spark
wan/v3.0-prime-spark/reference-to-video
Reference to Video480p / 720p / 1080p2–30s5s · 720p · 80
Video Fast Extend 1.1
video-fast/v1.1/video-extend
Video Extend480p / 720p / 1080p3–30s5s · 720p · 135

Errors

A successful response has code 0. Any other code puts the reason in message. A missing or unknown key returns Unauthorized.

{ "code": -1, "message": "Unauthorized" }