APIImage Generation
GPT Image 2
Configurable fields and supported values for gpt-image-2.
Model ID
gpt-image-2
Capabilities
| Capability | Supported value |
|---|---|
| Text-to-image | Yes |
| Image-to-image | Yes |
| Multi-image reference | No |
Aspect ratio (aspect_ratio) | 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16 |
resolution | standard, 1440p, 4k |
quality | low, medium, high |
| Reference field | image |
Set top-level resolution when an explicit resolution is required.
Configurable fields
| Field | Required | Notes |
|---|---|---|
model | Yes | Must be gpt-image-2. |
prompt | Yes | Text description or editing instruction. |
aspect_ratio | No | Preferred aspect-ratio field; select one supported value listed above. |
size | No | Compatibility alias for aspect_ratio. New integrations should use aspect_ratio. |
quality | No | Only use the quality values listed above. |
n | No | Defaults to 1; account/model limit comes from the model list API. |
image | No | Single reference image URL for image-to-image generation. |
resolution | No | standard, 1440p, or 4k. |
response_format | No | url (default) or b64_json. |
output_format | No | png, jpeg, or webp. |
wait_for_completion | No | Defaults to false, which returns an asynchronous task ID. Set to true to wait in the create request. |
polling_timeout | No | Polling timeout used only when wait_for_completion is true. |
Example
{
"model": "gpt-image-2",
"prompt": "Create a cinematic editorial image",
"aspect_ratio": "16:9",
"quality": "high",
"resolution": "4k"
}Last updated on