Skip to main content
POST
/
v1
/
images
/
generations
Generate an image (OpenAI)
curl --request POST \
  --url https://api.ai.cc/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-image-1",
  "prompt": "A cute baby sea otter",
  "n": 1,
  "size": "1024x1024"
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}
This endpoint integrates a third-party model. For detailed parameter information, please refer to the official documentation at OpenAI Docs.

Authorizations

Authorization
string
header
required

Authentication is done using Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required
prompt
string
required
moderation
string

Control the content-moderation level for images generated by the GPT image models. Must be either low for less restrictive filtering or auto

n
integer

The number of images to generate. Must be between 1 and 10

output_format
string

The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of png, jpeg, or webp.

partial_images
integer

The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event.

quality
string

The quality of the image that will be generated. auto (default value) will automatically select the best quality for the given model. high, medium and low are supported for the GPT image models. hd and standard are supported for dall-e-3. standard is the only option for dall-e-2.

response_format
string

The format in which generated images with dall-e-2 and dall-e-3 are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.

size
string

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

Response

200 - application/json

Image generated successfully

created
integer
data
object[]