asOpenAI localized example text:Path, Request Bodyand OpenAIimages/generations,images/edits, can OpenAI SDK.in use v2 endpoint (POST /api/v2/open/aigc/gpt-image-2.5, camelCase Request Body)localized example textGPT Image v2 endpoint.task and, can.
Overview
GPT Image 2.5 with Sunburst and Flare, Request and exactly identical, Request Bodymodel: | model | localized example text | Scenario |
|---|---|---|---|
gpt-image-2.5-flare | , | , image,,, | |
gpt-image-2.5-sunburst | localized example text | , image, |
exactly identical, when inlocalized example textandqualitylocalized example text.Scenarioflare.
| Capability | localized example text | RequestFormat |
|---|---|---|
| Text-to-Image / Image-to-Image | POST /v1/images/generations | application/json |
| Image Editing (upload a file) | POST /v1/images/edits | multipart/form-data |
| Query Tasklocalized example text | GET /v1/images/generations/{taskId} | — |
- supported Text-to-Image, Image-to-Image and Mask repainting
- supported up to 16 images Reference image, 1 images image
- supported 10and 1K / 2K / 4K Resolution
- -
resolutioneach, Pricing and GPT Image 2 exactly identical - default:task booking after Usually 1 seconds return
taskId, query image;async=falsecan 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.5-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.5-flare can, fieldexactly identical.
Image-to-Imagelocalized example textimage Image-to-Image.
{
"model": "gpt-image-2.5-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, up to 16 images.
repainting
Mask as alpha PNG,localized example textrepainting, dimensions and images Reference image.mask mustandimage localized example text.
{
"model": "gpt-image-2.5-sunburst",
"prompt": ",",
"image": ["https://example.com/cup.png"],
"mask": "https://example.com/cup-mask.png",
"size": "1:1",
"resolution": "1k"
}Image Editinglocalized example text**POST** /v1/images/edits
Content-Type: multipart/form-data.and, field and Meaningexactly identical, in image and Mask 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.5-sunburst" \
-F "prompt=localized example text" \
-F "size=1024x1024" \
-F "image=@/path/to/cat.png"Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | gpt-image-2.5-sunburst orgpt-image-2.5-flare |
prompt | string | Yes | — | image, up to 20,000 characters.use Reference image when, subject and |
image | string[] | No | — | input imagelist (URL or Base64 data URI),Image-to-Image, up to 16 images |
mask | string | No | — | Maskimage, andimage use, repainting |
size | string | No | 1:1 | , pixel string or1K / 2K / 4K, see below「and Resolution」 |
resolution | string | No | 1k | Resolutionlocalized example text1k / 2k / 4k, size can.localized example text |
nsfw_check | boolean | No | — | Safety moderation toggle; takes precedence over extra_body.nsfw_checker when both are sent |
async | boolean | No | true | ;false image and return OpenAI image |
response_format | string | No | url | only async=false when:url orb64_json |
extra_body | object | No | — | Modelwith Parameter,{"nsfw_checker": true} |
callback_url | string | No | — | Callback notification URL after the task is complete |
task_nickname | string | No | — | Task label for business tracking |
user | string | No | — | (OpenAI field) |
Model1 images image (nas 1), Reference imageup to 16 images; supportedbackground/moderation/output_format/output_compression, will;quality( height quality).ParameterGPT Image 2.5 Official.
/v1/images/edits field and Meaning and exactly identical, inimage andmask as file; can useimage_urls URL Reference image,mask_url URL provide Mask, 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 10,1536x1024 pixel string or1K / 2K / 4K; If omitted orauto when1:1 localized example text.
size | 1K | 2K | 4K |
|---|---|---|---|
1:1 | 1024×1024 | 2048×2048 | 2880×2880 |
3:2 | 1536×1024 | 2048×1360 | 3520×2336 |
2:3 | 1024×1536 | 1360×2048 | 2336×3520 |
16:9 | 1536×864 | 2048×1152 | 3840×2160 |
9:16 | 864×1536 | 1152×2048 | 2160×3840 |
Resolutionasresolution > size localized example text.4K Resolution, width.
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, and GPT Image 2;`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`, Reference image exceeds 16 images )|
| 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 ).
## v2 endpoint| localized example text| v2 endpoint| (OpenAI )|
| --- | --- | --- |
| create Path| `POST /api/v2/open/aigc/gpt-image-2.5` | `POST /v1/images/generations` |
| query Path| `GET /api/v2/open/aigc/{taskId}` | `GET /v1/images/generations/{taskId}` |
| localized example text| Request Body `genType` | `model` localized example text`-sunburst` / `-flare` |
| fieldlocalized example text| camelCase (`imageUrls` / `maskUrl` / `callbackUrl`) | OpenAI field (`image` / `mask` / `callback_url`) |
| image| supported| supported (`async=false`) |
| OpenAI SDK localized example text| No | Yes |
v2 endpoint can use, task and.v2 fieldDescription[GPT Image v2 endpoint](/docs/gpt-image-v2).