OpenAI
gpt-image-2
OpenAI’s latest image generation and editing model with a reasoning thinking mode achieving 99%+ text rendering accuracy, supporting up to 2K resolution, flexible aspect ratios, and multilingual text, deeply integrated into ChatGPT and API.
| Provider | OpenAI |
| Tasks | text-to-image · image-to-image |
| Starting from | 0.9375 USD / token · Pricing details |
POST
gpt-image-2
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
gpt-image-2 Length must be between 1 and 32000.
Required string length:
1 - 32000Up to 10 reference images.
Required array length:
1 - 10 elementsMust be one of: high, low, medium. Defaults to medium.
Available options:
high, low, medium Must be one of: 1024x1024, 1024x1536, 1536x1024, auto. Defaults to auto.
Available options:
1024x1024, 1024x1536, 1536x1024, auto Previous
Query image taskPoll the status and result of an image generation task created via `POST /v1/image-generation`.
Call this endpoint periodically with the `task_id` returned from task creation. When `status` is `Success`, `output_images` contains the generated image URLs.
**Note:** this endpoint's envelope uses `message`, not `msg` as the create task endpoint does. Plan both field names when parsing.
### Recommended polling schedule
Image generation averages ~1 minute (some as fast as 10s). Use this schedule to balance responsiveness and request cost:
| Phase | Elapsed | Interval |
| --- | --- | --- |
| Initial wait | 0 – 10s | — (no requests) |
| Dense | 10s – 1 min | every 3s |
| Medium | 1 – 3 min | every 6s |
| Slow | 3 – 15 min | every 10s |
| Timeout | > 15 min | stop, report error |
Stop polling when `status` is `Success`, `Failed`, or `Cancelled`.
Next
gpt-image-2