> ## 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
              - 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
                properties:
                  code:
                    type: string
                    description: Response code
                    example: success
                  message:
                    type: string
                    description: Response message
                    example: ''
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                        description: Task ID
                        example: '860260753860210752'
                      action:
                        type: string
                        description: Original action that created this task
                        example: /kling/v1/videos/omni-video_POST
                      status:
                        type: string
                        enum:
                          - SUBMITTED
                          - PROCESSING
                          - SUCCESS
                          - FAILED
                        description: Task status
                        example: SUCCESS
                      fail_reason:
                        type: string
                        description: Failure reason or result URL when successful
                      submit_time:
                        type: integer
                        description: Task submission Unix timestamp
                        example: 1773130665
                      start_time:
                        type: integer
                        description: Task start Unix timestamp
                        example: 1773130715
                      finish_time:
                        type: integer
                        description: Task completion Unix timestamp
                        example: 1773130790
                      progress:
                        type: string
                        description: Task progress percentage
                        example: 100%
                      data:
                        type: object
                        description: Kling native response data
                        properties:
                          code:
                            type: integer
                            example: 0
                          message:
                            type: string
                            example: SUCCEED
                          request_id:
                            type: string
                            example: 7e91db5f-66d3-4df4-b7e5-c2ab89df1959
                          data:
                            type: object
                            properties:
                              created_at:
                                type: integer
                                description: Creation timestamp (ms)
                              task_id:
                                type: string
                                description: Task ID
                              task_status:
                                type: string
                                enum:
                                  - submitted
                                  - processing
                                  - succeed
                                  - failed
                                description: Kling native task status
                                example: succeed
                              updated_at:
                                type: integer
                                description: Last updated timestamp (ms)
                              task_result:
                                type: object
                                description: >-
                                  Task result containing generated videos or
                                  images
                                properties:
                                  videos:
                                    type: array
                                    description: Generated video list
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                          description: Video ID
                                          example: '860260754053148756'
                                        url:
                                          type: string
                                          description: Video download URL
                                        duration:
                                          type: string
                                          description: Video duration in seconds
                                          example: '5.041'
        '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

````