外观
wan2.6-i2v-flash
wan2.6-i2v-flash 请求参数与示例。
POST /v1/async/videos/generations
发送 JSON,请求头填写 Authorization: Bearer <PIXAPI_KEY> 和 Content-Type: application/json。
请求字段
通用字段放在请求体一级,下面列出的模型专用参数放进 providerOptions。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | wan2.6-i2v-flash |
prompt | string | 是 | 描述动作、场景、镜头和对白,最多 1,500 字符。 |
seconds | integer | 是 | 2–15 秒的整数,必须明确填写。 |
resolution | string | 否 | 720p / 1080p. Pixapi 默认:1080p。 |
n | integer | 否 | 默认 1,只支持整数 1。 |
image | string / string[] | 是 | 一张公网首帧图片 URL,JPEG/PNG/WebP/BMP。 必填,数组也只能含一张图。 |
providerOptions | object | 否 | 模型专用选项,详见下表。 |
providerOptions
本表所有字段都写在 providerOptions 内,不要与 model 并列。
| 字段 | 类型 | 说明 |
|---|---|---|
seed | integer | 随机种子 0–2147483647;省略时随机。相同种子不保证输出完全一致。 |
prompt_extend | boolean | 是否优化和扩展提示词,默认 true。 |
watermark | boolean | 是否添加 AI 可见水印,默认 false。 |
negative_prompt | string | 描述不希望出现的内容,最多 500 字符。 |
audio_url | string | 同步音频的公网 WAV/MP3 URL,建议时长不少于视频,超出会截取;参考素材模式不支持。 |
shot_type | string | single(默认)或 multi;文字/首帧模式需 prompt_extend=true 才生效。 |
audio | boolean | 默认 true;false 生成无声视频,不使用提供的音频。 |
输入规则
所有素材必须是公网 HTTP(S) URL,不支持 Base64、本地路径、外部资产 ID。seconds 必须是正整数。
示例
bash
curl https://api.pixapi.ai/v1/async/videos/generations \
-H "Authorization: Bearer $PIXAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.6-i2v-flash",
"prompt": "A cinematic scene with smooth camera motion",
"seconds": 5,
"resolution": "720p",
"n": 1,
"providerOptions": {
"prompt_extend": true,
"watermark": false
},
"image": "https://example.com/first-frame.jpg"
}'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.6-i2v-flash",
"prompt": "A cinematic scene with smooth camera motion",
"seconds": 5,
"resolution": "720p",
"n": 1,
"providerOptions": {
"prompt_extend": True,
"watermark": False
},
"image": "https://example.com/first-frame.jpg"
},
)
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.6-i2v-flash",
"prompt": "A cinematic scene with smooth camera motion",
"seconds": 5,
"resolution": "720p",
"n": 1,
"providerOptions": {
"prompt_extend": true,
"watermark": false
},
"image": "https://example.com/first-frame.jpg"
}),
});
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.6-i2v-flash",
"prompt": "A cinematic scene with smooth camera motion",
"seconds": 5,
"resolution": "720p",
"n": 1,
"providerOptions": {
"prompt_extend": true,
"watermark": false
},
"image": "https://example.com/first-frame.jpg"
}`)
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))
}异步请求保存返回的 id,用 GET /v1/tasks/{id} 查询至 completed 或 failed。参阅查询结果和计费说明。
