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

# kling-task-query

> Query the status and result of a Kling generation task. Use the task_id returned from the create task endpoint.



## OpenAPI

````yaml api-reference/model-api/kuaishou/openapi/kling-task-query/openapi.yaml GET /kling/v1/videos/{action}/{task_id}
openapi: 3.1.0
info:
  title: Kling Task Query
  description: >-
    Query the status and result of a Kling video/image generation task via
    AnyFast API
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/{action}/{task_id}:
    get:
      summary: Query Task
      description: >-
        Query the status and result of a Kling generation task. Use the task_id
        returned from the create task endpoint.
      operationId: queryKlingTask
      parameters:
        - name: action
          in: path
          required: true
          description: Task type matching the original creation endpoint.
          schema:
            type: string
            enum:
              - generations
              - text2video
              - image2video
              - omni-video
              - motion-control
              - lip-sync
              - kolors-virtual-try-on
            example: text2video
        - name: task_id
          in: path
          required: true
          description: Task ID returned from the create task endpoint.
          schema:
            type: string
            example: '860260753860210752'
      responses:
        '200':
          description: Task status retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: Response code. `0` indicates success.
                    example: 0
                  message:
                    type: string
                    description: Response message
                    example: ''
                  data:
                    type: object
                    required:
                      - task_id
                      - task_status
                      - created_at
                      - updated_at
                    properties:
                      task_id:
                        type: string
                        description: Task ID
                        example: asyntask_xv4xhxSNstoRRVnHsF1z0PlEBvCg20ok
                      task_status:
                        type: string
                        enum:
                          - submitted
                          - processing
                          - succeed
                          - failed
                        description: Task status
                        example: succeed
                      task_result:
                        type: object
                        description: Present when the task has generated output.
                        properties:
                          videos:
                            type: array
                            description: Generated video list.
                            items:
                              type: object
                              required:
                                - url
                                - duration
                              properties:
                                url:
                                  type: string
                                  description: Temporary video download URL.
                                  example: https://example.com/result.mp4
                                duration:
                                  type: string
                                  description: Actual video duration in seconds.
                                  example: '5'
                      created_at:
                        type: integer
                        description: Creation timestamp in milliseconds.
                        example: 1784720890000
                      updated_at:
                        type: integer
                        description: Last update timestamp in milliseconds.
                        example: 1784720949000
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````