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_00000000000000000000000000000000Endpoints
1. Create Task
Request
POST https://api.pixwithapi.online/api/task/createHeaders
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Api-Key | {API_KEY} | Yes |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | A non-empty prompt describing the image to generate or edit. For GIF output, describe the motion and loop. |
| image_urls | array | Conditional | Provide 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_id | string | Yes | 0-105 for both text-to-image and image-to-image. |
| options | object | No | Generation options. Each API request generates one output. |
| options.prompt_optimization | boolean | No | Translate and optimize the prompt. Default: false in the API (true in the Web workspace). |
| options.mode | string | No | 'Flare' or 'Sunburst'. Default: 'Flare'. |
| options.resolution | string | No | '1K', '2K', '4K' in both modes. Default: '1K'. |
| options.aspect_ratio | string | No | '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_format | string | No | 'png' or 'gif' for text-to-image. Default: 'png'. For image-to-image, omit this field or use 'png'; |
| options.quality | string | No | 'auto', 'low', 'medium', 'high', 'xhigh', 'max'. Default: 'auto'. Higher quality may take longer. |
| options.complexity | string | No | '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
| Parameter | Type | Description |
|---|---|---|
| code | int | 1=success, 0=error |
| message | string | Success and failure messages. |
| data | object | Task data. |
| data.task_id | string | Task identifier. |
| data.estimated_time | int | Estimated 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