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

# GPT-Image-2.6 Official Image Generation

> Async Sunburst and Flare image tasks through the official channel, with markup-guided editing, GIF and SVG output, R2 delivery and token pricing

Access both GPT-Image-2.6 models through the official channel. Submission returns an asynchronous task ID immediately. Images are generated in the background and stored in R2 before delivery.

| Model | model |
| - | - |
| Sunburst Official | `gpt-image-2.6-sunburst-official` |
| Flare Official | `gpt-image-2.6-flare-official` |

You must use the full model name from the table. `gpt-image-2.6-official` is only the series name and cannot be used as `model`.

Users in mainland China can replace `https://api.toapis.com` in the examples with `https://api.toapis.cn`. Create an API Key in the [console](https://toapis.com/console/token) and set the `TOAPIS_API_KEY` environment variable.

## Submit and poll

Submit a Flare image. Swap `model` to call Sunburst:

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A small blue circle on a plain white background",
    "size": "1:1",
    "resolution": "1k",
    "quality": "medium",
    "n": 1
  }'
```

```json theme={null}
{
  "id": "tsk_img_example",
  "object": "generation.task",
  "model": "gpt-image-2.6-flare-official",
  "status": "pending",
  "progress": 0,
  "created_at": 1789099098,
  "metadata": {}
}
```

Keep the `id` from the submit response and replace `TASK_ID` below:

```bash theme={null}
curl --fail-with-body \
  --url https://api.toapis.com/v1/images/generations/TASK_ID \
  --header "Authorization: Bearer $TOAPIS_API_KEY"
```

The submit response is `pending`. Polling may show `queued` or `in_progress`, ending in `completed` or `failed`. On `completed` read the R2-delivered result URL from `result.data[].url`; on `failed` read `error`. Poll the same task ID every few seconds; high-quality generation can take several minutes, so do not resubmit while waiting. See the [image task status API](https://docs.toapis.com/docs/en/api-reference/tasks/image-status.md) for all fields.

## Request parameters

**Authorization** `string` *required*

Use a ToAPIs API Key in the form `Bearer YOUR_API_KEY`.

**model** `string` *required*

`gpt-image-2.6-sunburst-official` / `gpt-image-2.6-flare-official`.

**prompt** `string` *required*

Image description. With reference or markup images, describe what to keep and what to change.

**size** `string` (default: auto)

Aspect-ratio names (such as `1:1`, `3:2`, `2:3`, `16:9`, `9:16`) or pixel sizes (such as `1024x1024`, `1536x1024`). For GIF output see the GIF section for size semantics. Pixel dimensions must be multiples of 16 on both sides (minimum 16), each side must not exceed 3840, and the long-to-short side ratio must not exceed 3:1; sizes beyond 2560x1440 are experimental.

**resolution** `string`

Resolution tier `1k` / `2k` / `4k`. When set explicitly it takes precedence over the tier inferred from `size`. The tier affects actual token usage and latency.

**quality** `string` (default: medium)

Six tiers: `auto`, `low`, `medium`, `high`, `xhigh`, `max`. `auto` lets the model pick the tier per request. Quality affects actual token usage and latency.

**n** `integer` (default: 1)

Generates 1 to 4 images per request. `n` must be `1` when `output_format` is `svg`.

**output\_format** `string`

Output format `png` / `jpeg` / `webp` / `gif` / `svg`. Uses the upstream default when omitted. See the GIF and SVG sections for their extra parameters and restrictions.

**output\_compression** `integer`

Compression level 0-100, applies to `jpeg` and `webp` output only.

**background** `string`

`transparent` / `opaque` / `auto`. Explicit transparency only applies to `png` / `webp` output; `svg` is transparent by default.

**moderation** `string`

Content moderation level `auto` / `low`.

**complexity** `string`

Generation complexity `low` / `medium` / `high`; defaults to `high` when omitted. Not billed separately.

## Reference images and masks

For image-to-image editing, add `image_urls` to the same JSON request, up to 16 images. URLs must be reachable by the server. You can get URLs through the [image upload API](https://docs.toapis.com/docs/en/api-reference/uploads/images.md) first. Reference images are billed as image input tokens.

`mask_url` points to a PNG alpha mask whose size must match the first reference image, and it requires `image_urls`.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-sunburst-official",
    "prompt": "Keep the subject and replace the masked area with a snowy forest",
    "image_urls": ["https://example.com/reference.png"],
    "mask_url": "https://example.com/mask.png",
    "quality": "high",
    "size": "1024x1024",
    "n": 1
  }'
```

## Markup-guided editing

`markup_url` points to an annotated reference image (or pass an inline annotation object via `markup`). Together with `image_urls` for the source image, the model edits according to the annotations. `markup_url` and `mask_url` are mutually exclusive; each request can use only one.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-sunburst-official",
    "prompt": "Follow the markup annotations to adjust the layout",
    "image_urls": ["https://example.com/reference.png"],
    "markup_url": "https://example.com/markup.png",
    "quality": "high",
    "n": 1
  }'
```

## GIF output

Set `output_format` to `gif` to generate an animation. `frame_count` sets the frame count (2-16) and `frame_duration_ms` sets the per-frame duration. GIF is text-to-image only and cannot be combined with `image_urls`, `mask_url`, `markup_url`, `markup`, or `output_compression`. Pass `size` as an exact pixel size (for example `512x512`) or omit it to use the upstream default frame dimensions; aspect-ratio values such as `1:1` are rejected for GIF.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A paper airplane looping across a blue sky, flat illustration",
    "output_format": "gif",
    "frame_count": 8,
    "frame_duration_ms": 200,
    "size": "512x512",
    "n": 1
  }'
```

## SVG output

Set `output_format` to `svg` to generate vector graphics. You must also pass the `svg` object with `svg.model` inside. SVG is text-to-image only, `n` must be `1`, and it cannot be combined with `image_urls`, `mask_url`, `markup_url`, `markup`, or `output_compression`. SVG generation additionally invokes the text model named by `svg.model` and bills that call at the corresponding text-model rate.

```bash theme={null}
curl --fail-with-body --request POST \
  --url https://api.toapis.com/v1/images/generations \
  --header "Authorization: Bearer $TOAPIS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-image-2.6-flare-official",
    "prompt": "A minimalist mountain logo, flat vector style",
    "output_format": "svg",
    "svg": { "model": "gpt-5" },
    "n": 1
  }'
```

## Token pricing

Both official models bill per token category: text input, cached text input, image input, cached image input, and image output are priced separately. Quota is reserved on submission, then settled against actual token usage with refunds or top-ups.

Cost formula in USD:

```text theme={null}
USD = (
  uncached_text_input_tokens * text_input_price
  + cached_text_input_tokens * cached_text_input_price
  + uncached_image_input_tokens * image_input_price
  + cached_image_input_tokens * cached_image_input_price
  + image_output_tokens * image_output_price
) / 1,000,000
```

GIF is billed on the output tokens of the whole animation. SVG output additionally produces one text-model call at the `svg.model` rate on top of image tokens.

Account-specific pricing or discounts still apply. Final charges can be verified in usage logs; the latest prices are on the [pricing page](https://toapis.com/pricing) and in your account configuration.

## Related models

[GPT-Image-2.5 Official](https://docs.toapis.com/docs/en/api-reference/images/gpt-image-2.5-official/generation.md), [standard](https://docs.toapis.com/docs/en/api-reference/images/gpt-image-2.5/generation.md), and [VIP](../gpt-image-2.5-vip/generation) editions use their own full model names. Use the `-official` suffix when calling this official channel.


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