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

> Generate or edit still images, animated GIFs, and vector SVGs with annotation-guided editing; billed by actual Tokens.

## Parameters and input modes

`model` and `input` are required; omitted optional fields use model defaults. See the Body section below for full field definitions.

| Request type | Required input fields |
| - | - |
| Text to image | `prompt` |
| Reference image editing | `prompt`, `image_urls` (up to 16) |
| Mask edit | `prompt`, `image_urls`, `mask_url` |
| Annotation-guided edit | `prompt`, `image_urls`, `markup_url` |
| Animated GIF | `prompt`, `output_format: "gif"` |
| SVG | `prompt`, `output_format: "svg"`, `svg.model` |

## Special modes

* **GIF** (`output_format: "gif"`): `size` is per-frame pixels, `resolution` is ignored, and `aspect_ratio` must be omitted or `auto` unless `size` is set. Frames pack into a sprite sheet (grid: see `frame_count`), billed as the whole sheet including unused cells.
* **SVG** (`output_format: "svg"`): Requires `svg.model` and `n: 1` (or omitted); `mask_url`, `markup_url`, and `output_compression` are rejected. Generation can take up to 22 minutes—keep polling the same `task_id`.

## Use cases

Submit an example to `POST /api/v1/tasks/create_task` with your own prompt and media URLs.

```json Text to image theme={null}
{
  "model": "gpt-image-2.6-official",
  "input": {
    "prompt": "Architectural photograph of a timber pavilion beside a misty pine pond at dawn.",
    "version": "flare",
    "aspect_ratio": "16:9",
    "resolution": "2K",
    "quality": "high",
    "complexity": "medium"
  }
}
```

```json Annotation-guided edit theme={null}
{
  "model": "gpt-image-2.6-official",
  "input": {
    "prompt": "Follow the arrows and notes on the annotation layer: move the brass lamp left and replace the ceramic mug with a glass carafe.",
    "image_urls": [
      "https://cdn.example.com/desk.png"
    ],
    "markup_url": "https://cdn.example.com/annotation.png"
  }
}
```

```json Mask edit theme={null}
{
  "model": "gpt-image-2.6-official",
  "input": {
    "prompt": "Replace the transparent masked background with warm limestone in soft daylight, keeping the product unchanged.",
    "image_urls": [
      "https://cdn.example.com/product.png"
    ],
    "mask_url": "https://cdn.example.com/mask.png"
  }
}
```

```json Animated GIF theme={null}
{
  "model": "gpt-image-2.6-official",
  "input": {
    "prompt": "A small red fox gently wags its tail as snow falls, fixed camera, seamless loop.",
    "output_format": "gif",
    "size": "512x512",
    "frame_count": 8,
    "frame_duration_ms": 200
  }
}
```

```json Vector SVG theme={null}
{
  "model": "gpt-image-2.6-official",
  "input": {
    "prompt": "Minimalist bakery emblem featuring a stylized wheat stalk in warm ochre and charcoal, flat vector shapes.",
    "output_format": "svg",
    "background": "transparent",
    "svg": {
      "model": "gpt-5.4-mini",
      "reasoning": {
        "effort": "low"
      }
    }
  }
}
```

