Hoppa till huvudinnehåll
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
}

Auktoriseringar

Authorization
string
header
obligatorisk

Rubriker

accept
enum<string>

Specifies the format of the response from the server.

Tillgängliga alternativ:
application/json

Kropp

application/json
prompt
string
obligatorisk

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.

Exempel:

"A cute baby sea otter"

model
enum<string>
obligatorisk

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

Tillgängliga alternativ:
dall-e-3,
gpt-image-1,
gpt-image-1.5
background
enum<string>
standard: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).

Tillgängliga alternativ:
transparent,
opaque,
auto
moderation
enum<string>
standard:auto

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

Tillgängliga alternativ:
low,
auto
n
integer
standard:1

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

Obligatoriskt intervall: 1 <= x <= 10
Exempel:

1

output_compression
integer
standard:100

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

Obligatoriskt intervall: 0 <= x <= 100
output_format
enum<string>
standard:png

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

Tillgängliga alternativ:
png,
jpeg,
webp
partial_images
integer
standard:0

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

Obligatoriskt intervall: 0 <= x <= 3
size
enum<string> | null
standard: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.

Tillgängliga alternativ:
1024x1024,
1792x1024,
1024x1792,
1536x1024,
1024x1536,
256x256,
512x512,
auto
Exempel:

"1024x1024"

quality
enum<string>
standard:auto

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

Tillgängliga alternativ:
auto,
high,
medium,
low,
hd,
standard
Exempel:

"auto"

response_format
enum<string> | null
standard: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).

Tillgängliga alternativ:
url,
b64_json
Exempel:

"url"

style
enum<string>
standard:vivid

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

Tillgängliga alternativ:
vivid,
natural
Exempel:

"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.

Svar

Image generated successfully or operation performed successfully.

data
object[]
obligatorisk
created
number
obligatorisk