> ## 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.5 Official Image Generation

> Async Sunburst and Flare image tasks through the official channel, with R2 delivery and token pricing at 80% of official rates

Access both GPT-Image-2.5 models through the official Azure 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.5-sunburst-official` |
| Flare Official | `gpt-image-2.5-flare-official` |

Use the full model name from this table. `gpt-image-2.5-official` is a series label, not a valid request model.

For mainland China, replace `https://api.toapis.com` 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 Query

Submit one Flare image. Change 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.5-flare-official",
    "prompt": "A small blue circle on a plain white background",
    "quality": "low",
    "size": "1024x1024",
    "n": 1
  }'
```

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

Save the `id` from the submission 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"
```

Submission returns `pending`. Polling may return `queued` or `in_progress`, followed by `completed` or `failed`. On `completed`, read the R2 image URLs from `result.data[].url`. On `failed`, read `error`. Poll the same task ID every few seconds. High-quality generation can take several minutes; keep polling instead of submitting duplicate requests. See the [image task status API](https://docs.toapis.com/docs/en/api-reference/tasks/image-status.md) for the complete response fields.

## Request Parameters

**Authorization** `string` *required*

Use a ToAPIs API Key as `Bearer YOUR_API_KEY`. Azure credentials are not required.

**model** `string` *required*

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

**prompt** `string` *required*

Describe the image. For reference-image requests, describe what to preserve and change.

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

Supports `auto`, `low`, `medium`, `high`, `xhigh`, and `max`. With `auto`, the upstream model selects the quality level for each request. Quality and dimensions affect actual token usage and processing time.

**size** `string` (default: 1024x1024)

Use pixel dimensions such as `1024x1024`, `1536x1024`, or `1024x1536`. Custom dimensions must pass upstream validation. These examples do not require an additional resolution field.

**background** `string`

Optional. Set `transparent` to request a transparent background. Omit it to use the upstream default. The default PNG output preserves transparency.

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

The official channel currently generates one image per request. Use `1`.

## Reference Image URLs

For image-to-image requests, add `image_urls` to the same JSON generation request. URLs must be accessible to the server. You can obtain URLs through the [image upload API](https://docs.toapis.com/docs/en/api-reference/uploads/images.md). Reference images incur image input token charges. Submission and polling use the same asynchronous flow.

```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.5-sunburst-official",
    "prompt": "Keep the subject and replace the background with a snowy forest",
    "image_urls": ["https://example.com/reference.png"],
    "quality": "high",
    "size": "1024x1024",
    "n": 1
  }'
```

## Token Pricing

Standard prices verified on 2026-09-11. Both official models are billed at 80% of official token rates, a 20% discount:

| Type | USD / 1,000,000 tokens |
| - | -: |
| Text input | 4.00 |
| Cached text input | 1.00 |
| Image input | 6.40 |
| Cached image input | 1.60 |
| Image output | 24.00 |

Quota is reserved at submission and reconciled against actual upstream text and image token usage on success. All six quality levels use these unit prices; there is no fixed per-image price for each quality. Sufficient account balance and API Key quota are required before submission.

Cost formula, in USD:

```text theme={null}
USD = (
  uncached_text_input_tokens * 4
  + cached_text_input_tokens * 1
  + uncached_image_input_tokens * 6.4
  + cached_image_input_tokens * 1.6
  + image_output_tokens * 24
) / 1,000,000
```

For example, 17 uncached text input tokens and 196 image output tokens cost `(17 * 4 + 196 * 24) / 1,000,000 = $0.004772`. This is not a fixed price per image.

Account-specific pricing or discounts still apply. Verify the final charge in usage logs. Current prices follow the [pricing page](https://toapis.com/pricing) and your account configuration.

## Related Models

The [standard tier](https://docs.toapis.com/docs/en/api-reference/images/gpt-image-2.5/generation.md) and [VIP tier](https://docs.toapis.com/docs/en/api-reference/images/gpt-image-2.5-vip/generation.md) have their own full model names. Use the `-official` suffix for the channel documented here.


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