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

# 创建 GPT Image 2.6 任务

> 创建 GPT Image 2、GPT Image 2.6、Nano Banana、Seedream 5.5 或 Muse Image 生图任务。

创建 GPT Image 2.6 异步生图任务。成功后返回 `task_id`，请用 [查询图片任务](https://docs.sigrunai.com/zh/api-reference/images/query.md) 轮询，完成后从 `result.image_url` 取图。

GPT Image 2 见 [创建 GPT Image 2 任务](https://docs.sigrunai.com/zh/api-reference/images/create.md)。Nano Banana 见 [创建 Nano Banana 任务](https://docs.sigrunai.com/zh/api-reference/images/nano-banana.md)。

## 模型

| `model` | 说明 | 计费 |
| - | - | - |
| `gpt-image-2.6-flare` | 更快 | `per_task` |
| `gpt-image-2.6-sunburst` | 更精细 | `per_task` |

两个模型各自按次计费。`quality` 只影响生成效果，不改变单价。实际单价以 [模型目录](https://docs.sigrunai.com/zh/api-reference/common/model-catalog.md) 和创建响应里的 `cost` 为准。

你也可以把质量写进模型名，例如 `gpt-image-2.6-sunburst-max`。这只是设置 `quality`，计费模型仍是 `gpt-image-2.6-sunburst`。

## 请求参数

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 见上表 |
| `prompt` | string | 是 | 提示词，1–32000 字符 |
| `quality` | string | 否 | `auto`（默认）、`low`、`medium`、`high`、`xhigh`、`max` |
| `n` | int | 否 | 只支持 **1**。省略时按 1 张计费 |
| `ratio` | string | 否 | `auto`、`1:1`、`3:2`、`2:3`、`4:3`、`3:4`、`5:4`、`4:5`、`16:9`、`9:16`、`21:9` |
| `size` | string | 否 | `ratio` 别名。不接受像素尺寸，例如 `1024x1024` |
| `resolution` | string | 否 | 只支持省略或 `1k` |
| `output_format` | string | 否 | `png`、`jpeg`、`webp`、`svg`、`gif`。`jpg` 按 `jpeg` 处理 |
| `images` | string\[] | 否 | 参考图公网 URL，最多 **16** 张 |
| `smart_queue` | bool | 否 | 默认 `false`。为 `true` 时，近期成功率过低会先保持 `queued`，恢复后再提交（最长约 2 小时）。详见 [智能排队](https://docs.sigrunai.com/zh/api-reference/common/smart-queue.md) |

`svg` 和 `gif` 不能带参考图。`gif` 的 `size` / `ratio` 只能省略或传 `auto`。

## 示例

### 文生图

```bash theme={null}
curl -X POST 'https://sigrunai.com/v1/images' \
  -H 'Authorization: Bearer sk_xxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "极简产品静物，白色背景，柔光",
    "quality": "medium",
    "n": 1,
    "ratio": "1:1",
    "resolution": "1k",
    "output_format": "png"
  }'
```

### 参考图编辑

```bash theme={null}
curl -X POST 'https://sigrunai.com/v1/images' \
  -H 'Authorization: Bearer sk_xxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-image-2.6-sunburst",
    "prompt": "保持产品外观，换成摄影棚柔光背景",
    "quality": "high",
    "size": "16:9",
    "images": ["https://example.com/product.jpg"]
  }'
```

成功响应示例：

```json theme={null}
{
  "code": 20000,
  "msg": "提交成功",
  "data": {
    "task_id": "img_xxxxxxxx",
    "status": "queued",
    "progress": 0,
    "model": "gpt-image-2.6-flare",
    "cost": 0.4,
    "result": {}
  }
}
```


## OpenAPI

````yaml POST /v1/images
openapi: 3.1.0
info:
  title: AI Platform OpenAPI
  description: 异步图片与视频生成。创建后轮询 task_id；结果 URL 约保留 3 天。
  version: 1.0.0
servers:
  - url: https://sigrunai.com
    description: AI Platform 生产环境
security:
  - bearerAuth: []
paths:
  /v1/images:
    post:
      tags:
        - Images
      summary: Create image task
      description: >-
        Create an async GPT Image 2, GPT Image 2.6, Nano Banana, Seedream 5.5,
        or Muse Image task.
      operationId: createImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageCreateRequest'
            examples:
              gptImage2:
                summary: gpt-image-2
                value:
                  model: gpt-image-2
                  prompt: Minimal product still life, white background, soft light
                  quality: medium
                  'n': 1
                  ratio: '1:1'
              gptImage26:
                summary: gpt-image-2.6-flare
                value:
                  model: gpt-image-2.6-flare
                  prompt: Minimal product still life, white background, soft light
                  quality: medium
                  'n': 1
                  ratio: '1:1'
                  resolution: 1k
                  output_format: png
              nanoBanana2:
                summary: nano-banana-2
                value:
                  model: nano-banana-2
                  prompt: >-
                    Cinematic sunset over a lake, golden light on distant
                    mountains
                  ratio: '16:9'
                  resolution: 2k
              nanoBananaPro:
                summary: nano-banana-pro
                value:
                  model: nano-banana-pro
                  prompt: Keep the product look, switch to soft studio lighting
                  ratio: '1:1'
                  resolution: 4k
                  images:
                    - https://example.com/product.jpg
              seedream55:
                summary: seedream-5.5
                value:
                  model: seedream-5.5
                  prompt: A blue cup on a wooden table, soft natural light
                  ratio: '1:1'
                  resolution: 1K
              museImage:
                summary: muse-image
                value:
                  model: muse-image
                  prompt: A misty forest at dawn, photorealistic
                  ratio: '16:9'
                  style: photorealistic
                  negative_prompt: watermark, text
      responses:
        '200':
          description: 提交成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskQueryResponse'
components:
  schemas:
    ImageCreateRequest:
      type: object
      required:
        - model
      properties:
        model:
          type: string
          description: >-
            gpt-image-2 (plus low/medium/high), gpt-image-2.6-flare /
            gpt-image-2.6-sunburst, nano-banana-2 / nano-banana-2.1 /
            nano-banana-pro, seedream-5.5, or muse-image
          example: nano-banana-2
        prompt:
          type: string
          minLength: 1
          maxLength: 32000
          description: >-
            GPT Image 2 / Seedream 5.5 / Muse Image max 4000; GPT Image 2.6 max
            32000; Nano Banana max 10000. Nano Banana / Seedream prompt is
            optional when images are provided. Muse Image prompt is always
            required
        quality:
          type: string
          enum:
            - auto
            - low
            - medium
            - high
            - xhigh
            - max
          default: auto
          description: >-
            GPT Image 2: auto / low / medium / high, billed by tier. GPT Image
            2.6 also accepts xhigh / max without changing the price
        'n':
          type: integer
          minimum: 1
          maximum: 4
          default: 1
          description: >-
            GPT Image 2 accepts 1–4. GPT Image 2.6, Nano Banana, Seedream 5.5,
            and Muse Image accept 1 only
        ratio:
          type: string
        size:
          type: string
          description: >-
            Alias of ratio. GPT Image 2.6 accepts auto or an aspect ratio, not a
            pixel size. Muse Image reduces a pixel size such as 1024x1024 to its
            ratio
        resolution:
          type: string
          description: >-
            GPT Image 2.6 accepts 1k only. Nano Banana: 0.5k/1k/2k/4k depending
            on the model
        images:
          type: array
          items:
            type: string
            format: uri
          maxItems: 16
          description: >-
            Reference image URLs. GPT Image 2 max 15; GPT Image 2.6 max 16; Nano
            Banana max 5; Seedream 5.5 max 8; Muse Image max 10. GPT Image 2.6
            svg and gif cannot include reference images
        output_format:
          type: string
          enum:
            - png
            - jpeg
            - webp
            - svg
            - gif
          description: >-
            GPT Image 2.6 only. jpg is treated as jpeg. For gif, omit size or
            send auto
        style:
          type: string
          maxLength: 1000
          description: >-
            Muse Image only. Free-text style such as photorealistic, anime, or
            cinematic
        negative_prompt:
          type: string
          maxLength: 1000
          description: Muse Image only. What should not appear, kept apart from prompt
        smart_queue:
          type: boolean
          default: false
          description: >-
            When true, a very low recent success rate keeps the task queued
            until recovery (up to about 2 hours)
    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，格式：Bearer sk_xxx

````

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