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

# Query image task

> Image URLs (`result.image_url`) are kept for about **3 days**. Download promptly.

Create and query share the same `data` shape. `data.cost` is the charged amount (credits).

### Status values

| status | Meaning |
| :- | :- |
| `queued` / `pending` / `submitted` | Submitted, waiting |
| `processing` / `in_progress` / `running` | Generating |
| `completed` / `success` / `succeeded` | Done — read `result.image_url` |
| `failed` | Failed — see `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.