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

# Query Video Task

> Query the status and result of a video generation task.

> \[!IMPORTANT]
> The video download URL (`video_url`) is valid for **3 days**. Please download or transfer it in time.

### Task Status Descriptions

| Status Value (status)              | Description                                                                                     | Progress (progress) | Remarks                                                                  |
| :--------------------------------- | :---------------------------------------------------------------------------------------------- | :------------------ | :----------------------------------------------------------------------- |
| `queued` / `pending` / `submitted` | **Queued / Submitted**. The task has been successfully submitted and is waiting for scheduling. | `0`                 | Initial state.                                                           |
| `processing`                       | **Processing**. The task has started running on the model side.                                 | `1 - 99`            | Progress updates in real-time during generation.                         |
| `completed`                        | **Completed**. The video generation is complete.                                                | `100`               | The download link is available in the `result.video_url` field.          |
| `failed`                           | **Failed**. The video generation task failed.                                                   | `0`                 | You can view the specific cause of failure in the `error_message` field. |

### State Machine Diagram

```mermaid theme={null}
graph TD
    classDef queued fill:#e0f2fe,stroke:#0284c7,stroke-width:2px;
    classDef processing fill:#fef9c3,stroke:#ca8a04,stroke-width:2px;
    classDef completed fill:#dcfce7,stroke:#15803d,stroke-width:2px;
    classDef failed fill:#fee2e2,stroke:#b91c1c,stroke-width:2px;

    Start((Task Created)) --> queued[queued / pending / submitted<br>Queued]
    queued --> processing[processing<br>Processing]
    processing --> completed[completed<br>Completed]
    processing --> failed[failed<br>Failed]

    class queued queued;
    class processing processing;
    class completed completed;
    class failed failed;
```


## OpenAPI

````yaml GET /api/open-api/v1/videos/{taskId}
openapi: 3.1.0
info:
  title: Jimmy AI OpenAPI
  description: API for Jimmy AI video generation services
  version: 1.0.0
servers:
  - url: https://www.jimmyai.cn
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/open-api/v1/videos/{taskId}:
    get:
      summary: Query Video Task
      description: Query the status and result of a video generation task.
      operationId: queryVideo
      parameters:
        - name: taskId
          in: path
          required: true
          description: The ID of the task to query
          schema:
            type: string
      responses:
        '200':
          description: Task status and result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoQueryResponse'
components:
  schemas:
    VideoQueryResponse:
      type: object
      properties:
        code:
          type: string
          example: '20000'
        msg:
          type: string
          example: ok
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            progress:
              type: integer
            model:
              type: string
            created_at:
              type: integer
              format: int64
            completed_at:
              type: integer
              format: int64
            result:
              type: object
              properties:
                video_url:
                  type: string
                  description: URL of the generated video (Valid for 3 days)
                image_url:
                  type: string
                  description: >-
                    URL of the generated image (for image tasks, Valid for 3
                    days)
            error_message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````