Skip to navigation

GPT Image Models

View as Markdown

GPT image models use the image generation endpoint.

curl https://api.getopenmodels.com/v1/images \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OM_API_KEY" \
-d '{
"model": "gpt-image-2",
"route": { "provider": "<provider-for-this-model>" },
"route_mode": "balanced",
"prompt": "An elegant commercial product photograph: a transparent modern glass tumbler filled with ice cubes and lemon slices, with a bold, clearly printed label reading \"PURE FRESH\" on the glass. The background is a clean light-blue gradient with professional studio lighting.",
"n": 1,
"size": "1024x1024",
"quality": "low"
}'

For GPT image models, set image generation options as top-level fields in the request body. The route and route_mode fields in the example are OpenModels routing options; remove them to use the default available route.

FieldTypeNotes
promptstringRequired text description of the desired image.
nintegerNumber of images to generate. Valid range: 1-10.
sizestringOutput image size. Common values: auto, 1024x1024, 1536x1024, 1024x1536. gpt-image-2 also accepts custom WIDTHxHEIGHT values when both edges are multiples of 16, the aspect ratio is between 1:3 and 3:1, and the image stays within current pixel and edge limits.
qualitystringRendering quality. Valid values: auto, low, medium, high. Use low for fast drafts and medium or high for final assets.
output_formatstringImage format. Valid values: png, jpeg, webp. Default: png.
output_compressionintegerCompression level from 0 to 100. Only applies when output_format is jpeg or webp.
backgroundstringBackground handling. Use auto or opaque; gpt-image-2 does not support transparent backgrounds.
moderationstringContent moderation strictness. Valid values: auto, low. Default: auto.