GPT-Image-2
GPT-Image-2 Image Generation
- Asynchronous processing mode, returns a task ID for subsequent queries
- Compatible with OpenAI Images protocol, supports text-to-image / image-to-image
- Supports 13 image aspect ratios, passed through the aspect_ratio field
- Added resolution tier field, supports 1K / 2K / 4K resolution selection (4K full aspect ratio supported)
- Added size field, supports custom pixel dimensions (mutually exclusive with aspect_ratio / resolution, total pixels ≥ 2,088,960 required for precise generation)
- Up to 10 reference images, supports mixed URL and base64 inputs
- Submitted prompts will undergo platform sensitive word / security review, violating content will be directly rejected
POST
Documentation Index
Fetch the complete documentation index at: https://docs.aireiter.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
All endpoints require authentication using a Bearer Token.Get the API Key:Visit the API Key Management Page to obtain your API Key.Add the following header in the request:
Body
Model NameFixed value:
"gpt_image_2"Model Parameters Object
Initiator Task IDUser-defined task identifier, required
Size × Resolution Mapping Table
aspect_ratio × resolution → Actual Pixels (13 ratios × 3 levels):
| aspect_ratio | 1K | 2K | 4K |
|---|---|---|---|
1:1 | 1024×1024 / 1254×1254 | 2048×2048 | 2880×2880 |
3:2 | 1536×1024 | 2048×1360 | 3520×2336 |
2:3 | 1024×1536 | 1360×2048 | 2336×3520 |
4:3 | 1024×768 | 2048×1536 | 3312×2480 |
3:4 | 768×1024 | 1536×2048 | 2480×3312 |
5:4 | 1280×1024 / 1448×1086 | 2560×2048 | 3216×2576 |
4:5 | 1024×1280 / 1122×1402 | 2048×2560 | 2576×3216 |
16:9 | 1536×864 / 1672×941 | 2048×1152 | 3840×2160 |
9:16 | 864×1536 / 941×1672 | 1152×2048 | 2160×3840 |
2:1 | 2048×1024 / 1774×887 | 2688×1344 | 3840×1920 |
1:2 | 1024×2048 / 887×1774 | 1344×2688 | 1920×3840 |
21:9 | 2016×864 / 1915×821 | 2688×1152 | 3840×1648 |
9:21 | 864×2016 / 821×1915 | 1152×2688 | 1648×3840 |
3:2/2:3@ 2K is actually 2048×1360 (approximate ratio, error < 0.5%); 4K now supports all 13 ratios.
Custom Size (size parameter)
When you need precise control over pixel dimensions, use thesize parameter instead of the aspect_ratio + resolution combination.
Valid range: Total pixels 655,360 ~ 8,294,400 (upstream official limit)
Tested effective lower limit: Total pixels ≥ 2,088,960 (approximately 1440×1452 or 2048×1020 equivalent area)
Below this lower limit, the upstream does not report an error but silently replaces it with a close proportion size of about 1.57M pixels.
Common size examples
| size value | Total pixels | Recommended use |
|---|---|---|
2048x2048 | 4,194,304 | Square HD |
2048x1536 | 3,145,728 | 4:3 landscape |
1536x2048 | 3,145,728 | 3:4 portrait |
2048x1152 | 2,359,296 | 16:9 landscape |
1152x2048 | 2,359,296 | 9:16 portrait |
3840x2160 | 8,294,400 | 4K 16:9 (highest quality) |
2688x1344 | 3,612,672 | 2:1 wide landscape |
Response
Initiator task ID, which can be used to query the result
Initial status, fixed to
"pending"Estimated consumed credits
Creation time (ISO format)