GPT Image 2.5 sizes: fix invalid dimensions and request 4K
Validate GPT Image 2.5 dimensions before calling the API. Check 1080x1920, exact 9:16 alternatives, 4K limits and generation versus export sizes.
GPT Image 2.5 custom dimensions must satisfy all the documented limits, not just the requested aspect ratio. Both edges must be divisible by 16, neither edge can exceed 3840 pixels, the long-to-short edge ratio cannot exceed 3:1, and the image must contain 655,360–8,294,400 pixels. These checks explain why a familiar delivery size such as 1080x1920 is not a valid generation size.
This guide applies to gpt-image-2.5-flare and gpt-image-2.5-sunburst through the OpenAI API. It follows the official size and quality options, checked September 9, 2026. A gateway or application can expose a narrower set of sizes.
Which common sizes pass the rules?
| Requested size | Rule result | Reason or use |
|---|---|---|
1024x1024 | Pass | Square; also an official recommended size |
1536x1024 | Pass | Landscape; official recommended size |
1024x1536 | Pass | Portrait; official recommended size |
1080x1920 | Fail | Width is not divisible by 16 |
1152x2048 | Pass | Exact 9:16 portrait alternative |
1024x1824 | Pass | Approximately 9:16, not exactly 9:16 |
3840x2160 | Pass; experimental resolution | Exactly the maximum documented pixel count |
4096x2160 | Fail | An edge exceeds 3840 pixels; pixel count also exceeds the limit |
512x512 | Fail | Below the minimum total pixel count |
3072x1024 | Pass | Exactly the maximum 3:1 ratio |
“Pass” means the dimensions satisfy the rules; it is not a live API test result. The table was checked with the local validator below. Use an explicit size when testing dimensions. With auto, the service chooses dimensions, which makes a controlled size comparison harder.
Check dimensions locally before sending a request
Save this as check_size.py. It has no third-party dependencies and makes no network calls:
import re
import sys
def size_errors(value):
if not re.fullmatch(r"[0-9]+x[0-9]+", value):
return ["Use WIDTHxHEIGHT with a lowercase x"]
width, height = map(int, value.split("x"))
if width <= 0 or height <= 0:
return ["Both dimensions must be positive"]
errors = []
if width % 16 or height % 16:
errors.append("Both edges must be divisible by 16")
if max(width, height) > 3840:
errors.append("Neither edge may exceed 3840")
if max(width, height) > 3 * min(width, height):
errors.append("The aspect ratio must not exceed 3:1")
if not 655360 <= width * height <= 8294400:
errors.append("Pixel count must be 655360 through 8294400")
return errors
if __name__ == "__main__":
value = sys.argv[1] if len(sys.argv) > 1 else "1080x1920"
errors = size_errors(value)
print("; ".join(errors) if errors else "Passes dimension rules")
raise SystemExit(1 if errors else 0)
Run python check_size.py 1152x2048 to check an exact portrait ratio. A nonzero exit status is useful for rejecting invalid dimensions in a workflow before it reaches the generation step. Keep authentication and quota checks separate: this script cannot validate them.
How to request 4K without overpromising
3840x2160 is 8,294,400 pixels and a 16:9 frame. It passes the custom-size rules, but OpenAI marks resolutions above 2560x1440 as experimental. Do not turn that into a claim that every 4K request succeeds or that every output contains more useful detail than a smaller image.
Using the API guide’s generation example, change size to 3840x2160 and record the actual result dimensions, model, quality setting and usage. If you compare models, keep those settings consistent. The Flare and Sunburst comparison explains their intended uses; the pricing guide explains why dimensions alone do not give you the final bill.
Generate at one size, deliver at another
For a required 1080x1920 deliverable, generate at a compliant 9:16 size such as 1152x2048, then resize the saved image. This avoids changing the ratio, although resampling can soften fine text. If you choose an approximately matching ratio, decide whether to crop or add margins; stretching distorts the image.
Keep labels and important objects away from the edges if later cropping is possible. Inspect the final exported file, not just the generation preview. An editor may flatten transparency or change compression during export; see how to verify a transparent PNG.
If valid dimensions still fail
Check the exact model, API method and service URL, then save the response’s error details. An old node or gateway may validate against its own fixed list of sizes. A syntax error, a provider restriction, an access problem and an exhausted quota are different conditions; passing this validator does not eliminate them.
Start with 1024x1024 and the same prompt to isolate whether the failure changes with dimensions. This comparison sends additional billable requests if you run it. Avoid automatic retries for a deterministic invalid-parameter response: fix the parameter or unsupported route first.
Frequently Asked Questions
- Can GPT Image 2.5 use 1080x1920?
- 1080x1920 fails the documented custom-size rule because 1080 is not divisible by 16. 1152x2048 is an exact 9:16 alternative that satisfies the documented dimensions rules. Resize afterward if your delivery format must be 1080x1920.
- Is 3840x2160 supported?
- 3840x2160 satisfies the documented dimension constraints and reaches the maximum pixel count of 8,294,400. OpenAI marks resolutions above 2560x1440 as experimental, so rule compliance is not a guarantee of output quality or request success.
- Does the size validator send a paid request?
- No. The validator checks integer dimensions locally. It does not test authentication, quota, routing, generation quality or current server acceptance.


