73707bc35f34
Generate images with Ideogram 4.0 from a text or structured prompt
Generate one or more images from a prompt with Ideogram 4.0. The prompt accepts either natural language or a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. A structured JSON prompt is consumed by the model directly and skips magic prompt.
magic_prompt controls how a natural-language prompt is prepared: AUTO/ON rewrite and expand the prompt before generation, while OFF keeps your wording and only converts the prompt into the structured format the model consumes.
When resolution is omitted, the server picks an aspect ratio automatically based on the prompt.
By default the request blocks until the images are ready and returns them in data. Set async to true to return immediately after the request is accepted, then poll for completion and results with GET /v1/generations/{generation_id} using the returned generation_id.
Request body
Example request
{
"magic_prompt": "",
"async": false,
"seed": 12345,
"rendering_speed": "DEFAULT",
"enable_copyright_detection": true,
"prompt": "prompt",
"resolution": "",
"num_images": 1
}Response
The generated images (synchronous requests), or an acknowledgement to poll with GET /v1/generations/{generation_id} (async requests).
Example response
{
"data": [
{
"seed": 12345,
"prompt": "prompt",
"resolution": "1024x1024",
"url": "https://openapi-generator.tech",
"is_image_safe": true
},
{
"seed": 12345,
"prompt": "prompt",
"resolution": "1024x1024",
"url": "https://openapi-generator.tech",
"is_image_safe": true
}
],
"seed": 12345,
"generation_id": "generation_id"
}