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

# Create a Kling video task

> Create a Kling 3.0 Turbo, Kling 3.0, or Kling 3.0 Omni task through the normalized GENGEN API.



## OpenAPI

````yaml openapi/kling-video.yaml POST /contents/generations/tasks
openapi: 3.1.0
info:
  title: Kling video API
  version: 1.0.0
  description: Provider-specific GENGEN reference for Kling 3.0 video generation.
servers:
  - url: https://gengen.farm/api/gengen/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /contents/generations/tasks:
    post:
      summary: Create a Kling video task
      description: >
        Create an asynchronous Kling 3.0 Turbo, Kling 3.0, or Kling 3.0 Omni
        task through the

        shared GENGEN video endpoint. New integrations should use the normalized
        top-level

        `model`, `mode`, `prompt`, `assets`, and `controls` fields.


        Kling 3.0 Turbo supports text-to-video and first-frame image-to-video at
        720P or 1080P.

        Kling 3.0 adds an optional last frame, native audio, and 4K output.
        Kling 3.0 Omni adds

        reference images, elements, and reference or base video inputs.
      operationId: createKlingVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKlingTaskRequest'
            examples:
              turboFirstFrame:
                summary: Kling 3.0 Turbo first-frame animation
                value:
                  model: kling-3.0-turbo
                  mode: image_to_video
                  prompt: >-
                    The camera arcs around the product as soft light sweeps
                    across it.
                  assets:
                    firstFrameImage: https://example.com/product.png
                  controls:
                    resolution: 1080p
                    duration: 5
                    watermark: false
              kling30FirstLastFrame:
                summary: Kling 3.0 first and last frame with native audio
                value:
                  model: kling-3.0
                  mode: image_to_video
                  prompt: Transition naturally from sunrise to a bright afternoon.
                  assets:
                    firstFrameImage: https://example.com/sunrise.png
                    lastFrameImage: https://example.com/afternoon.png
                  controls:
                    resolution: 1080p
                    duration: 8
                    multiShot: true
                    audioMode: native
              omniReference:
                summary: Kling 3.0 Omni with image references
                value:
                  model: kling-3.0-omni
                  mode: omni_video
                  prompt: >-
                    Keep the character consistent while she crosses the neon-lit
                    street.
                  assets:
                    referenceImages:
                      - https://example.com/character-front.jpg
                      - https://example.com/character-side.jpg
                  controls:
                    resolution: 1080p
                    aspectRatio: '16:9'
                    duration: 10
                    multiShot: true
                    audioMode: native
              omniBaseVideo:
                summary: Kling 3.0 Omni base-video transformation
                value:
                  model: kling-3.0-omni
                  mode: video_to_video
                  prompt: Restyle the scene as a hand-painted science-fiction film.
                  assets:
                    baseVideo: https://example.com/source.mp4
                  controls:
                    resolution: 1080p
                    audioMode: original
      responses:
        '200':
          description: The Kling task was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTask'
              example:
                id: kling30:task_123
                model: kling-3.0
                status: pending
                outputs:
                  videos: []
                  images: []
                createdAt: '2026-08-31T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: bash
          label: Kling 3.0 text to video
          source: |
            curl --request POST \
              --url https://gengen.farm/api/gengen/v1/contents/generations/tasks \
              --header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
              --header 'Content-Type: application/json' \
              --data '{
                "model": "kling-3.0",
                "mode": "text_to_video",
                "prompt": "A cinematic dolly shot through a rain-soaked market at night.",
                "controls": {
                  "resolution": "1080p",
                  "aspectRatio": "16:9",
                  "duration": 5,
                  "multiShot": true,
                  "audioMode": "native",
                  "watermark": false
                }
              }'
components:
  schemas:
    CreateKlingTaskRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - kling-3.0-turbo
            - kling-3.0
            - kling-3.0-omni
        mode:
          type: string
          enum:
            - text_to_video
            - image_to_video
            - omni_video
            - video_to_video
          description: Turbo and Kling 3.0 accept only text_to_video or image_to_video.
        prompt:
          type: string
          maxLength: 3072
        assets:
          $ref: '#/components/schemas/KlingAssets'
        controls:
          $ref: '#/components/schemas/KlingControls'
        providerOptions:
          type: object
          properties:
            kling:
              type: object
              properties:
                externalTaskId:
                  type: string
                  description: Optional unique upstream correlation ID.
                videoInputType:
                  type: string
                  enum:
                    - feature_video
                    - base_video
              additionalProperties: false
          additionalProperties: false
      additionalProperties: false
    VideoTask:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      properties:
        id:
          type: string
        model:
          type: string
          enum:
            - kling-3.0-turbo
            - kling-3.0
            - kling-3.0-omni
        status:
          type: string
          enum:
            - pending
            - queued
            - processing
            - running
            - succeeded
            - failed
            - cancelled
        outputs:
          type: object
          required:
            - videos
            - images
          properties:
            videos:
              type: array
              items:
                type: string
                format: uri
            images:
              type: array
              items:
                type: string
                format: uri
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        statusUpdateTime:
          type: string
          format: date-time
        failureReason:
          type: string
      additionalProperties: false
    KlingAssets:
      type: object
      properties:
        firstFrameImage:
          type: string
          description: Public HTTPS image URL, data URL, or raw base64 image.
        lastFrameImage:
          type: string
          description: Optional for Kling 3.0 and Omni; requires firstFrameImage.
        referenceImages:
          type: array
          maxItems: 7
          description: >-
            Kling 3.0 Omni reference images. Combination limits can be lower
            when elements or video are included.
          items:
            type: string
        featureVideo:
          type: string
          format: uri
          description: >-
            Kling 3.0 Omni public HTTPS MP4 or MOV feature-video URL. One video
            is allowed, up to 200 MB and 3-15.5 seconds. Requires multiShot true
            and audioMode off.
        baseVideo:
          type: string
          format: uri
          description: >-
            Kling 3.0 Omni public HTTPS MP4 or MOV base-video URL. One video is
            allowed, up to 200 MB and 3-15.5 seconds. Cannot be combined with
            first or last frames.
        elements:
          type: array
          description: Advanced Kling 3.0 Omni element objects.
          items:
            type: object
            additionalProperties: true
      additionalProperties: false
    KlingControls:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720p
            - 1080p
            - 4k
          default: 720p
          description: Kling 3.0 Turbo does not support 4k.
        aspectRatio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
          default: '16:9'
          description: Used when no frame or video determines the aspect ratio.
        duration:
          type: integer
          minimum: 3
          maximum: 15
          default: 5
        multiShot:
          type: boolean
          default: true
          description: >-
            Kling 3.0 and Omni only. Base video requires false; feature video
            requires true.
        audioMode:
          type: string
          enum:
            - native
            - original
            - 'off'
          default: 'off'
          description: >-
            Kling 3.0 accepts native or off. Original is available only for Omni
            video workflows.
        generateAudio:
          type: boolean
          description: Convenience alias. true maps to native and false maps to off.
        watermark:
          type: boolean
          default: false
      additionalProperties: false
    Error:
      type: object
      required:
        - error_code
        - error
      properties:
        error_code:
          type: string
        error:
          type: string
        error_params:
          type: object
          additionalProperties: true
  responses:
    BadRequest:
      description: The normalized Kling request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The GENGEN bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: The workspace does not have enough available balance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The API key or selected resource is not authorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Kling or GENGEN rate or concurrency capacity was exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnexpectedError:
      description: GENGEN or Kling could not complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: GENGEN API key
      description: A workspace API key beginning with `gengen_live_`.

````