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

# Get Task

> Query the status and result of an asynchronous image generation task.



## OpenAPI

````yaml /en/openapi/images/task-query.yaml GET /v1/images/tasks/{task_id}
openapi: 3.1.0
info:
  title: Get Task
  version: '1.0'
  description: Query the status and result of an asynchronous image generation task.
servers:
  - url: https://openapi.imini.ai/imini/router
security:
  - ApiKeyAuth: []
paths:
  /v1/images/tasks/{task_id}:
    get:
      summary: Get Task
      description: >
        Query the status and output of the specified asynchronous image
        generation task.


        A polling interval of **2 seconds** is recommended; tasks typically
        complete within **10–30 seconds**.
      operationId: getImageTask
      parameters:
        - name: task_id
          in: path
          required: true
          description: Unique task ID, returned by the image generation endpoint.
          schema:
            type: string
            example: task_8f3a2c1b9d4e
      responses:
        '200':
          description: Query successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: Unique task ID
                    example: task_8f3a2c1b9d4e
                  status:
                    type: string
                    description: |
                      Task status:
                      - `queued` — Submitted, waiting in queue
                      - `processing` — Model is generating
                      - `succeeded` — Generation succeeded
                      - `failed` — Generation failed, see the `error` field
                    enum:
                      - queued
                      - processing
                      - succeeded
                      - failed
                    example: succeeded
                  model:
                    type: string
                    description: The model ID used for this task
                    example: google/nano-banana-2
                  created_at:
                    type: string
                    format: date-time
                    description: Task creation time (ISO 8601)
                    example: '2026-03-30T10:00:00Z'
                  completed_at:
                    type: string
                    format: date-time
                    nullable: true
                    description: >-
                      Task completion time (ISO 8601); `null` while not yet
                      completed
                    example: '2026-03-30T10:00:12Z'
                  images:
                    nullable: true
                    type: array
                    description: >-
                      Generation result list. Populated when `status` is
                      `succeeded`, otherwise `null`.
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: Platform CDN image URL
                          example: >-
                            https://file.iminicdn.com/file/2026/04/06/2041350421116751872.png
                        width:
                          type: integer
                          description: Image width (pixels)
                          example: 1920
                        height:
                          type: integer
                          description: Image height (pixels)
                          example: 1080
                  error:
                    nullable: true
                    description: >-
                      Error information. Populated when `status` is `failed`,
                      otherwise `null`.
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: PROVIDER_ERROR
                      message:
                        type: string
                        description: Error details
                        example: Upstream provider returned an error
                      status:
                        type: integer
                        description: HTTP status code
                        example: 502
                  request_id:
                    type: string
                    description: Unique request ID
                    example: req_abc123
              examples:
                Succeeded:
                  summary: Generation succeeded
                  value:
                    task_id: task_8f3a2c1b9d4e
                    status: succeeded
                    model: google/nano-banana-2
                    created_at: '2026-03-30T10:00:00Z'
                    completed_at: '2026-03-30T10:00:12Z'
                    images:
                      - url: >-
                          https://file.iminicdn.com/file/2026/04/06/2041350421116751872.png
                        width: 1920
                        height: 1080
                    error: null
                    request_id: req_abc123
                Processing:
                  summary: In progress
                  value:
                    task_id: task_8f3a2c1b9d4e
                    status: processing
                    model: google/nano-banana-2
                    created_at: '2026-03-30T10:00:00Z'
                    completed_at: null
                    images: null
                    error: null
                    request_id: req_abc123
                Failed:
                  summary: Generation failed
                  value:
                    task_id: task_8f3a2c1b9d4e
                    status: failed
                    model: google/nano-banana-2
                    created_at: '2026-03-30T10:00:00Z'
                    completed_at: '2026-03-30T10:00:05Z'
                    images: []
                    error:
                      code: PROVIDER_ERROR
                      message: Upstream provider returned an error
                      status: 502
                    request_id: req_abc123
        '401':
          description: API Key is invalid or missing
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: UNAUTHORIZED
                      message:
                        type: string
                        example: API Key is invalid or missing
                      status:
                        type: integer
                        example: 401
                      request_id:
                        type: string
                        example: req_abc123
        '404':
          description: Task ID not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: TASK_NOT_FOUND
                      message:
                        type: string
                        example: The specified task ID does not exist
                      status:
                        type: integer
                        example: 404
                      request_id:
                        type: string
                        example: req_abc123
        '500':
          description: Internal platform error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: INTERNAL_ERROR
                      message:
                        type: string
                        example: An internal error occurred
                      status:
                        type: integer
                        example: 500
                      request_id:
                        type: string
                        example: req_abc123
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >
        Pass `Authorization: Bearer <YOUR_API_KEY>` in the request header. Go to
        the [API Keys management page](https://imini.ai/api-keys) to create and
        manage API Keys.

````