Creates an image given a prompt. Internally routes to a chat completions model with image generation capabilities.

post/v1/images/generations

Request

  • Base URL
    https://api.llmgateway.io
  • Auth
    HTTP bearer

Request body

promptstring required

A text description of the desired image(s).

modelstring

The model to use for image generation. Defaults to auto which selects an appropriate image generation model.

ninteger

The number of images to generate. Must be between 1 and 10.

sizestring

The size of the generated images. Supported sizes depend on the model and provider.

quality'standard' | 'hd' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto'

The quality of the image that will be generated. Supported values depend on the model and provider.

response_format'b64_json'

The format in which the generated images are returned. Only b64_json is supported since images are generated via chat completions models.

style'vivid' | 'natural'

The style of the generated images.

aspect_ratiostring

The aspect ratio of the generated images (e.g. '1:1', '16:9', '4:3', '5:4'). Takes precedence over size if both are provided.

moderation'auto' | 'low'

Content moderation strictness for models that support it (GPT Image). 'auto' applies the default filtering, 'low' is less restrictive. Ignored by models without a moderation control.

service_tier'auto' | 'default' | 'flex' | 'priority'

Processing tier for the request, forwarded to the underlying chat completion. flex and priority are only accepted for provider/model mappings that support the tier; an unsupported tier returns a 400 unsupported_service_tier error.

Example request

{
  "prompt": "A white siamese cat",
  "model": "gemini-3.1-flash-image",
  "n": 1,
  "size": "1024x1024",
  "quality": "standard",
  "response_format": "b64_json",
  "style": "vivid",
  "aspect_ratio": "16:9",
  "moderation": "low",
  "service_tier": "flex"
}

Response

Image generation response.

creatednumber required

Changes