Image modelsAdvanced usersUpdated
POST/v1/images/generations

API console

POST/v1/images/generations
View keys

Requests use the API key you enter and follow standard API billing.

GPT Image 2.6 Sunburst

Request ID gpt-image-2.6-sunburst

Protocols

Authentication

Requests require an API key from API key management. For JSON requests, set Content-Type: application/json.

  • Authorization: Bearer YOUR_API_KEY

Request parameters

POST /v1/images/generations

FieldTypeRequiredDescription
modelstringRequiredUse this model ID gpt-image-2.6-sunburst.
promptstringRequiredDescribe the image to generate.
sizestringConditionalUse auto for GIF. For still images, set aspect_ratio and image_size.
aspect_ratiostringConditionalOutput aspect ratio. Accepted values auto, 1:1, 3:2, 2:3, 16:9, 9:16, 4:3, 3:4, 4:5, 5:4. Default auto. For still images. Omit for GIF.
image_sizestringConditionalOutput resolution tier. Accepted values 1K, 2K, 4K. When omitted, the value is derived from size. Default 1K. For still images. Omit for GIF.
resolutionstringConditionalAlias for still-image resolution. When both this and image_size are set, their values must agree. For still images. Omit for GIF.
output_formatstringOptionalpng generates a still image and gif generates an animation. For GIF, use size: "auto" and n: 1. Frame settings are automatic. Default png.
backgroundstringOptionalUses automatic background handling. Accepted values auto.
qualitystringOptionalGeneration quality setting. Accepted values auto, low, medium, high. Default auto.
nintegerOptionalOne image per request. Default 1.
image_urlsstring[]OptionalReference images as a JSON array. Each item is a public HTTPS image URL or a Base64 image data URL. Also accepts image_input. Maximum reference images 8. Use PNG, JPEG, or WebP references for 2K or 4K still images.
?asyncstringOptionalURL query parameter. Set 1, true, or yes to receive 202 and a task_id. Omit it to wait for the result.

POST /v1/images/edits

FieldTypeRequiredDescription
modelstringRequiredUse this model ID gpt-image-2.6-sunburst.
promptstringRequiredDescribe the changes to make to the reference image.
aspect_ratiostringOptionalOutput aspect ratio. Accepted values auto, 1:1, 3:2, 2:3, 16:9, 9:16, 4:3, 3:4, 4:5, 5:4. Default auto.
image_sizestringOptionalOutput resolution tier. Accepted values 1K, 2K, 4K. When omitted, the value is derived from size. Default 1K.
resolutionstringOptionalAlias for still-image resolution. When both this and image_size are set, their values must agree.
output_formatstringOptionalEdited images are returned as PNG. Default png.
backgroundstringOptionalUses automatic background handling. Accepted values auto.
qualitystringOptionalGeneration quality setting. Accepted values auto, low, medium, high. Default auto.
nintegerOptionalOne image per request. Default 1.
image_urlsstring[]ConditionalReference images as a JSON array. Each item is a public HTTPS image URL or a Base64 image data URL. Also accepts image_input. Maximum reference images 8. Provide at least one reference when sending JSON edits. Use PNG, JPEG, or WebP references for 2K or 4K still images.
image[]file[]ConditionalWith multipart/form-data edits, upload at least one image and repeat the field for more. A single file can also use image. Maximum reference images 8. Use PNG, JPEG, or WebP references for 2K or 4K still images.
?asyncstringOptionalURL query parameter. Set 1, true, or yes to receive 202 and a task_id. Omit it to wait for the result.

Request examples

Set your API key in the local ICODEEASY_API_KEY environment variable and choose an endpoint that accepts direct HTTP calls. For endpoints that require a specific client, follow that client’s setup guide.

Replace example media URLs and asset IDs with your own valid assets.

Images Generations

bash
curl -sS 'https://api.icodeeasy.cc/v1/images/generations' \
  -H "Authorization: Bearer $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A watercolor illustration of a paper lantern by a lake.",
  "output_format": "png",
  "aspect_ratio": "16:9",
  "image_size": "1K",
  "n": 1
}'

Images Generations · Generate a GIF

bash
curl -sS 'https://api.icodeeasy.cc/v1/images/generations?async=1' \
  -H "Authorization: Bearer $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "A paper lantern sways gently in a seamless loop.",
  "output_format": "gif",
  "size": "auto",
  "n": 1
}'

Images Generations · Generate a GIF from a reference image

bash
curl -sS 'https://api.icodeeasy.cc/v1/images/generations?async=1' \
  -H "Authorization: Bearer $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "Animate the lantern in the reference image in a seamless loop while preserving the composition.",
  "output_format": "gif",
  "size": "auto",
  "n": 1,
  "image_urls": [
    "https://example.com/reference.png"
  ]
}'

Images Edits

bash
curl -sS 'https://api.icodeeasy.cc/v1/images/edits' \
  -H "Authorization: Bearer $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-2.6-sunburst",
  "prompt": "Change the background to a pale blue wall. Preserve the subject.",
  "image_urls": [
    "https://example.com/reference.png"
  ],
  "output_format": "png",
  "aspect_ratio": "16:9",
  "image_size": "1K",
  "n": 1
}'

Check image task

bash
curl -sS 'https://api.icodeeasy.cc/v1/images/tasks/YOUR_TASK_ID' \
  -H "Authorization: Bearer $ICODEEASY_API_KEY"

Responses and tasks

HTTP 200 · Synchronous success

With ?sync=1, read the generated image URLs from data[].url. created is a Unix timestamp in seconds, and id is the task ID.

json
{
  "id": "d142c93a-de26-40c9-be62-0de840d10960",
  "created": 1781599773,
  "data": [
    {
      "url": "https://example.com/generated-image.png"
    }
  ]
}

HTTP 202 · Asynchronous submission

json
{
  "task_id": "d142c93a-de26-40c9-be62-0de840d10960",
  "status": "pending"
}

With ?async=1, use the same API key to poll GET /v1/images/tasks/{task_id}. status is pending, completed, or failed. On completion, read the image URL from result_url.

HTTP 200 · Completed task lookup

json
{
  "task_id": "d142c93a-de26-40c9-be62-0de840d10960",
  "status": "completed",
  "model": "gpt-image-2.6-sunburst",
  "result_url": "https://example.com/generated-image.png"
}

Common errors

When the lookup returns failed, read error. If error_detail is present, check retryable before submitting again.

Response examples and errors

Full integration guide · See the full API guide for request fields, task states, and response formats.

Capabilities and limits

  • text_to_image · Supported
  • image_to_image · Supported
  • image_editing · Supported
  • reference_images · Conditional — Requires valid reference images in a supported request format
  • Limits Reference images: up to 8 · Resolutions: 1K, 2K, 4K · Input: Static PNG or animated GIF. GIF uses size: auto and n: 1. Static 2K/4K reference images must be PNG, JPEG, or WebP.

Model Capability Catalog · View pricing