v4

latestOpenAPI 3.0.22026-08-02109239415.7 KB
generate

Generate with FLUX.2-Klein asynchronously via webhook

Accepts a FLUX.2-Klein generation request for asynchronous processing and returns immediately with a generation_id. The generated images are POSTed to the supplied webhook_url once ready, in a payload that mirrors the synchronous response with an added generation_id for correlation.

See Webhooks for the delivery payload and how to verify webhook signatures.

post/v1/flux-2-klein/async/generate

Query parameters

webhook_urlstring uri required

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.

Example:https://api.example.com/webhooks/ideogram

Request body

promptstring required

A natural-language prompt for image generation.

system_promptstring nullable

An optional system prompt applied alongside the prompt — use it for standing instructions such as style constraints or "do not render text". When omitted, no system prompt is applied. If you trained a LoRA with a system prompt, supply the same one here for best results.

widthinteger nullable

Output width in pixels; must be a positive multiple of 16.

heightinteger nullable

Output height in pixels; must be a positive multiple of 16.

num_inference_stepsinteger nullable

Optional diffusion step count. When omitted, the server uses the model's default. Higher values trade latency for quality.

seedinteger nullable

Random seed for reproducibility.

num_imagesinteger nullable

Number of images to generate.

custom_model_uristring nullable

A custom model URI in the format model/<model_name>/version/<version_name>. When provided, the URI must resolve to a registered fine-tune of the FLUX.2-Klein base model; the fine-tune's LoRA checkpoint is layered on the base. When omitted, the FLUX.2-Klein base is used with no LoRA.

Example request

{
  "prompt": "A photo of a tabby cat sleeping on a couch, soft daylight.",
  "system_prompt": "Do not include any text in the image.",
  "width": 1024,
  "height": 1024,
  "num_inference_steps": 4,
  "custom_model_uri": "model/my-flux-klein-lora/version/0"
}

Response

Request accepted for asynchronous delivery.

generation_idstring required

URL-safe base64 ID of the accepted generation. Matches the generation_id field delivered in the webhook payload, and the generation_id accepted by the generation polling endpoint.

Example response

{
  "generation_id": "generation_id"
}