> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireiter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 3.0 Motion Control 视频生成

> - 异步处理模式，返回任务ID用于后续查询
- 使用一张主体参考图和一个动作参考视频生成可控视频
- 支持 720p / 1080p，可设置人物朝向来源和背景来源，按参考视频真实时长计费


export const apiKeyUrl = 'https://aireiter.com/keys';

## Authorizations

<ParamField header="Authorization" type="string" required>
  所有接口均需要使用 Bearer Token 进行认证

  获取 API Key：

  访问 <a href={apiKeyUrl} target="_blank">API Key 管理页面</a> 获取您的 API Key

  使用时在请求头中添加：

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required>
  模型名称：

  * `"kling_3_0_motion_control"` - 默认
</ParamField>

<ParamField body="params" type="object" required>
  模型参数对象

  <Expandable title="params 对象属性">
    <ParamField body="prompt" type="string">
      期望输出效果的文本描述

      * 可选
      * 最大长度：2500 字符
      * 示例：`No distortion, the character's movements are consistent with the video.`
    </ParamField>

    <ParamField body="image_url" type="string" required>
      主体参考图像 URL

      * 必填
      * 仅支持单张图片
      * 支持格式：JPG、JPEG、PNG
      * 最大文件大小：10MB
      * 图片尺寸需大于 300px
      * 宽高比需在 2:5 到 5:2 之间
      * 生成视频中的角色、背景和其他元素会基于这张参考图
    </ParamField>

    <ParamField body="video_url" type="string" required>
      动作参考视频 URL

      * 必填
      * 仅支持单个视频
      * 支持格式：MP4、MOV / QuickTime
      * 最大文件大小：100MB
      * 视频尺寸需大于 300px
      * 宽高比需在 2:5 到 5:2 之间
      * 时长：`character_orientation=image` 时最长 10 秒，`character_orientation=video` 时最长 30 秒
      * 预估积分和实际扣费会按该视频的真实时长计算，无需传入 `video_length`
      * 生成视频中的角色动作会与该参考视频保持一致
    </ParamField>

    <ParamField body="resolution" type="string" default="720p">
      输出分辨率模式

      * `720p` - 标准模式（默认）
      * `1080p` - 高清模式
    </ParamField>

    <ParamField body="character_orientation" type="string" default="video">
      人物朝向参考来源

      * `video` - 与参考视频中的人物朝向保持一致，视频最长 30 秒（默认）
      * `image` - 与参考图片中的人物朝向保持一致，视频最长 10 秒
    </ParamField>

    <ParamField body="background_source" type="string" default="input_video">
      背景参考来源

      * `input_video` - 使用动作视频背景（默认）
      * `input_image` - 使用主体图片背景
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="out_task_id" type="string" required>
  发起方任务ID

  用户自定义的任务标识，必填
</ParamField>

## Response

<ResponseField name="out_task_id" type="string">
  发起方任务ID，可用于查询结果
</ResponseField>

<ResponseField name="status" type="string">
  初始状态，固定为 `"pending"`
</ResponseField>

<ResponseField name="estimated_credits" type="number">
  预估消耗积分
</ResponseField>

<ResponseField name="created_at" type="string">
  创建时间（ISO 格式）
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://aireiter.com/api/openapi/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "kling_3_0_motion_control",
      "params": {
        "prompt": "让角色跟随参考视频自然跳舞，保持主体身份一致",
        "image_url": "https://example.com/subject.png",
        "video_url": "https://example.com/motion.mp4",
        "resolution": "720p",
        "character_orientation": "video",
        "background_source": "input_video"
      },
      "out_task_id": "my_task_123456"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://aireiter.com/api/openapi/submit"

  payload = {
      "model": "kling_3_0_motion_control",
      "params": {
          "prompt": "让角色跟随参考视频自然跳舞，保持主体身份一致",
          "image_url": "https://example.com/subject.png",
          "video_url": "https://example.com/motion.mp4",
          "resolution": "720p",
          "character_orientation": "video",
          "background_source": "input_video"
      },
      "out_task_id": "my_task_123456"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://aireiter.com/api/openapi/submit";

  const payload = {
    model: "kling_3_0_motion_control",
    params: {
      prompt: "让角色跟随参考视频自然跳舞，保持主体身份一致",
      image_url: "https://example.com/subject.png",
      video_url: "https://example.com/motion.mp4",
      resolution: "720p",
      character_orientation: "video",
      background_source: "input_video"
    },
    out_task_id: "my_task_123456"
  };

  fetch(url, {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data));
  ```
</RequestExample>
