Create Image

POST/v1/images/generations
Generate one or more images from a text prompt.

Request Body

application/json
prompt:requiredstring

Text instruction describing the requested output.

ExampleA cute baby sea otter
model:requiredstring

Model identifier used for this request.

Examplemix/gpt-image-2-pro
n:optionalstring

Number of results to generate.

Example1
size:optionalstring

Requested output image dimensions.

Allowed1024x10241536x10241024x15362048x20482048x11523840x21602160x3840auto
Exampleauto
type:optionalstring

Response representation requested from the endpoint.

Allowedurl
Exampleurl

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.

Compatibility References

Use these external references to review additional parameters supported by compatible provider formats.