Skip to main content
POST
  1. After submission, a task_id will be returned. If you provided a callback_url, when the task status becomes finished or failed, a POST request will be sent to the callback_url.
  2. Regardless of whether callback_url is provided, you can retrieve the result through the unified Query Task Status endpoint.
Use gpt-image-2.5-flare to generate one image from a prompt or edit up to 16 reference images. A non-empty image_urls array selects editing automatically; omit it or pass an empty array for text-to-image generation.

Parameters

  • prompt is required and supports up to 32,000 characters.
  • quality: low, medium, high (default), xhigh, or max.
  • background: auto (default), transparent, or opaque.
  • output_format: png (default), jpeg, or webp. Transparent backgrounds require PNG or WebP.
  • mask_url: optional HTTP(S) mask image URL identifying the area to edit; requires non-empty image_urls.
  • Reference images must use HTTP(S) URLs. Each request produces one output image.

Image Size

  • size defaults to 1:1. Supported ratios: 1:1, 2:3, 3:2, 4:3, 3:4, 4:5, 5:4, 16:9, 9:16, 21:9.
  • resolution supports 1K (default), 2K, and 4K. An omitted size uses a square at the selected tier.
  • Explicit size=auto is available only with 1K; the model determines the image size. Select a ratio or custom size for 2K or 4K.
  • For aspect ratios, actual pixel dimensions may vary by model and generation. Inspect the returned image for exact dimensions; use a custom size when exact pixels are required.
  • Custom WIDTHxHEIGHT sizes require 2K or 4K. Both dimensions must be divisible by 16, the longest edge must not exceed 3840, the aspect ratio must not exceed 3:1, and total pixels must be between 655,360 and 8,294,400. A 3840-pixel edge requires 4K.

Examples

Text To Image

Image Edit

Mask Edit

Transparent Background

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Body

application/json
model
enum<string>
required

GPT Image 2.5 Flare model identifier.

Available options:
gpt-image-2.5-flare
input
object
required

Generate one image, or edit reference images when image_urls is non-empty.

callback_url
string<uri>

Optional webhook URL for task completion or failure.

Response

200 - application/json

Task submitted successfully

code
integer
required

HTTP status code

Example:

200

data
object
required