---
title: "Generate (legacy)"
method: POST
path: "/generate"
tags: ["generate"]
---

# Generate (legacy)

`POST /generate`

Generates images synchronously based on a given prompt and optional parameters.

Images links are available for a limited period of time; if you would like to keep the image, you must download it.

## Request body

- GenerateImageRequest
  - `image_request` ImageRequest, required
    - `prompt` string, required — The prompt to use to generate the image.
    - `aspect_ratio` 'ASPECT_10_16' | 'ASPECT_16_10' | 'ASPECT_9_16' | 'ASPECT_16_9' | 'ASPECT_3_2' | 'ASPECT_2_3' | 'ASPECT_4_3' | 'ASPECT_3_4' | 'ASPECT_1_1' | 'ASPECT_1_3' | 'ASPECT_3_1' — (Cannot be used in conjunction with resolution) The aspect ratio to use for image generation, which determines the image's resolution. Defaults to ASPECT_1_1.
    - `model` 'V_1' | 'V_1_TURBO' | 'V_2' | 'V_2_TURBO' | 'V_2A' | 'V_2A_TURBO' | 'V_3' | 'AUTO' — The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.
    - `magic_prompt_option` 'AUTO' | 'ON' | 'OFF' — Determine if MagicPrompt should be used in generating the request or not.
    - `magic_prompt_system_prompt_config_id` string — A base64url-encoded magic prompt system prompt config ID to use for this request.
    - `magic_prompt_version` 'V_0' | 'V_0_1' | 'V_0_2' | 'V_0_3' | 'V_0_4' | 'V_0_5' | 'V_0_6' | 'V_0_7' | 'V_0_8' | 'V4_QWEN_3_5_27B' | 'V4_QWEN_3_5_27B_PREFUSED' | 'V4_QWEN_3_5_27B_FULL_FINETUNE' | 'V4_QWEN_3_5_27B_FULL_FINETUNE_LORA' | 'V4_QWEN_3_5_27B_EXPERIMENTAL' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_Q36_2P5K' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_2P5K' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_NONNAS_5K' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_9K' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_ALTCAP_BAL_10K' | 'V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K' | 'V4_QWEN_3_5_27B_SGLANG_EXPERIMENTAL_Q36_2P5K_TP2' | 'V4_QWEN_3_5_27B_PRUNA_FP8' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_02' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_03' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_04' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_05' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_06' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_07' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_08' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_09' | 'V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_10' — The magic prompt version to use when magic prompt option is set to AUTO or ON.
    - `seed` integer — Random seed. Set for reproducible generation.
    - `style_type` 'AUTO' | 'GENERAL' | 'FICTION' | 'REALISTIC' | 'DESIGN' | 'RENDER_3D' | 'ANIME' | 'CUSTOM' | 'STYLIZED' — The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.
    - `negative_prompt` string — Only available for model versions V_1, V_1_TURBO, V_2 and V_2_TURBO. Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt.
    - `num_images` integer — The number of images to generate.
    - `resolution` 'RESOLUTION_512_1536' | 'RESOLUTION_576_1408' | 'RESOLUTION_576_1472' | 'RESOLUTION_576_1536' | 'RESOLUTION_640_1024' | 'RESOLUTION_640_1344' | 'RESOLUTION_640_1408' | 'RESOLUTION_640_1472' | 'RESOLUTION_640_1536' | 'RESOLUTION_704_1152' | 'RESOLUTION_704_1216' | 'RESOLUTION_704_1280' | 'RESOLUTION_704_1344' | 'RESOLUTION_704_1408' | 'RESOLUTION_704_1472' | 'RESOLUTION_720_1280' | 'RESOLUTION_736_1312' | 'RESOLUTION_768_1024' | 'RESOLUTION_768_1088' | 'RESOLUTION_768_1152' | 'RESOLUTION_768_1216' | 'RESOLUTION_768_1232' | 'RESOLUTION_768_1280' | 'RESOLUTION_768_1344' | 'RESOLUTION_832_960' | 'RESOLUTION_832_1024' | 'RESOLUTION_832_1088' | 'RESOLUTION_832_1152' | 'RESOLUTION_832_1216' | 'RESOLUTION_832_1248' | 'RESOLUTION_864_1152' | 'RESOLUTION_896_960' | 'RESOLUTION_896_1024' | 'RESOLUTION_896_1088' | 'RESOLUTION_896_1120' | 'RESOLUTION_896_1152' | 'RESOLUTION_960_832' | 'RESOLUTION_960_896' | 'RESOLUTION_960_1024' | 'RESOLUTION_960_1088' | 'RESOLUTION_1024_640' | 'RESOLUTION_1024_768' | 'RESOLUTION_1024_832' | 'RESOLUTION_1024_896' | 'RESOLUTION_1024_960' | 'RESOLUTION_1024_1024' | 'RESOLUTION_1088_768' | 'RESOLUTION_1088_832' | 'RESOLUTION_1088_896' | 'RESOLUTION_1088_960' | 'RESOLUTION_1120_896' | 'RESOLUTION_1152_704' | 'RESOLUTION_1152_768' | 'RESOLUTION_1152_832' | 'RESOLUTION_1152_864' | 'RESOLUTION_1152_896' | 'RESOLUTION_1216_704' | 'RESOLUTION_1216_768' | 'RESOLUTION_1216_832' | 'RESOLUTION_1232_768' | 'RESOLUTION_1248_832' | 'RESOLUTION_1280_704' | 'RESOLUTION_1280_720' | 'RESOLUTION_1280_768' | 'RESOLUTION_1280_800' | 'RESOLUTION_1312_736' | 'RESOLUTION_1344_640' | 'RESOLUTION_1344_704' | 'RESOLUTION_1344_768' | 'RESOLUTION_1408_576' | 'RESOLUTION_1408_640' | 'RESOLUTION_1408_704' | 'RESOLUTION_1472_576' | 'RESOLUTION_1472_640' | 'RESOLUTION_1472_704' | 'RESOLUTION_1536_512' | 'RESOLUTION_1536_576' | 'RESOLUTION_1536_640' — (For model_version for 2.0 only, cannot be used in conjunction with aspect_ratio) The resolution to use for image generation, represented in width x height. If not specified, defaults to using aspect_ratio.
    - `color_palette` union — A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). Not supported by V_1, V_1_TURBO, V_2A and V_2A_TURBO models.
      - ColorPaletteWithPresetName
        - `name` 'EMBER' | 'FRESH' | 'JUNGLE' | 'MAGIC' | 'MELON' | 'MOSAIC' | 'PASTEL' | 'ULTRAMARINE', required — A color palette preset value.
      - ColorPaletteWithMembers — A color palette represented only via its members. Cannot be used in conjunction with preset name.
        - `members` ColorPaletteMember[], required — A list of ColorPaletteMembers that define the color palette. Each color palette member consists of a required color hex and an optional weight between 0.05 and 1.0 (inclusive). It is recommended that these weights descend from highest to lowest for the color hexes provided.
          - `color_hex` string, required — The hexadecimal representation of the color with an optional chosen weight.
          - `color_weight` number — The weight of the color in the color palette.

