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

# Query Image Info by TaskID

> Query the status and results of image generation tasks



## OpenAPI

````yaml /api-reference/image/openapi.json post /v1/images/infobytaskid
openapi: 3.0.3
info:
  title: Images Service API
  description: >-
    AI Image Generation Service API - Provides various AI model image
    generation, task query and history record functions
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://api.tensorslab.com
    description: Development environment
security: []
tags:
  - name: Image Generation
    description: Image generation related interfaces
  - name: Task Management
    description: Task management related interfaces
paths:
  /v1/images/infobytaskid:
    post:
      tags:
        - Task Management
      summary: Query Image Info by TaskID
      description: Query the status and results of image generation tasks
      operationId: infoByTaskId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - taskid
              properties:
                taskid:
                  type: string
                  description: Task ID
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageInfoResponse'
              examples:
                completed:
                  summary: Task completed
                  value:
                    code: 1000
                    msg: OK
                    data:
                      taskid: abcd_1234567890abcdef
                      starttime: '2026-01-30 12:00:00'
                      url:
                        - https://example.com/image.jpg
                      image_status: 3
                      width: 2048
                      height: 2048
                processing:
                  summary: Processing
                  value:
                    code: 1000
                    msg: OK
                    data:
                      taskid: abcd_1234567890abcdef
                      url: []
                      image_status: 2
                failed:
                  summary: Task failed
                  value:
                    code: 1000
                    msg: OK
                    data:
                      taskid: abcd_1234567890abcdef
                      url: []
                      image_status: 4
                      error_message: Generation failed
        '404':
          description: Task not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ImageInfoResponse:
      type: object
      description: Image info response
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/ImageInfoData'
          required:
            - data
    ErrorResponse:
      type: object
      description: Error response
      properties:
        code:
          type: integer
          description: 'Error code: 9999=Error, 9000=Insufficient Credits'
        msg:
          type: string
          description: Error message
      required:
        - code
        - msg
    BaseResponse:
      type: object
      description: Base response structure
      properties:
        code:
          type: integer
          description: >-
            Response status code: 1000=Success, 9999=Failure, 9000=Insufficient
            Credits
        msg:
          type: string
          description: Response message
      required:
        - code
        - msg
    ImageInfoData:
      type: object
      description: Image information data
      properties:
        taskid:
          type: string
          description: Task ID
        category:
          type: string
          description: Category
        type:
          type: integer
          description: Type
        starttime:
          type: string
          description: Start time
          format: date-time
        url:
          type: array
          description: List of generated image URLs
          items:
            type: string
            format: uri
        image_status:
          type: integer
          description: 'Task status: 1=Queued, 2=Processing, 3=Completed, 4=Failed'
          enum:
            - 1
            - 2
            - 3
            - 4
        width:
          type: integer
          description: Image width
        height:
          type: integer
          description: Image height
        images:
          type: array
          description: Source image list
          items:
            type: string
        prompt:
          type: string
          description: Prompt
        negative:
          type: string
          description: Negative prompt
        origseed:
          type: integer
          description: Random seed
        error_message:
          type: string
          description: Error message (when task fails)
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API Key authentication, please include the Authorization field in the
        request header

````