Skip to main content
POST
/
kling
/
v1
/
videos
/
text2video
Kling 文生视频
curl --request POST \
  --url https://api.tkhub.ai/v1/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "kling-v1",
  "prompt": "宇航员站起身走了",
  "duration": 5,
  "width": 1280,
  "height": 720,
  "fps": 30
}
'
{
  "task_id": "abcd1234efgh",
  "status": "queued"
}

Authorizations

Authorization
string
header
required

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

Body

application/json

视频生成请求

model
string

模型/风格 ID

Example:

"kling-v1"

prompt
string

文本描述提示词

Example:

"宇航员站起身走了"

image
string

图片输入 (URL 或 Base64)

Example:

"https://example.com/image.jpg"

duration
number

视频时长(秒)

Example:

5

width
integer

视频宽度

Example:

1280

height
integer

视频高度

Example:

720

fps
integer

视频帧率

Example:

30

seed
integer

随机种子

Example:

20231234

n
integer

生成视频数量

Example:

1

response_format
string

响应格式

Example:

"url"

user
string

用户标识

Example:

"user-1234"

metadata
object

扩展参数 (如 negative_prompt, style, quality_level 等)

Response

成功创建视频生成任务

视频生成任务提交响应

task_id
string

任务 ID

Example:

"abcd1234efgh"

status
string

任务状态

Example:

"queued"