OpenAI 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

Moderations

Given text and/or image inputs, classifies if those inputs are potentially harmful.

Classifies if text and/or image inputs are potentially harmful. Learn more in the [moderation guide](/docs/guides/moderation).

post
https://api.openai.com/v1/moderations

Body

application/json

CreateModerationRequest

inputOne Of
required

Input (or inputs) to classify. Can be a single string, an array of strings, or
an array of multi-modal input objects similar to other models.

Variant 1string

A string of text to classify for moderation.

Default:

Example:I want to kill them.

modelAny Of

The content moderation model you would like to use. Learn more in
the moderation guide, and learn about
available models here.

Default:omni-moderation-latest

Example:omni-moderation-2024-09-26

Variant 1string

Response

200 application/json

OK

CreateModerationResponse

Represents if a given text input is potentially harmful.

idstringrequired

The unique identifier for the moderation request.

modelstringrequired

The model used to generate the moderation results.

resultsarray[object]required

A list of moderation objects.

Show Child Parameters
post/moderations

Body

{ "input": "I want to kill them." }
 
200 application/json