gpt-image-2-pro Image Generation API
gpt-image-2-pro
gpt-image-2-pro Image Generation API
Use POST /v1/images/generations to call the high-resolution image generation entry for gpt-image-2-pro.
POST
gpt-image-2-pro Image Generation API
gpt-image-2-pro Image Generation API
gpt-image-2-pro shares the unified image generation endpoint with gpt-image-2, but additionally exposes 2K and 4K high-resolution tiers, making it suitable for scenarios that require larger canvases and higher output sizes.
- The unified endpoint is
POST /v1/images/generations. - Select the target model with
model = "gpt-image-2-pro". - In addition to the base sizes,
2Kand4Khigh-resolution tiers are also available. - Supports both
urlandb64_jsonresponse formats. - You can include
imagein JSON as a reference image; whether it takes effect depends on the actual image channel that is hit.
Method and Path
Request Example
Response Example
Authentication
Body
Must be passed as
gpt-image-2-pro.Generation prompt. For text-to-image use cases, this should be treated as required.
Number of images to generate. If omitted or explicitly set to
0, the unified layer falls back to 1.Output size. In addition to the base tiers, high-resolution extended tiers are also supported.
Optional reference image input. Common formats are a Base64 string or a Base64 array.
Response format, common values are
url and b64_json.Quality field. Whether it truly takes effect depends on the final channel that is hit.
Style field, passed through unchanged to supported upstreams.
Background control field, passed through unchanged to supported upstreams.
Explicit watermark switch.
false is semantically different from omitting it.High-Resolution Tiers
2K Extended Tiers
| Preset | Actual Target Size |
|---|---|
1:1(2K) | 2048x2048 |
4:3(2K) | 2048x1536 |
3:2(2K) | 2560x1712 |
2:3(2K) | 1712x2560 |
16:9(2K) | 2048x1152 |
9:16(2K) | 1152x2048 |
4K Extended Tiers
| Preset | Actual Target Size |
|---|---|
1:1(4K) | 2880x2880 |
4:3(4K) | 3840x2880 |
3:2(4K) | 3840x2560 |
2:3(4K) | 2560x3840 |
16:9(4K) | 3840x2160 |
9:16(4K) | 2160x3840 |
These high-resolution tiers reflect the target sizes exposed by the plugin side. If the upstream does not natively accept the corresponding size, the gateway or plugin may fall back to the closest official size and append the aspect ratio intent to the prompt.
Response
Generation timestamp.
The image URL returned when
response_format = url.The image Base64 data returned when
response_format = b64_json.Some upstreams rewrite the prompt and return it in this field.