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

# Query video task

> Poll the status and result of a video generation task created via `POST /v1/video-generation`.

Call this endpoint periodically with the `task_id` returned from task creation. When `status` is `Success`, `file_url` contains the generated video URL.

**Note:** this endpoint's envelope uses `message`, not `msg` as the create task endpoint does. Plan both field names when parsing.

### Recommended polling schedule

Video generation averages 2+ minutes. Use this schedule to balance responsiveness and request cost:

| Phase        | Elapsed       | Interval         |
| ---          | ---           | ---              |
| Initial wait | 0 – 30s       | — (no requests)  |
| Medium       | 30s – 2 min   | every 5s         |
| Dense        | 2 – 4 min     | every 3s (peak)  |
| Slow         | 4 – 8 min     | every 8s         |
| Idle         | 8 – 15 min    | every 15s        |
| Timeout      | > 15 min      | stop, report error |

Stop polling when `status` is `Success`, `Failed`, or `Cancelled`.




## OpenAPI

````yaml /openapi/video/_query.yaml get /query/video-generation
openapi: 3.0.3
info:
  title: Query video generation task
  version: 1.0.0
  description: Poll the status and result of a video generation task.
servers:
  - url: https://api.linkmodel.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: video
paths:
  /query/video-generation:
    get:
      tags:
        - video
      summary: Query video task
      description: >
        Poll the status and result of a video generation task created via `POST
        /v1/video-generation`.


        Call this endpoint periodically with the `task_id` returned from task
        creation. When `status` is `Success`, `file_url` contains the generated
        video URL.


        **Note:** this endpoint's envelope uses `message`, not `msg` as the
        create task endpoint does. Plan both field names when parsing.


        ### Recommended polling schedule


        Video generation averages 2+ minutes. Use this schedule to balance
        responsiveness and request cost:


        | Phase        | Elapsed       | Interval         |

        | ---          | ---           | ---              |

        | Initial wait | 0 – 30s       | — (no requests)  |

        | Medium       | 30s – 2 min   | every 5s         |

        | Dense        | 2 – 4 min     | every 3s (peak)  |

        | Slow         | 4 – 8 min     | every 8s         |

        | Idle         | 8 – 15 min    | every 15s        |

        | Timeout      | > 15 min      | stop, report error |


        Stop polling when `status` is `Success`, `Failed`, or `Cancelled`.
      operationId: query-video-generation
      parameters:
        - name: task_id
          in: query
          required: true
          description: Task id returned from `POST /v1/video-generation`.
          schema:
            type: string
            example: aurora_abc123
      responses:
        '200':
          description: Query result with current task status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                        example: aurora_abc123
                      prompt:
                        type: string
                        example: A futuristic city at sunset
                      file_url:
                        type: string
                        format: uri
                        description: >-
                          Generated video URL. Populated once `status` is
                          `Success`.
                        example: https://cdn.xxx.com/out.mp4
                      first_frame_image:
                        type: string
                        description: Echoed from the original request (if it was provided).
                      last_frame_image:
                        type: string
                        description: Echoed from the original request (if it was provided).
                      model:
                        type: string
                        example: sora-2
                      duration:
                        type: integer
                        example: 10
                      metadata:
                        type: string
                        description: Reserved field. Usually empty.
                      msg:
                        type: string
                        description: Task-level detail or error message.
                      status:
                        type: string
                        description: >-
                          Current task state. Poll until terminal (`Success` or
                          `Failed`).
                        enum:
                          - Pending
                          - Processing
                          - Success
                          - Failed
                          - Cancelled
                        example: Success
                  message:
                    type: string
                    description: >-
                      Envelope-level status. This endpoint uses `message`
                      (create task uses `msg`).
                    example: success
                  request_id:
                    type: string
                    format: uuid
        '400':
          description: Bad request — `task_id` missing or malformed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: task_id is required
                  request_id:
                    type: string
        '401':
          description: Unauthorized — missing or invalid API key.
        '404':
          description: Task not found.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````