Skip to main content
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 url and b64_json response formats.
  • Size restrictions for dall-e-2 and dall-e-3 are validated directly by the unified layer.
  • When n is omitted or explicitly set to 0, the unified layer automatically defaults it to 1.

Method and Path

Request Example

Response Example

Authentication

Body

string
required
Model name. The unified layer requires this field to be present.
string
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.
integer
Number of images to generate. If omitted or explicitly set to 0, the unified layer falls back to 1.
string
Output size. dall-e-2 accepts only 256x256, 512x512, and 1024x1024; dall-e-3 accepts only 1024x1024, 1024x1792, and 1792x1024.
string
Image quality. dall-e-3 defaults to standard; gpt-image-1 defaults to auto.
string
Response format. Common values are url and b64_json. When b64_json or base64 is requested, the unified layer returns Base64 image data.
string | object
Style field, passed through unchanged to supported upstream providers.
string | object
Background control field, passed through unchanged to supported upstream providers.
boolean
Explicit watermark switch. false is semantically different from omitting it: omission means the default strategy is used, while false explicitly disables it.

Response

integer
Generation timestamp.
string
The image URL returned when response_format = url.
string
The Base64 image data returned when response_format = b64_json.
string
Some upstream providers rewrite the prompt and return it in this field.
object
Additional metadata. Whether it exists depends on the specific channel.

Use Cases

Basic Image Generation

High-Quality DALL·E 3

Base64 Output

Notes

This page describes only the common semantics of the unified entry point, and does not mean that all image channels support exactly the same fields. Whether fields such as style, background, and watermark actually take effect depends on the final channel that is hit.