图生视频
接口:POST /kling/v1/videos/image2video 归属:快手可灵(官方格式) 调用地址:Base URL https://api.allyang.cn(OpenAI 兼容前缀 https://api.allyang.cn/v1)+ 上述路径 鉴权:请求头 Authorization: Bearer <你的令牌>;令牌在控制台「令牌管理」创建 说明:下方为本接口契约。路径、字段名与枚举取值与线上接口一致;叙述文字已按本平台口径重写。价格、并发与限流等数值以控制台及实际返回为准,未确认处标注「待补」。
OpenAPI Specification
yaml
openapi: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/kling/v1/videos/image2video:
post:
summary: 图生视频
description: "上游文档链接已按合规要求移除;接口契约以本平台线上实测为准。"
tags:
- 快手可灵(官方格式)
parameters:
- name: Authorization
in: header
description: ''
required: false
example: Bearer {{YOUR_API_KEY}}
schema:
type: string
default: Bearer {{YOUR_API_KEY}}
requestBody:
content:
application/json:
schema:
type: object
properties:
image:
type: string
description: "参考图像,必填。支持 Base64 或图片 URL,格式 .jpg / .jpeg / .png,体积不超过 10MB,分辨率不低于 300*300px。"
image_tail:
type: string
description: "参考图像(尾帧控制),可选。支持 Base64 或图片 URL,格式 .jpg / .jpeg / .png,体积不超过 10MB,分辨率不低于 300*300px。"
prompt:
type: string
description: "正向文本提示,可选,不超过 500 字符。"
maxLength: 5000
negative_prompt:
type: string
description: "可选。负向提示词,上限 200 字符。"
maxLength: 2000
cfg_scale:
type: number
description: "可选。与提示词的贴合程度,区间 [0, 1],数值越大越贴近。"
minimum: 0
maximum: 1
mode:
type: string
description: "可选。生成模式二选一:std(高性能)、pro(高表现)。"
enum:
- std(高性能)
- pro(高表现)
duration:
type: string
description: "可选。成片时长(秒),取 5 或 10;带尾帧的请求只能用 5 秒。"
enum:
- '5'
- '10'
callback_url:
type: string
description: "可选。任务完成后向该地址推送结果。"
model_name:
type: string
description: "可选模型:kling-v1、kling-v1-5、kling-v1-6。"
required:
- image
examples: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
description: "错误码,含义见错误码对照表。"
message:
type: string
description: "错误信息。"
request_id:
type: string
description: "系统为每次调用分配的请求编号,便于追踪链路与定位故障。"
data:
type: object
properties:
task_id:
type: string
description: "任务 ID,由系统分配。"
task_status:
type: string
description: "任务所处阶段;取值 submitted(已提交)、processing(处理中)、succeed(成功)、failed(失败)。"
enum:
- submitted(已提交)
- processing(处理中)
- succeed(成功)
- failed(失败)
created_at:
type: integer
description: "任务落库时刻,Unix 时间戳,单位毫秒。"
updated_at:
type: integer
description: "任务最近更新时刻,Unix 时间戳,单位毫秒。"
required:
- task_id
- task_status
- created_at
- updated_at
required:
- code
- message
- request_id
- data
example:
code: 0
message: string
request_id: string
data:
task_id: string
task_status: string
created_at: 0
updated_at: 0
headers: {}
security: []
components:
schemas: {}
securitySchemes: {}
servers: []
security: []