Size & output pixels¶
gpt-image-2 renders images at a fixed set of aspect ratios and three resolution tiers. You can describe the size you want in either of two ways, and YexAPI picks the closest supported ratio and tier.
Option A: OpenAI-style WIDTHxHEIGHT¶
- Aspect ratio: the closest supported ratio to
width / height. - Resolution tier: chosen from the longer edge:
| Longer edge you request | Tier |
|---|---|
| up to 1792 px | 1k |
| 1793 – 2560 px | 2k |
| above 2560 px | 4k |
Width and height must each be between 64 and 8192.
Common OpenAI sizes map like this:
size |
Ratio | Tier | Price |
|---|---|---|---|
1024x1024 |
1:1 | 1k | $0.025 |
1536x1024 |
3:2 | 1k | $0.025 |
1024x1536 |
2:3 | 1k | $0.025 |
1792x1024 |
16:9 | 1k | $0.025 |
2048x2048 |
1:1 | 2k | $0.035 |
2048x1152 |
16:9 | 2k | $0.035 |
3840x2160 |
16:9 | 4k | $0.045 |
Option B: aspect ratio + resolution¶
Supported ratios: 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9,
9:16, 2:1, 1:2, 21:9, 9:21.
resolution is 1k, 2k or 4k (case-insensitive, default 1k). You can
also send resolution together with a WIDTHxHEIGHT size; the explicit value
wins.
auto¶
"size": "auto" (or leaving size out) lets the model pick the aspect ratio.
The resolution tier is still 1k unless you set resolution.
Actual output pixels¶
The output pixel size is decided by the model and is not guaranteed to equal the size you request. These are dimensions we measured:
| Request | Output we observed |
|---|---|
1:1, 1k (e.g. 1024x1024) |
1024 × 1024, sometimes 1254 × 1254 |
3:2, 2k |
2048 × 1360 |
16:9, 2k (2048x1152) |
2048 × 1152 |
16:9, 4k (3840x2160) |
3840 × 2160 |
If your application needs exact dimensions, resize or crop the result on
your side. Price depends only on the tier (1k / 2k / 4k), not on the
exact output pixels.
Invalid values¶
Anything that cannot be parsed, such as "size": "huge" or
"resolution": "8k", is rejected with HTTP 400 before any charge.