Skip to content
English

Wan 2.7 Image-to-Video API

POST /v1/tasks

All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name wan2.7-video/image-to-video
Type Video generation (image-to-video)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

Wan 2.7 Image-to-Video API animates a first frame into video and also supports last-frame, driving-audio, or first-clip media inputs.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.
API key and pricing
  • All HiAPI task models use the same API key. Create the key in the dashboard and keep it on your server.
  • Pricing depends on model, resolution, duration, and request volume. Use the HiAPI Pricing page as the live source of truth.
  • For image and video generation, validate prompts with lower-cost settings before moving final requests to higher specs or longer durations.

Best suited for

First-frame animation

Animate a first_frame image with camera motion.

mediaprompt
First-last transition

Pass first_frame and last_frame to control start and end frames.

media[].type
Low-cost testing

Use 720P and 2 seconds to validate the image URL and prompt.

resolutionduration
Stable media input

Media URLs must be publicly reachable, without hotlink blocking or complex redirects.

media[].url

Request parameters

model string required

Fixed value wan2.7-video/image-to-video.

example wan2.7-video/image-to-video
input object required

Business parameters for image-to-video media input and generation settings.

prompt string required

Image-to-video prompt, up to 5000 characters.

media array required

Media inputs, 1-3 items. Each item includes type and url. SVG is not supported.

type enum required

Media type.

enum: first_framelast_framedriving_audiofirst_clip
url string required

Stable public URL, OSS URL, or supported base64 data URI.

negative_prompt string optional

Negative prompt, up to 500 characters.

default ""
resolution enum optional

Video resolution. Use uppercase values.

default 1080P enum: 720P1080P
duration integer optional

Video duration in seconds, range 2-15.

default 5
prompt_extend boolean optional

Whether to optimize the prompt.

default true
watermark boolean optional

Whether to add a watermark.

default false
seed integer optional

Random seed, range 0-2147483647.

callback object optional

Optional callback configuration. In production, pass callback.url so HiAPI can notify your service when the task reaches a terminal state.

url string required

HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final for terminal-state notifications.

default final enum: final

Example requests

First-frame image-to-video

Low-cost example with one first_frame item.

Request body
{
  "model": "wan2.7-video/image-to-video",
  "input": {
    "prompt": "Make the image gently move with subtle camera motion.",
    "media": [
      {
        "type": "first_frame",
        "url": "https://example.com/first-frame.jpg"
      }
    ],
    "resolution": "720P",
    "duration": 2,
    "prompt_extend": false,
    "watermark": false
  }
}
First-last-frame transition

Use two images to control start and end frames.

Request body
{
  "model": "wan2.7-video/image-to-video",
  "input": {
    "prompt": "Create a smooth transition from the first frame to the last frame.",
    "media": [
      {
        "type": "first_frame",
        "url": "https://example.com/first.jpg"
      },
      {
        "type": "last_frame",
        "url": "https://example.com/last.jpg"
      }
    ],
    "resolution": "720P",
    "duration": 5,
    "prompt_extend": true,
    "watermark": false
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated video from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

Next steps