POST
/
kling
/
v1
/
videos
/
text2video
curl -X POST "https://api.applerouter.ai/kling/v1/videos/text2video" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-v1",
    "prompt": "An astronaut stands up and walks away",
    "duration": 5,
    "width": 1280,
    "height": 720,
    "fps": 30
  }'
{
  "task_id": "task-abc123",
  "status": "queued"
}

Overview

Generate videos from text descriptions using Kling models (kling-v1, kling-v1-5).
model
string
required
Kling Model ID (e.g. kling-v1, kling-v1-5)
prompt
string
required
Video Prompt
duration
number
Video Duration (seconds)
width
integer
Video Width (e.g. 1280)
height
integer
Video Height (e.g. 720)
fps
integer
Frame Rate (e.g. 30)
curl -X POST "https://api.applerouter.ai/kling/v1/videos/text2video" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-v1",
    "prompt": "An astronaut stands up and walks away",
    "duration": 5,
    "width": 1280,
    "height": 720,
    "fps": 30
  }'
{
  "task_id": "task-abc123",
  "status": "queued"
}

Check Status

Use GET /kling/v1/videos/text2video/{task_id} to check task status:
curl -X GET "https://api.applerouter.ai/kling/v1/videos/text2video/task-abc123" \
  -H "Authorization: Bearer sk-your-api-key"

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"