## Response `200`

Image(s) generated successfully.

- GenerateImageResponse — The response which contains information about the generated image, including the download link. Images links are available for a limited period of time; if you would like to keep the image, you must download it.
  - `request_id` string — URL-safe base64 ID of the sampling request. Present when the caller supplied `webhook_url` and the request was accepted for async delivery; in that case `data` is omitted and the generated images will be POSTed to the customer's `webhook_url` when ready.
  - `created` string, date-time, required — The time the request was created.
  - `data` ImageObject[] — A list of ImageObjects that contain the generated image(s).
    - `url` string, uri, nullable — The direct link to the image generated.
    - `prompt` string, required — The prompt used for the generation. This may be different from the original prompt.
    - `resolution` string, required — The resolution of the final image.
    - `upscaled_resolution` string — Output resolution, only used if operations alters image dimensions, such as upscale, crop etc.
    - `is_image_safe` boolean, required — Whether this request passes safety checks. If false, the url field will be empty.
    - `seed` integer, required — Random seed. Set for reproducible generation.
    - `style_type` 'AUTO' | 'GENERAL' | 'FICTION' | 'REALISTIC' | 'DESIGN' | 'RENDER_3D' | 'ANIME' | 'CUSTOM' | 'STYLIZED' — The style type to generate with; this is only applicable for models V_2 and above and should not be specified for model versions V_1.

## Other responses

- `400` — Invalid input provided.
- `401` — Not authorized to generate an image.
- `422` — Prompt failed the safety check.
- `429` — Too many requests.

---

[API](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ideogram/ideogram-openapi-3-0/revisions/bd40f367a834/schema)
