跳转到主要内容
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.foxapi.cc/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "kling-o3-ref",
  "prompt": "参照 <<<video_1>>> 的运镜和节奏,拍摄城市雨夜街景",
  "mode": "pro",
  "video_list": [
    {
      "video_url": "https://example.com/reference.mp4",
      "refer_type": "feature",
      "keep_original_sound": "no"
    }
  ],
  "duration": 5
}
'
{
  "created": 1757165031,
  "id": "task-unified-1757165031-uyujaw3d",
  "model": "<string>",
  "object": "video.generation.task",
  "progress": 0,
  "status": "pending",
  "task_info": {
    "can_cancel": true,
    "estimated_time": 45
  },
  "type": "video"
}

授权

Authorization
string
header
必填

所有接口均需要使用Bearer Token进行认证

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

请求体

application/json
model
enum<string>
默认值:kling-o3-ref
必填

Kling O3 参考视频生成模型

说明:

  • 基于可灵 AI kling-v3-omni 模型,参考视频作为特征参考
可用选项:
kling-o3-ref
示例:

"kling-o3-ref"

prompt
string
必填

文本提示词,支持模板引用

说明:

  • 使用 <<<image_1>>> 引用 image_list 中的图片
  • 使用 <<<video_1>>> 引用 video_list 中的视频
  • 引用编号从 1 开始
示例:

"夕阳下的海边栈桥,金色光芒洒在海面上"

mode
string
默认值:standard

生成模式

可选值:

说明
standard标准质量,生成速度较快
pro高质量,生成时间较长
示例:

"standard"

image_list
object[] | null

图片列表,用于图片引导生成

说明:

  • 支持首帧 (first_frame)、尾帧 (end_frame)、参考图(type 留空)
  • prompt 中通过 <<<image_N>>> 引用
video_list
object[] | null

参考视频列表

说明:

  • 最多 1 个参考视频
  • prompt 中通过 <<<video_1>>> 引用
aspect_ratio
string
默认值:16:9

输出视频宽高比

可选值:

说明
16:9横屏(默认)
9:16竖屏
1:1方形
示例:

"16:9"

duration
integer
默认值:5

输出视频时长(秒)

说明:

  • 范围:3 - 15 秒
  • 使用 base 参考视频时,时长由参考视频决定
示例:

5

multi_prompt
object[] | null

多段提示词序列

说明:

  • 每段包含独立的提示词和时长
  • 各段时长之和应等于总 duration

响应

任务创建成功

created
integer

任务创建时间戳

示例:

1757165031

id
string

任务ID

示例:

"task-unified-1757165031-uyujaw3d"

model
string

实际使用的模型名称

object
enum<string>

任务的具体类型

可用选项:
video.generation.task
progress
integer

任务进度百分比 (0-100)

必填范围: 0 <= x <= 100
示例:

0

status
enum<string>

任务状态

可用选项:
pending,
processing,
completed,
failed
示例:

"pending"

task_info
object

异步任务信息

type
enum<string>

任务的输出类型

可用选项:
video
示例:

"video"