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

# 查询图片任务

> 图片地址（`result.image_url`）保存有效期约 **3 天**，请及时转存。

创建与查询返回同一套 `data` 结构；`data.cost` 为本次扣费（积分）。

### 任务状态

| status | 说明 |
| :- | :- |
| `queued` / `pending` / `submitted` | 已提交，等待调度 |
| `processing` / `in_progress` / `running` | 生成中 |
| `completed` / `success` / `succeeded` | 成功，可读 `result.image_url` |
| `failed` | 失败，见 `error_message` |

```bash theme={null}
curl -X GET 'https://sigrunai.com/v1/images/img_xxxxxxxx' \
  -H 'Authorization: Bearer sk_xxx'
```


## OpenAPI

````yaml GET /v1/images/{taskId}
openapi: 3.1.0
info:
  title: AI Platform OpenAPI
  description: >-
    Async image and video generation. Create a task, then poll task_id. Result
    URLs are kept about 3 days.
  version: 1.0.0
servers:
  - url: https://sigrunai.com
    description: AI Platform production
security:
  - bearerAuth: []
paths:
  /v1/images/{taskId}:
    get:
      tags:
        - Images
      summary: Query image task
      operationId: getImage
      parameters:
        - name: taskId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 任务详情
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskQueryResponse'
components:
  schemas:
    TaskQueryResponse:
      type: object
      properties:
        code:
          type: integer
          example: 20000
        msg:
          type: string
        data:
          $ref: '#/components/schemas/TaskQueryData'
    TaskQueryData:
      type: object
      properties:
        task_id:
          type: string
        status:
          type: string
          description: queued / processing / completed / failed 等
        progress:
          type: integer
        model:
          type: string
        created_at:
          type: integer
        completed_at:
          type: integer
        cost:
          type: number
        error_message:
          type: string
        result:
          $ref: '#/components/schemas/TaskResult'
    TaskResult:
      type: object
      properties:
        image_url:
          type: string
        video_url:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API key from the console. Format: Bearer sk_xxx'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.