Skip to navigation

Replace background with Ideogram 4.5

Rebuild the background of an image as the setting shown in a background_reference image, with Ideogram 4.5 at its highest quality. The people in the source image are kept, people in the reference are left out, and results keep the source image’s aspect ratio. Returns a generation_id; poll GET /v2/generations/{generation_id} or supply a webhook_url.

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

The source image and the background reference.
imagefileRequired

The source image. JPEG, PNG, WEBP, HEIF, AVIF, GIF, BMP, TIFF, and MPO are supported, up to 50 MB. Its longer side may be at most the model’s maximum aspect ratio times its shorter side; a more extreme proportion is rejected with a 400 that states the allowed range. Multipart requests only.

background_referencefileRequired

A photo of the setting the new background should match. Its people are not copied. It is held to the same aspect-ratio limit as image. Multipart requests only.

num_imagesintegerOptional1-4Defaults to 1
The number of images to generate.
privatebooleanOptional
Whether to keep the result private. When omitted, the result is private. Enterprise generations are always private.
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

Background replacement accepted for asynchronous processing.
generation_idstring

The generation ID to poll with GET /v2/generations/{generation_id}.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
503
Service Unavailable Error