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

# GPT Image 2.6

> 可选 Flare 或 Sunburst，支持文生图、多参考图编辑及 1K、2K、4K 输出档位。

## 参数与输入模式

model 和 input 始终必填。文生图传 prompt，参考图编辑同时传 image\_urls。GIF 输出仅支持文生图。

| 请求场景 | input 必填字段 |
| - | - |
| 文生图 | prompt |
| 参考图编辑 | prompt 与 image\_urls |
| GIF 动图 | prompt、output\_format=gif，且 aspect\_ratio=auto（不传 image\_urls） |

## 使用场景

将示例提交到创建任务接口，并将提示词和参考图地址替换为你的内容。

```json 文生图 theme={null}
{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "version": "flare"
  }
}
```

```json 编辑产品图 theme={null}
{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "Keep the product and label unchanged. Replace only the background with warm limestone in soft daylight.",
    "image_urls": [
      "https://cdn.example.com/product.png"
    ],
    "resolution": "1K",
    "aspect_ratio": "1:1"
  }
}
```

```json 一次生成多张 theme={null}
{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.",
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "output_count": 4
  }
}
```

```json 生成 GIF 动图 theme={null}
{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "A puppy raises one paw to wave, fixed camera, seamless loop.",
    "output_format": "gif",
    "aspect_ratio": "auto",
    "resolution": "1K"
  }
}
```

```json 使用 Sunburst 版本 theme={null}
{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "Minimal editorial poster with crisp serif typography reading \"AUTUMN ISSUE\", clean grid layout.",
    "resolution": "2K",
    "aspect_ratio": "3:4",
    "version": "sunburst"
  }
}
```

