Skip to content

wan2.7-videoedit ​

Request parameters and examples for wan2.7-videoedit.

POST /v1/async/videos/generations

Send JSON with Authorization: Bearer <PIXAPI_KEY> and Content-Type: application/json.

Request fields ​

Send the common fields at the top level. Put the model-specific controls listed below inside providerOptions.

FieldTypeRequiredDescription
modelstringYeswan2.7-videoedit
promptstringNoDescribe motion, scene, camera, and dialogue; at most 5,000 characters. Optional editing instruction; can be omitted.
secondsintegerYesInteger 2–10 seconds; explicitly required. Trim from the beginning; cannot exceed source duration.
resolutionstringNo720p / 1080p. Pixapi default: 1080p.
nintegerNoDefault 1; only integer 1 is supported.
imagestring / string[]NoNot supported. Put editing references inside providerOptions.media.
providerOptionsobjectNoModel-specific options; see the table below.

providerOptions ​

All fields in this table are nested inside providerOptions, not alongside model.

FieldTypeDescription
aspect_ratiostring16:9, 9:16, 1:1, 4:3, 3:4. Default 16:9; image-to-video follows the input image ratio.
seedintegerRandom seed, 0–2147483647; omitted means random. The same seed does not guarantee identical output.
prompt_extendbooleanRewrite and expand the prompt for generation; default true.
watermarkbooleanAdd a visible AI watermark. Default false.
negative_promptstringContent to exclude; at most 500 characters.
mediaobject[]Required. Each item contains type and public url; see the media rules below.
audio_settingstringauto (default): choose audio behavior from the edit; origin: retain source audio.

Input rules ​

All media must be publicly accessible HTTP(S) URLs. No Base64, local paths, or external asset IDs. seconds must be a positive number.

media.type: exactly one video, plus up to 4 reference_image items. Source video: MP4/MOV, 2–10s, 240–4096px, ≤100 MB. Without aspect_ratio, the source ratio is retained.

Reference images: JPEG/PNG (no alpha)/BMP/WebP, each edge 240–8000px, ratio 1:8–8:1, ≤20 MB. Address references in the prompt as Image 1, Video 1, etc., numbered separately by media type.

Example ​

bash
curl https://api.pixapi.ai/v1/async/videos/generations \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "wan2.7-videoedit",
  "prompt": "A cinematic scene with smooth camera motion",
  "seconds": 5,
  "resolution": "720p",
  "n": 1,
  "providerOptions": {
    "prompt_extend": true,
    "watermark": false,
    "media": [
      {
        "type": "video",
        "url": "https://example.com/source.mp4"
      }
    ]
  }
}'
py
import os
import requests

response = requests.post(
    "https://api.pixapi.ai/v1/async/videos/generations",
    headers={"Authorization": f"Bearer {os.environ['PIXAPI_KEY']}"},
    json={
  "model": "wan2.7-videoedit",
  "prompt": "A cinematic scene with smooth camera motion",
  "seconds": 5,
  "resolution": "720p",
  "n": 1,
  "providerOptions": {
    "prompt_extend": True,
    "watermark": False,
    "media": [
      {
        "type": "video",
        "url": "https://example.com/source.mp4"
      }
    ]
  }
},
)
response.raise_for_status()
print(response.json())
js
const response = await fetch('https://api.pixapi.ai/v1/async/videos/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PIXAPI_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "model": "wan2.7-videoedit",
  "prompt": "A cinematic scene with smooth camera motion",
  "seconds": 5,
  "resolution": "720p",
  "n": 1,
  "providerOptions": {
    "prompt_extend": true,
    "watermark": false,
    "media": [
      {
        "type": "video",
        "url": "https://example.com/source.mp4"
      }
    ]
  }
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
go
package main

import (
  "bytes"
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  body := []byte(`{
  "model": "wan2.7-videoedit",
  "prompt": "A cinematic scene with smooth camera motion",
  "seconds": 5,
  "resolution": "720p",
  "n": 1,
  "providerOptions": {
    "prompt_extend": true,
    "watermark": false,
    "media": [
      {
        "type": "video",
        "url": "https://example.com/source.mp4"
      }
    ]
  }
}`)
  req, err := http.NewRequest("POST", "https://api.pixapi.ai/v1/async/videos/generations", bytes.NewBuffer(body))
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer " + os.Getenv("PIXAPI_KEY"))
  req.Header.Set("Content-Type", "application/json")
  resp, err := http.DefaultClient.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()
  result, err := io.ReadAll(resp.Body)
  if err != nil { panic(err) }
  if resp.StatusCode >= 400 { panic(string(result)) }
  fmt.Println(string(result))
}

For asynchronous requests, save the returned id and poll GET /v1/tasks/{id} until completed or failed. See task results and billing.