Skip to content
  • There are no suggestions because the search field is empty.

Image API Reference

For the given prompt, the model generates a new image that matches the prompt description.

Create Image

Creates an image for the given text prompt.

Azure OpenAI

Request

POST https://api.core42.ai/openai//deployments/<deployment-id>/images/generations

OpenAI

Request

POST https://api.core42.ai/v1/images/generations

Request Parameters 

Name 

Required 

Type 

Description 

model

true

string

ID of the model to use for this request. The available models are dall-e-3, gpt-image-1, and sdxl-turbo.

prompt

true

string

A text description of the desired image(s). The maximum supported length:

  • dall-e-3: 4000 characters

  • gpt-image-1: 32000 characters

background

false

string or null

Allows to set transparency for the background of the generated image(s). Must be one of transparent, opaque or auto (default value). When auto is used, the model will automatically determine the best background for the image.

If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

Note: This parameter applies only to the GPT Image 1 model.

moderation

false

string or null

Control the content-moderation level for images generated by gpt-image-1. Must be either low for less restrictive filtering or auto (default value).

Note: This parameter applies only to the GPT Image 1 model.

n

false

integer or null

The number of images to generate. The value must be between 1 and 10. n=1 is the default and supported value for DALL·E 3.

quality

false

string

The quality of the image that will be generated.

For dall-e-3: standard and hd. The default quality of the image is standard.

For gpt-image-1:

high, medium and low .

output_compression

false

integer or null

The compression level (0-100%) for the generated images. This parameter is only supported for GPT Image 1 model with the webp, or jpeg output formats and defaults to 100.

output_format

false

string or null

The format in which the generated images are returned. Must be one of png, webp, or jpeg.

Note: This parameter applies only to the GPT Image 1 model.

response_format

false

string or null

The format in which the generated images are returned. Must be one of url or b64_json.
URL validity after the image has been generated:

  1. OpenAI: One hour

  2. Azure OpenAI: 24 hours

This parameter applies only to the DALL·E 3 model.

size

false

string or null

The size of the generated images.

  • dall-e-3: Must be one of 1024x1024 (default value), 1792x1024, or 1024x1792

  • gpt-image-1: Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default value)

style

false

string or null

The style of the generated images. Must be one of vivid or natural.

  1. Vivid causes the model to lean towards generating hyper-real and dramatic images.

  2. Natural causes the model to produce more natural, less hyper-real-looking images.

Note: This parameter applies only to the DALL·E 3 model.

user

false

string or null

A unique identifier represents your end-user.

 

For the DALL·E 3 model, the consumption for API requests is charged per unit per image. The usage can be monitored in the API request chart available on the Reports page.

Create Image Edit

Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports gpt-image-1.

Azure OpenAI

Request

POST https://api.core42.ai/openai//deployments/<deployment-id>/images/edits

OpenAI

Request

POST https://api.core42.ai/v1/images/edits

Request Parameters 

Name 

Required 

Type 

Description

image

true

string or array

The image(s) to edit. Must be a supported image file or an array of images.. The available model is gpt-image-1. Each image should be a png, or jpg file less than 25MB. You can provide up to 16 images..

model

true

string

ID of the model to use for this request. The available models are gpt-image-1.

prompt

true

string

A text description of the desired image(s). The maximum supported length for gpt-image-1 is 32000 characters.

background

false

string or null

Allows to set transparency for the background of the generated image(s). Must be one of transparent, opaque, or auto (default value). When auto is used, the model will automatically determine the best background for the image.
If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.

mask

false

file

An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If multiple images are provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

n

false

integer or null

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

quality

false

string

The quality of the image that will be generated.
For gpt-image-1: high, medium and low.

response_format

false

string or null

The format in which the generated images are returned. Must be one of url or b64_json.
URL validity after the image has been generated:

  1. OpenAI: One hour

  2. Azure OpenAI: 24 hours

size

false

string or null

The size of the generated images. Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536(portrait) or auto (default value)

user

false

string or null

A unique identifier represents your end-user.