Generate images

Generate images from a text prompt with a dedicated image model.

Authentication

AuthorizationBearer
Your production key sent as a bearer token.

Request

This endpoint expects an object.
modelstringRequired

Image model, for example openai/gpt-image-2.

promptstringRequired>=1 character
Text prompt for the image.
customerstring or nullOptional

Customer ID (UUID) to scope this request to, applying that customer’s routing policy, provider keys, budget, and usage attribution.

vendorstring or nullOptional
Pin the vendor that runs this request.
ninteger or nullOptional1-10
Number of images, 1 to 10.
sizestring or nullOptional

Image size, for example 1024x1024.

qualitystring or nullOptional

Quality tier, model-specific.

output_formatstring or nullOptional

Output format such as png, jpeg, or webp, model-specific.

response_formatenum or nullOptional

Legacy OpenAI field; most current models return b64_json only.

Allowed values:
stylestring or nullOptional

Style hint, model-specific.

userstring or nullOptional

End-user identifier forwarded to the provider.

provider_optionsmap from strings to any or nullOptional

Provider-specific options, allowlisted per vendor family.

Response

Successful Response
createdinteger
Unix timestamp in seconds.
datalist of objects
Generated images.
usageobject or nullOptional

Token usage reported by the provider; absent for flat per-image models.

images_generatedintegerOptionalDefaults to 0
Number of images generated.
costdouble or nullOptional

Cost of the request in USD; null when the route is unpriced.

Errors

422
Unprocessable Entity Error