Image / GPT Image

GPT Image 2.5 Image Generation API

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:modellocalized example textScenario
gpt-image-2.5-flare,, image,,,
gpt-image-2.5-sunburstlocalized example text, 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, Image-to-Image and Mask repainting
  • supported up to 16 images Reference image, 1 images image
  • supported 10and 1K / 2K / 4K Resolution
  • -resolution each, Pricing and GPT Image 2 exactly identical
  • 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.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

ParameterTypeRequiredDefaultDescription
modelstringYes—gpt-image-2.5-sunburst orgpt-image-2.5-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, up to 16 images
maskstringNo—Maskimage, andimage use, repainting
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), 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.

size1K2K4K
1:11024×10242048×20482880×2880
3:21536×10242048×13603520×2336
2:31024×15361360×20482336×3520
16:91536×8642048×11523840×2160
9:16864×15361152×20482160×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).
Updated 2026-10-23