Image models
GPT Image 2 (High)
On this page
GPT Image 2 — fast, high-fidelity AI image generation & editing.
| modelId | gpt-image-2-text-to-image, gpt-image-2-image-to-image |
| Modality | image |
| Pricing | See this model on the Pricing page for the current per-call price (with your markup). |
Operations
| Operation | modelId | Endpoint | Required input |
|---|---|---|---|
| Gpt Image 2 Text To Image | gpt-image-2-text-to-image | POST /api/v1/generate | prompt |
| Gpt Image 2 Image To Image | gpt-image-2-image-to-image | POST /api/v1/generate | prompt |
| Poll task | — | GET /api/v1/task/{id}?model=gpt-image-2-text-to-image | — |
Gpt Image 2 Text To Image — gpt-image-2-text-to-image
| Field | Type | Required | Values / example |
|---|---|---|---|
| prompt | string | Yes | Used to describe the generated images. Max 20000 characters. (default: A vintage brass diving helmet overgrown with coral and tiny anemones, resting on pale sand in slanting shafts of turquoise underwater light.) |
| resolution | string | No | Image resolution (options: 1K | 2K | 4K) (default: 1K) |
| aspect_ratio | string | Conditional | when `resolution` is `1K`: For 2K and 4K resolution, the following aspect ratios are not supported: 5:4, 4:5, 3:1, 1:3, and 9:21. (options: auto | 1:1 | 3:2 | 2:3 | 4:3 | 3:4 | 16:9 | 9:16 | 2:1 | 1:2 | 3:1 | 1:3 | 21:9 | 9:21 | 5:4 | 4:5) · when `resolution` is `2K`/`4K`: For 2K and 4K resolution, the following aspect ratios are not supported: 5:4, 4:5, 3:1, 1:3, and 9:21. (options: auto | 1:1 | 3:2 | 2:3 | 4:3 | 3:4 | 16:9 | 9:16 | 2:1 | 1:2 | 21:9) |
bash
curl -X POST https://you.bot/api/v1/generate \
-H "Authorization: Bearer $YOUBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"modelId":"gpt-image-2-text-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","resolution":"1K","aspect_ratio":"auto"}}'Gpt Image 2 Image To Image — gpt-image-2-image-to-image
| Field | Type | Required | Values / example |
|---|---|---|---|
| prompt | string | Yes | Used to describe the generated images. Max 20000 characters. (default: Restyle this into a luminous stained-glass mosaic of a gliding sea turtle, jewel-toned teal and amber panes outlined in black lead, backlit like a cathedral window.) |
| input_urls | string[] | No | Image for reference (image URL) |
| resolution | string | No | Image resolution (options: 1K | 2K | 4K) (default: 1K) |
| aspect_ratio | string | Conditional | when `resolution` is `1K`: For 2K and 4K resolution, the following aspect ratios are not supported: 5:4, 4:5, 3:1, 1:3, and 9:21. (options: auto | 1:1 | 3:2 | 2:3 | 4:3 | 3:4 | 16:9 | 9:16 | 2:1 | 1:2 | 3:1 | 1:3 | 21:9 | 9:21 | 5:4 | 4:5) · when `resolution` is `2K`/`4K`: For 2K and 4K resolution, the following aspect ratios are not supported: 5:4, 4:5, 3:1, 1:3, and 9:21. (options: auto | 1:1 | 3:2 | 2:3 | 4:3 | 3:4 | 16:9 | 9:16 | 2:1 | 1:2 | 21:9) |
bash
curl -X POST https://you.bot/api/v1/generate \
-H "Authorization: Bearer $YOUBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"modelId":"gpt-image-2-image-to-image","input":{"prompt":"A photorealistic portrait of a red fox in a snowy forest, soft morning light, shallow depth of field, 85mm.","input_urls":["https://example.com/input.jpg"],"resolution":"1K","aspect_ratio":"auto"}}'