Skip to Content
Image ModelsChatGPT Image 2.6

ChatGPT Image 2.6

Overview

OpenAI’s GPT Image 2.6 for image generation and editing in two versions: Flare, the fast version, which OpenAI says improves layout quality, and Sunburst, for refined, higher-quality output and consistent edits.

Generate PNG images at 1K, 2K or 4K, or create GIF animations from text. Image-to-image output is PNG.

Test API KEY: key_00000000000000000000000000000000

Endpoints

1. Create Task

Request

POST https://api.pixwithapi.online/api/task/create

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Api-Key{API_KEY}Yes

Request Parameters

ParameterTypeRequiredDescription
promptstringYesA non-empty prompt describing the image to generate or edit. For GIF output, describe the motion and loop.
image_urlsarrayConditionalProvide 1–10 public image URLs for image-to-image. Omit for text-to-image and GIF output. Reference images must be no larger than 20 MB each; PNG, JPEG, WebP, GIF and BMP are supported at 1K, while 2K/4K do not support GIF or BMP references.
model_idstringYes0-105 for both text-to-image and image-to-image.
optionsobjectNoGeneration options. Each API request generates one output.
options.prompt_optimizationbooleanNoTranslate and optimize the prompt. Default: false in the API (true in the Web workspace).
options.modestringNo'Flare' or 'Sunburst'. Default: 'Flare'.
options.resolutionstringNo'1K', '2K', '4K' in both modes. Default: '1K'.
options.aspect_ratiostringNo'Auto', '1:1', '3:2', '2:3', '4:3', '3:4', '5:4', '4:5', '16:9', '9:16', '21:9'. Default: 'Auto'. GIF requires 'Auto'. Custom pixel sizes are not supported.
options.output_formatstringNo'png' or 'gif' for text-to-image. Default: 'png'. For image-to-image, omit this field or use 'png';
options.qualitystringNo'auto', 'low', 'medium', 'high', 'xhigh', 'max'. Default: 'auto'. Higher quality may take longer.
options.complexitystringNo'Auto', 'low', 'medium', 'high'. Default: 'Auto', which lets the model decide.

Example Request - Text-to-Image

{ "prompt": "A ceramic coffee cup beside a rainy window, warm natural light", "model_id": "0-105", "options": { "mode": "Flare", "resolution": "2K", "aspect_ratio": "16:9", "output_format": "png", "quality": "high", "complexity": "medium" } }

Example Request - Image-to-Image

{ "prompt": "Keep the product and label from the first image and place it in the setting of the second image", "model_id": "0-105", "image_urls": [ "https://cdn.pixwithapi.online/example-product.jpg", "https://cdn.pixwithapi.online/example-setting.jpg" ], "options": { "mode": "Sunburst", "resolution": "4K", "aspect_ratio": "Auto", "quality": "max", "complexity": "high" } }

Response Parameters

ParameterTypeDescription
codeint1=success, 0=error
messagestringSuccess and failure messages.
dataobjectTask data.
data.task_idstringTask identifier.
data.estimated_timeintEstimated processing time in seconds; actual time may vary with quality.

Response

{ "code": 1, "message": "success", "data": { "task_id": "d425ab4dc256f0ebaa84862b9cea8a3d", "estimated_time": 100 } }

Use the returned task_id to get task results. The result URL points to the generated PNG or GIF file.

Last updated on