> ## 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.

# 任务信息查询

> 查询图片生成任务的状态和结果



## OpenAPI

````yaml /zh/api-reference/image/openapi.json post /v1/images/infobytaskid
openapi: 3.0.3
info:
  title: 图片服务 API
  description: AI图片生成服务 API - 提供多种AI模型图片生成、任务查询和历史记录功能
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://api.tensorslab.com
    description: 开发环境
security: []
tags:
  - name: 图片生成
    description: 图片生成相关接口
  - name: 任务管理
    description: 任务管理相关接口
paths:
  /v1/images/infobytaskid:
    post:
      tags:
        - 任务管理
      summary: 任务信息查询
      description: 查询图片生成任务的状态和结果
      operationId: infoByTaskId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - taskid
              properties:
                taskid:
                  type: string
                  description: 任务ID
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageInfoResponse'
              examples:
                completed:
                  summary: 任务完成
                  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: 处理中
                  value:
                    code: 1000
                    msg: OK
                    data:
                      taskid: abcd_1234567890abcdef
                      url: []
                      image_status: 2
                failed:
                  summary: 任务失败
                  value:
                    code: 1000
                    msg: OK
                    data:
                      taskid: abcd_1234567890abcdef
                      url: []
                      image_status: 4
                      error_message: Generation failed
        '404':
          description: 任务不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ImageInfoResponse:
      type: object
      description: 图片信息响应
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/ImageInfoData'
          required:
            - data
    ErrorResponse:
      type: object
      description: 错误响应
      properties:
        code:
          type: integer
          description: 错误码：9999=错误，9000=积分不足
        msg:
          type: string
          description: 错误消息
      required:
        - code
        - msg
    BaseResponse:
      type: object
      description: 基础响应结构
      properties:
        code:
          type: integer
          description: 响应状态码：1000=成功，9999=失败，9000=积分不足
        msg:
          type: string
          description: 响应消息
      required:
        - code
        - msg
    ImageInfoData:
      type: object
      description: 图片信息数据
      properties:
        taskid:
          type: string
          description: 任务ID
        category:
          type: string
          description: 分类
        type:
          type: integer
          description: 类型
        starttime:
          type: string
          description: 开始时间
          format: date-time
        url:
          type: array
          description: 生成的图片URL列表
          items:
            type: string
            format: uri
        image_status:
          type: integer
          description: 任务状态：1=排队中，2=处理中，3=完成，4=失败
          enum:
            - 1
            - 2
            - 3
            - 4
        width:
          type: integer
          description: 图片宽度
        height:
          type: integer
          description: 图片高度
        images:
          type: array
          description: 源图片列表
          items:
            type: string
        prompt:
          type: string
          description: 提示词
        negative:
          type: string
          description: 负向提示词
        origseed:
          type: integer
          description: 随机种子
        error_message:
          type: string
          description: 错误消息（任务失败时）
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API密钥认证，请在请求头中包含Authorization字段

````