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

# Truy xuất video MiniMax H3

> Truy xuất tác vụ video MiniMax H3 theo ID tác vụ, bao gồm trạng thái, tiến độ, dấu thời gian, URL kết quả hoặc thông tin chi tiết về lỗi.

Sử dụng endpoint này sau khi tạo tác vụ video MiniMax H3. Phản hồi bao gồm `video_url` khi tác vụ hoàn tất.

## Kiểm tra các trường này

* `status` có thể là `queued`, `in_progress`, `completed` hoặc `failed`.
* `progress` là tỷ lệ phần trăm hoàn thành ước tính từ `0` đến `100`.
* `video_url` xuất hiện khi tác vụ hoàn tất.
* `error` xuất hiện khi tác vụ thất bại.

## Thăm dò tác vụ

<Steps>
  <Step title="Trước tiên, hãy tạo tác vụ">
    Bắt đầu bằng [Tạo video MiniMax H3](./create) và lưu `id` được trả về.
  </Step>

  <Step title="Truy xuất trạng thái tác vụ">
    Gửi ID tác vụ đến endpoint này cho đến khi `status` là `completed` hoặc `failed`.
  </Step>

  <Step title="Tải xuống tệp MP4">
    Khi `status` là `completed`, hãy gọi [Tải xuống nội dung video MiniMax H3](./retrieve-content).
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/minimax-h3/get-retrieve.openapi.json GET /v1/videos/{task_id}
openapi: 3.1.0
info:
  title: MiniMax H3 Video Retrieve API
  version: 1.0.0
  description: >-
    Retrieve a MiniMax H3 video task by task ID. Poll this endpoint until the
    status is completed or failed.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /v1/videos/{task_id}:
    get:
      summary: Retrieve a MiniMax H3 video task
      description: >-
        Read the state of a MiniMax H3 video task that was created through POST
        /v1/videos.
      operationId: minimax_h3_retrieve_video
      parameters:
        - name: task_id
          in: path
          required: true
          description: Task ID returned by POST /v1/videos.
          schema:
            type: string
          example: <task_id>
      responses:
        '200':
          description: Current MiniMax H3 video task state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiniMaxH3VideoTask'
              examples:
                queued:
                  summary: Task queued
                  value:
                    id: <task_id>
                    task_id: <task_id>
                    object: video
                    model: minimax-h3
                    status: queued
                    progress: 0
                    created_at: 1779938152
                in_progress:
                  summary: Task in progress
                  value:
                    id: <task_id>
                    object: video
                    model: minimax-h3
                    status: in_progress
                    progress: 30
                    created_at: 1779938152
                completed:
                  summary: Task completed
                  value:
                    id: <task_id>
                    object: video
                    model: minimax-h3
                    status: completed
                    progress: 100
                    created_at: 1779938152
                    completed_at: 1779938219
                    expires_at: 1780543019
                    video_url: https://<provider-cdn>/<video_id>.mp4
                failed:
                  summary: Task failed
                  value:
                    id: <task_id>
                    object: video
                    model: minimax-h3
                    status: failed
                    progress: 100
                    created_at: 1779938152
                    completed_at: 1779938219
                    error:
                      message: The video task could not be completed.
                      code: generation_failed
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: Retrieve task status
          source: |-
            curl "https://api.cometapi.com/v1/videos/<task_id>" \
              -H "Authorization: Bearer $COMETAPI_KEY"
        - lang: Python
          label: Retrieve task status
          source: |
            import os

            import requests

            task_id = "<task_id>"
            response = requests.get(
                f"https://api.cometapi.com/v1/videos/{task_id}",
                headers={
                    "Authorization": "Bearer " + os.environ["COMETAPI_KEY"]
                },
                timeout=60,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Retrieve task status
          source: |
            const taskId = "<task_id>";
            const response = await fetch(
              `https://api.cometapi.com/v1/videos/${taskId}`,
              { headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` } },
            );

            if (!response.ok) {
              throw new Error(await response.text());
            }

            console.log(await response.json());
components:
  schemas:
    MiniMaxH3VideoTask:
      type: object
      required:
        - id
        - object
        - model
        - status
        - progress
        - created_at
      properties:
        id:
          type: string
          description: Task ID. Use this value as task_id in retrieve and content requests.
          example: <task_id>
        task_id:
          type: string
          description: >-
            Compatibility alias for id. This field can be omitted from retrieve
            responses.
          example: <task_id>
        object:
          type: string
          const: video
          description: Object type for the asynchronous video task.
        model:
          type: string
          description: Model ID that the task uses.
          enum:
            - minimax-h3
            - minimax-h3-max
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
          description: Task lifecycle status. Poll until the value is completed or failed.
        progress:
          type: integer
          minimum: 0
          maximum: 100
          description: Task progress as a coarse percentage.
        created_at:
          type: integer
          format: int64
          description: Task creation time as a Unix timestamp in seconds.
        completed_at:
          type: integer
          format: int64
          description: >-
            Unix timestamp returned by the platform. Use status, not this field,
            to decide when polling can stop.
        expires_at:
          type: integer
          format: int64
          description: >-
            Result expiration time as a Unix timestamp in seconds when the task
            provides one.
        video_url:
          type: string
          format: uri
          description: Video delivery URL. This field appears on completed tasks.
          example: https://<provider-cdn>/<video_id>.mp4
        error:
          type: object
          description: Failure details. This field appears when the task fails.
          properties:
            message:
              type: string
              description: Human-readable failure description.
            code:
              type: string
              description: Failure code when the task provides one.
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication. Use your CometAPI API key.

````