跳转到主要内容
POST
/
v1
/
videos
/
generate
curl --request POST \
  --url https://openapi.imini.ai/imini/router/v1/videos/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "kling/kling-v3",
  "resolution": "720P",
  "aspect_ratio": "9:16",
  "duration": 8,
  "generate_audio": true,
  "extra_params": {
    "multi_shot": true,
    "shot_type": "customize",
    "multi_prompt": [
      {
        "index": 1,
        "prompt": "Two friends talking under a streetlight at night. Warm glow, casual poses, no dialogue.",
        "duration": "2"
      },
      {
        "index": 2,
        "prompt": "A runner sprinting through a forest, leaves flying. Low-angle shot, focus on movement.",
        "duration": "3"
      },
      {
        "index": 3,
        "prompt": "A woman hugging a cat, smiling. Soft sunlight, cozy home setting, emphasize warmth.",
        "duration": "3"
      }
    ]
  }
}
'
{
  "task_id": "task_2042864638838083584",
  "model": "kling/kling-v3",
  "created_at": "2026-04-11T07:17:39.146Z",
  "request_id": "291a4117-9df8-4349-aee1-bdf8ffcacb9a"
}

授权

Authorization
string
header
必填

在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。前往 API Keys 管理页 创建和管理 API Key。

请求体

application/json
model
string
必填

固定值 kling/kling-v3

prompt
string

提示词,不超过 2500 字符。

开启 extra_params.multi_shot 分镜模式时可为空,分镜词由 extra_params.multi_prompt 提供。

示例:

"A cinematic shot of an orange cat stretching slowly under cherry blossoms, warm sunlight"

resolution
enum<string>
默认值:720P

输出分辨率,默认 720P

可用选项:
720P,
1080P
aspect_ratio
enum<string>
默认值:16:9

输出宽高比,默认 16:9

可用选项:
16:9,
9:16,
1:1
duration
integer
默认值:5

视频时长(秒),默认 5,取值范围 3 ~ 15

必填范围: 3 <= x <= 15
generate_audio
boolean
默认值:false

是否生成声音,默认 false

reference_images
object[]

参考图列表。为空时为文生视频,否则按 reference_type 组合决定输入模式:

  • 图生视频:1 张 first_frame
  • 首尾帧生视频:1 张 first_frame + 1 张 last_frame
  • 多参考图生视频:N 张 asset
extra_params
object

支持可灵官方扩展参数,全部选填。:

  • multi_shot — 分镜模式开关
  • shot_type — 分镜类型
  • multi_prompt — 分镜提示词数组
  • negative_prompt — 负向提示词
  • cfg_scale — 提示词遵循度
  • camera_control — 运镜控制

响应

提交成功(异步模式)

task_id
string

任务唯一 ID,用于后续轮询查询

示例:

"task_2042864638838083584"

model
string

本次任务使用的模型 ID

示例:

"kling/kling-v3"

created_at
string

任务创建时间(ISO 8601)

示例:

"2026-04-11T07:17:39.146Z"

request_id
string

请求唯一 ID

示例:

"291a4117-9df8-4349-aee1-bdf8ffcacb9a"