OpenAI GPT Image 2.6
Official GPT Image 2.6 Sunburst and Flare parameters for image generation, editing, GIF animation, SVG, markup, and streaming.
GPT Image 2.6 generates and edits images, accepts markup guidance, and produces GIF animations and SVG artwork. This guide follows the official OpenAI Image API documentation checked on November 6, 2026. Use the modelsell.app API address and API key shown below.
Models and Endpoints
| Model ID | Use case |
|---|---|
gpt-image-2.6-sunburst | Detailed compositions and image editing. |
gpt-image-2.6-flare | Fast generation and iterative edits. |
| Operation | Request |
|---|---|
| Generate images, GIF, or SVG | POST https://api.modelsell.com/v1/images/generations, JSON |
| Edit images or create GIF from references | POST https://api.modelsell.com/v1/images/edits, multipart or JSON |
Authenticate with Authorization: Bearer $MODELSELL_API_KEY and specify the full model ID. For the previous generation, see GPT Image 2.5.
Generate an Image
curl --fail-with-body -sS https://api.modelsell.com/v1/images/generations \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "A clean product photograph of a ceramic coffee cup, light gray background, soft side lighting",
"size": "1024x1024",
"quality": "medium",
"complexity": "low",
"output_format": "png",
"n": 1
}' > result.jsondata[].b64_json contains base64-encoded file bytes. Save the first result with the following code. Use a .gif or .svg extension when requesting those formats.
import base64
import json
from pathlib import Path
result = json.loads(Path("result.json").read_text())
Path("result.png").write_bytes(base64.b64decode(result["data"][0]["b64_json"]))Request Parameters
These fields apply to image generation and editing, except SVG options, which apply only to generation.
| Field | Type | Default | Description |
|---|---|---|---|
model | string | Specify explicitly | Full model ID from the table above. |
prompt | string | Required | Generation or editing instructions, up to 32,000 characters. |
n | integer | 1 | Number of outputs, 1–10. SVG requires 1; GIF also has a total pixel budget. |
size | string | auto | Output dimensions, such as 1024x1024, 1536x1024, 1024x1536, or a supported WIDTHxHEIGHT. For GIF, this is the size of each frame. |
quality | string | auto | low, medium, high, xhigh, max, or auto; controls rendering quality. |
complexity | string | high | low, medium, or high; controls planning computation independently of quality. |
background | string | auto | auto, opaque, or transparent. Transparent raster output uses PNG or WebP; SVG can also be transparent. |
output_format | string | png | Generation: png, jpeg, webp, gif, svg. Editing: png, jpeg, webp, gif. |
output_compression | integer | 100 | 0–100, JPEG/WebP only. An explicit 0 is valid. |
moderation | string | auto | auto or low. |
stream | boolean | false | Return SSE events. GIF/SVG do not support Image API streaming. |
partial_images | integer | 0 | Streaming previews, 0–3. With 0, only the final image event is returned. Fewer previews may arrive than requested. |
frame_count | integer | 9 | GIF only, 2–16 frames. |
frame_duration_ms | integer | 200 | GIF only. The official generation guide specifies 20–2000 milliseconds, rounded to 10 ms when encoded. |
svg | object | Omitted | SVG author configuration; send only when SVG model selection is enabled. |
svg.model | string | Conditionally required | SVG author model ID, required when using enabled model selection. The top-level model still selects the image model. |
svg.reasoning.effort | string / null | Author default | Independent of image complexity. The schema lists none, minimal, low, medium, high, xhigh, and max; supported values depend on the author model. |
safety_identifier | string | Omitted | Stable end-user identifier, up to 128 characters. Prefer a hash over a raw username or email. |
user | string | Omitted | Deprecated identifier. A nonempty safety_identifier takes precedence; omitted, null, or empty values fall back to user. |
GPT Image returns base64 file content directly: omit response_format. style belongs to retired image models. The documented input_fidelity controls apply to earlier GPT Image models; do not treat it as a configurable 2.6 setting.
Complexity and Quality
Start with complexity: "low" for focused changes. Higher complexity can help with text, layouts, and relationships between objects, but may increase latency and introduce more changes. quality controls rendering separately. Adjusting complexity has no separate surcharge.
For static images, start with auto or the three standard sizes. Custom dimensions must be multiples of 16, with an aspect ratio between 1:3 and 3:1, and meet the selected model's edge and pixel limits. GIF has separate frame-size and total-request pixel constraints; do not apply the static-image minimum pixel count to each GIF frame.
Edit Images
Input images can be PNG, JPEG/JPG, or WebP, each under 50 MB, with up to 16 images. Source images, masks, and markup are separate inputs. Source images do not all need to be PNG. SVG is not a supported editing input.
| Input | Multipart | JSON | Meaning |
|---|---|---|---|
| Source images | image for one file; image[] for multiple files | images array | Required for editing. |
mask | PNG file | Image reference object | Transparent pixels mark the edit region on the first image. Mutually exclusive with markup. |
markup | Transparent PNG file | Image reference object | Circles, arrows, or annotations over the first image, explained in the prompt. Mutually exclusive with mask. |
A JSON image reference is {"image_url":"https://..."}, {"image_url":"data:image/webp;base64,..."}, or {"file_id":"file-..."}. Provide exactly one of image_url and file_id per object. images contains 1–16 objects; mask and markup each take one object. image_url has a maximum length of 20,971,520 characters, which is a string limit rather than a binary file-size limit.
Upload with Multipart
curl --fail-with-body -sS https://api.modelsell.com/v1/images/edits \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-F 'model=gpt-image-2.6-flare' \
-F '[email protected];type=image/webp' \
-F 'prompt=Make the cup dark blue. Preserve its shape, lighting, and background.' \
-F 'complexity=low' \
-F 'quality=medium' \
-F 'output_format=png' > result.jsonFor multiple files, repeat -F 'image[]=@filename;type=image/MIME' with the correct MIME type. Let curl set the multipart boundary instead of manually setting the request's Content-Type.
JSON References
{
"model": "gpt-image-2.6-sunburst",
"prompt": "Keep the product unchanged and replace the background with a pale blue studio backdrop",
"images": [
{ "image_url": "https://example.com/product.jpg" }
],
"quality": "high",
"complexity": "medium",
"output_format": "png"
}Send this JSON to /v1/images/edits. Use reference objects rather than an array of URL strings, and send image inputs to the editing endpoint.
Markup and Masks
markup must be a PNG with transparent pixels and match the first image's dimensions after orientation. The first image and overlay can each contain up to 16,777,216 pixels, and the overlay file must be at most 50 MB. Do not combine markup with prompt_rewriter. Explain what the annotations mean and whether to remove them from the finished image.
curl --fail-with-body -sS https://api.modelsell.com/v1/images/edits \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-F 'model=gpt-image-2.6-flare' \
-F '[email protected];type=image/webp' \
-F '[email protected];type=image/png' \
-F 'prompt=Make the chair inside the red circle dark green. Preserve the rest of the room and remove the red circle.' \
-F 'quality=medium' > result.jsonFor mask editing, prepare a PNG source and a matching PNG mask with an alpha channel. Fully transparent mask pixels identify the edit region. The mask guides editing rather than guaranteeing an exact pixel boundary. Do not combine mask with markup, and do not use masks with GIF output.
Animated GIF
Both generation and editing support output_format: "gif". Describe the movement, camera behavior, starting pose, and loop in the prompt.
curl --fail-with-body -sS https://api.modelsell.com/v1/images/generations \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-sunburst",
"prompt": "A folded paper bird gently flaps its wings. Keep the camera still and return to the starting pose for a seamless loop.",
"output_format": "gif",
"size": "auto",
"quality": "medium",
"complexity": "medium",
"frame_count": 9,
"frame_duration_ms": 200,
"n": 1
}' > result.json- This produces approximately 1.8 seconds per loop.
ncounts animations;frame_countcounts frames in each animation. - To guide motion with still references, send source images to
/v1/images/editswith the same GIF settings. sizespecifies the finished frame dimensions. Custom dimensions must be positive multiples of 16. Frame count, frame size, and animation count must fit the model limits and total request pixel budget; reduce them or useautoif needed.- GIF does not support streaming, partial previews,
mask, customoutput_compression, orprompt_rewriter. Send frame settings only with GIF output. - The official API reference requires access to the selected model's GIF preview.
Decoded b64_json is a complete GIF file, not an array of PNG frames.
SVG Output
Generate SVG through /v1/images/generations for editable paths, shapes, and colors. The editing endpoint does not produce SVG. SVG output itself requires a supported model and project access, separately from access to author model selection.
curl --fail-with-body -sS https://api.modelsell.com/v1/images/generations \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "A vector coffee-cup icon built from simple geometric shapes, three flat colors, no text",
"output_format": "svg",
"quality": "medium",
"complexity": "low",
"n": 1
}' > result.jsonSVG requires n: 1 and does not support streaming, partial previews, output_compression, or prompt_rewriter. The image model first creates a reference image, which an SVG author uses to produce the vector document. quality and complexity control the reference image.
Add this object only when SVG author selection is enabled. Replace the placeholder with an available author model ID; otherwise omit the entire object:
{
"svg": {
"model": "YOUR_SVG_AUTHOR_MODEL_ID",
"reasoning": { "effort": "medium" }
}
}The author model determines supported reasoning levels. Decode the result as UTF-8 XML and save it as .svg. The result contains static vectors without scripts, external resources, or embedded raster images.
Transparency and Compression
Set background: "transparent" with PNG or WebP output. Request an isolated subject on a fully transparent background, and preserve the alpha channel when saving the file. JPEG does not support transparency. SVG output also accepts background: "transparent".
output_compression applies only to JPEG/WebP and accepts both 0 and 100. Omit it for PNG, GIF, and SVG.
Streaming with SSE
For static-image generation or editing, use stream: true and partial_images: 0–3.
curl --fail-with-body -N https://api.modelsell.com/v1/images/generations \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.6-flare",
"prompt": "A soft watercolor illustration of a lighthouse by the sea",
"output_format": "png",
"stream": true,
"partial_images": 2
}'| Endpoint | Preview event | Final event |
|---|---|---|
| generations | image_generation.partial_image | image_generation.completed |
| edits | image_edit.partial_image | image_edit.completed |
Each SSE data: payload is an event JSON object with image bytes in b64_json. Preview events include partial_image_index; completion events provide the final image and usage. Do not use the ordinary JSON data[0] path for SSE. Completion can arrive before all requested previews.
Response and Usage
| Field | Meaning |
|---|---|
created | Ordinary JSON response timestamp in Unix seconds; SSE uses created_at. |
data[].b64_json | Base64 file bytes; save with the requested output format. |
background, output_format, quality, size | Actual output settings. |
safety_identifier | Effective identifier, including fallback from deprecated user. |
usage | Image-model input, output, and total tokens, with text/image details where returned. |
svg_usage | SVG author's model and input, output, reasoning, and total token counts, separate from image-model usage. |
SVG uses both a reference-image model and an author model. Each actual partial image adds 100 image output tokens, and the requested number of previews is not guaranteed. Store returned usage rather than treating the requested preview count as a fixed final bill.
Official References
GPT Image 2.5 Integration Guide
Previous Page
Image Generation
OpenAI Images API 兼容的图像生成接口。默认同步返回图片结果;如需异步提交,在请求 URL 上携带 `?async=true`,接口会返回图片任务 ID,可通过 `/v1/tasks/{id}` 查询结果。 GPT Image 2.5 / 2.6 使用专用 GPT Image 请求定义;Seedream 等模型使用各自的参数定义。 GPT Image 2.6 支持 complexity、动画 GIF 和 SVG;SVG 仅用于此生成接口。 `stream=true` 时返回 SSE,包含 `image_generation.partial_image` 和 `image_generation.completed` 事件。 官方参数说明:https://developers.openai.com/api/docs/guides/image-generation 。