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

# 查询图片生成任务状态

> 查询图片异步任务状态和结果。查询接口只读取平台任务状态。



## OpenAPI

````yaml /openapi/gateway-v1.openapi.yaml get /v2/images/generations/{id}
openapi: 3.1.0
info:
  title: WengaoCloud AI Gateway API
  version: 0.1.0
  description: WengaoCloud AI 聚合平台公开 API 契约草案，覆盖 OpenAI 兼容接口、Anthropic 原生接口和平台扩展接口。
servers:
  - url: https://xxx.wengaocloud.com
    description: 问高云 API 网关根域名。OpenAI SDK 的 base_url 使用 https://xxx.wengaocloud.com/v1。
  - url: https://{tenant}.wengaocloud.com
    description: 控制台展示的租户或 OEM API 网关根域名。
    variables:
      tenant:
        default: xxx
security:
  - bearerAuth: []
tags:
  - name: models
    x-group: 模型
  - name: openai-compatible
    x-group: OpenAI 兼容接口
  - name: anthropic-native
    x-group: Anthropic 原生接口
  - name: images-v3
    x-group: 图片（V3 同步）
  - name: volcengine-images
    x-group: 图片（火山直连）
  - name: images
    x-group: 图片（V1 兼容）
  - name: async-images
    x-group: 图片异步任务
  - name: aliwan-images
    x-group: 图片（百炼万相）
  - name: videos
    x-group: 视频
paths:
  /v2/images/generations/{id}:
    get:
      tags:
        - async-images
      summary: 查询图片生成任务状态
      description: 查询图片异步任务状态和结果。查询接口只读取平台任务状态。
      operationId: getAsyncImageGenerationTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 创建接口返回的图片任务 ID，通常以 `imgtask_` 开头。
      responses:
        '200':
          description: 图片任务状态。任务成功后返回问高云图片 URL。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationAsyncTaskResponse'
              examples:
                running:
                  value:
                    id: imgtask_5a16c0f5d2b64b40a86f7f5b21f42a61
                    object: image.generation.task
                    model: gpt-image-2-async
                    status: running
                    created_at: 1779860000
                    completed_at: null
                succeeded:
                  value:
                    id: imgtask_5a16c0f5d2b64b40a86f7f5b21f42a61
                    object: image.generation.task
                    model: gpt-image-2-async
                    status: succeeded
                    created_at: 1779860000
                    completed_at: 1779860060
                    result:
                      images:
                        - url: https://cdn.wengaocloud.com/images/ai/example.png
                failed:
                  value:
                    id: imgtask_5a16c0f5d2b64b40a86f7f5b21f42a61
                    object: image.generation.task
                    model: gpt-image-2-async
                    status: failed
                    created_at: 1779860000
                    completed_at: 1779860030
                    error:
                      code: image_generation_failed
                      message: 图片生成失败
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ImageGenerationAsyncTaskResponse:
      type: object
      required:
        - id
        - object
        - model
        - status
        - created_at
        - completed_at
      properties:
        id:
          type: string
          example: imgtask_5a16c0f5d2b64b40a86f7f5b21f42a61
        object:
          type: string
          enum:
            - image.generation.task
        model:
          type: string
          example: gpt-image-2-async
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
            - expired
        created_at:
          type: integer
          description: Unix 时间戳，秒。
        completed_at:
          oneOf:
            - type: integer
              description: Unix 时间戳，秒。
            - type: 'null'
        result:
          type: object
          properties:
            images:
              type: array
              items:
                $ref: '#/components/schemas/ImageGenerationAsyncResultImage'
        error:
          type: object
          properties:
            code:
              type: string
              example: image_generation_failed
            message:
              type: string
              example: 图片生成失败
      additionalProperties: true
    ImageGenerationAsyncResultImage:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: 问高云侧结果图 URL。
          example: https://cdn.wengaocloud.com/images/ai/example.png
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              example: model_endpoint_mismatch
            message:
              type: string
              example: 该模型不支持当前 endpoint。
  responses:
    Unauthorized:
      description: API Key 缺失或无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: 资源不存在。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      x-default: sk-your-api-key

````