Wan
wan2.7-i2v animates an image into a video. It supports first/last frame control, lip-sync from a
driving audio track, and clip continuation.
For text-to-video, reference-to-video, video editing and Wan 3.0, see Wan.
https://llm.siraya.ai/v1/videos/generations
https://llm.siraya.ai/v1/videos/{video_id}
Send async: true and poll
Renders typically take one to three minutes. Send "async": true to get an id back
immediately, then poll GET /v1/videos/{video_id} until status is completed or failed —
or pass a callbackUrl to be notified instead. See
Asynchronous generation.
Supported Models
| Model ID | Inputs | Resolutions | seconds |
|---|---|---|---|
wan2.7-i2v |
first/last frame · lip-sync driving audio · clip continuation | 720P, 1080P (default 1080P) |
2–15 (default 5) |
Header
Bearer <API_KEY>).
Body
Every field is sent flat, at the top level of the request body — there is no settings or
options wrapper, and no extra_body is needed.
wan2.7-i2v.
role — see
input_references.
2–15; when continuing a clip it is the total length after continuation.
720P or 1080P (default 1080P).
"blurry, low quality".
-1, for a random seed.
false when you want the prompt used verbatim.
true, the request returns immediately with a video id you poll for status. When false (the default), it waits for generation to finish and returns the completed video URL.
async is true. An https:// URL the router will POST the result to, so you don't have to poll.
curl https://llm.siraya.ai/v1/videos/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.7-i2v",
"prompt": "She turns toward the camera and smiles",
"frame_images": [
{ "frame_type": "first_frame", "image_url": "https://your-domain.com/portrait.jpg" }
],
"seconds": 5,
"resolution": "720P",
"async": true
}'
import requests
url = "https://llm.siraya.ai/v1/videos/generations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
}
data = {
"model": "wan2.7-i2v",
"prompt": "She turns toward the camera and smiles",
"frame_images": [
{"frame_type": "first_frame", "image_url": "https://your-domain.com/portrait.jpg"}
],
"seconds": 5,
"resolution": "720P",
"async": True
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Example Response
Media inputs
frame_images
Hard constraints on the opening and closing frame of the render.
| Field | Type | Description |
|---|---|---|
frame_type |
string | first_frame or last_frame. |
image_url |
string | Public URL or a base64 data URL. |
input_references
Each entry carries a role and a url; role is what decides how the material is used:
role |
Meaning |
|---|---|
driving_audio |
Lip-sync driving audio, paired with a first_frame |
first_clip |
A prior clip to continue from |
Examples
First and last frame
{
"model": "wan2.7-i2v",
"prompt": "The flower slowly blooms",
"frame_images": [
{ "frame_type": "first_frame", "image_url": "https://your-domain.com/bud.jpg" },
{ "frame_type": "last_frame", "image_url": "https://your-domain.com/bloom.jpg" }
],
"resolution": "1080P",
"async": true
}
Lip-sync from a portrait
{
"model": "wan2.7-i2v",
"prompt": "The person lip-syncs to the audio",
"frame_images": [
{ "frame_type": "first_frame", "image_url": "https://your-domain.com/portrait.png" }
],
"input_references": [
{ "role": "driving_audio", "url": "https://your-domain.com/track.mp3" }
],
"resolution": "720P",
"watermark": false
}
Continuing a clip
seconds here is the total length after continuation, not the length of the new footage.
{
"model": "wan2.7-i2v",
"prompt": "Continue the scene",
"input_references": [
{ "role": "first_clip", "url": "https://your-domain.com/clip1.mp4" }
],
"seconds": 10,
"resolution": "720P",
"watermark": false
}
Poll for status
{
"id": "video_9M1Ll0p-27nCK2vX82bHn...",
"object": "video",
"status": "completed",
"seconds": 5,
"model": "wan2.7-i2v",
"output_url": "https://.../result_00.mp4",
"usage": { "completion_tokens": 0, "total_tokens": 0 }
}
| Field | Present | Meaning |
|---|---|---|
id |
always | Opaque — pass it as-is to the status endpoint; don't parse it |
status |
always | processing · completed · failed |
output_url |
completed | Signed and expiring — download promptly rather than storing it as a stable link |
error |
failed | { "code": "...", "message": "..." } |
usage |
always | Always zero — no token concept |
Behavior worth knowing
prompt_extend is on by default. Your prompt is rewritten before generation unless you send
"prompt_extend": false.
Material URLs must be public. Images, audio and clips are fetched by the model service itself; a URL behind authentication fails the task with a download error. For large images, prefer a URL over base64 — the request-body size limit applies to the whole payload.
Errors
A request-time refusal is final — retrying the same body won't help.
| Status | Meaning |
|---|---|
400 |
Parameter validation — a seconds outside 2–15, a resolution the model doesn't offer |
401 |
Invalid API key |
404 |
Unrecognized model code |
200 with status: "processing" |
Accepted — keep polling. A task that fails after starting reports status: "failed" with an error object |