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

> [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

### Cost and limitations

* The image model creates a reference image, then a text model authors the SVG. `usage` covers the reference image and `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.
* 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. 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–64, default 9 | More frames generally increase latency and cost |
| `frame_duration_ms` | 20–2000ms, default 200ms, rounded to 10ms | Total duration is approximately frame count multiplied by frame duration |
| `size` | `auto` or a valid WIDTHxHEIGHT | Size of each finished frame; frame count, frame size, and the total pixel budget must all fit |

GIF is generation-only and does not support streaming, partial images, custom `output_compression`, or `prompt_rewriter`. Do not use `frame_count` or `frame_duration_ms` with PNG, JPEG, WebP, or SVG.

### 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` or `prompt_rewriter`.

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 |
| 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)
* [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 and optionally frame_count and
    frame_duration_ms

    - 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. 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. The GIF
            example uses 512x512; frame count, frame size, and the total pixel
            budget must all fit
          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; the example uses
                gpt-5.6-terra from the model catalog
              example: gpt-5.6-terra
              default: gpt-5.6-terra
          required:
            - model
        frame_count:
          type: integer
          description: >-
            GIF frame count. Official documented range: 2–64; default: 9. Only
            valid when output_format=gif
          minimum: 2
          maximum: 64
          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. reasoning_tokens is
        already included in output_tokens and must not be added again
      properties:
        model:
          type: string
          example: gpt-5.6-sol
        input_tokens:
          type: integer
          example: 1572
        output_tokens:
          type: integer
          example: 1437
        reasoning_tokens:
          type: integer
          example: 994
        total_tokens:
          type: integer
          example: 3009
  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.