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

# GPT Image 2.6

> Generate and edit images with GPT Image 2.6 Sunburst and Flare through the AnyFast Image API.

GPT Image 2.6 is OpenAI's image generation and editing model family. AnyFast exposes both models through the Image API:

| Model ID | Best for |
| - | - |
| `gpt-image-2.6-sunburst` | Precise image editing and high-quality final assets |
| `gpt-image-2.6-flare` | Fast, high-quality everyday image generation |

Both models accept text and image inputs and return images. Use `POST /v1/images/generations` to create an image from text, or `POST /v1/images/edits` to edit one or more uploaded images.

## What changed in GPT Image 2.6

* **Two specialized modes** — Sunburst is for detailed visual work and Flare is for fast iteration.
* **Complexity control** — Set `complexity` to `low`, `medium`, or `high` to control planning effort independently of rendering `quality`; omitted values use `high`.
* **Markup-guided edits** — The model family supports annotation layers that point to the region to change.
* **Expanded image outputs** — OpenAI documents SVG and animated GIF generation for GPT Image 2.6. The output controls below show the corresponding request fields.
* **Usage accounting** — AnyFast responses include input and output image token counts under `usage`.

## Key capabilities

* **Text-to-image** — Generate an image from a natural-language prompt
* **Image editing** — Apply broad or localized edits to uploaded images
* **Flexible dimensions** — Use recommended sizes or valid custom `WIDTHxHEIGHT` dimensions up to 4K
* **Expanded quality controls** — Select `low`, `medium`, `high`, `xhigh`, `max`, or `auto`
* **Planning complexity** — Select `low`, `medium`, or `high` independently of rendering quality
* **Transparent output** — Request a transparent background with PNG or WebP output
* **Multiple outputs** — Use `n` to request more than one result in one generation request

> [tab] Generate images
>
> Send a JSON request to `POST /v1/images/generations`. Choose Sunburst for maximum editing and rendering precision, or Flare when latency matters more.
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/generations \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "model": "gpt-image-2.6-flare",
>     "prompt": "A clean editorial product photograph of a translucent green glass bottle on pale stone, soft morning light",
>     "size": "1536x1024",
>     "quality": "high",
>     "complexity": "medium",
>     "background": "opaque",
>     "output_format": "jpeg",
>     "output_compression": 85,
>     "safety_identifier": "user-123",
>     "n": 1
>   }'
> ```
>
> ## Official usage examples
>
> The following images are from OpenAI's official GPT Image 2.6 guides. They show how the same prompt can respond to different planning complexity settings and how a reference image can be turned into a transparent product cutout.
>
> ### Compare planning complexity
>
> OpenAI uses the same paper-cut football prompt at low, medium, and high complexity with Sunburst. The examples illustrate how planning complexity can change the composition and level of detail.
>
> ![Paper-cut football scene generated with low complexity](https://developers.openai.com/images/platform/guides/image-prompting/paper-cut-football-effort-low-gpt-image-2-6-sunburst.webp)
>
> Low complexity — OpenAI official example
>
> ![Paper-cut football scene generated with medium complexity](https://developers.openai.com/images/platform/guides/image-prompting/paper-cut-football-effort-medium-gpt-image-2-6-sunburst.webp)
>
> Medium complexity — OpenAI official example
>
> ![Paper-cut football scene generated with high complexity](https://developers.openai.com/images/platform/guides/image-prompting/paper-cut-football-effort-high-gpt-image-2-6-sunburst.webp)
>
> High complexity — OpenAI official example
>
> ### Create a transparent product cutout
>
> This official example uses a shampoo photograph as the input and requests a transparent PNG output. OpenAI shows the result from both Flare and Sunburst.
>
> ![Shampoo product photograph used as the input image](https://developers.openai.com/images/platform/guides/image-prompting/shampoo.webp)
>
> Input — OpenAI official example
>
> ![Shampoo bottle isolated on a transparent background with GPT Image 2.6 Flare](https://developers.openai.com/images/platform/guides/image-prompting/extract-product-gpt-image-2-6-flare.webp)
>
> Flare output — OpenAI official example
>
> ![Shampoo bottle isolated on a transparent background with GPT Image 2.6 Sunburst](https://developers.openai.com/images/platform/guides/image-prompting/extract-product-gpt-image-2-6-sunburst.webp)
>
> Sunburst output — OpenAI official example
>
> > [!NOTE]
> >
> > These are official OpenAI usage references. See the [OpenAI image generation guide](https://developers.openai.com/api/docs/guides/image-generation) and [GPT Image 2.6 prompting guide](https://developers.openai.com/api/docs/guides/image-prompting?model=gpt-image-2.6) for the prompts and settings.

> [tab] Edit images
>
> Send a JSON request with `images` references or a multipart file upload to `POST /v1/images/edits`. Use Sunburst when the workflow depends on precise preservation or targeted edits.
>
> ```bash JSON image URL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/edits \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "model": "gpt-image-2.6-sunburst",
>     "images": [
>       {"image_url": "https://example.com/product.png"}
>     ],
>     "prompt": "Keep the product unchanged and replace the background with a warm studio gradient",
>     "size": "1536x1024",
>     "quality": "xhigh",
>     "complexity": "high",
>     "output_format": "png"
>   }'
> ```
>
> ```bash Multipart file upload theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/v1/images/edits \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --form 'model=gpt-image-2.6-sunburst' \
>   --form 'image[]=@/path/to/product.png' \
>   --form 'prompt=Keep the product unchanged and replace the background with a warm studio gradient' \
>   --form 'size=1536x1024' \
>   --form 'quality=xhigh' \
>   --form 'output_format=png'
> ```

## Output controls

| Parameter | Values | Notes |
| - | - | - |
| `quality` | `low`, `medium`, `high`, `xhigh`, `max`, `auto` | Defaults to `auto`; higher settings generally increase detail, latency, and token use |
| `size` | `auto` or `WIDTHxHEIGHT` | Recommended sizes include `1024x1024`, `1536x1024`, and `1024x1536` |
| `background` | `auto`, `opaque`, `transparent` | Transparent output requires `png` or `webp` |
| `output_format` | `png`, `jpeg`, `webp`, `gif` | Defaults to `png`; GIF requests also require `frame_count` and `frame_duration_ms` |
| `frame_count` | `2`–`16` | GIF only; defaults to `9` and must fit the total pixel budget |
| `frame_duration_ms` | `20`–`2000` | GIF only; defaults to `200` and rounds to 10 ms |
| `output_compression` | `0`–`100` | Applies to JPEG and WebP output |
| `moderation` | `auto`, `low` | Defaults to `auto` |
| `complexity` | `low`, `medium`, `high` | Defaults to `high`; controls planning effort independently of rendering quality |
| `safety_identifier` | String up to 128 characters | Optional stable, privacy-preserving end-user identifier |

## Animated GIF output

Each frame must fit the total pixel budget; `1024x1024` exceeds the budget at the default 9 frames, so use `1024x768` or reduce the frame count.

```bash GIF generation theme={null}
curl --request POST \
  --url https://www.anyfast.ai/v1/images/generations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A gently waving flag icon with a seamless loop",
    "size": "1024x768",
    "quality": "low",
    "complexity": "low",
    "output_format": "gif",
    "frame_count": 2,
    "frame_duration_ms": 200,
    "n": 1
  }'