> 使用返回的 task\_id [查询任务](https://docs.apistable.ai/zh/query-task.md) 或设置 callback\_url，并在生成后 14 天内下载图片。

> [card] [在线试用](https://apistable.ai/zh/models/gpt-image-2.6#try)
>
> 设置参数并在线生成图片。

> [card] [查看价格](https://apistable.ai/zh/models/gpt-image-2.6#pricing)
>
> 查看各分辨率档位与计费规则。


## OpenAPI

````yaml openapi-gpt-image-2.6-zh.json POST /api/v1/tasks/create_task
openapi: 3.1.0
info:
  title: APIstable API
  version: 1.0.0-preview
  description: >-
    Public /api/v1 protocol. Valid API keys have the same account-scoped access.
    Read the selected model documentation for its ID, supported inputs, result
    format and availability before submitting. No client submission idempotency
    or max_credits. Availability, pricing, file retention and callback formats
    follow the selected model contract. Unconfigured operations return 503.
servers:
  - url: https://apistable.ai
    description: API Stable API
security: []
paths:
  /api/v1/tasks/create_task:
    post:
      summary: GPT Image 2.6
      description: 可选 Flare 或 Sunburst，支持文生图、多参考图编辑及 1K、2K、4K 输出档位。
      operationId: gpt-image-2.6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - gpt-image-2.6
                  example: gpt-image-2.6
                  description: 本页对应的 APIstable 模型 ID。
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    prompt:
                      type: string
                      description: 生成或编辑画面描述。传入多张参考图时，可说明每张图要保留或修改的内容。
                    resolution:
                      default: 1K
                      description: 输出分辨率档位，可选 1K（默认）、2K 或 4K。普通渠道按分辨率档位固定计费。
                      type: string
                      enum:
                        - 1K
                        - 2K
                        - 4K
                    aspect_ratio:
                      default: auto
                      description: 输出宽高比。默认 auto，文生图输出 1:1，参考图编辑匹配最接近的支持比例；GIF 须设为 auto。
                      type: string
                      enum:
                        - auto
                        - '1:1'
                        - '3:2'
                        - '2:3'
                        - '4:3'
                        - '3:4'
                        - '5:4'
                        - '4:5'
                        - '16:9'
                        - '9:16'
                        - '21:9'
                    image_urls:
                      default: []
                      description: 用于编辑的参考图公网 URL。最多 16 张。
                      type: array
                      items:
                        type: string
                    version:
                      default: flare
                      description: >-
                        模型版本：flare（默认，适合日常快速出图）或
                        sunburst（构图、文字与精细编辑精度更高）。普通渠道同价。
                      type: string
                      enum:
                        - flare
                        - sunburst
                    quality:
                      description: 生成质量档位。省略时由模型自动选择；不影响普通渠道单张价格。
                      type: string
                      enum:
                        - auto
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                    output_format:
                      default: png
                      description: >-
                        输出文件格式，默认 png。gif 仅支持文生图（不传 image_urls），且须设置
                        aspect_ratio=auto。
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                        - gif
                    complexity:
                      description: 画面细节复杂度。省略时由模型自动选择；不影响普通渠道单张价格。
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                    output_count:
                      default: 1
                      description: 生成的独立图片数量（1–4，默认 1）。仅对成功生成的图片计费。
                      type: integer
                      minimum: 1
                      maximum: 4
                    fallback:
                      default: false
                      description: >-
                        默认 false。传 true 在普通渠道失败时尝试官方回退；按实际 Token 用量计费。GIF 及
                        aspect_ratio=auto 的参考图编辑不支持回退。
                      type: boolean
                    nsfw_check:
                      default: false
                      description: 生成前审核提示词和参考图的敏感内容。默认 false。
                      type: boolean
                  required:
                    - prompt
                  additionalProperties: false
                  allOf:
                    - if:
                        properties:
                          output_format:
                            const: gif
                        required:
                          - output_format
                      then:
                        properties:
                          image_urls:
                            maxItems: 0
                          aspect_ratio:
                            const: auto
                  description: 图片生成参数。
                callback_url:
                  type: string
                  format: uri
                  description: 任务完成时接收签名回调的公网 HTTPS 地址。须为可直接访问的地址，不能跳转到其他地址。省略时可轮询查询任务接口。
            example:
              model: gpt-image-2.6
              input:
                prompt: >-
                  Studio photograph of a cobalt blue ceramic teapot, soft
                  daylight, neutral background.
                resolution: 1K
                aspect_ratio: '1:1'
                version: flare
                output_count: 1
                fallback: false
      responses:
        '200':
          description: Accepted task. Poll the common task endpoint or use callback_url.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - msg
                  - data
                additionalProperties: false
                properties:
                  code:
                    const: 200
                  msg:
                    const: success
                  data:
                    type: object
                    required:
                      - task_id
                    additionalProperties: false
                    properties:
                      task_id:
                        type: string
        '400':
          description: >-
            40001 invalid JSON, 40002 invalid input/callback or input rejected
            by screening, 40003 unsupported parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: '40201: Insufficient credits (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '40301: Website session requests require the APIstable site origin.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '40401: Unknown model or resource not found in this account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '40901: Resource incompatible with this operation.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: '41001: Source audio or temporary resource has expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: '41301: Request too large.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '42201: Requested capability combination is not enabled.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '42901: Rate/concurrency limit (live acceptance).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '50301: Service unavailable. No live submission or charge.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        Webhook:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                description: >-
                  任务成功或失败后，APIstable 向创建任务时传入的 `callback_url` 发送 JSON POST。验签后返回
                  HTTP 2xx 确认接收。


                  用 `data.status` 判断生成结果。部分成功也返回 `succeeded`，`result.urls`
                  仅包含成功图片，`result.items` 返回各生成项的状态与扣费。全部失败时为
                  `failed`，`data.result` 为 `null`，`data.message` 提供失败原因。


                  签名和去重使用 `X-APIstable-Signature`、`X-APIstable-Timestamp` 和
                  `X-APIstable-Event-Id`。详见 [Webhook 安全与验签](/zh/webhook-secret)。


                  **Webhook 请求体示例**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "gpt-image-2.6",
                      "status": "succeeded",
                      "created_at": "2026-11-23T08:30:00.000Z",
                      "completed_at": "2026-11-23T08:30:18.000Z",
                      "duration": 18000,
                      "charged_credits": 2.1,
                      "message": "",
                      "input": "{\"prompt\":\"Studio photograph of a cobalt blue ceramic teapot, soft daylight, neutral background.\",\"resolution\":\"1K\",\"aspect_ratio\":\"1:1\"}",
                      "result": {
                        "urls": [
                          "https://cdn.example.com/generated/image.png"
                        ],
                        "items": [
                          {
                            "id": "e7aacd19-819a-4747-bbbf-46fb6f2995a5",
                            "status": "succeeded",
                            "charged_credits": 2.1,
                            "urls": [
                              "https://cdn.example.com/generated/image.png"
                            ]
                          }
                        ]
                      }
                    }
                  }

                  ```
                content:
                  application/json:
                    schema:
                      type: object
                      required:
                        - code
                        - msg
                        - data
                      properties:
                        code:
                          type: integer
                          const: 200
                        msg:
                          type: string
                          const: success
                        data:
                          type: object
                          additionalProperties: false
                          required:
                            - task_id
                            - model
                            - status
                            - created_at
                            - completed_at
                            - duration
                            - charged_credits
                            - message
                            - input
                            - result
                          properties:
                            task_id:
                              type: string
                            model:
                              type: string
                              const: gpt-image-2.6
                            status:
                              type: string
                              enum:
                                - succeeded
                                - failed
                            created_at:
                              type: string
                              format: date-time
                            completed_at:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            duration:
                              type:
                                - integer
                                - 'null'
                              minimum: 0
                              description: 任务总耗时（毫秒）；处理中为 null。
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: 最终实扣积分；完成前为 null。
                            message:
                              type: string
                              description: 失败时的原因说明；成功时为空字符串。
                            input:
                              type: string
                              contentMediaType: application/json
                              description: 已受理模型参数的 JSON 字符串。
                            result:
                              type:
                                - object
                                - 'null'
                              required:
                                - urls
                                - items
                              properties:
                                urls:
                                  type: array
                                  items:
                                    type: string
                                    format: uri
                                items:
                                  type: array
                                  items:
                                    type: object
                                    required:
                                      - id
                                      - status
                                      - charged_credits
                                      - urls
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      status:
                                        type: string
                                      charged_credits:
                                        type: number
                                        minimum: 0
                                      urls:
                                        type: array
                                        items:
                                          type: string
                                          format: uri
                    example:
                      code: 200
                      msg: success
                      data:
                        task_id: c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb
                        model: gpt-image-2.6
                        status: succeeded
                        created_at: '2026-11-23T08:30:00.000Z'
                        completed_at: '2026-11-23T08:30:18.000Z'
                        duration: 18000
                        charged_credits: 2.1
                        message: ''
                        input: >-
                          {"prompt":"Studio photograph of a cobalt blue ceramic
                          teapot, soft daylight, neutral
                          background.","resolution":"1K","aspect_ratio":"1:1"}
                        result:
                          urls:
                            - https://cdn.example.com/generated/image.png
                          items:
                            - id: e7aacd19-819a-4747-bbbf-46fb6f2995a5
                              status: succeeded
                              charged_credits: 2.1
                              urls:
                                - https://cdn.example.com/generated/image.png
              responses:
                2XX:
                  description: 已接收 Webhook。
              method: post
              type: path
            path: '{$request.body#/callback_url}'
      security:
        - bearerAuth: []
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - msg
        - data
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        登录 APIstable 后，在 [API Key 管理](https://apistable.ai/zh/console/keys)
        创建并复制密钥。


        每次调用都要在 HTTP 请求头传入：


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        将 YOUR_API_KEY 替换为你创建的 API Key。

````

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