OpenAI Images Generations API
POSThttps://api.acedata.cloud/openai/images/generations
POSThttps://api.acedata.cloud/v1/images/generations
Unified image generation endpoint compatible with the OpenAI Images API. A single endpoint supports DALL·E 2/3, the full GPT Image family (gpt-image-1, gpt-image-1.5, gpt-image-2), and Google's Nano Banana family (nano-banana, nano-banana-2, nano-banana-pro). Fine-grained control via size, quality, style, background, output_format, moderation, etc., with transparent background, PNG/JPEG/WebP outputs, and optional callback_url for async delivery.
Request Headers
acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token
Request Body
modelstringRequired parameter
Models for image generation. Supports OpenAI's `dall-e-2`, `dall-e-3`, `gpt-image-1` / `gpt-image-1.5` / `gpt-image-2` series, as well as Google's `nano-banana` / `nano-banana-2-lite` / `nano-banana-2` / `nano-banana-pro`. The parameters `size`, `quality`, `style`, `background`, `output_format`, `moderation`, and `response_format` supported by different models vary, please refer to the description of each field for details. `gpt-image-2` offers two optional suffix variants: `gpt-image-2:official` (official channel, stable and compliant, supports higher resolution, billed at double the price per image) and `gpt-image-2:reverse` (equivalent to the default `gpt-image-2`, offering better cost performance).
promptstringRequired parameter
Text description of the required image. The GPT image model supports up to 32,000 characters, `dall-e-2` supports up to 1,000 characters, and `dall-e-3` supports up to 4,000 characters. A selection of example prompts is provided in the dropdown list (source: [EvoLinkAI/awesome-gpt-image-2-prompts](https://github.com/EvoLinkAI/awesome-gpt-image-2-prompts), Apache-2.0 license); you can also enter your own.
ninteger
The number of images to be generated ranges from 1 to 10. `dall-e-3` is fixed at `1`. The `dall-e-2`, `gpt-image-1` / `gpt-image-1.5` / `gpt-image-2` series, as well as the `nano-banana` / `nano-banana-2-lite` / `nano-banana-2` / `nano-banana-pro` series all support `n>1`: they will return and charge for the corresponding number of images. Note that `response_format=b64_json` only supports `n=1`, and for `n>1`, please use the default URL return. If some images fail to generate, only the successful parts will be returned and charged.
sizestring
The size of the generated image is in the format `widthxheight`, or fill in `auto` for the model to choose automatically. **`gpt-image-2`** accepts any `WIDTHxHEIGHT` value that conforms to the format, including 1K presets (`1024x1024`, `1536x1024`, `1024x1536`, `1792x1024`, `1024x1792`), 2K presets (`2048x2048`, `2048x1536`, `1536x2048`, `2048x1152`, `1152x2048`), 4K presets (`2880x2880`, `3264x2448`, `2448x3264`, `3840x2160`, `2160x3840`), and any custom size; regardless of the size, each image is billed uniformly. Size limitations: custom sizes must be multiples of 16, with the longer side not exceeding 3840, and total pixels not exceeding 8,294,400. `dall-e-2` supports: `256x256`, `512x512`, `1024x1024`. `dall-e-3` supports: `1024x1024`, `1792x1024`, `1024x1792`. Passing `auto` (default) or leaving it blank will allow the model to choose automatically.
callback_urlstring
Optional callback URL. Once provided, the API will immediately return `task_id` and will push the results to that URL via a POST request after the image generation is complete. The callback payload contains `task_id`, `trace_id`, `success` (boolean), and the complete response data or error information.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
stylestring
The style of `dall-e-3`: `vivid` (hyper-realistic/dramatic) or `natural` (more naturally neutral).
qualitystring
Image quality. GPT image model options: `auto` (default), `high`, `medium`, `low`. `dall-e-3` options: `hd` or `standard`. `dall-e-2` supports only: `standard`.
backgroundstring
Set the background opacity for the GPT image model. The optional values are `transparent`, `opaque`, or `auto` (default). When selecting `transparent`, please use an output format that supports the Alpha channel (png/webp).
Please select
moderationstring
The content review levels of the GPT image model. `low` will relax the filtering strength; `auto` uses the default policy.
Please select
output_formatstring
The return format of the GPT image model. Optional values are `png`, `jpeg`, or `webp`.
Please select
partial_imagesinteger
The number of intermediate images sent during the streaming process (0-3). `0` indicates that the final image is returned directly in one event.
response_formatstring
The return format for `dall-e-2` / `dall-e-3` images: `url` or `b64_json`. The GPT image model does not support this parameter (always returns base64 encoded).
output_compressioninteger
The compression level (0-100%) of the GPT image model when using `webp` or `jpeg` output formats.
Response

Integration guide
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
OpenAI generation
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.