Generate high-quality videos from text descriptions or existing images using the Legnext AI video generation capabilities.

Endpoint

POST https://api.legnext.ai/api/v1/video-diffusion

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

Image-to-Video Mode

Choose one of two input methods: Option 1: Using existing generated image
ParameterTypeRequiredDescription
jobIdstringYesID of the source image generation task
imageNointegerYesImage number to animate (0/1/2/3)
promptstringNoVideo generation prompt text (1-8192 characters)
videoTypeintegerNoVideo quality type (0: 480p, 1: 720p)
callbackstringNoCallback URL for task completion notifications
Option 2: Using prompt with image URL
ParameterTypeRequiredDescription
promptstringYesVideo generation prompt text with image URL included, format: “[image_url] your prompt text” (1-8192 characters)
videoTypeintegerNoVideo quality type (0: 480p, 1: 720p)
callbackstringNoCallback URL for task completion notifications

Video Types

ValueResolutionDescription
0480pStandard definition (default)
1720pHigh definition

Example Requests

Image-to-Video (Using existing image)

curl -X POST "https://api.legnext.ai/api/v1/video-diffusion" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "c6821434-5e41-408f-b42b-2562306b109c",
    "imageNo": 0,
    "prompt": "Make this image move with gentle animation",
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
    "videoType": 0
  }'

Image-to-Video (Using image URL)

curl -X POST "https://api.legnext.ai/api/v1/video-diffusion" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "https://example.com/image.jpg A cinematic shot of ocean waves crashing against rocks",
    "videoType": 1,
    "callback": "https://webhook.site/d0ca59bc-35a6-4a1e-b1b1-aea7faeb7f67"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "bb40cae1-edd9-4cb0-9f66-e029b4439100",
    "model": "midjourney",
    "task_type": "video_diffusion",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "video_urls": [
            "https://image.legnext.ai/20250922/01k5qv5dyrfegbw3rss6jkmrtn_0_0.mp4?Expires=1761107607&Signature=da9zd27VIGrBNyeAOkwLycV9pns%3D",
            "https://image.legnext.ai/20250922/01k5qv5dyrfegbw3rss6jkmrtn_0_1.mp4?Expires=1761107607&Signature=B7skZf4oThnLD1qFZb49R3sgHEU%3D",
            "https://image.legnext.ai/20250922/01k5qv5dyrfegbw3rss6jkmrtn_0_2.mp4?Expires=1761107607&Signature=LxLClpHz42mz1LOX09FIjo5pTR8%3D",
            "https://image.legnext.ai/20250922/01k5qv5dyrfegbw3rss6jkmrtn_0_3.mp4?Expires=1761107607&Signature=t%2BrR0ZpkrNb%2FHNY1NV3vT0dS5FY%3D"
        ]
    },
    "meta": {
        "created_at": "2025-09-22T04:33:25Z",
        "started_at": "2025-09-22T04:33:26Z",
        "ended_at": "2025-09-22T04:37:20Z",
        "usage": {
            "type": "point",
            "frozen": 00,
            "consume": 00
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}