GPT-Image-2.6
Generate or edit images with either model. Results return in the same response; no task polling is required.
| Model ID | Use case |
|---|---|
gpt-image-2.6-flare | Interactive creation and iteration. |
gpt-image-2.6-sunburst | Detailed composition and reference-image editing. |
Endpoints
Use https://api.uniall.ai with Authorization: Bearer $UNIAI_API_KEY. Replace the key, reference URLs and local file paths with your own values.
| Method | Path | Input |
|---|---|---|
| POST | /v1/images/generations | JSON text-to-image request. |
| POST | /v1/images/edits | JSON references or multipart image files. |
Parameters
Both models use the same fields, with JSON options at the top level. complexity controls planning effort independently of quality for generation and editing.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | One of the two exact IDs above. |
prompt | string | Yes | Generation or editing instruction, up to 32,000 characters. |
images | object array | Either for JSON editing | 1–16 ordered reference objects, with URLs in images[].image_url. |
image_urls | string array | Either for JSON editing | Compatible form: 1–16 ordered reference URLs. |
mask | object | No | Editing only: URL in mask.image_url. Applies to the first reference. |
markup | object | No | Editing overlay URL in markup.image_url. Multipart uses a separate markup file. |
size | string | No | auto or WIDTHxHEIGHT. Default: auto. Static-image and GIF limits below. |
quality | string | No | auto, low, medium, high, xhigh, max; omitted uses the default quality. |
complexity | string | No | low, medium, high. Independent planning effort. The console selects high by default; API requests may set it explicitly. |
n | integer | No | Requested count, 1–10; default 1. GIF is subject to its pixel budget; use 1. |
output_format | string | No | png (default), jpeg, webp, gif. Editing uses PNG/JPEG/WebP; GIF limits below. |
background | string | No | auto, opaque, transparent. Transparency requires PNG or WebP. |
output_compression | integer | No | 0–100, for JPEG/WebP only. Explicit zero is preserved; no default is applied when omitted. |
frame_count | integer | No | GIF only, 2–16; omitted uses 9 for the request pixel budget. |
frame_duration_ms | integer | No | GIF only, 20–2000 ms; default 200. Encoded timing rounds to 10 ms. |
safety_identifier | string | No | Hashed end-user identifier, up to 128 characters. |
prompt_rewriter | JSON | No | Compatibility JSON, preserving explicit 0/false. Shape and availability depend on account access; no public structure is specified. |
response_format | string | No | url or b64_json; set it explicitly to select result delivery. |
moderation | string | No | auto or low. |
For JSON edits, choose the images object array or the image_urls string array. The mask and markup objects each contain an image_url, as shown below.
For explicit static-image dimensions, both sides must be multiples of 16, the longest side must be at most 3,840 pixels, the aspect ratio must be between 1:3 and 3:1, and total pixels must be 655,360–8,294,400. For example: 1024x1024, 1024x1536, 1536x1024, 1536x864 or 2048x1152.
References must be PNG, JPEG or WebP, up to 50 MiB each. URLs must remain reachable without login, cookies or custom headers. A reference may also be a complete image Data URL, such as data:image/png;base64,....
Generate an image
curl "https://api.uniall.ai/v1/images/generations" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "A sculptural burgundy glass perfume bottle on ivory travertine, warm side lighting, no lettering",
"size": "1536x864",
"quality": "high",
"complexity": "high",
"n": 1,
"output_format": "png",
"response_format": "url"
}'
For transparent output, set background to transparent and output_format to png or webp.
Edit with references and a mask
Use image_urls for JSON reference strings and mask.image_url for the mask:
curl "https://api.uniall.ai/v1/images/edits" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-sunburst",
"prompt": "Replace only the masked background with a warm cream studio backdrop; keep the product unchanged",
"image_urls": ["https://images.example.com/product.png"],
"mask": {
"image_url": "https://images.example.com/mask.png"
},
"size": "1024x1024",
"quality": "high",
"complexity": "high",
"n": 1,
"output_format": "png",
"response_format": "url"
}'
The mask is one PNG with an alpha channel, smaller than 4 MiB and the same dimensions as the first reference. Transparent areas identify where to edit. Omit mask for an edit without a mask.
Edit local files
curl "https://api.uniall.ai/v1/images/edits" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-F "model=gpt-image-2.6-sunburst" \
-F "prompt=Replace only the masked background with a warm cream studio backdrop; keep the product unchanged" \
-F "image[]=@product.png" \
-F "mask=@mask.png" \
-F "size=1024x1024" \
-F "quality=high" \
-F "complexity=high" \
-F "n=1" \
-F "output_format=png" \
-F "response_format=url"
Repeat image[] for more references, up to 16. Let cURL set the multipart Content-Type.
Markup editing
Send an annotation overlay separately from the reference image:
curl "https://api.uniall.ai/v1/images/edits" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-sunburst",
"prompt": "Change only the annotated bottle to blue and remove the annotation strokes",
"images": [{"image_url": "https://images.example.com/product.png"}],
"markup": {"image_url": "https://images.example.com/overlay.png"},
"complexity": "high",
"quality": "high",
"size": "1024x1024",
"output_format": "png",
"response_format": "url"
}'
The overlay is a transparent PNG smaller than 50 MiB, matching the first reference after orientation. The first image and overlay must each be at most 16,777,216 pixels. Do not combine markup with mask or prompt_rewriter.
For local files:
curl "https://api.uniall.ai/v1/images/edits" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-F "model=gpt-image-2.6-sunburst" \
-F "prompt=Change only the annotated bottle to blue and remove the annotation strokes" \
-F "image[]=@product.png" \
-F "markup=@overlay.png" \
-F "complexity=high" \
-F "quality=high" \
-F "size=1024x1024" \
-F "output_format=png" \
-F "response_format=url"
Generate a GIF
Use the generation endpoint with output_format: "gif". Describe motion and looping in prompt, then set the frame count and duration:
curl "https://api.uniall.ai/v1/images/generations" \
-H "Authorization: Bearer $UNIAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "A silver tabby kitten dancing, alternating its front paws in a smooth seamless loop, fixed camera, cream background",
"complexity": "medium",
"quality": "high",
"output_format": "gif",
"size": "256x256",
"n": 1,
"frame_count": 12,
"frame_duration_ms": 120,
"response_format": "b64_json"
}'
GIF dimensions must be multiples of 16, with each side at most 3,840 pixels and width × height × frame_count × n ≤ 8,294,400. The static-image minimum pixel count does not apply to GIF frames. GIF excludes masks, markup, compression and prompt rewriting. These are request controls; delivered frames, timing, dimensions and counts may still differ.
The current service supports GIF generation only; GIF reference-image editing is unavailable. A response may also include a PNG sprite sheet; inspect every data[] item.
Response
With response_format: "url", read the results from data[].url. Example:
{
"data": [
{
"url": "https://images.example.com/result.png"
}
]
}
With response_format: "b64_json", decode each data[].b64_json value as file bytes. The value has no Data URL prefix. Example with shortened content:
{
"data": [
{
"b64_json": "R0lGODlh..."
}
]
}
The actual file format, dimensions, animation frames, timing and number of results may differ from the request. Optional output_format and size response fields describe the actual result when present. Inspect the delivered files rather than relying on the requested extension or count. Results retain original GIF bytes and their actual MIME type. Differences from the requested format, dimensions, frames or count do not trigger rejection, conversion or extra generation to reach n.
If a request fails or times out, do not automatically submit it again. Keep the error and request ID for troubleshooting.
Only synchronous Images API calls are supported. Responses sessions, a File ID service and streaming are unavailable; omit partial_images or set it to 0.