wan2.7

wan2.7

wan2.7 (Alibaba) covers T2V / I2V / continuation style async video.

Overview

Official $0.125/s
LumeAPI from $0.072 / s
POST /v1/videos (+ poll + content)
Base: https://api.lumeapi.site/v1

Auth: Authorization: Bearer sk-… from the Console. Use this model id exactly in the model field.

Request parameters — Wan 2.7 video

Only parameters relevant to wan2.7 are listed below.

FieldTypeReqDescription
modelstringwan2.7 — unified T2V / I2V / video continuation entry
promptstringRequired for text-to-video (max 5000 chars). Optional but recommended for I2V.
image_urlsstring[]I2V: 1 image = first frame; 2 images = first + last frame. Mutually exclusive with image_with_roles. Cannot combine with video_urls.
image_with_rolesarray<object>[{url, role: first_frame|last_frame}] — alternative to image_urls
video_urlsstring[]Video continuation (first URL used). Cannot combine with image_urls/first_frame/audio_url.
resolutionstring720P | 1080P (default). Billing: $0.072/s · $0.125/s
durationinteger2–15 seconds. Alias: seconds. Default 5.
sizestringT2V only: 16:9 (default) | 9:16 | 1:1 | 4:3 | 3:4. Alias: aspect_ratio. Ignored when image/video input present.
audio_urlstringCustom audio URL (wav/mp3, 2–30s). T2V = BGM; I2V = motion driver. Cannot combine with video_urls.
negative_promptstringContent to avoid (max 500 chars)
prompt_extendbooleanSmart prompt rewrite (default true)
watermarkbooleanAdd "AI生成" watermark (default false)
seedintegerRandom seed (≥0)
image / image_url / imagesstring | arrayGateway maps to image_urls

Notes

FieldTypeReqDescription
Mode routingNo image/video → text-to-video. image_urls/image_with_roles → I2V. video_urls → continuation.
Async flowPOST /v1/videos → poll GET /v1/videos/{id} → GET /v1/videos/{id}/content when completed.

Examples

bash
curl https://api.lumeapi.site/v1/videos \
  -H "Authorization: Bearer $LUMEAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7",
    "prompt": "City traffic timelapse at night",
    "resolution": "1080P",
    "duration": 5,
    "size": "16:9"
  }'

Video async flow

Base URL

All requests go to https://api.lumeapi.site/v1 with Authorization: Bearer sk-…

Three-step async flow

(1) POST /v1/videos → save id from response. (2) GET /v1/videos/{id} every 5–15s until status is completed or failed. (3) On completed, GET /v1/videos/{id}/content to download MP4.

Use the gateway task id

Poll and download with the id returned by POST /v1/videos (e.g. task_Fk6QrnX6…). This is the only task id your client needs.

Poll interval & timeout

Poll every 5–15 seconds with back-off. Typical completion: 30s–5min depending on model. Stop after 15–30 minutes if still not completed.

Failed tasks are terminal

When status=failed, read error.message. Do not call /content. Submit a new POST /v1/videos to retry.

Billing on submit

Balance is debited when POST /v1/videos returns 200. Poll until completed or failed before treating the job as successful.

Status map

StatusMeaningAction
queuedJob accepted, waiting to startKeep polling GET /v1/videos/{id}
in_progressVideo is being generatedKeep polling; progress may increase
completedReady to downloadGET /v1/videos/{id}/content
failedGeneration failedRead error.message; submit a new job to retry

Errors

  • 401 — invalid or missing Bearer key
  • 402 — insufficient wallet balance (top up in Account)
  • 403 — model id not on the whitelist / wrong id spelling
  • 429 — rate limited; back off and retry
  • 502 — temporary gateway error; retry