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

# GPT-Image-2.5 Ext Image Generation

>  - Use gpt-image-2.5-ext and select Flare or Sunburst with version
- Asynchronous processing: query results using the task ID after submission
- Supports text-to-image and image-to-image with up to 16 reference images
- Supports 10 aspect ratios and auto, with 1K / 2K / 4K resolution tiers
- Generate 1–4 images per request, billed by version, resolution, and the number of images actually delivered 

```bash cURL theme={null}
# Create once per new generation operation; keep the original value when retrying.
IDEMPOTENCY_KEY="$(uuidgen)"

curl --request POST \
  --url https://gccai.heqingsong.uk/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-GccAi-Response-Version: 2026-07-27' \
  --header "Idempotency-Key: ${IDEMPOTENCY_KEY}" \
  --data '{
    "model": "gpt-image-2.5-ext",
    "version": "flare",
    "prompt": "A cozy reading nook beside a window on a rainy day, a warm table lamp, cinematic lighting",
    "size": "1:1",
    "resolution": "1K",
    "n": 1
  }'
```

```python Python theme={null}
import uuid
import requests

# Create once per new generation operation; reuse the original headers and payload when retrying.
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json",
    "X-GccAi-Response-Version": "2026-07-27",
    "Idempotency-Key": str(uuid.uuid4()),
}
payload = {
    "model": "gpt-image-2.5-ext",
    "version": "flare",
    "prompt": "A cozy reading nook beside a window on a rainy day, a warm table lamp, cinematic lighting",
    "size": "1:1",
    "resolution": "1K",
    "n": 1,
}

response = requests.post(
    "https://gccai.heqingsong.uk/v1/images/generations",
    headers=headers,
    json=payload,
)

print(response.status_code, response.json())
```

```javascript JavaScript theme={null}
// Create once per new generation operation; reuse the original headers and body when retrying.
const headers = {
  Authorization: "Bearer <token>",
  "Content-Type": "application/json",
  "X-GccAi-Response-Version": "2026-07-27",
  "Idempotency-Key": crypto.randomUUID(),
};
const body = JSON.stringify({
  model: "gpt-image-2.5-ext",
  version: "flare",
  prompt: "A cozy reading nook beside a window on a rainy day, a warm table lamp, cinematic lighting",
  size: "1:1",
  resolution: "1K",
  n: 1,
});

const response = await fetch(
  "https://gccai.heqingsong.uk/v1/images/generations",
  { method: "POST", headers, body },
);

console.log(response.status, await response.json());
```

```json 202 theme={null}
{
  "code": 202,
  "request_id": "req_example",
  "data": {
    "id": "task_01EXAMPLE",
    "object": "generation.task",
    "type": "image",
    "status": "pending",
    "progress": 0,
    "poll_url": "/v1/tasks/task_01EXAMPLE"
  }
}
```

```json 200 theme={null}
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01EXAMPLE"
    }
  ]
}
```

```json 400 theme={null}
{
  "error": {
    "message": "n must be an integer between 1 and 4",
    "type": "invalid_request_error",
    "param": "",
    "code": "invalid_request_error"
  }
}
```

## Authentication and headers

**Authorization** `string` *required*

