Image / GPT Image

GPT Image 2.6 Image Generation API

asOpenAI localized example text:Path, Request Bodyand OpenAIimages/generations, images/edits, can OpenAI SDK.with v2 endpointPOST /api/v2/open/aigc/gpt-image-2.6 (camelCase Request Body, localized example textgenType ), task and, use.

Overview

GPT Image 2.6 with Sunburst and Flare, Request and exactly identical, Request Bodymodel:modellocalized example textScenario
gpt-image-2.6-flare,, image,,,
gpt-image-2.6-sunburstand, image,

exactly identical, when inlocalized example textandqualitylocalized example text.Scenarioflare.

Capabilitylocalized example textRequestFormat
Text-to-Image / Image-to-ImagePOST /v1/images/generationsapplication/json
Image Editing (upload a file)POST /v1/images/editsmultipart/form-data
Query Tasklocalized example textGET /v1/images/generations/{taskId}—
  • supported Text-to-Image and Image-to-Image, 1 images image
  • Reference image images, ModelCapability
  • supported15 and 1K / 2K / 4K Resolution
  • -resolution each
  • default:task booking after Usually 1 seconds returntaskId, query image;async=false can as, Request OpenAI imageBase URL:https://mm-internal-cn.leonecloud.com

localized example text```http Authorization: Bearer YOUR_API_KEY


## Create Task

**POST** `/v1/images/generations`

`Content-Type: application/json`.defaultlocalized example text——task bookingafter Usually 1 seconds return`taskId`, etc. image.Requestimage when`async=false`, see below[localized example text](#-async-false).

### Text-to-Imagelocalized example text```bash
curl -X POST "https://mm-internal-cn.leonecloud.com/v1/images/generations" \
 -H "Authorization: Bearer YOUR_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{
 "model": "gpt-image-2.6-sunburst",
 "prompt": ",, and,",
 "size": "16:9",
 "resolution": "2k",
 "callback_url": "https://example.com/webhooks/image",
 "task_nickname": "autumn-fox"
 }'

localized example textmodel localized example textgpt-image-2.6-flare can, fieldexactly identical.

Image-to-Imagelocalized example textimage Image-to-Image.

{
 "model": "gpt-image-2.6-sunburst",
 "prompt": "Reference image in the subject,",
 "image": ["https://example.com/product.png"],
 "size": "1:1",
 "resolution": "1k"
}

Reference imagesupported can URL, supported Base64 data URI.

Image Editinglocalized example text**POST** /v1/images/edits

Content-Type: multipart/form-data.and, field and Meaningexactly identical, in image file, no URL or Base64.task bookingand query Methodexactly identical.

curl -X POST "https://mm-internal-cn.leonecloud.com/v1/images/edits" \
 -H "Authorization: Bearer YOUR_API_KEY" \
 -F "model=gpt-image-2.6-sunburst" \
 -F "prompt=localized example text" \
 -F "size=1024x1024" \
 -F "image=@/path/to/cat.png"

Request Parameters

ParameterTypeRequiredDefaultDescription
modelstringYes—gpt-image-2.6-sunburst orgpt-image-2.6-flare
promptstringYes—image, up to 20,000 characters.use Reference image when, subject and
imagestring[]No—input imagelist (URL or Base64 data URI),Image-to-Image
sizestringNo1:1, pixel string or1K / 2K / 4K, see below「and Resolution」
resolutionstringNo1kResolutionlocalized example text1k / 2k / 4k, size can.localized example text
nsfw_checkbooleanNo—Safety moderation toggle; takes precedence over extra_body.nsfw_checker when both are sent
asyncbooleanNotrue;false image and return OpenAI image
response_formatstringNourlonly async=false when:url orb64_json
extra_bodyobjectNo—Modelwith Parameter,{"nsfw_checker": true}
callback_urlstringNo—Callback notification URL after the task is complete
task_nicknamestringNo—Task label for business tracking
userstringNo—(OpenAI field)
Model1 images image (n as 1); supportedmask repainting; supportedbackground / moderation / output_format / output_compression, will;quality ( height quality).Mask,complexity, webp / gif / svg output or token,GPT Image 2.6 Official.

/v1/images/edits field and Meaning and exactly identical, inimage as file; can useimage_urls URL Reference image, and upload a file can.localized example textextra_body JSON characters.

and Resolutionsize supported1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 21:9, 9:21, 2:1, 1:2, 1:3, 3:1 15,1536x1024 pixel string or1K / 2K / 4K; If omitted orauto when1:1 localized example text.

