Skip to navigation

Generate with GPT Image 2.5 Flare

Generate images with GPT Image 2.5 Flare, the fast variant of GPT Image 2.5. Optionally upload source images as images using multipart/form-data to edit them with the prompt. Returns results directly by default; set async or supply a webhook_url to get a generation_id and poll GET /v2/generations/{generation_id}.

Authentication

Api-Keystring

API key for access control. Use in the header with the name "Api-Key"

Query parameters

dry_runbooleanOptionalDefaults to false

When true, the request is validated and priced but not run: nothing is generated, stored, or billed, and no safety review is performed. The response is a PriceQuote object instead of the usual response for this endpoint. Send exactly the request you would send to generate, so the quote reflects the same options.

Request

A request to generate images with GPT Image 2.5 Flare. Send it as application/json, or as multipart/form-data to include source images.

promptstringRequired1-10000 characters
The prompt to generate images from, or the edit instruction to apply when source images are supplied. It is passed to the model as written.
imagesfilesOptional

Optional source images to edit (max 16, max 25MB each; JPEG, PNG, or WEBP). Multipart requests only.

maskfileOptional

An optional mask for the first source image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Fully transparent pixels mark the areas to edit. The mask must have the same dimensions as the first source image, and requires source images in the same request.

backgroundenumOptionalDefaults to auto

The output background. transparent returns images with an alpha channel, opaque forces a solid background, and auto lets the model decide from the prompt.

Allowed values:
qualityenumOptionalDefaults to auto

How much rendering effort the model spends. Lower tiers return sooner and cost less; auto lets the model choose, which it currently renders at high.

Allowed values:
num_imagesintegerOptional1-8Defaults to 1
The number of images to generate.
seedintegerOptional0-2147483647
Random seed. Set for reproducible generation.
aspect_ratiostringOptional

The requested output aspect ratio, for example "1:1", "16:9", or "9:16". Ignored when resolution is provided. Defaults to "1:1".

resolutionstringOptional

Exact output resolution, formatted as "WIDTHxHEIGHT", for example "2048x2048" or "1920x1088". When provided, this takes precedence over aspect_ratio. The dimensions must satisfy GPT Image 2.5 Flare constraints: each side is a multiple of 16, the largest side is at most 3840px, the long:short ratio is at most 3:1, and total pixels are between 655360 and 8294400 inclusive.

asyncbooleanOptionalDefaults to false

When false (the default), the request waits until the images are ready and returns them in data. When true, the request returns as soon as it is accepted; poll GET /v2/generations/{generation_id} with the returned generation_id for the result.

webhook_urlstringOptionalformat: "uri"<=2048 characters

HTTPS URL that Ideogram delivers the generated result to. Ideogram sends a JSON POST to this URL once all images for the request have finished generating. The body mirrors the synchronous generate response: request_id, created, and a data array containing every generated image (url, prompt, resolution, seed, is_image_safe). Each delivery is signed with Ed25519 and verifiable against the public keys at https://api.ideogram.ai/v1/.well-known/jwks.json. Must be HTTPS; private and loopback hosts and the cloud metadata service are rejected.

Response

The generated images (synchronous requests), or an acknowledgement to poll with GET /v2/generations/{generation_id} (async requests).

generation_idstring

URL-safe base64 ID of the generation. Use it to poll GET /v2/generations/{generation_id}.

seedinteger0-2147483647
Random seed. Set for reproducible generation.
datalist of objectsOptional

The generated images, in generation order. Present only for synchronous requests (async omitted or false).

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error