> Track results via [Query task](https://docs.apistable.ai/query-task.md) or `callback_url` ([Webhook security](https://docs.apistable.ai/webhook-secret.md)); see [Create task](https://docs.apistable.ai/create-task.md) for submission errors. Output URLs remain valid for 14 days; tasks unfinished after 24 hours fail at no charge.

## Playground and pricing

Each task generates up to `n` outputs and settles once from actual Token usage, rounded up to 0.1 Credits (capped by the submission hold; unused Credits are returned). Partial success is charged only for the outputs returned; failed tasks cost 0. SVG also bills the selected writer’s Tokens at its quoted rate (reasoning counts as output Tokens). Check balances via [Available Credits](https://docs.apistable.ai/credits.md).

| Token type | Credits / 1M Tokens | USD / 1M Tokens |
| - | - | - |
| Text input | 950.0 | \$4.750 |
| Cached text input | 237.5 | \$1.188 |
| Image input | 1520.0 | \$7.600 |
| Cached image input | 380.0 | \$1.900 |
| Image output | 5700.0 | \$28.500 |

> [card] [Try in Playground](https://apistable.ai/models/gpt-image-2.6-official#try)
>
> Set parameters and generate an image.

> [card] [View pricing](https://apistable.ai/models/gpt-image-2.6-official#pricing)
>
> View Token rates, estimates, and hold caps.


## OpenAPI

````yaml openapi-gpt-image-2.6-official.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 Official
      description: >-
        Generate or edit still images, animated GIFs, and vector SVGs with
        annotation-guided editing; billed by actual Tokens.
      operationId: gpt-image-2.6-official
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: false
              properties:
                model:
                  type: string
                  enum:
                    - gpt-image-2.6-official
                  example: gpt-image-2.6-official
                  description: The APIstable model ID for this endpoint.
                input:
                  $schema: https://json-schema.org/draft/2020-12/schema
                  type: object
                  properties:
                    prompt:
                      type: string
                      description: Generation or edit prompt (max 32,000 characters).
                      maxLength: 32000
                    aspect_ratio:
                      description: >-
                        Output aspect ratio (default auto). Omit when editing to
                        match the reference image; ignored when size is set. For
                        GIF, omit or use auto unless size is set.
                      type: string
                      enum:
                        - auto
                        - '1:1'
                        - '3:2'
                        - '2:3'
                        - '4:3'
                        - '3:4'
                        - '5:4'
                        - '4:5'
                        - '16:9'
                        - '9:16'
                        - '2:1'
                        - '1:2'
                        - '3:1'
                        - '1:3'
                        - '21:9'
                        - '9:21'
                      default: auto
                    size:
                      description: >-
                        Exact WxH pixels; overrides aspect_ratio and resolution.
                        Static/SVG: multiples of 16, edge ≤ 3840, ratio ≤ 3:1,
                        area 655,360–8,294,400. GIF: per-frame pixels (default
                        512x512, multiples of 16); sheet limits apply instead of
                        min area.
                      type: string
                      pattern: ^([1-9][0-9]*)x([1-9][0-9]*)$
                    resolution:
                      description: >-
                        Output resolution tier: 1K (default), 2K, or 4K. Ignored
                        when size is set or output_format is gif.
                      type: string
                      enum:
                        - 1K
                        - 2K
                        - 4K
                      default: 1K
                    quality:
                      description: >-
                        Quality level: auto (default), low, medium, high, xhigh,
                        or max. Higher quality uses more Tokens.
                      type: string
                      enum:
                        - auto
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                      default: auto
                    'n':
                      description: >-
                        Number of images or GIFs to generate (1–4, default 1) in
                        one task. Must be 1 for SVG.
                      type: integer
                      minimum: 1
                      maximum: 4
                      default: 1
                    image_urls:
                      description: >-
                        Up to 16 public HTTP(S) URLs or image Data URLs
                        (supported for still images, GIF, and SVG). Keep URLs
                        accessible until the task finishes.
                      maxItems: 16
                      type: array
                      items:
                        anyOf:
                          - type: string
                            pattern: ^[hH][tT][tT][pP][sS]?:\/\/
                          - type: string
                            pattern: >-
                              ^data:image\/[a-zA-Z0-9.+-]+;base64,[A-Za-z0-9+/]+={0,2}$
                    mask_url:
                      description: >-
                        Public HTTP(S) URL or PNG Data URL of a PNG alpha mask
                        matching the first reference image. Requires image_urls;
                        incompatible with markup_url, GIF, and SVG. Keep
                        accessible until the task finishes.
                      anyOf:
                        - type: string
                          pattern: ^[hH][tT][tT][pP][sS]?:\/\/
                        - type: string
                          pattern: ^data:image\/png;base64,[A-Za-z0-9+/]+={0,2}$
                    output_format:
                      description: 'Output format: png (default), jpeg, webp, gif, or svg.'
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                        - gif
                        - svg
                      default: png
                    output_compression:
                      description: >-
                        Compression quality (0–100). Only valid with jpeg or
                        webp.
                      type: integer
                      minimum: 0
                      maximum: 100
                    nsfw_check:
                      description: >-
                        Run APIstable pre-generation safety screening on prompts
                        and reference images (default false). `moderation` is
                        not accepted.
                      type: boolean
                      default: false
                    version:
                      description: >-
                        Model variant: flare (default, faster) or sunburst
                        (higher fidelity for layout, text, and edits).
                      type: string
                      enum:
                        - flare
                        - sunburst
                      default: flare
                    background:
                      description: >-
                        Background mode: auto, opaque, or transparent (png,
                        webp, or svg only). Text-to-SVG defaults transparent;
                        image-to-SVG defaults opaque.
                      type: string
                      enum:
                        - transparent
                        - opaque
                        - auto
                    complexity:
                      description: >-
                        Planning detail level: low, medium, or high (default).
                        No separate fee.
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                      default: high
                    safety_identifier:
                      description: >-
                        Optional end-user identifier for abuse monitoring (max
                        128 characters).
                      type: string
                      maxLength: 128
                    markup_url:
                      description: >-
                        HTTPS URL or PNG Data URL of a transparent PNG
                        annotation layer matching the first reference image (≤
                        16,777,216 px each, layer ≤ 50 MB). Requires image_urls;
                        incompatible with mask_url, GIF, and SVG. Keep
                        accessible until the task finishes.
                      anyOf:
                        - type: string
                          pattern: ^[hH][tT][tT][pP][sS]:\/\/
                        - type: string
                          pattern: ^data:image\/png;base64,[A-Za-z0-9+/]+={0,2}$
                    frame_count:
                      description: >-
                        GIF frame count (2–16, default 9); only valid when
                        output_format is gif. Packs into a sprite sheet (2–8:
                        4×2, 9: 3×3, 10–12: 4×3, 13–16: 4×4; axes swappable;
                        edge ≤ 3840, area ≤ 8,294,400, ratio ≤ 3:1).
                      type: integer
                      minimum: 2
                      maximum: 16
                      default: 9
                    frame_duration_ms:
                      description: >-
                        GIF frame duration in ms (min 20, default 200; rounded
                        to 10 ms increments). Only valid when output_format is
                        gif.
                      type: integer
                      minimum: 20
                      maximum: 9007199254740991
                      default: 200
                    svg:
                      description: >-
                        Required when output_format is svg. Set model to a
                        supported SVG writer; optional reasoning.effort accepts
                        none, minimal, low, medium, high, xhigh, or max
                        (case-insensitive; omit or null for writer default;
                        supported levels vary by writer). Returns 503
                        svg_pricing_unavailable if writer pricing is temporarily
                        unavailable; retry shortly.
                      type: object
                      properties:
                        model:
                          type: string
                          enum:
                            - gpt-5.4-mini
                            - gpt-5.4
                            - gpt-5.5
                            - gpt-5.6-sol
                            - gpt-6-luna
                            - gpt-6.1-sol
                            - gpt-6-astra
                        reasoning:
                          anyOf:
                            - type: object
                              properties:
                                effort:
                                  anyOf:
                                    - type: string
                                      pattern: >-
                                        ^([nN][oO][nN][eE]|[mM][iI][nN][iI][mM][aA][lL]|[lL][oO][wW]|[mM][eE][dD][iI][uU][mM]|[hH][iI][gG][hH]|[xX][hH][iI][gG][hH]|[mM][aA][xX])$
                                    - type: 'null'
                              additionalProperties: false
                            - type: 'null'
                      required:
                        - model
                      additionalProperties: false
                  required:
                    - prompt
                  additionalProperties: false
                  allOf:
                    - if:
                        required:
                          - output_compression
                      then:
                        required:
                          - output_format
                        properties:
                          output_format:
                            enum:
                              - jpeg
                              - webp
                    - if:
                        properties:
                          background:
                            const: transparent
                        required:
                          - background
                      then:
                        properties:
                          output_format:
                            enum:
                              - png
                              - webp
                              - svg
                    - if:
                        required:
                          - mask_url
                      then:
                        required:
                          - image_urls
                        properties:
                          image_urls:
                            minItems: 1
                    - if:
                        required:
                          - markup_url
                      then:
                        required:
                          - image_urls
                        properties:
                          image_urls:
                            minItems: 1
                    - not:
                        required:
                          - mask_url
                          - markup_url
                    - if:
                        properties:
                          output_format:
                            enum:
                              - gif
                              - svg
                        required:
                          - output_format
                      then:
                        not:
                          anyOf:
                            - required:
                                - mask_url
                            - required:
                                - markup_url
                            - required:
                                - output_compression
                    - if:
                        properties:
                          output_format:
                            enum:
                              - gif
                        required:
                          - output_format
                      then:
                        if:
                          not:
                            required:
                              - size
                        then:
                          properties:
                            aspect_ratio:
                              const: auto
                    - if:
                        properties:
                          output_format:
                            enum:
                              - svg
                        required:
                          - output_format
                      then:
                        required:
                          - svg
                        properties:
                          'n':
                            const: 1
                    - if:
                        required:
                          - frame_count
                      then:
                        required:
                          - output_format
                        properties:
                          output_format:
                            const: gif
                    - if:
                        required:
                          - frame_duration_ms
                      then:
                        required:
                          - output_format
                        properties:
                          output_format:
                            const: gif
                    - if:
                        required:
                          - svg
                      then:
                        required:
                          - output_format
                        properties:
                          output_format:
                            const: svg
                  description: >-
                    Model input parameters. Omitted optional fields use model
                    defaults.
                callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional public HTTPS endpoint for signed completion
                    callbacks; no redirects or private IPs.
            example:
              model: gpt-image-2.6-official
              input:
                prompt: >-
                  Studio photograph of a cobalt blue ceramic teapot, soft
                  daylight, neutral background.
                aspect_ratio: '1:1'
                resolution: 1K
                version: flare
      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: >-
                  When the task succeeds or fails, APIstable sends a JSON POST
                  to the `callback_url` supplied at creation. Verify the
                  signature and return HTTP 2xx to acknowledge delivery.


                  All outputs from the request are returned in `result.urls`
                  (possibly fewer than `n`), with the single task total in
                  `charged_credits`. Failed tasks return `status: "failed"` and
                  `result: null` at no charge.


                  Use `X-APIstable-Signature`, `X-APIstable-Timestamp`, and
                  `X-APIstable-Event-Id` to verify and deduplicate deliveries.
                  See [Webhook security](/webhook-secret).


                  **Webhook payload example**


                  ```json

                  {
                    "code": 200,
                    "msg": "success",
                    "data": {
                      "task_id": "c6adbc82-8b9a-4d6f-8b60-1114c8c4aafb",
                      "model": "gpt-image-2.6-official",
                      "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-official
                            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: >-
                                Total elapsed milliseconds; null while
                                processing.
                            charged_credits:
                              type:
                                - number
                                - 'null'
                              minimum: 0
                              description: Final charged Credits; null until completion.
                            message:
                              type: string
                              description: >-
                                Failure reason for failed tasks; empty on
                                success.
                            input:
                              type: string
                              contentMediaType: application/json
                              description: JSON-serialized accepted model input.
                            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-official
                        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 acknowledged.
              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: >-
        Sign in to APIstable, then create and copy a key from [API Key
        management](https://apistable.ai/console/keys).


        Send this HTTP header with every request:


        ```http

        Authorization: Bearer YOUR_API_KEY

        ```


        Replace YOUR_API_KEY with the key you created.

````

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