跳转到主要内容
POST
/
openai
/
images
/
generations
Openai Images Generations
curl --request POST \
  --url https://api.acedata.cloud/openai/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A cute baby sea otter",
  "model": "dall-e-3",
  "background": "auto",
  "moderation": "auto",
  "n": 1,
  "output_compression": 100,
  "output_format": "png",
  "partial_images": 0,
  "size": "1024x1024",
  "quality": "auto",
  "response_format": "url",
  "style": "vivid",
  "callback_url": "<string>"
}
'
{
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "created": 123
}

授权

Authorization
string
header
必填

请求头

accept
enum<string>

Specifies the format of the response from the server.

可用选项:
application/json

请求体

application/json
prompt
string
必填

A text description of the desired image(s). The maximum length is 32000 characters for GPT image models, 1000 characters for dall-e-2, and 4000 characters for dall-e-3.

示例:

"A cute baby sea otter"

model
enum<string>
必填

The model to use for image generation. Defaults to dall-e-2 unless a GPT-image-only parameter is supplied.

可用选项:
dall-e-3,
gpt-image-1,
gpt-image-1.5
background
enum<string>
默认值:auto

Set transparency for GPT image models. Must be transparent, opaque, or auto (default). If transparent, choose an output format that supports alpha (png/webp).

可用选项:
transparent,
opaque,
auto
moderation
enum<string>
默认值:auto

Content-moderation level for GPT image models. low relaxes filtering; auto applies the default.

可用选项:
low,
auto
n
integer
默认值:1

How many images to generate. Must be between 1 and 10. For dall-e-3, only 1 is supported.

必填范围: 1 <= x <= 10
示例:

1

output_compression
integer
默认值:100

Compression level (0-100%) for GPT image models when using webp or jpeg output formats.

必填范围: 0 <= x <= 100
output_format
enum<string>
默认值:png

Return format for GPT image models. Must be png, jpeg, or webp.

可用选项:
png,
jpeg,
webp
partial_images
integer
默认值:0

Number of partial images to emit during streaming (0-3). 0 returns the final image in one event.

必填范围: 0 <= x <= 3
size
enum<string> | null
默认值:auto

The size of the generated images. GPT image models: 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default). dall-e-2: 256x256, 512x512, or 1024x1024. dall-e-3: 1024x1024, 1792x1024, or 1024x1792.

可用选项:
1024x1024,
1792x1024,
1024x1792,
1536x1024,
1024x1536,
256x256,
512x512,
auto
示例:

"1024x1024"

quality
enum<string>
默认值:auto

Quality of the image. GPT image models: auto (default), high, medium, low. dall-e-3: hd or standard. dall-e-2: standard.

可用选项:
auto,
high,
medium,
low,
hd,
standard
示例:

"auto"

response_format
enum<string> | null
默认值:url

The format in which dall-e-2/dall-e-3 images are returned: url or b64_json. Not supported for GPT image models (they always return base64).

可用选项:
url,
b64_json
示例:

"url"

style
enum<string>
默认值:vivid

Style for dall-e-3: vivid (hyper-real/dramatic) or natural (more neutral).

可用选项:
vivid,
natural
示例:

"vivid"

callback_url
string

Optional callback URL. When provided, the API returns a task_id immediately and POSTs the result to this URL once image generation completes. The callback payload includes task_id, trace_id, success (boolean), and the full response data or error.

响应

Image generated successfully or operation performed successfully.

data
object[]
必填
created
number
必填