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

# 查询图像任务状态

> 接口说明：根据 logId 查询异步图像任务的执行状态与结果。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json get /api/ai/image/task/{logId}
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: AI 服务/模型中转
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/互动
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
paths:
  /api/ai/image/task/{logId}:
    get:
      tags:
        - AI 服务/图像生成
      summary: 查询图像任务状态
      description: 接口说明：根据 logId 查询异步图像任务的执行状态与结果。
      operationId: ImageController_getImageTaskStatus
      parameters:
        - name: logId
          in: path
          description: 任务日志ID，由异步图像生成编辑接口返回，用于任务状态或生成结果查询。
          required: true
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TaskStatusResponseVo'
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: 请求成功
                    data:
                      logId: string
                      status: generating
                      startedAt: '2026-07-02T12:00:00.000Z'
                      points: 1
                      request: {}
                      createdAt: '2026-07-02T12:00:00.000Z'
                      updatedAt: '2026-07-02T12:00:00.000Z'
                      duration: 1
                      response: {}
                      images:
                        - url: string
                          b64_json: string
                          revised_prompt: string
                      errorMessage: string
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: 参数验证失败
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: 未认证或 API Key 无效
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    TaskStatusResponseVo:
      type: object
      properties:
        logId:
          type: string
          description: 任务日志ID
        status:
          type: string
          enum:
            - generating
            - success
            - failed
          description: 任务状态
        startedAt:
          description: 开始时间
          type: string
          format: date-time
        duration:
          description: 持续时间(毫秒)
          type: number
        points:
          type: number
          description: 消耗Credits
        request:
          type: object
          additionalProperties: true
          description: 请求参数
          properties: {}
        response:
          description: 响应结果
          type: object
          additionalProperties: true
          properties: {}
        images:
          type: array
          items:
            type: object
            properties:
              url:
                description: 图片URL
                type: string
              b64_json:
                description: base64编码的图片
                type: string
              revised_prompt:
                description: 修订后的提示词
                type: string
            additionalProperties: false
          description: 生成的图片列表
        errorMessage:
          description: 错误信息
          type: string
        createdAt:
          type: string
          format: date-time
          description: 创建时间
        updatedAt:
          type: string
          format: date-time
          description: 更新时间
      required:
        - logId
        - status
        - startedAt
        - points
        - request
        - createdAt
        - updatedAt
      additionalProperties: false
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: AiToEarn Open Platform API Key。

````