Head Tail To Video (Wan 2.1)

POSThttps://api.newportai.com/api/async/wan/head_tail_to_video/2.1

The Head Tail To Video (Wan 2.1) API generates high-quality videos by interpolating between two provided images based on a text prompt. By supplying a starting (head) frame, an ending (tail) frame, and a description, the API creates a five-second video that seamlessly transitions between the two visual states.

  • Submit a POST request to the Head Tail To Video (Wan 2.1) API to obtain a taskId.
  • Submit a POST request to the Polling API to retrieve the generated video results.
  • Configure a Callback URL to receive results automatically on completion.

Request Headers

Content-Type string Required

Enum: application/json

Authorization string Required

Bearer authentication token. Example: Bearer {{APIKey}}.

Request Body

prompt string Required

The text description guiding the video generation. Must be fewer than 1,500 characters.

firstImage string Required

The URL of the starting (head) frame image.

lastImage string Required

The URL of the ending (tail) frame image.

resolution string Optional

Specifies the output video resolution. Supported values: 480p, 720p. Default: 480p.

Response

code integer

Returns 0 for success, or a specific error code.

message string

Returns "success" or a descriptive error message.

data object
taskId string

The unique identifier for the task. Use this ID with the Polling API to retrieve the generated output.

Errors

10192Illegal param

Polling

Use the Polling API to retrieve the processing results.

Callback

Alternatively, you can enable Callback to receive task results automatically upon completion.

0Task Completed
{
    "code": 0,
    "message": "success",
    "data": {
        "task": {
            "taskId": "1938b6f630344de1a30c85ff12c3c75b",
            "status": 3,
            "taskType": "wan/head_tail_to_video/2.1"
        },
        "videos": [
            {
                "videoType": "mp4",
                "videoUrl": "https://dreamface-resource-cv.oss-us-east-1.aliyuncs.com/wan-video-ai/2025-07-29/7355950893615812608.mp4"
            }
        ]
    }
}
Request
cURL
curl -X POST 'https://api.newportai.com/api/async/wan/head_tail_to_video/2.1' \
  -H "Authorization: Bearer {{key}}" \
  -H 'Content-Type: application/json' \
  -d '{
    "prompt":"a boy singing",
    "resolution":"480p",
    "firstImage":"https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/INj5UrnnrKIzCR1uYBWv0.png",
    "lastImage":"https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/VE-i9SzS3ZRdVTSzJWTcA.jpeg"
}'
0Successful
{
    "code": 0,
    "message": "success",
    "data": {
        "taskId": "1938b6f630344de1a30c85ff12c3c75b"
    }
}