generative

Generate images from a text prompt

Changed on

Starts an image generation request and returns a tracking ID.

post/v2/generative/images

Request

Request body

promptstring required

The text prompt to generate images from. Must contain at least one non-whitespace character and be at most 1800 characters.

aspect_ratio'1:1' | '9:16' | '16:9' | '4:3' | '3:4'

The aspect ratio of the generated images.

style_idstring

The style identifier to apply to the generated images. Use an id from text_to_image.styles returned by GET /v2/generative/inputs.

modelstring

The image generation model identifier. Use an id from text_to_image.models returned by GET /v2/generative/inputs. If omitted, the backend selects the default model.

Example request

{
  "prompt": "dog playing a banjo",
  "aspect_ratio": "1:1",
  "style_id": "studio-shot",
  "model": "GPT_IMAGE_STANDARD_v3"
}

Response

Image generation request accepted

idstring required

The UUID of the generation request.

Example response

{
  "id": "e5cf9549-67c2-4312-a3c3-d2ac6263e6b6"
}

Changes