Overview
GPT Image 2 is OpenAI''s next-generation image model, supporting both text-to-image generation and image editing via a unified task-based API. It delivers photorealistic outputs up to 4K resolution with four quality tiers, batch generation of up to 4 images, and PNG / JPEG / WebP output formats.
Key Features
- Text-to-Image generation - Create images from natural language prompts
- Image editing - Modify existing images with text instructions; optional mask for region-targeted edits
- Multi-resolution output - From 1024x1024 up to 4K (3840x2160) with aspect ratio variants
- Quality tiers -
high, medium, low, and auto to balance quality vs. speed
- Batch generation - Up to 4 images per request
- Output formats - PNG (default), JPEG, WebP
Size Options
| Size | Aspect Ratio |
|---|
1024x1024 | 1:1 Square |
1536x1024 | 3:2 Landscape |
1024x1536 | 2:3 Portrait |
2048x2048 | 1:1 Large |
2048x1152 | 16:9 Widescreen |
3840x2160 | 4K Landscape |
2160x3840 | 4K Portrait |
auto | Model chooses (default) |
Pricing
Token-Based Billing (per 1M tokens)
Text tokens:
Input: $5.00
Cached input: $1.25
Output: $10.00
Image tokens:
Input: $8.00
Cached input: $2.00
Output: $30.00
Quality affects cost significantly (default: high). Token cost is ceiled to the nearest cent.
Parameters
n
Type: integer · Default: 1
Number of edited images to generate.
mask
Type: string
Optional mask image (URL or Base64-encoded) to specify the edit region.
size
Type: Enum · Default: "auto"
Output image resolution.
Possible values: 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, 2160x3840, auto
format
Type: Enum · Default: "png"
Output image format.
Possible values: png, jpeg, webp
images* required
Type: list<string>
Input images to edit. Each item is a URL or Base64-encoded string.
prompt* required
Type: string
Text prompt describing the desired edit.