Skip to navigation

Generate with P-Image Ideogram

Generate images with P-Image Ideogram, a fast model with selectable quality and resolution tiers. 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 P-Image Ideogram.

promptstringRequired1-10000 characters
The prompt to generate images from, in natural language or as a structured Ideogram 4.0 JSON prompt.
magic_promptenumOptionalDefaults to auto

Controls magic prompt (automatic prompt rewriting). off disables magic prompt entirely. Defaults to auto.

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

The generation quality level. Defaults to medium.

Allowed values:
resolutionenum or nullOptional

The output size tier. Defaults to 1k. Cannot be combined with custom_width/custom_height.

Allowed values:
aspect_ratioenumOptionalDefaults to 1x1

The output aspect ratio. Defaults to 1x1.

custom_widthinteger or nullOptional

Optional. An exact output width in pixels, used together with custom_height for output sizes outside the preset tiers. Must be a positive multiple of 16 between 16 and 4096, and custom_width × custom_height must not exceed 4,194,304 pixels (2048×2048). Cannot be combined with resolution or aspect_ratio; the request is billed at the resolution tier matching its total pixel count.

custom_heightinteger or nullOptional

Optional. An exact output height in pixels, used together with custom_width. See custom_width for the accepted range and billing behavior.

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