size1K2K4K
1:11024×10242048×20482880×2880
16:91280×7202048×11523840×2160
9:16720×12801152×20482160×3840
4:31152×8642304×17283264×2448
3:4864×11521728×23042448×3264
3:21536×10242048×13603504×2336
2:31024×15361360×20482336×3504
5:41120×8962240×17923200×2560
4:5896×11201792×22402560×3200
21:91456×6242912×12483840×1648
9:21624×14561248×29121648×3840
2:11536×7683072×15363840×1920
1:2768×15361536×30721920×3840
1:3—688×20481280×3840
3:1—2048×6883840×1280

Resolutionasresolution > size localized example text.4K Resolution, width.

1:3 and3:1 provide 2K / 4K,1k will return ParameterError.

task booking(default)task:| Parameter | Type | Description | | --- | --- | --- | | code | int | Status Code, 0 indicates success | | msg | string | Message | | data.taskId | string | Task ID, used to query task status | | data.status | string | Task Status, task bookingwhen asprocessing | | data.createdAt | string | Created Time |

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20260509150000_abc12345",
 "status": "processing",
 "createdAt": "2026-05-09 15:00:00"
 }
}

Query Task

GET /v1/images/generations/{taskId}

/v1/images/generations and/v1/images/edits create task query.tasklocalized example textprocessing when recommendedsecondsPolling,success orfailed; can usecallback_url complete, Polling.

curl "https://mm-internal-cn.leonecloud.com/v1/images/generations/task_20260509150000_abc12345" \
 -H "Authorization: Bearer YOUR_API_KEY"
{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20260509150000_abc12345",
 "status": "success",
 "result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/images/2026/05/09/output_001.png"],
 "progress": 100,
 "createdAt": "2026-05-09 15:00:00",
 "updatedAt": "2026-05-09 15:00:25"
 }
}

(async=false)

as OpenAI image, can OpenAI SDK:```json
{
"created": 1778394000,
"data": [
{ "url": "https://.../output_001.png" }
]
}


localized example text`response_format=b64_json` when,`data` as`{"b64_json":"..."}`.

> 4K image when: when width 10 minutes; Scenariorecommended use default, when.

## localized example text`resolution` each;`sunburst` and`flare` localized example text.Reference imageinput.

| Resolutionlocalized example text| each Pricing|
| --- | --- |
| `1K` | $0.030 |
| `2K` | $0.050 |
| `4K` | $0.080 |

Create Taskwhen, taskSuccess after, Failure.and as.

## Errorlocalized example text**(default)**Error, HTTP Status Code as 200,`code`:| `code` | Description |
| --- | --- |
| 0 | Success |
| 10002 | Parametermissing or malformed / supported model (`size`, `resolution`, and`1:3`, `3:1` localized example text`1k`) |
| 10005 | API Key invalid or missing |
| 30003 | Task not found |
| 40001 | Insufficient balance, Create Taskwhen Failure, after|
| 90003 | Internal server error |

taskFailurewhen will,.

**(`async=false`)**OpenAI Error, and use HTTP Status Code:`400` ParameterError, `401` Failure,`402` Insufficient balance, `500` taskexecute Failure,`504` etc. exceeds 10 minutes not image (**tasknot**, `error.code` localized example text`taskId`, can query ).

## and GPT Image Model| Model | Billing Method | image| Scenario|
| --- | --- | --- | --- |
| `gpt-image-2.6-sunburst` / `-flare` ()| Resolution each| as, can| can|
| [GPT Image 2.6 Official](/docs/gpt-image-2-6-official) | token| localized example text| Mask,`complexity`, `webp` / `gif` / `svg`, any dimensions|
| [GPT Image 2.5](/docs/gpt-image-2-5) | Resolution each| as, can|, and exactly identical|

## v2 endpoint

v2 endpoint and task and, field as camelCase:| localized example text| v2 endpoint| (OpenAI )|
| --- | --- | --- |
| create Path| `POST /api/v2/open/aigc/gpt-image-2.6` | `POST /v1/images/generations` |
| query Path| `GET /api/v2/open/aigc/{taskId}` | `GET /v1/images/generations/{taskId}` |
| localized example text| Request Body `genType` (`sunburst` / `flare`) | `model` localized example text`-sunburst` / `-flare` |
| Reference imagefield | `imageUrls` | `image` |
| fieldlocalized example text| camelCase (`callbackUrl` / `taskNickname`) | OpenAI field (`callback_url` / `task_nickname`) |
| image| supported| supported (`async=false`) |
| OpenAI SDK localized example text| No | Yes |

v2 fieldDescription[GPT Image v2 endpoint](/docs/gpt-image-v2).
Updated 2026-11-19