Video generation model. Produces video clips from text or images.
Key strengths
- Text + image input
- Multiple aspect ratios
- Duration control
- Motion coherence
Use cases
- Short videos
- Ads
- Social content
- Concept clips
Alibaba's alibaba/wan2.6-flash is a high-fidelity video generation model. It supports text-to-video and image-to-video workflows with configurable duration, aspect ratio, and resolution, plus first-frame and last-frame control for guided scene composition.
Generates cinematic clips with consistent motion, camera control, and optional native audio. Billed per second of generated content.
alibaba/wan2.6-flash is fully OpenAI-compatible — drop in your existing OpenAI Python or Node SDK and switch `baseURL` to `https://api.tokenlx.ai`. TokenLX transparently routes your requests to the optimal provider endpoint while preserving streaming, function-calling, and structured-output semantics.
Performance
Compare different providers across TokenLX · All locations.
Effective Pricing
Pricing is shown by the model billing method, using per-call or per-second prices and resolution tiers.
Recent activity
Total usage per day on TokenLX (last 30 days).
Sample code & API
TokenLX normalizes requests and responses across providers. Use any OpenAI SDK or our native SDK.
# ─── 图生视频(首帧驱动)───
import requests, time
headers = {"Authorization": "Bearer sk-tokenlx-...", "Content-Type": "application/json"}
resp = requests.post(
"https://api.tokenlx.ai/v1/aigc/video/tasks",
headers=headers,
json={
"model": "wan2.6-flash",
"prompt": "画面中的人物缓缓转头微笑",
"referenceImageUrls": ["https://example.com/first-frame.jpg"],
"videoInputMode": "first_frame",
"duration": 5,
"size": "1920*1080",
},
)
task = resp.json()
task_id = task.get("taskId") or task.get("task_id") or task.get("id")
# 轮询结果
while True:
result = requests.get(
f"https://api.tokenlx.ai/v1/aigc/video/tasks/{'{'}task_id{'}'}?model=wan2.6-flash",
headers=headers,
).json()
print("status:", result.get("status"))
if result.get("status") in ("completed", "succeeded", "done"):
print(result)
break
time.sleep(10)
# ─── 图生视频(参考图模式)───
ref_img_resp = requests.post(
"https://api.tokenlx.ai/v1/aigc/video/tasks",
headers=headers,
json={
"model": "wan2.6-flash",
"prompt": "基于参考图生成相关视频",
"referenceImageUrls": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg",
"https://example.com/ref3.jpg",
],
"videoInputMode": "reference",
"duration": 5,
"size": "1920*1080",
},
)
print("taskId:", ref_img_resp.json())
# 轮询方式同上
# ─── 参考视频生成示例 ───
ref_resp = requests.post(
"https://api.tokenlx.ai/v1/aigc/video/tasks",
headers=headers,
json={
"model": "wan2.6-flash",
"prompt": "保持相同的运动风格,换成海边场景",
"videoInputMode": "reference",
"referenceVideoUrls": ["https://example.com/reference.mp4"],
"duration": 5,
"size": "1280*720",
},
)
print("taskId:", ref_resp.json())Replace sk-aihubrouter-… with your key from the dashboard.
Parameter Reference
POST /v1/aigc/video/tasksGET /v1/aigc/video/tasks/{taskId}?model=wan2.6-flashResponse is raw upstream JSON passthrough — fields vary by channel.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name |
| prompt | string | Yes | Video description prompt |
| duration | int | No | Duration in seconds (≤15s) |
| size | string | No | Video size in W*H format (e.g. 1920*1080) |
| seed | int | No | Random seed — fixed value produces reproducible results |
| generateAudio | bool | No | Generate audio track |
| referenceAudioUrls | array | No | Custom audio URLs (wav/mp3, 2~30s, ≤15MB) |
| referenceImageUrls | array | Image-to-video | Reference image URLs. Formats: JPEG/JPG/PNG/BMP/WEBP; Resolution: [240,8000]px; Aspect ratio: 1:8~8:1; Size: ≤20MB (wan2.7) / ≤10MB (older models) |
| videoInputMode | string | No | Input mode. Auto-inferred if omitted: 1 image → first_frame, 2 → first_last_frame, ≥3 → reference first_framefirst_last_framereference |
| referenceVideoUrls | array | Ref-video | Reference video URLs. Formats: mp4/mov; Duration: 1~30s (r2v) / 2~10s (continuation); Resolution: [240,4096]px; Size: ≤100MB |
modelstringYespromptstringYesdurationintNosizestringNoseedintNogenerateAudioboolNoreferenceAudioUrlsarrayNoreferenceImageUrlsarrayImage-to-videovideoInputModestringNofirst_framefirst_last_framereferencereferenceVideoUrlsarrayRef-video