The generation and task query endpoints use a platform API Key for Bearer Token authentication. Get a key from the [API Key management page](https://gccai.heqingsong.uk/keys).

```
Authorization: Bearer YOUR_API_KEY
```

Query the task using an API Key belonging to the same platform user.

**Content-Type** `string` *required*

Use `application/json` for submission. Both text-to-image and image-to-image use a JSON request body.

## Version selection

| Display name | `model` | `version` |
| - | - | - |
| Flare (default) | `gpt-image-2.5-ext` | `flare` |
| Sunburst | `gpt-image-2.5-ext` | `sunburst` |

## Request parameters

**model** `string` *required*

Fixed value: `gpt-image-2.5-ext`.

**version** `string` (default: flare)

Model version. Options: `flare`, `sunburst`.

**prompt** `string` *required*

The prompt for image generation or editing. It must not be empty after trimming leading and trailing whitespace.

For image-to-image, describe what to preserve and what to change in the reference images.

**resolution** `string` (default: 1K)

Output resolution tier. Options: `1K`, `2K`, `4K`.

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

Output aspect ratio. Choose `auto` or one of the following 10 ratios:

`1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `5:4`, `4:5`, `21:9`.

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

The number of images to generate per request. Must be an integer from `1` to `4`.

**image\_urls** `string[]`

An array of up to `16` reference images. Omit reference images for text-to-image; include them for image-to-image. Reference images incur no additional charge.

Supported input formats:

* Accessible image URLs
* Data URL: `data:image/...;base64,...`

## Usage examples

The following are JSON request bodies for `POST /v1/images/generations`. Use the authentication and recommended headers described above. Replace the reference image placeholders with real, accessible image URLs.

### Text-to-image

```json theme={null}
{
  "model": "gpt-image-2.5-ext",
  "version": "flare",
  "prompt": "A sky garden in a futuristic city, early morning mist, architectural photography",
  "size": "16:9",
  "resolution": "2K",
  "n": 1
}
```

### Image-to-image with Sunburst

```json theme={null}
{
  "model": "gpt-image-2.5-ext",
  "version": "sunburst",
  "prompt": "Preserve the product and packaging text, replace the background with a soft off-white studio setting, and add a natural cast shadow",
  "size": "1:1",
  "resolution": "2K",
  "n": 1,
  "image_urls": [
    "https://example.com/product.png"
  ]
}
```

### Multiple reference images and outputs

```json theme={null}
{
  "model": "gpt-image-2.5-ext",
  "version": "sunburst",
  "prompt": "Use the product in the first image as the subject, take inspiration from the setting in the second image, and create a landscape advertisement",
  "size": "16:9",
  "resolution": "2K",
  "n": 2,
  "image_urls": [
    "https://example.com/product.png",
    "https://example.com/set.jpg"
  ]
}
```

### Automatic aspect ratio and 4K resolution

```json theme={null}
{
  "model": "gpt-image-2.5-ext",
  "version": "flare",
  "prompt": "A minimalist key visual for a product launch, choosing a suitable aspect ratio based on the image content",
  "size": "auto",
  "resolution": "4K",
  "n": 1
}
```

## Query task results

Use the task ID to call the [task query endpoint](https://gccai.heqingsong.uk/en/api-reference/tasks/status.md):

```bash theme={null}
curl --request GET \
  --url https://gccai.heqingsong.uk/v1/tasks/task_01EXAMPLE \
  --header 'Authorization: Bearer <token>'
```

### Successful task

The task ID, timestamps, URLs, and amounts below illustrate the response structure only. They do not represent a real task or actual prices.

```json theme={null}
{
  "code": 200,
  "data": {
    "id": "task_01EXAMPLE",
    "status": "completed",
    "progress": 100,
    "created": 1788912000,
    "completed": 1788912045,
    "actual_time": 45,
    "estimated_time": 300,
    "cost": 0.2,
    "credits_cost": 2,
    "result": {
      "images": [
        {
          "url": [
            "https://example.com/output-1.png",
            "https://example.com/output-2.png"
          ],
          "expires_at": 1788998445
        }
      ]
    }
  }
}
```

## Response

**code** `integer`

Response status code. A successful submission in the unified format returns `200`.

**request\_id** `string`

The identifier for this request, used for troubleshooting.

**data** `object`

The accepted asynchronous task.

**Task fields**

**id** `string`

The unique task identifier, used to query task status and image results.

**object** `string`

Object type. The value is `generation.task`.

**type** `string`

Task type. The value is `image`.

**status** `string`

The initial status is `pending`, indicating that the task has been accepted.

**progress** `integer`

Current progress, initially `0`.

**poll\_url** `string`

The relative path for querying the task, such as `/v1/tasks/task_01EXAMPLE`.


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