Skip to content

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

CapabilityMethodPath
Create video taskPOST/v1/videos
Retrieve video taskGET/v1/videos/{task_id}
Download video contentGET/v1/videos/{task_id}/content
Unified create endpointPOST/v1/video/generations
Unified retrieve endpointGET/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:

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Supported Models

ModelDescription
wan2.7Wan 2.7 video generation model

Available models may vary by account access and platform configuration.

Supported Modes

ModeHow to call
Text to videoUse prompt without image inputs
Image to videoUse image, images, or input_reference with one image
Start/end framesUse images with two image URLs
Reference image videoUse images with multiple reference images
Unified video APIUse /v1/video/generations with the same fields when your client already targets that endpoint

Request Parameters

http
POST /v1/videos
ParameterRequiredDescription
modelYesWan model name. Use wan2.7
promptYesVideo prompt describing the subject, motion, scene, camera language, and style
durationNoVideo duration in seconds. You can also use the string field seconds
secondsNoDuration as a string, such as "5". Use either seconds or duration
sizeNoOutput spec. Use a resolution such as 720p or 1080p, or an aspect ratio such as 16:9, 9:16, or 1:1
imageNoSingle image URL, equivalent to one item in images
imagesNoImage URL array. One image is usually image-to-video input; two images can be start/end frames; multiple images can be references
input_referenceNoSingle reference image URL, equivalent to a single image input
metadataNoWan-specific extension parameters passed through to the task creation flow

Common metadata fields:

FieldDescription
resolutionOutput resolution, such as 720p or 1080p; pass it only when the selected model supports it
aspect_ratioOutput aspect ratio, such as 16:9, 9:16, or 1:1
ratioAspect-ratio alias. If both aspect_ratio and ratio are provided, platform behavior depends on the channel adapter
negative_promptNegative prompt
seedRandom seed
prompt_extendWhether to enable prompt expansion. Actual behavior depends on the selected model
watermarkWhether to add a watermark. Actual behavior depends on channel configuration
payloadCustom 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

bash
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

bash
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.

bash
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.

bash
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:

json
{
  "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:

bash
curl https://cubicspaces.cloud/v1/videos/task_xxx \
  -H "Authorization: Bearer YOUR_API_KEY"

While the task is running, the response usually looks like:

json
{
  "id": "task_xxx",
  "object": "video",
  "model": "wan2.7",
  "status": "running",
  "progress": 45,
  "metadata": {}
}

When the task is completed, the response usually looks like:

json
{
  "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

bash
curl -L https://cubicspaces.cloud/v1/videos/task_xxx/content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output wan2.7-video.mp4

The 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

StatusDescription
queuedThe task has been created and is waiting to run
runningThe task is generating
succeededThe task is complete and the video URL is available
failedThe task failed. Check the error information in the response
cancelledThe task was cancelled