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

# GPT Image 2.6 New Capabilities

> Model selection for GPT Image 2.6 Flare and Sunburst, plus complexity control, SVG vector output, animated GIFs, markup-guided edits, interactive examples, and real results.

> [!NOTE]
>
> The Playground provides three named examples: **raster PNG with complexity, SVG, and a two-frame GIF**. Enter `Bearer sk-xxx` under **Authorization**, choose an example, edit the prompt, and send the request.

> [!WARNING]
>
> `data[0].b64_json` has no `data:` prefix, and SVG and GIF responses are also base64-encoded. The browser Playground may be unable to display a long base64 response even when the request succeeded. Use the Python example below to decode and save the result locally.

## Model selection

GPT Image 2.6 was released on 2026-11-04. It retains `/v1/images/generations` and `/v1/images/edits`, and adds complexity control, SVG output, animated GIF output, and markup-guided editing.

| Model | Focus | Best for |
| - | - | - |
| `gpt-image-2.6-flare` | Fast iteration | Drafts, batch generation, social content, and rapid prompt comparisons |
| `gpt-image-2.6-sunburst` | Detailed visual work | Complex layouts, dense text, finished assets, and precise editing |

See the [model pricing directory](https://docs.apiyi.com/en/models/index.md) for current token rates. Actual cost depends on size, quality, output format, and token usage. SVG also incurs authoring-model charges, so its cost is not comparable to a standard PNG.

## New capabilities

> [card] [Complexity control](#complexity-control-planning)
>
> Controls planning before rendering, independently of the quality setting.

> [card] [SVG vector output](#svg-generate-editable-vector-files)
>
> Returns editable paths, shapes, and colors for icons, illustrations, and UI assets.

> [card] [Animated GIF output](#gif-generate-looping-animations)
>
> Produces a complete GIF in one request with frame count and frame duration controls.

> [card] [Markup-guided edits](#markup-guided-edits)
>
> Uses a transparent annotation layer to identify the edit region while the prompt describes the change.

## complexity: control planning

`complexity` controls how much the model plans before rendering. It is intended for dense text, complex layouts, and relationships between objects. `quality` controls rendering quality instead; the two settings serve different purposes.

| Official level | Recommended use |
| - | - |
| `low` | Focused edits, simple compositions, and quick drafts |
| `medium` | A balance for ordinary layouts and multiple constraints |
| `high` | Dense text, complex layouts, and object relationships; used by default when complexity is omitted |

Complexity has no separate fee. Higher levels can increase latency and introduce unwanted changes. Compare results for your task instead of assuming that a higher level is always better.

> [!NOTE]
>
> **APIYI passes this parameter through natively**: the `low` / `medium` / `high` levels pass through as-is (defaulting to `high` when omitted), with no extra field or group configuration required.

> [accordion] Upstream test note: additional accepted levels
>
> The upstream error response in our test also listed `none`, `xhigh`, and `max`, and the current route accepted them. OpenAI's public guide documents `low / medium / high`; production requests should use those official levels rather than relying on additional values as a long-term compatibility guarantee.

## SVG: generate editable vector files

Set `output_format: "svg"`. The current upstream also requires the nested `svg.model` field to select the text model that authors the vector code:

```json theme={null}
{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A minimal flat vector icon of a rocket, exactly three solid colors, geometric editable shapes, no text, no raster texture, transparent background.",
  "output_format": "svg",
  "svg": {
    "model": "gpt-5.6-terra"
  },
  "quality": "low",
  "size": "1024x1024",
  "n": 1
}
```

![Vector rocket icon with red fins, a blue window, and a white body](https://mintcdn.com/apiyillc/I9X_C01jz8OkWw6c/images/gpt-image-2-6/rocket.svg?fit=max\&auto=format\&n=I9X_C01jz8OkWw6c\&q=85\&s=c2dc54229ae6495d2926adcc44513fa4)

A real SVG generated through APIYI's passthrough route: editable path and circle elements

### Authoring model selection and billing

The client specifies `svg.model`; APIYI does not select it randomly. The supported set depends on the upstream and current group, so support is not guaranteed for every OpenAI text model. This page verifies `gpt-5.6-terra`, `gpt-6-luna`, and `gpt-4.1-mini`; test other models in your actual group. Authoring charges use the input and output token rates of the selected text model:

* Authoring cost = `svg_usage.input_tokens` × input rate + `svg_usage.output_tokens` × output rate.
* Total SVG cost = reference-image cost + authoring-model cost. The image model creates a reference image before the text model authors the SVG.
* Successful responses include both `usage` and `svg_usage`: `usage` covers the reference image, while `svg_usage` covers the authoring model. Both contribute to cost.
* `svg_usage.reasoning_tokens` is already included in `svg_usage.output_tokens`. Do not add it again.

In an APIYI passthrough test on 2026-11-05 using `gpt-image-2.6-sunburst` and `gpt-5.6-terra`, the response included these usage fields:

```json theme={null}
{
  "output_format": "svg",
  "usage": {
    "input_tokens": 100,
    "output_tokens": 824,
    "total_tokens": 924
  },
  "svg_usage": {
    "model": "gpt-5.6-terra",
    "input_tokens": 1572,
    "output_tokens": 850,
    "reasoning_tokens": 350,
    "total_tokens": 2422
  }
}
```

Using the current directory rates for `gpt-5.6-terra` of \$2 per million input tokens and \$12 per million output tokens, the estimated authoring charge is `1572 ÷ 1000000 × 2 + 850 ÷ 1000000 × 12 = \$0.013344`, excluding the reference-image charge.

The following authoring models were tested with the same prompt. All returned real SVG without scripts, embedded raster images, or external references:

| `svg.model` | Result | Input / output tokens | Reasoning tokens | Elapsed | Estimated authoring charge |
| - | - | -: | -: | -: | -: |
| `gpt-5.6-terra` | PASS | 1,572 / 850 | 350 | 29.196s | \$0.013344 |
| `gpt-6-luna` | PASS | 1,572 / 1,618 | 1,110 | 53.436s | \$0.0009662 |
| `gpt-4.1-mini` | PASS | 2,005 / 513 | 0 | 23.777s | \$0.0016228 |

All three requests reported the same reference-image usage: 100 input, 824 output, and 924 total tokens, billed separately. The response model name for `gpt-4.1-mini` was `gpt-4.1-mini-2025-04-14`. Prices can change and tiered rates can vary by group. See the [model pricing directory](https://docs.apiyi.com/en/models/index.md) and your bill for actual charges. A single image per model is not a quality ranking.

### Limitations

* SVG is available only through `/v1/images/generations` with `n=1`. The edit endpoint does not support SVG output or SVG as a raster input.
* Streaming, partial images, `output_compression`, and `prompt_rewriter` are unsupported.
* The result is static vector XML without scripts, external resources, or embedded raster images. Decode and save it as `.svg`, not as a PNG.

## GIF: generate looping animations

Set `output_format: "gif"` and describe the subject, motion, and loop in the prompt. Both `/v1/images/generations` and `/v1/images/edits` support GIF; for edits, pass reference images in `images` and the first image becomes the animated subject. This low-cost example should produce **2 frames at 100ms each, for a total duration of 0.2 seconds**:

```json theme={null}
{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A minimal two-frame looping animation of a yellow circle moving slightly right and returning to its starting position on a plain white background, no text, seamless loop.",
  "output_format": "gif",
  "quality": "low",
  "size": "512x512",
  "frame_count": 2,
  "frame_duration_ms": 100,
  "n": 1
}
```

![Two-frame looping animation of a yellow circle moving right and returning to its starting position](https://mintcdn.com/apiyillc/I9X_C01jz8OkWw6c/images/gpt-image-2-6/two-frame-loop.gif?s=d010bf9dbb9b5c3a3e9b915bb2164a3d)

A real GIF generated through APIYI's passthrough route: 2 frames and 0.2 seconds

| Parameter | Official range and default | Notes |
| - | - | - |
| `frame_count` | **2–16**, default 9 | Out-of-range values do not error on this route; they fall back to defaults (see below). More frames generally increase latency and cost |
| `frame_duration_ms` | **20–2000ms**, default 200ms, rounded to 10ms | Total duration = frame count × frame duration |
| `size` | `auto`, or `WIDTHxHEIGHT` with both dimensions a multiple of **16** | Size of **each frame**, not of the final animation |

### Size boundaries: every frame shares one sheet

GPT Image 2.6 draws all frames into a single sprite sheet and then cuts it into frames, so the limits apply to the sheet rather than to one frame:

| Constraint | Boundary |
| - | - |
| Longest sheet edge | ≤ **3840** |
| Total sheet pixels | ≤ **8,294,400** (= 3840×2160), and ≥ **about 655,360** (589,824 rejected, 665,856 accepted) |
| Sheet aspect ratio | ≤ **3:1** |
| Frame dimensions | Width and height are multiples of **16** |

The sheet layout is fixed: `4×2` for 2–8 frames, `3×3` for 9, `4×3` for 10–12, and `4×4` for 13–16. Converted to the maximum square frame:

| Frames | Layout | Max square frame | Notes |
| - | -: | -: | - |
| 2–8 | 4×2 | **960×960** | Limited by the 3840 edge (4×960) |
| 9 | 3×3 | **960×960** | 9×960² uses the whole budget |
| 10–12 | 4×3 | **816×816** | 832² exceeds the budget |
| 13–16 | 4×4 | **720×720** | 16×720² uses the whole budget |

Rules of thumb:

* **512×512 works for all 2–16 frames** — the safest choice
* **768×768 works up to 12 frames**; at 16 frames the sheet is 3072×3072 = 9,437,184, over budget
* **960×960 works up to 9 frames**
* **1024×1024 and 2048×2048 never work.** At 1024² the 2–8 frame sheet is 4096 wide, past the 3840 edge; 2048² needs 8192×4096 with only 2 frames
* `frame_count` values of 1 or 17 do not return 400: this route drops `frame_count` and `frame_duration_ms` and falls back to the default **9 frames / 1.8 seconds**. Use ffprobe below to confirm the real frame count
* With `n > 1`, this route validates each image separately and does not add them up: 2 images × 16 frames × 512² (8,388,608 total) still succeeded. The official guide says multiple animations must fit the same budget; go by the actual response
* For a wider picture, change the aspect ratio: 9 frames of 1280×720 produce exactly a 3840×2160 sheet

Exceeding the boundary returns 400 with `param: "size"`. The two common errors:

```text theme={null}
GIF frames exceed the total request pixel budget. Reduce the frame size or frame_count.
```

```text theme={null}
No supported sheet fits 8 GIF frames at size '1024x1024'. Invalid size '4096x2048'. The longest edge must be less than or equal to 3840.
```

GIF output does not support streaming, partial images, custom `output_compression`, or `prompt_rewriter`. `frame_count` and `frame_duration_ms` apply to GIF only — do not send them with PNG, JPEG, WebP, or SVG.

### GIF through the edit endpoint

`/v1/images/edits` also accepts `output_format: "gif"`. The first input image becomes the animated subject; the remaining fields match the generation endpoint:

```json theme={null}
{
  "model": "gpt-image-2.6-sunburst",
  "images": [{ "image_url": "https://example.com/cat.png" }],
  "prompt": "Make this cat dance a short loop, plain background, fixed camera, return to the starting pose on the last frame",
  "output_format": "gif",
  "size": "512x512",
  "frame_count": 16,
  "frame_duration_ms": 100
}
```

> [!NOTE]
>
> The sheet budget was measured on the official relay on 2026-11-09: 8,294,400 passes at the exact limit, while 12 frames of 832² (only 12,288 pixels over) is rejected. The model side can change it; the 400 error you actually receive is authoritative.

### Verify the actual frame count

Do not rely only on HTTP 200 or the response's `output_format`. If a route drops the frame fields, it can still return a default 9-frame, 1.8-second GIF. Inspect the actual file with `ffprobe`:

```bash theme={null}
ffprobe -v error -select_streams v:0 -count_frames \
  -show_entries stream=codec_name,width,height,nb_read_frames,duration \
  -of json result.gif
```

For this example, expect `nb_read_frames=2` and `duration=0.200000`.

## Markup-guided edits

GPT Image 2.6 also supports markup-guided edits through the `markup` field on `/v1/images/edits`:

1. Keep the original image as the first input.
2. Create a transparent PNG at the same dimensions and add circles, arrows, or sketches around the region to change.
3. Upload that annotation layer as `markup`, then describe the change and the details to preserve in `prompt`.
4. Markup applies to the first input image and cannot be combined with `mask`.

> [!NOTE]
>
> `prompt_rewriter` is not a parameter of the Images API and is not supported by APIYI; in the provider's Responses API image tool, prompts are rewritten automatically and the result is returned in the `revised_prompt` field.

For ordinary editing, multi-image fusion, and masks, see the [Image Edit API](https://docs.apiyi.com/en/api-capabilities/gpt-image-2/image-edit.md). Markup forwarding must be verified separately on the target route; this page does not present it as a tested interactive example.

## Client-side decoding

All output formats use `data[0].b64_json`; only the file extension changes:

```python theme={null}
import base64
from pathlib import Path

payload = response.json()
fmt = payload["output_format"]
raw = base64.b64decode(payload["data"][0]["b64_json"])
Path(f"result.{fmt}").write_bytes(raw)
```

SVG decodes to UTF-8 XML, while GIF and raster formats decode to binary files. Production code should also check the HTTP status, `error` field, and actual file signature rather than trusting the extension alone.

## Route compatibility and troubleshooting

> [!WARNING]
>
> New 2.6 fields require native JSON passthrough. Compatibility can vary across upstream routes, and these public examples do not guarantee identical behavior in every group. Verify them in the group your account actually uses.

| Symptom | What to check first |
| - | - |
| `SVG generation requires 'svg.model'` even though it was provided | Whether the route filtered or rewrote the nested `svg` object |
| A request for 2 frames at 100ms returns 9 frames and 1.8 seconds | Whether `frame_count` and `frame_duration_ms` were dropped in favor of defaults |
| `GIF frames exceed the total request pixel budget` | Whether `frame_count × frame pixels × n` exceeds 8,294,400, or the sheet edge exceeds 3840 |
| An invalid complexity string still returns 200 | Validation behavior can differ across upstreams; this alone does not prove the field was dropped. Compare valid-level behavior and inspect upstream logs |
| Playground shows `unable to complete request` | Check whether the response was actually 200; long base64 may exceed the browser's display capacity, so decode locally |
| SVG cost is higher than expected | Inspect both `usage` and `svg_usage`, not only reference-image tokens |

## Related documentation

* [GPT-Image-2.5 / 2 overview](https://docs.apiyi.com/en/api-capabilities/gpt-image-2/overview.md)
* [Standard text-to-image Playground](https://docs.apiyi.com/en/api-capabilities/gpt-image-2/text-to-image.md)
* [Image Edit Playground](https://docs.apiyi.com/en/api-capabilities/gpt-image-2/image-edit.md)
* [Official vs reverse comparison (2.6)](https://docs.apiyi.com/en/api-capabilities/gpt-image-2/vs-gpt-image-2-6-all.md) - Selection guide vs `gpt-image-2.6-all`
* [Image API essentials and best practices](https://docs.apiyi.com/en/api-capabilities/image-api-best-practices.md)
* [Model pricing directory](https://docs.apiyi.com/en/models/index.md)


## OpenAPI

````yaml api-reference/gpt-image-2-6-generate-openapi-en.yaml POST /v1/images/generations
openapi: 3.1.0
info:
  title: GPT Image 2.6 Text-to-Image and New Capabilities API
  description: >
    Text-to-image with OpenAI `gpt-image-2.6-flare` / `gpt-image-2.6-sunburst`,
    including raster images, complexity control, SVG vector output, and animated
    GIF output.


    - Complexity: official low / medium / high levels, default high, with no
    separate fee

    - SVG: set output_format=svg and provide svg.model; generations only, n=1

    - GIF: set output_format=gif; 2–16 frames (default 9), 20–2000ms per frame;
    supported on both generations and edits

    - Responses contain data[0].b64_json for client-side base64 decoding


    **Authentication**: Add `Authorization: Bearer YOUR_API_KEY` to request
    headers


    **Get an API Key**: Visit the [APIYI Console](https://api.apiyi.com/token)
  version: 1.0.0
servers:
  - url: https://api.apiyi.com
    description: Primary endpoint
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      tags:
        - GPT Image 2.6
      summary: 'GPT Image 2.6: generate PNG, SVG, or GIF'
      description: >
        Generate images from text prompts with GPT Image 2.6. The three named
        request examples demonstrate complexity, SVG, and GIF.


        Complexity controls planning before rendering and is independent of
        rendering quality. SVG requires the nested svg.model field. GIF frame
        controls apply only when output_format=gif. GIF frames share one sprite
        sheet: longest edge ≤3840, total pixels ≤8,294,400 (≥655,360), 2–16
        frames, and a maximum square frame of 960 / 816 / 720 depending on frame
        count. SVG and GIF do not support streaming, partial images, or
        output_compression.
      operationId: generateGptImage26
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Image26Request'
            examples:
              complexityPng:
                summary: Raster PNG + low complexity
                description: >-
                  Use a four-panel infographic to inspect complexity;
                  quality=low controls cost
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A clean 2x2 technical infographic on a white background.
                    Top-left: a red circle labeled 'A'. Top-right: a blue square
                    labeled 'B'. Bottom-left: a green triangle labeled 'C'.
                    Bottom-right: a yellow hexagon labeled 'D'. A black arrow
                    connects A to B to C to D in that order. Exactly four
                    labels, balanced grid, no other text.
                  output_format: png
                  complexity: low
                  quality: low
                  size: 1024x1024
                  'n': 1
              svgVector:
                summary: SVG vector icon
                description: >-
                  Keep the nested svg.model object; the response also contains
                  svg_usage
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A minimal flat vector icon of a rocket, exactly three solid
                    colors, geometric editable shapes, no text, no raster
                    texture, transparent background.
                  output_format: svg
                  svg:
                    model: gpt-5.6-terra
                  quality: low
                  size: 1024x1024
                  'n': 1
              gifAnimation:
                summary: Two-frame looping GIF
                description: >-
                  The finished file should contain 2 frames and last 0.2
                  seconds, not the default 9 frames
                value:
                  model: gpt-image-2.6-sunburst
                  prompt: >-
                    A minimal two-frame looping animation of a yellow circle
                    moving slightly right and returning to its starting position
                    on a plain white background, no text, seamless loop.
                  output_format: gif
                  quality: low
                  size: 512x512
                  frame_count: 2
                  frame_duration_ms: 100
                  'n': 1
      responses:
        '200':
          description: >-
            Generation succeeded; returns base64-encoded PNG, JPEG, WebP, SVG,
            or GIF
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Image26Response'
        '400':
          description: >-
            Invalid parameters, or the active route did not forward new fields
            such as svg.model
        '401':
          description: Unauthorized - invalid API Key
        '403':
          description: Content moderation block
        '429':
          description: Rate limit or insufficient quota
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
components:
  schemas:
    Image26Request:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Flare is optimized for fast iteration; Sunburst is intended for
            detailed visual work
          enum:
            - gpt-image-2.6-flare
            - gpt-image-2.6-sunburst
          default: gpt-image-2.6-sunburst
        prompt:
          type: string
          maxLength: 32000
          description: >-
            Prompt text in English or Chinese. For GIF, describe the subject,
            motion, and loop
          example: A minimal flat vector icon of a rocket, three solid colors, no text
        complexity:
          type: string
          description: >-
            Planning complexity before rendering, independent of quality.
            Official levels are low / medium / high, with high as the default
            when omitted. No separate fee
          enum:
            - low
            - medium
            - high
          default: high
        size:
          type: string
          description: >-
            Output size as a preset or a valid WIDTHxHEIGHT string. For GIF this
            is the size of each frame and both dimensions must be multiples of
            16; n × frame_count × frame pixels must fit the total pixel budget
            (sheet edge ≤3840, total ≤8,294,400, ≥655,360)
          example: 1024x1024
          default: auto
        quality:
          type: string
          description: >-
            Rendering quality, independent of complexity. For SVG, controls the
            reference image quality
          enum:
            - auto
            - low
            - medium
            - high
            - xhigh
            - max
          default: auto
        output_format:
          type: string
          description: >-
            Output format. SVG and GIF are generation-only and do not support
            edits, streaming, partial images, or output_compression
          enum:
            - png
            - jpeg
            - webp
            - svg
            - gif
          default: png
        output_compression:
          type: integer
          description: Compression level for jpeg / webp only; do not use with SVG or GIF
          minimum: 0
          maximum: 100
          example: 85
        background:
          type: string
          description: >-
            Background mode. transparent requires a compatible output format;
            JPEG does not support transparency
          enum:
            - auto
            - opaque
            - transparent
          default: auto
        moderation:
          type: string
          description: Moderation strength
          enum:
            - auto
            - low
          default: auto
        'n':
          type: integer
          description: Number of results. The examples and SVG output use 1
          enum:
            - 1
          default: 1
        svg:
          type: object
          description: >-
            SVG-specific configuration. The current upstream requires svg.model
            when output_format=svg
          properties:
            model:
              type: string
              description: >-
                Text model that authors the SVG vector code. Verified with
                gpt-5.6-terra, gpt-6-luna, and gpt-4.1-mini; test other models
                in your actual group. The example uses gpt-5.6-terra
              example: gpt-5.6-terra
              default: gpt-5.6-terra
          required:
            - model
        frame_count:
          type: integer
          description: >-
            GIF frame count. Official range: 2–16; default: 9. Only valid when
            output_format=gif. Out-of-range values fall back to the 9-frame
            default on the gateway. Sheet layout: 4×2 for 2–8 frames, 3×3 for 9,
            4×3 for 10–12, 4×4 for 13–16; max square frame is 960 / 816 / 720
          minimum: 2
          maximum: 16
          default: 9
          example: 2
        frame_duration_ms:
          type: integer
          description: >-
            Duration of each GIF frame in milliseconds, 20–2000, rounded to
            10ms; default 200. Only valid when output_format=gif
          minimum: 20
          maximum: 2000
          default: 200
          example: 100
    Image26Response:
      type: object
      properties:
        created:
          type: integer
          description: Unix timestamp
        background:
          type: string
          description: Effective background mode
          example: opaque
        data:
          type: array
          description: Generated results
          items:
            type: object
            properties:
              b64_json:
                type: string
                description: >-
                  Raw base64 without a data: prefix. Save using output_format;
                  SVG decodes to UTF-8 XML
              generation_id:
                type: string
                description: Generation ID, when provided
        output_format:
          type: string
          example: gif
        quality:
          type: string
          example: low
        size:
          type: string
          example: 512x512
        usage:
          $ref: '#/components/schemas/ImageUsage'
        svg_usage:
          $ref: '#/components/schemas/SvgUsage'
    ImageUsage:
      type: object
      description: Token usage for the image model
      properties:
        input_tokens:
          type: integer
          example: 59
        output_tokens:
          type: integer
          example: 555
        total_tokens:
          type: integer
          example: 614
        input_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
              example: 59
            image_tokens:
              type: integer
              example: 0
        output_tokens_details:
          type: object
          properties:
            text_tokens:
              type: integer
              example: 0
            image_tokens:
              type: integer
              example: 555
    SvgUsage:
      type: object
      description: >-
        Authoring-model usage returned for SVG output. The client selects the
        model through svg.model, and charges use that text model's input and
        output token rates. reasoning_tokens is already included in
        output_tokens and must not be added again
      properties:
        model:
          type: string
          example: gpt-5.6-terra
        input_tokens:
          type: integer
          example: 1572
        output_tokens:
          type: integer
          example: 850
        reasoning_tokens:
          type: integer
          example: 350
        total_tokens:
          type: integer
          example: 2422
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API Key obtained from the APIYI Console

````

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