OpenAI API

Creates a variation of a given image.

post
https://api.openai.com/v1/images/variations

Body

multipart/form-data

CreateImageVariationRequest

imagestringrequired

The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.

modelAny Of

The model to use for image generation. Only dall-e-2 is supported at this time.

Default:dall-e-2

Example:dall-e-2

Variant 1string
ninteger | null

The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.

Default:1

>= 1<= 10

Example:1

response_formatstring | null

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

Allowed values:urlb64_json

Default:url

Example:url

sizestring | null

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

Allowed values:256x256512x5121024x1024

Default:1024x1024

Example:1024x1024

userstring

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Example:user-1234

Response

200 application/json

OK

ImagesResponse

createdintegerrequired
dataarray[object]required

Represents the url or the content of an image generated by the OpenAI API.

Show Child Parameters
post/images/variations

Body

{ "image": "image" }
 
200 application/json

Models

List and describe the various models available in the API.

Lists the currently available models, and provides basic information about each one such as the owner and availability.

get
https://api.openai.com/v1/models

Response

200 application/json

OK

ListModelsResponse

objectstringrequired

Allowed values:list

dataarrayrequired

Describes an OpenAI model offering that can be used with the API.

Show Child Parameters
get/models
 
200 application/json

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

get
https://api.openai.com/v1/models/{model}

Path Parameters

modelstringrequired

The ID of the model to use for this request

Example:gpt-4o-mini

Response

200 application/json

OK

Model

Describes an OpenAI model offering that can be used with the API.

idstringrequired

The model identifier, which can be referenced in the API endpoints.

createdintegerrequired

The Unix timestamp (in seconds) when the model was created.

objectstringrequired

The object type, which is always “model”.

Allowed values:model

owned_bystringrequired

The organization that owns the model.

get/models/{model}
 
200 application/json

Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.

delete
https://api.openai.com/v1/models/{model}

Path Parameters

modelstringrequired

The model to delete

Example:ft:gpt-4o-mini:acemeco:suffix:abc123

Response

200 application/json

OK

DeleteModelResponse

idstringrequired
deletedbooleanrequired
objectstringrequired
delete/models/{model}
 
200 application/json