跳转到主要内容
POST
/
v1
/
videos
/
generations
Kling V3 Text-to-Video
curl --request POST \
  --url https://api.foxapi.cc/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "kling-v3-text-to-video",
  "prompt": "一座古老的日式庭院,雨滴缓缓落入石灯笼旁的池塘,泛起层层涟漪。镜头缓慢推进,电影质感,浅景深",
  "resolution": "1080p",
  "generate_audio": true,
  "negative_prompt": "模糊, 低质量, 水印",
  "aspect_ratio": "16:9",
  "duration": 10
}
'
{
  "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"
}

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

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

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

请求体

application/json
model
string
默认值:kling-v3-text-to-video
必填

kling-v3-text-to-video:纯文本驱动视频生成,支持 720p/1080p

示例:

"kling-v3-text-to-video"

prompt
string
必填

文本提示词,描述想要生成的视频内容

说明:

  • 最长 2500 字符
  • 支持中英文
Maximum string length: 2500
示例:

"一座古老的日式庭院,雨滴缓缓落入池塘,泛起层层涟漪"

resolution
string
默认值:720p

输出分辨率

可选值:

  • 720p — 720P 标清
  • 1080p — 1080P 高清
  • 4k — 原生 4K 超清(独立档位,计费不受 generate_audio / voice_ids 影响)
示例:

"720p"

generate_audio
boolean
默认值:false

是否生成配套音频

说明:

  • 启用后视频将包含 AI 生成的音效/配乐
  • 默认关闭
示例:

false

negative_prompt
string
默认值:""

负面提示词,描述不希望出现的元素

说明:

  • 用逗号分隔多个关键词
  • 常用:模糊, 低质量, 水印, 文字叠加

非必须不要传这个参数。

示例:

"模糊, 低质量, 水印, 文字叠加"

aspect_ratio
string
默认值:16:9

输出视频宽高比

可选值:

  • 16:9 — 横屏(默认)
  • 9:16 — 竖屏
  • 1:1 — 方形
示例:

"16:9"

duration
integer
默认值:5

输出视频时长(秒)

可选值:

  • 5 — 5 秒短视频(默认)
  • 10 — 10 秒视频
示例:

5

voice_ids
string[] | null

声音 ID 列表,用于 voice control

说明:

  • 最多 2 个声音
  • prompt 中使用 <<<voice_1>>> / <<<voice_2>>> 引用
  • 通过 kling-video-create-voice 端点获取 voice_id
  • 使用时 generate_audio 必须为 true

非必须不要传这个参数。

示例:
["voice_123456"]
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"