Skip to navigation

Generate with automatic model selection

Generate images with the model Ideogram picks as best suited to each request. Optionally upload source images as images using multipart/form-data to edit them with the prompt. Returns results directly by default; set async 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 an automatically selected model. Send it as application/json, or as multipart/form-data to include source images.

promptstringRequired1-10000 characters
The prompt to generate images from or, when source images are supplied, the change to make to them.
imagesfilesOptional

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

negative_promptstringOptional<=10000 characters
Description of what to exclude from the images. The prompt takes precedence over the negative prompt. Not every model uses it. Cannot be combined with source images.
aspect_ratiostringOptionalformat: "^(auto|[1-9][0-9]{0,4}x[1-9][0-9]{0,4})$"Defaults to auto

The output aspect ratio. auto (the default) picks the most suitable ratio for the request. Without source images the value must be a supported ratio (for example "16x9" or "1x1"); with source images any "WIDTHxHEIGHT" value is accepted and the output uses the closest supported shape. Omit resolution when supplying a non-auto value.

resolutionstringOptionalformat: "^[1-9][0-9]{1,4}x[1-9][0-9]{1,4}$"

The requested output resolution, formatted as "WIDTHxHEIGHT" (for example "1280x800"). The output is served at the closest resolution the selected model supports. Omit aspect_ratio (or leave it auto) when supplying a resolution.

resolution_tierenumOptional
The output resolution tier. Affects which model serves the request, since not every model offers every tier. When omitted, the selected model's default tier is used.
Allowed values:
magic_promptenumOptionalDefaults to auto

Controls magic prompt (automatic prompt rewriting). Defaults to auto.

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

Whether the generated images should be kept private. When omitted, the default follows the caller's plan; some plans always generate privately.

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.

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
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error