AI

Generates images against the model the resolved site has configured for images, in the OpenAI-compatible request and response shape. Every image is returned inline as b64_json: no hosted, separately-addressable artifact is created, and no url is ever returned. Both model and prompt are required, and model is validated against the site's image configuration rather than its chat or embeddings models; there is no implicit default. The n field is honored — omitting it means one image. A value below 1, a value above the configured maximum, or any value above 1 on a site whose image model can only produce one, is refused with a 400 naming the field. The size field is passed through to the provider as a WIDTHxHEIGHT string; where the site carries an image size setting the caller's value wins and the site's is the default. Every response reports the serving site in the X-dotCMS-Resolved-Site header.

post/api/inference/v1/images/generations

Request

Query parameters

siteIdstring

Request body

modelstring

Model id, as configured for this site's images

promptstring

What to generate

ninteger

Number of images; at least 1, defaults to 1

sizestring

Image size

Example request

{
  "model": "dall-e-3",
  "prompt": "A cat in a hammock",
  "n": 1,
  "size": "1024x1024"
}

Response

The generated images, each inline as base64

createdinteger

Epoch seconds

Changes