Kling AI Video Effects API

Apply preset creative effects to images.

Documentation

Specifications

Other Resources

OpenAPI Specification

kling-ai-video-effects-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Kling AI Open Platform Account Video Effects API
  description: 'The Kling AI Open Platform is the developer API for Kuaishou''s Kling generative video and image models. Every capability follows the same asynchronous pattern: submit a task with POST (receiving a task_id), then poll the matching GET endpoint by task_id until status is succeed and the generated video or image URLs are returned. Generated asset URLs are short-lived and should be downloaded promptly. Authentication uses a JWT (HS256) signed from an Access Key / Secret Key pair, passed as a Bearer token; tokens are short-lived (about 30 minutes).


    endpointsModeled: The overall path structure, async task model, JWT auth, and model catalog are grounded in Kling''s official Open Platform documentation and cross-referenced against multiple Kling API wrappers. Kling''s official reference pages block automated fetching (HTTP 446), so exact request/response field-level schemas here are honestly modeled on the documented behavior rather than copied verbatim, and should be reconciled against the live reference before code generation.'
  version: '1.0'
  contact:
    name: Kling AI Open Platform
    url: https://app.klingai.com/global/dev
servers:
- url: https://api.klingai.com
  description: Kling AI Open Platform (global)
security:
- bearerAuth: []
tags:
- name: Video Effects
  description: Apply preset creative effects to images.
paths:
  /v1/videos/effects:
    post:
      operationId: createVideoEffectsTask
      tags:
      - Video Effects
      summary: Create a video-effects task
      description: Apply a preset creative effect to one or more input images.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoEffectsRequest'
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreatedResponse'
  /v1/videos/effects/{task_id}:
    get:
      operationId: getVideoEffectsTask
      tags:
      - Video Effects
      summary: Query a video-effects task
      parameters:
      - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          description: Task status and, when complete, the effect video URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
components:
  schemas:
    VideoTaskResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        request_id:
          type: string
        data:
          type: object
          properties:
            task_id:
              type: string
            task_status:
              type: string
              enum:
              - submitted
              - processing
              - succeed
              - failed
            task_result:
              type: object
              properties:
                videos:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      url:
                        type: string
                      duration:
                        type: string
    VideoEffectsRequest:
      type: object
      required:
      - effect_scene
      properties:
        effect_scene:
          type: string
          description: Preset effect name, e.g. hug, kiss, squish, expansion.
        model_name:
          type: string
          example: kling-v1-6
        image:
          type: string
          description: Input image URL or base64 string.
        images:
          type: array
          items:
            type: string
          description: Multiple input images for effects that require them.
        duration:
          type: string
          enum:
          - '5'
        callback_url:
          type: string
    TaskCreatedResponse:
      type: object
      properties:
        code:
          type: integer
          description: Business status code (0 indicates success).
        message:
          type: string
        request_id:
          type: string
        data:
          type: object
          properties:
            task_id:
              type: string
            task_status:
              type: string
              enum:
              - submitted
              - processing
              - succeed
              - failed
            created_at:
              type: integer
            updated_at:
              type: integer
  parameters:
    TaskId:
      name: task_id
      in: path
      required: true
      schema:
        type: string
      description: The task identifier returned by the create-task call.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'A JWT signed with HS256 from your Access Key (as the iss claim) and Secret Key, passed as Authorization: Bearer <token>. Tokens are short-lived (about 30 minutes; nbf is typically set 5 seconds in the past).'