Skip to navigation

Precise edit with Ideogram 4.5

Edit an image with Ideogram 4.5 and get the result back at that image’s exact width and height. Upload the image as image using multipart/form-data, with optional reference_images and a mask. 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 edit an image with Ideogram 4.5 at that image's own size. Send it as multipart/form-data with the image to edit and any reference_images and mask.

promptstringRequired1-10000 characters

The edit instruction, in natural language or as a structured JSON prompt. Natural language is automatically converted into a structured prompt; valid structured JSON is used as is.

imagefileRequired

The image to edit (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. The output always matches this image's width and height, and pixels the edit did not meaningfully change are copied exactly from it. Images too large for the model are scaled down, keeping their proportions, and returned as rendered. Images with an aspect ratio outside 1:6 to 6:1 are rejected.

reference_imagesfilesOptional

Optional images to guide the edit (max 4, max 25MB each; JPEG, PNG, or WEBP). They are never edited themselves; only image is. Multipart requests only. A request with a mask can include at most three, because the mask takes up one reference slot.

maskfileOptional

An optional mask that limits the edit to part of image (max 25MB; JPEG, PNG, or WEBP). Multipart requests only. Black marks the area to edit and white the area to keep; values in between are rounded to the nearer of the two. The mask must have the same width and height as image and contain both black and white areas. A masked request can include at most three reference_images.

qualityenumOptionalDefaults to medium

The rendering quality to use. very_low is the fastest and cheapest, and high takes longer and is priced higher.

Allowed values:
seedintegerOptional0-2147483647
Random seed. Set for reproducible generation.
num_imagesintegerOptional1-8Defaults to 1
The number of images to generate.
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 edited images (synchronous requests), or an acknowledgement to poll with GET /v2/generations/{generation_id} (async requests).

generation_idstringOptional

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

datalist of objectsOptional

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

seedintegerOptional
The seed that was used, including when you did not set one.

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