OpenAI Images Compatible Image Generation
OpenAI Images Compatible
OpenAI Images Compatible Image Generation
Use POST /v1/images/generations to call the unified image generation entry point, and select compatible models such as gpt-image-1, dall-e-3, and dall-e-2 via model.
POST
OpenAI Images Compatible Image Generation
OpenAI Images Compatible Image Generation
Submit text-to-image requests through the unified image generation entry point, and return an OpenAI Images-style response.- A unified image generation API that selects different image models through
model. - Preserves the OpenAI Images response structure:
created+data[]. - Supports both
urlandb64_jsonresponse formats. - Size restrictions for
dall-e-2anddall-e-3are validated directly by the unified layer. - When
nis omitted or explicitly set to0, the unified layer automatically defaults it to1.
Method and Path
Request Example
Response Example
Authentication
Body
Model name. The unified layer requires this field to be present.
Generation prompt. For image generation, it should be treated as required semantically; whether the request is ultimately blocked is determined jointly by the unified layer and the upstream provider.
Number of images to generate. If omitted or explicitly set to
0, the unified layer falls back to 1.Output size.
dall-e-2 accepts only 256x256, 512x512, and 1024x1024; dall-e-3 accepts only 1024x1024, 1024x1792, and 1792x1024.If you are actually using
gpt-image-2-pro, the plugin layer also exposes high-tier options such as 1:1(2K), 4:3(2K), 3:2(2K), 2:3(2K), 16:9(2K), 9:16(2K), 1:1(4K), 4:3(4K), 3:2(4K), 2:3(4K), 16:9(4K), and 9:16(4K). See the full mapping in Image Model Support Matrix.Image quality.
dall-e-3 defaults to standard; gpt-image-1 defaults to auto.Response format. Common values are
url and b64_json. When b64_json or base64 is requested, the unified layer returns Base64 image data.Style field, passed through unchanged to supported upstream providers.
Background control field, passed through unchanged to supported upstream providers.
Explicit watermark switch.
false is semantically different from omitting it: omission means the default strategy is used, while false explicitly disables it.Response
Generation timestamp.
The image URL returned when
response_format = url.The Base64 image data returned when
response_format = b64_json.Some upstream providers rewrite the prompt and return it in this field.
Additional metadata. Whether it exists depends on the specific channel.