Wan 2.7 Video
Wan 2.7 Video creates asynchronous video generation tasks. You can generate videos from a text prompt, or provide images as image-to-video input, start/end frames, or reference images.
After creating a task, the API returns a task ID immediately. Poll the task until it reaches a terminal state. When the task is completed, read the final video URL from metadata.url or download it through the content endpoint.
Endpoints
| Capability | Method | Path |
|---|---|---|
| Create video task | POST | /v1/videos |
| Retrieve video task | GET | /v1/videos/{task_id} |
| Download video content | GET | /v1/videos/{task_id}/content |
| Unified create endpoint | POST | /v1/video/generations |
| Unified retrieve endpoint | GET | /v1/video/generations/{task_id} |
/v1/videos and /v1/video/generations accept the same request fields. New integrations should prefer /v1/videos.
Requests require an API key:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonSupported Models
| Model | Description |
|---|---|
wan2.7 | Wan 2.7 video generation model |
Available models may vary by account access and platform configuration.
Supported Modes
| Mode | How to call |
|---|---|
| Text to video | Use prompt without image inputs |
| Image to video | Use image, images, or input_reference with one image |
| Start/end frames | Use images with two image URLs |
| Reference image video | Use images with multiple reference images |
| Unified video API | Use /v1/video/generations with the same fields when your client already targets that endpoint |
Request Parameters
POST /v1/videos| Parameter | Required | Description |
|---|---|---|
model | Yes | Wan model name. Use wan2.7 |
prompt | Yes | Video prompt describing the subject, motion, scene, camera language, and style |
duration | No | Video duration in seconds. You can also use the string field seconds |
seconds | No | Duration as a string, such as "5". Use either seconds or duration |
size | No | Output spec. Use a resolution such as 720p or 1080p, or an aspect ratio such as 16:9, 9:16, or 1:1 |
image | No | Single image URL, equivalent to one item in images |
images | No | Image URL array. One image is usually image-to-video input; two images can be start/end frames; multiple images can be references |
input_reference | No | Single reference image URL, equivalent to a single image input |
metadata | No | Wan-specific extension parameters passed through to the task creation flow |
Common metadata fields:
| Field | Description |
|---|---|
resolution | Output resolution, such as 720p or 1080p; pass it only when the selected model supports it |
aspect_ratio | Output aspect ratio, such as 16:9, 9:16, or 1:1 |
ratio | Aspect-ratio alias. If both aspect_ratio and ratio are provided, platform behavior depends on the channel adapter |
negative_prompt | Negative prompt |
seed | Random seed |
prompt_extend | Whether to enable prompt expansion. Actual behavior depends on the selected model |
watermark | Whether to add a watermark. Actual behavior depends on channel configuration |
payload | Custom passthrough string returned with the task result |
Image URLs must be publicly reachable. Common supported image formats include jpg, jpeg, png, and webp.
Examples
Text-to-Video
curl -X POST https://cubicspaces.cloud/v1/videos \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "wan2.7",
"prompt": "A cinematic shot of a glass cube floating above a quiet lake at sunrise, soft reflections, slow camera push in",
"duration": 5,
"size": "16:9",
"metadata": {
"resolution": "720p",
"negative_prompt": "blur, distortion, low quality",
"prompt_extend": true
}
}'Image-to-Video
curl -X POST https://cubicspaces.cloud/v1/videos \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "wan2.7",
"prompt": "Keep the product shape consistent. The camera slowly rotates around the product on a clean studio background.",
"image": "https://example.com/product.png",
"duration": 5,
"size": "1:1",
"metadata": {
"resolution": "720p",
"negative_prompt": "deformation, flicker"
}
}'Start/End Frame
When you provide two images, the system treats them as start and end frames. This is useful for transition videos.
curl -X POST https://cubicspaces.cloud/v1/videos \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "wan2.7",
"prompt": "Create a smooth transition from image 1 to image 2, keep lighting natural and motion fluid.",
"images": [
"https://example.com/start.png",
"https://example.com/end.png"
],
"duration": 5,
"size": "16:9",
"metadata": {
"resolution": "720p"
}
}'Unified Video API
If your client already uses the unified video endpoint, you can also create Wan 2.7 tasks through /v1/video/generations.
curl -X POST https://cubicspaces.cloud/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "wan2.7",
"prompt": "A futuristic cubic city at night, neon reflections, cinematic camera movement",
"seconds": "5",
"image": "https://example.com/reference.png",
"metadata": {
"aspect_ratio": "16:9",
"resolution": "720p"
}
}'Response and Retrieval
A successful create request returns a video task object:
{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video",
"model": "wan2.7",
"status": "queued",
"progress": 0,
"created_at": 1770000000
}Save id; use it to retrieve task status and download the generated video.
Retrieve the task:
curl https://cubicspaces.cloud/v1/videos/task_xxx \
-H "Authorization: Bearer YOUR_API_KEY"While the task is running, the response usually looks like:
{
"id": "task_xxx",
"object": "video",
"model": "wan2.7",
"status": "running",
"progress": 45,
"metadata": {}
}When the task is completed, the response usually looks like:
{
"id": "task_xxx",
"object": "video",
"model": "wan2.7",
"status": "succeeded",
"progress": 100,
"metadata": {
"url": "https://example.com/generated-video.mp4"
}
}Different channels may return additional fields. Clients should primarily use status to determine the task state and read the final video URL from metadata.url.
Download Video Content
curl -L https://cubicspaces.cloud/v1/videos/task_xxx/content \
-H "Authorization: Bearer YOUR_API_KEY" \
--output wan2.7-video.mp4The content endpoint returns the video file or redirects to the video URL after the task is completed. If the task is not complete, keep polling the retrieve endpoint.
Status Values
| Status | Description |
|---|---|
queued | The task has been created and is waiting to run |
running | The task is generating |
succeeded | The task is complete and the video URL is available |
failed | The task failed. Check the error information in the response |
cancelled | The task was cancelled |