openapi: 3.1.0
info:
  title: Kling v3 Motion Control
  version: '1.0'
  description: Kling 3.0 motion-control model. Uses the character from a reference image as the subject and replicates the motion from a reference video.
servers:
- url: https://openapi.imini.ai/imini/router
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Pass `Authorization: Bearer <YOUR_API_KEY>` in the request header. Go to the [API Keys management page](https://imini.ai/api-keys) to create and manage API Keys.
security:
- ApiKeyAuth: []
paths:
  /v1/videos/generate:
    post:
      summary: Kling v3 Motion Control
      operationId: generateKlingV3MotionControl
      security:
      - ApiKeyAuth: []
      description: |
        Submit an asynchronous video generation task. You will need to poll the query endpoint to retrieve the result.

        > Model ID: `kling/kling-v3-motion-control` · Underlying: Kling 3.0 Motion Control

        Provide the subject (character / background / style) via `reference_images`, and the motion source via `reference_videos`. The character in the generated video will replicate the motion from the reference video.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - model
              properties:
                model:
                  type: string
                  description: Fixed value `kling/kling-v3-motion-control`.
                prompt:
                  type: string
                  description: |
                    The prompt, which may contain both positive and negative descriptions. Up to **2500** characters.
                  example: A dancer performs graceful movements in a sunlit studio
                resolution:
                  type: string
                  description: Output resolution. Defaults to `720P`.
                  default: 720P
                  enum:
                  - 720P
                  - 1080P
                reference_images:
                  type: array
                  description: |
                    Reference image. **Only 1 image is supported.** The character, background, and other elements in the generated video are driven by this image.

                    **Content requirements**:
                    - The character proportions should match the motion in the reference video — avoid driving a half-body character with full-body motion;
                    - The character must clearly expose the full upper body or full body, including limbs and head, without occlusion;
                    - Avoid extreme orientations (e.g. inverted, lying flat); the character should occupy a reasonable portion of the frame;
                    - Both realistic and stylized characters are supported (humans / humanoid animals / some pure animals / some characters with humanoid limb proportions).

                    **Image requirements**:
                    - Formats: `jpg` / `jpeg` / `png`;
                    - Size ≤ **10 MB**;
                    - Dimensions: **300px – 65536px**;
                    - Aspect ratio between `1:2.5` and `2.5:1`.
                  maxItems: 1
                  items:
                    type: object
                    required:
                    - url
                    properties:
                      url:
                        type: string
                        description: |
                          Image address, in one of two forms:
                          **1)** A publicly accessible URL (`http://` or `https://`);
                          **2)** A Data URI base64 encoding (starting with `data:image/`).
                      reference_type:
                        type: string
                        description: |-
                          asset: reference image.
                          Omitted, null, empty or unknown strings are treated as asset.
                        default: asset
                        enum:
                        - asset
                reference_videos:
                  type: array
                  description: |
                    Reference video. **Only 1 clip is supported.** The character's motion in the generated video will match this video.

                    **Content requirements**:
                    - The character must clearly expose the full upper body or full body, including limbs and head, without occlusion;
                    - We recommend a single-person video; if multiple people appear, the character occupying the largest portion of the frame is used;
                    - Real-person motion is preferred; some stylized characters with humanoid limb proportions are also supported;
                    - The video should be a single continuous shot with the character visible throughout — avoid cuts or camera moves (otherwise the clip will be cropped);
                    - Avoid overly fast motion; steadier motion produces better results.

                    **Video requirements**:
                    - Formats: `MP4` / `MOV`;
                    - Size ≤ **100 MB**;
                    - Dimensions (both width and height must fall within): **340px – 3850px**;
                    - Duration ≥ **3s**; the upper bound depends on `extra_params.character_orientation`:
                      - `video`: **≤ 30s**;
                      - `image`: **≤ 10s**.
                    - Publicly accessible URL only; base64 is not supported.

                    > For high-difficulty or fast motion, the model may only extract a usable subset of the motion (a minimum of **3s** of continuous usable motion is required). The generated result may be shorter than the uploaded clip.
                  maxItems: 1
                  items:
                    type: object
                    required:
                    - url
                    properties:
                      url:
                        type: string
                        description: Publicly accessible video URL. base64 is not supported.
                      reference_type:
                        type: string
                        description: |-
                          asset: reference video (default).
                          The motion source is an asset, not an edit source.
                          Omitted, null, empty or unknown strings are treated as asset.
                        default: asset
                        enum:
                        - asset
                generate_audio:
                  type: boolean
                  description: Whether to generate audio. Defaults to `false`.
                  default: false
                extra_params:
                  type: object
                  description: Extension parameters.
                  required:
                  - character_orientation
                  properties:
                    character_orientation:
                      type: string
                      description: |
                        **Required.** Source for the orientation of the character in the generated video.
                        - `image` — follow the orientation from the reference image; the reference video duration must be ≤ **10s**;
                        - `video` — follow the orientation from the reference video; the reference video duration must be ≤ **30s**.

                        > When using subject references (`<<<element_x>>>`), only `video` is currently supported (orientation from the reference video).
                      enum:
                      - image
                      - video
                  additionalProperties: true
            examples:
              "Motion Control (follow video orientation)":
                summary: Motion Control (follow video orientation)
                value:
                  model: kling/kling-v3-motion-control
                  prompt: A dancer performs graceful movements in a sunlit studio
                  reference_images:
                  - url: https://example.com/character.jpg
                    reference_type: asset
                  reference_videos:
                  - url: https://example.com/motion-source.mp4
                    reference_type: asset
                  resolution: 720P
                  generate_audio: false
                  extra_params:
                    character_orientation: video
              "Motion Control (follow image orientation)":
                summary: Motion Control (follow image orientation)
                value:
                  model: kling/kling-v3-motion-control
                  prompt: A stylized character mimics the reference motion in a cinematic scene
                  reference_images:
                  - url: https://example.com/character.jpg
                    reference_type: asset
                  reference_videos:
                  - url: https://example.com/motion-source-10s.mp4
                    reference_type: asset
                  resolution: 1080P
                  extra_params:
                    character_orientation: image
      responses:
        '200':
          description: Submitted successfully (asynchronous mode)
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: Unique task ID, used for subsequent polling
                    example: task_2042864638838083584
                  model:
                    type: string
                    description: The model ID used for this task
                    example: kling/kling-v3-motion-control
                  created_at:
                    type: string
                    description: Task creation time (ISO 8601)
                    example: '2026-04-21T07:17:39.146Z'
                  request_id:
                    type: string
                    description: Unique request ID
                    example: 291a4117-9df8-4349-aee1-bdf8ffcacb9a
        '400':
          description: Validation Error (e.g. invalid parameter, invalid prompt)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: INVALID_PARAMETER
                      message:
                        type: string
                        description: Error message details
                        example: reference_videos duration must not exceed 10 seconds when character_orientation is "image"
                      status:
                        type: integer
                        description: HTTP status code
                        example: 400
                      request_id:
                        type: string
                        description: Unique request identifier
                        example: req_abc123