```

### Custom size rules

Custom dimensions must satisfy all of the following requirements:

* Width and height are multiples of 16 pixels.
* The aspect ratio is between `1:3` and `3:1`.
* Neither edge exceeds 3,840 pixels.
* Total pixels are between 655,360 and 8,294,400.
* Resolutions above `2560x1440` are experimental.

## Image editing inputs

* For JSON requests, pass up to 16 objects in `images`. Each object uses `file_id` for an uploaded File API asset or `image_url` for a fully qualified URL or Base64-encoded data URL.
* `images[].image_url` uses URI format and has a maximum length of `20,971,520` characters.
* For multipart requests, upload a single source image with `image`, or up to 16 source images with `image[]`.
* Do not combine JSON `images` references with multipart `image` or `image[]` fields.
* An optional mask must have an alpha channel and match the first source image's format and dimensions.
* The source image and mask must each be smaller than 50 MB.

## Response handling

GPT Image models return image data in `data[].b64_json`. Each result may also include `data[].revised_prompt`; AnyFast returns token accounting in `usage`. Decode the Base64 value and save it using the extension reported by `output_format`; save GIF results with a `.gif` extension. The `response_format` parameter used by DALL·E models does not apply to GPT Image 2.6.

```bash Decode the first result theme={null}
echo "$RESPONSE" | jq -r '.data[0].b64_json' | base64 --decode > result.png
```

> [!NOTE]
>
> The upstream OpenAI API also lets supported mainline models call GPT Image 2.6 through the Responses API image-generation tool. This page documents the direct AnyFast Image API endpoints.

See the [OpenAI image generation guide](https://developers.openai.com/api/docs/guides/image-generation), [Create image API](https://developers.openai.com/api/reference/resources/images/methods/generate), [Create image edit API](https://developers.openai.com/api/reference/resources/images/methods/edit), [Sunburst model page](https://developers.openai.com/api/docs/models/gpt-image-2.6-sunburst), and [Flare model page](https://developers.openai.com/api/docs/models/gpt-image-2.6-flare) for the upstream model specification.

> [card] [GPT Image 2.6 API Reference](https://docs.anyfast.ai/api-reference/model-api/openai/gpt-image-2-6.md)
>
> View generation and editing request fields, response fields, and usage accounting.


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